25 #include <QGridLayout>
27 #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>
41 this->setContentsMargins(1, 1, 1, 1);
43 QGridLayout* grid =
new QGridLayout(
this);
44 grid->setContentsMargins(0, 0, 0, 0);
45 this->setLayout(grid);
46 this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
48 QWidget* view1 =
new QWidget(
this);
49 view1->setMinimumSize(100, 100);
50 view1->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
55 grid->addWidget(view1, 0, 0, 1, 2);
69 Display::Display(QWidget* widget) : SoQtExaminerViewer(widget), sceneRootNode(new SoSeparator), contentRootNode(new SoSeparator), camera(new SoPerspectiveCamera)
71 this->setBackgroundColor(SbColor(80 / 255.0f, 80 / 255.0f, 80 / 255.0f));
72 this->setAccumulationBuffer(
true);
73 this->setHeadlight(
true);
74 this->setViewing(
true);
75 this->setDecoration(
false);
77 this->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);
78 this->setFeedbackVisibility(
true);
82 this->setSceneGraph(sceneRootNode);
85 sceneRootNode->addChild(camera);
86 this->setCamera(camera);
89 camera->position.setValue(SbVec3f(10, -10, 5));
90 camera->pointAt(SbVec3f(0, 0, 0), SbVec3f(0, 0, 1));
93 sceneRootNode->addChild(contentRootNode);
95 this->setViewing(
false);
96 this->setViewing(
true);
103 sceneRootNode->unref();
109 return contentRootNode;
114 camera->viewAll(contentRootNode, SbViewportRegion());
119 camera->viewAll(node, SbViewportRegion(), slack);