26 #include <QGridLayout>
28 #include <Inventor/nodes/SoSeparator.h>
29 #include <Inventor/nodes/SoPickStyle.h>
30 #include <Inventor/nodes/SoMaterial.h>
31 #include <Inventor/nodes/SoDrawStyle.h>
32 #include <Inventor/nodes/SoVertexProperty.h>
33 #include <Inventor/nodes/SoLineSet.h>
34 #include <Inventor/events/SoMouseButtonEvent.h>
35 #include <Inventor/events/SoLocation2Event.h>
42 this->setContentsMargins(1, 1, 1, 1);
44 QGridLayout* grid =
new QGridLayout(
this);
45 grid->setContentsMargins(0, 0, 0, 0);
46 this->setLayout(grid);
47 this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
49 QWidget* view1 =
new QWidget(
this);
50 view1->setMinimumSize(100, 100);
51 view1->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
56 grid->addWidget(view1, 0, 0, 1, 2);
70 Display::Display(QWidget* widget) : SoQtExaminerViewer(widget), sceneRootNode(new SoSeparator), contentRootNode(new SoSeparator), camera(new SoPerspectiveCamera)
72 this->setBackgroundColor(SbColor(80 / 255.0f, 80 / 255.0f, 80 / 255.0f));
73 this->setAccumulationBuffer(
false);
74 this->setHeadlight(
true);
75 this->setViewing(
true);
76 this->setDecoration(
false);
78 this->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);
79 this->setFeedbackVisibility(
true);
83 this->setSceneGraph(sceneRootNode);
86 sceneRootNode->addChild(camera);
87 this->setCamera(camera);
90 camera->position.setValue(SbVec3f(10, -10, 5));
91 camera->pointAt(SbVec3f(0, 0, 0), SbVec3f(0, 0, 1));
94 sceneRootNode->addChild(this->contentRootNode);
101 sceneRootNode->unref();
107 return this->contentRootNode;
112 camera->viewAll(this->contentRootNode, SbViewportRegion());