Commit bcc14a79 by Alisa Jung

still compiling

parent 18280c79
......@@ -242,6 +242,12 @@ MainWindow::MainWindow(QWidget *parent)
connect(deletePrimitive, SIGNAL(triggered(bool)),controller, SLOT(deletePrimitive()));
deletePrimitive->setShortcut(QKeySequence(Qt::Key_Delete));
treeView = new QTreeView(this);
treeView->setModel(controller->getSceneGraph()->getModel());
treeView->expandAll();
}
......
......@@ -16,7 +16,9 @@
#include <controller.h>
#include <QLayout>
#include <QSplitter>
#include <QTreeView>
#include <scenegraph.h>
#include <myitemmodel.h>
class MainWindow : public QMainWindow
{
Q_OBJECT
......@@ -87,6 +89,8 @@ private:
QAction* deletePrimitive;
QTreeView* treeView;
public slots :
void showAboutBox ( ) ;
};
......
......@@ -13,6 +13,7 @@ SceneGraph::SceneGraph()
coneIndex = 1;
torusIndex = 1;
model = new MyItemModel;
}
//Scenegraph gets a list of all views it needs to notify on changes
......@@ -20,6 +21,10 @@ void SceneGraph::registerView(MyGLWidget* view){
views.append(view);
}
MyItemModel* SceneGraph::getModel(){
return model;
}
//add primitives to sceneGraph
RigidBodyTransformation* SceneGraph::addSphere(int tesselation){
nextSphereName = "Sphere ";
......
......@@ -4,6 +4,7 @@
#include <QList>
#include <rigidbodytransformation.h>
#include <QString>
#include <myitemmodel.h>
class MyGLWidget;
......@@ -30,6 +31,9 @@ public:
//automatically selects last added primitive. if none left, selects 0.
RigidBodyTransformation* deleteNode(RigidBodyTransformation* r);
MyItemModel* getModel();
//Hallo. Todos:
//Log selected name in status bar
//add remaining primitive types
......@@ -56,6 +60,9 @@ private:
QList<MyGLWidget*> views;
MyItemModel* model;
};
#endif // SCENEGRAPH_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment