26 #include <QGridLayout>
28 #include <Inventor/events/SoLocation2Event.h>
29 #include <Inventor/events/SoMouseButtonEvent.h>
30 #include <Inventor/nodes/SoDrawStyle.h>
31 #include <Inventor/nodes/SoLineSet.h>
32 #include <Inventor/nodes/SoMaterial.h>
33 #include <Inventor/nodes/SoPickStyle.h>
34 #include <Inventor/nodes/SoSeparator.h>
35 #include <Inventor/nodes/SoVertexProperty.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);
72 SoQtExaminerViewer(widget),
73 sceneRootNode(new SoSeparator),
74 contentRootNode(new SoSeparator),
75 camera(new SoPerspectiveCamera)
77 this->setBackgroundColor(SbColor(80 / 255.0f, 80 / 255.0f, 80 / 255.0f));
78 this->setAccumulationBuffer(
false);
79 this->setHeadlight(
true);
80 this->setViewing(
true);
81 this->setDecoration(
false);
83 this->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);
84 this->setFeedbackVisibility(
true);
88 this->setSceneGraph(sceneRootNode);
91 sceneRootNode->addChild(camera);
92 this->setCamera(camera);
95 camera->position.setValue(SbVec3f(10, -10, 5));
96 camera->pointAt(SbVec3f(0, 0, 0), SbVec3f(0, 0, 1));
99 sceneRootNode->addChild(this->contentRootNode);
106 sceneRootNode->unref();
113 return this->contentRootNode;
119 camera->viewAll(this->contentRootNode, SbViewportRegion());