25 #include <QGridLayout>
27 #include <Inventor/events/SoLocation2Event.h>
28 #include <Inventor/events/SoMouseButtonEvent.h>
29 #include <Inventor/nodes/SoDrawStyle.h>
30 #include <Inventor/nodes/SoLineSet.h>
31 #include <Inventor/nodes/SoMaterial.h>
32 #include <Inventor/nodes/SoPickStyle.h>
33 #include <Inventor/nodes/SoSeparator.h>
34 #include <Inventor/nodes/SoVertexProperty.h>
40 this->setContentsMargins(1, 1, 1, 1);
42 QGridLayout* grid =
new QGridLayout(
this);
43 grid->setContentsMargins(0, 0, 0, 0);
44 this->setLayout(grid);
45 this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
47 QWidget* view1 =
new QWidget(
this);
48 view1->setMinimumSize(100, 100);
49 view1->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
54 grid->addWidget(view1, 0, 0, 1, 2);
70 SoQtExaminerViewer(widget),
71 sceneRootNode(new SoSeparator),
72 contentRootNode(new SoSeparator),
73 camera(new SoPerspectiveCamera)
75 this->setBackgroundColor(SbColor(80 / 255.0f, 80 / 255.0f, 80 / 255.0f));
76 this->setAccumulationBuffer(
true);
77 this->setHeadlight(
true);
78 this->setViewing(
true);
79 this->setDecoration(
false);
81 this->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_BLEND);
82 this->setFeedbackVisibility(
true);
86 this->setSceneGraph(sceneRootNode);
89 sceneRootNode->addChild(camera);
90 this->setCamera(camera);
93 camera->position.setValue(SbVec3f(10, -10, 5));
94 camera->pointAt(SbVec3f(0, 0, 0), SbVec3f(0, 0, 1));
97 sceneRootNode->addChild(contentRootNode);
99 this->setViewing(
false);
100 this->setViewing(
true);
107 sceneRootNode->unref();
114 return contentRootNode;
120 camera->viewAll(contentRootNode, SbViewportRegion());
126 camera->viewAll(node, SbViewportRegion(), slack);