33#include <Inventor/nodes/SoSelection.h>
35#include <Inventor/Qt/SoQt.h>
37#include <Inventor/Qt/viewers/SoQtViewer.h>
38#include <Inventor/Qt/viewers/SoQtFullViewer.h>
39#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>
58#include "moc_G4OpenInventorQtViewer.cpp"
74 QWidget* parent = SoQt::getTopLevelWidget();
88 auto uiQt =
dynamic_cast<G4UIQt*
>(UI->GetG4UIWindow());
120 fViewer->setSize(SbVec2s(width, height));
132 FileWritePS =
new QAction(
"Write PostScript (gl2ps)",
this);
133 FileWritePS->setFont(*font);
134 connect(FileWritePS, SIGNAL(triggered()),
this,
135 SLOT(FileWritePSCB()));
136 filemenu->addAction(FileWritePS);
138 FileWritePDF =
new QAction(
"Write PDF (gl2ps)",
this);
139 FileWritePDF->setFont(*font);
140 connect(FileWritePDF, SIGNAL(triggered()),
this,
141 SLOT(FileWritePDFCB()));
142 filemenu->addAction(FileWritePDF);
144 FileWriteIV =
new QAction(
"Write IV",
this);
145 FileWriteIV->setFont(*font);
146 connect(FileWriteIV, SIGNAL(triggered()),
this,
147 SLOT(FileWriteIVCB()));
148 filemenu->addAction(FileWriteIV);
150 FileEscape =
new QAction(
"Escape",
this);
151 FileEscape->setFont(*font);
152 connect(FileEscape, SIGNAL(triggered()),
this,
153 SLOT(FileEscapeCB()));
154 filemenu->addAction(FileEscape);
167 EtcEraseDetector =
new QAction(
"Erase detector",
this);
168 EtcEraseDetector->setFont(*font);
169 connect(EtcEraseDetector, SIGNAL(triggered()),
this,
170 SLOT(EtcEraseDetectorCB()));
171 etcmenu->addAction(EtcEraseDetector);
173 EtcEraseEvent =
new QAction(
"Erase event",
this);
174 EtcEraseEvent->setFont(*font);
175 connect(EtcEraseEvent, SIGNAL(triggered()),
this,
176 SLOT(EtcEraseEventCB()));
177 etcmenu->addAction(EtcEraseEvent);
179 EtcSetSolid =
new QAction(
"Set solid",
this);
180 EtcSetSolid->setFont(*font);
181 connect(EtcSetSolid, SIGNAL(triggered()),
this, SLOT(EtcSetSolidCB()));
182 etcmenu->addAction(EtcSetSolid);
184 EtcSetReducedWireframe =
new QAction(
"Set (G4) reduced wireframe",
this);
185 EtcSetReducedWireframe->setFont(*font);
186 connect(EtcSetReducedWireframe, SIGNAL(triggered()),
this,
187 SLOT(EtcSetReducedWireframeCB()));
188 etcmenu->addAction(EtcSetReducedWireframe);
190 EtcSetFullWireframe =
new QAction(
"Set full wireframe",
this);
191 EtcSetFullWireframe->setFont(*font);
192 connect(EtcSetFullWireframe, SIGNAL(triggered()),
this,
193 SLOT(EtcSetFullWireframeCB()));
194 etcmenu->addAction(EtcSetFullWireframe);
196 EtcVisibMInvisibD =
new QAction(
"Visible mothers + invisible daughters",
198 EtcVisibMInvisibD->setFont(*font);
199 connect(EtcVisibMInvisibD, SIGNAL(triggered()),
this,
200 SLOT(EtcVisibMInvisibDCB()));
201 etcmenu->addAction(EtcVisibMInvisibD);
203 EtcVisibMVisibD =
new QAction(
"Visible mothers + visible daughters",
this);
204 EtcVisibMVisibD->setFont(*font);
205 connect(EtcVisibMVisibD, SIGNAL(triggered()),
this,
206 SLOT(EtcVisibMVisibDCB()));
207 etcmenu->addAction(EtcVisibMVisibD);
209 EtcUpdateScene =
new QAction(
"Update scene",
this);
210 EtcUpdateScene->setFont(*font);
211 connect(EtcUpdateScene, SIGNAL(triggered()),
this,
212 SLOT(EtcUpdateSceneCB()));
213 etcmenu->addAction(EtcUpdateScene);
215 EtcSceneGraphStats =
new QAction(
"Scene graph stats",
this);
216 EtcSceneGraphStats->setFont(*font);
217 connect(EtcSceneGraphStats, SIGNAL(triggered()),
this,
218 SLOT(EtcSceneGraphStatsCB()));
219 etcmenu->addAction(EtcSceneGraphStats);
223 const SbViewportRegion& vpRegion =
fViewer->getViewportRegion();
236 fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD);
246 QWidget* mainWin = SoQt::getTopLevelWidget();
310void G4OpenInventorQtViewer::FileWritePSCB()
314 SbBool superimpState =
322void G4OpenInventorQtViewer::FileWritePDFCB()
326 SbBool superimpState =
334void G4OpenInventorQtViewer::FileWriteIVCB()
340void G4OpenInventorQtViewer::FileEscapeCB()
350G4OpenInventorQtViewer::EtcEraseDetectorCB()
357G4OpenInventorQtViewer::EtcEraseEventCB()
363void G4OpenInventorQtViewer::EtcSetSolidCB()
369void G4OpenInventorQtViewer::EtcSetReducedWireframeCB()
375void G4OpenInventorQtViewer::EtcSetFullWireframeCB()
381void G4OpenInventorQtViewer::EtcVisibMInvisibDCB()
388void G4OpenInventorQtViewer::EtcVisibMVisibDCB()
395void G4OpenInventorQtViewer::EtcUpdateSceneCB()
401void G4OpenInventorQtViewer::EtcSceneGraphStatsCB()
G4GLOB_DLL std::ostream G4cout
G4double GetGreen() const
void setOrigWindowSize(int w, int h)
virtual void ViewerRender()
virtual SoCamera * GetCamera()
G4OpenInventorQtViewer(G4OpenInventorSceneHandler &scene, const G4String &name="")
virtual void FinishView()
G4OpenInventorQtExaminerViewer * fViewer
virtual ~G4OpenInventorQtViewer()
void WriteInventor(const G4String &file="g4out.iv")
SoSelection * fSoSelection
void WritePostScript(const G4String &file="g4out.ps")
void SceneGraphStatistics()
G4VInteractorManager * fInteractorManager
void WritePDF(const G4String &file="g4out.pdf")
void SetReducedWireFrame(bool)
Geant4_SoGL2PSAction * fGL2PSAction
static G4UImanager * GetUIpointer()
void SetCreatedInteractor(G4Interactor)
virtual void FlushAndWaitExecution()=0
unsigned int GetWindowSizeHintX() const
const G4Colour & GetBackgroundColour() const
unsigned int GetWindowSizeHintY() const
static Verbosity GetVerbosity()