28 #ifdef G4VIS_BUILD_OIQT_DRIVER
35 #include <Inventor/nodes/SoSelection.h>
37 #include <Inventor/Qt/SoQt.h>
39 #include <Inventor/Qt/viewers/SoQtViewer.h>
40 #include <Inventor/Qt/viewers/SoQtFullViewer.h>
41 #include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
57 G4OpenInventorQtViewer::G4OpenInventorQtViewer(
58 G4OpenInventorSceneHandler& sceneHandler,
const G4String&
name)
59 : G4OpenInventorViewer(sceneHandler, name)
68 void G4OpenInventorQtViewer::Initialise()
71 QWidget* parent = SoQt::getTopLevelWidget();
73 G4cout <<
"G4OIQtViewer: Creating G4OIQtExaminerViewer with parent " <<
77 fViewer =
new G4OpenInventorQtExaminerViewer(parent,
"Geant4",
TRUE);
95 fViewer->setSize(SbVec2s(width, height));
98 const SbViewportRegion& vpRegion = fViewer->getViewportRegion();
100 fViewer->setGLRenderAction(fGL2PSAction);
103 G4cout <<
"G4OpenInventorQtViewer: setting scene graph " <<
105 G4cout <<
"G4OpenInventorQtViewer: getNumChildren " <<
106 fSoSelection->getNumChildren() <<
G4endl;
107 fViewer->setSceneGraph(fSoSelection);
108 fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);
110 fViewer->saveHomePosition();
111 fViewer->setTitle(
fName);
116 QWidget* mainWin = SoQt::getTopLevelWidget();
117 G4cout <<
"G4OIQtViewer: calling SoQt::show on mainWin = " << mainWin
120 fInteractorManager->FlushAndWaitExecution();
122 fInteractorManager->SetCreatedInteractor(fViewer->getWidget());
125 G4OpenInventorQtViewer::~G4OpenInventorQtViewer()
129 fViewer->setSceneGraph(0);
137 void G4OpenInventorQtViewer::FinishView()
141 fViewer->saveHomePosition();
144 void G4OpenInventorQtViewer::SetView()
146 G4OpenInventorViewer::SetView();
150 fViewer->setBackgroundColor
155 void G4OpenInventorQtViewer::ViewerRender()
161 SoCamera* G4OpenInventorQtViewer::GetCamera () {
162 if(!fViewer)
return 0;
163 return fViewer->getCamera();