Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VtkQtViewer Class Reference

#include <G4VtkQtViewer.hh>

+ Inheritance diagram for G4VtkQtViewer:

Public Member Functions

 G4VtkQtViewer (G4VSceneHandler &, const G4String &name)
 
virtual ~G4VtkQtViewer ()
 
void Initialise ()
 
virtual void CreateMainWindow (QVTKOpenGLNativeWidget *, const QString &)
 
void FinishView ()
 
- Public Member Functions inherited from G4VtkViewer
 G4VtkViewer (G4VSceneHandler &, const G4String &name)
 
void Initialise ()
 
virtual ~G4VtkViewer ()
 
void SetView ()
 
void ClearView ()
 
void DrawView ()
 
void ShowView ()
 
void FinishView ()
 
void DrawViewHUD ()
 
void DrawShadows ()
 
void ExportScreenShot (G4String, G4String)
 
void ExportOBJScene (G4String)
 
void ExportVRMLScene (G4String)
 
void ExportVTPScene (G4String)
 
void ExportView ()
 
void SetGeant4View ()
 
- Public Member Functions inherited from G4VViewer
 G4VViewer (G4VSceneHandler &, G4int id, const G4String &name="")
 
virtual ~G4VViewer ()
 
virtual void Initialise ()
 
virtual void ResetView ()
 
virtual void SetView ()=0
 
virtual void ClearView ()=0
 
virtual void DrawView ()=0
 
void RefreshView ()
 
virtual void ShowView ()
 
virtual void FinishView ()
 
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
 
const G4StringGetName () const
 
const G4StringGetShortName () const
 
void SetName (const G4String &)
 
G4int GetViewId () const
 
G4VSceneHandlerGetSceneHandler () const
 
const G4ViewParametersGetViewParameters () const
 
const G4ViewParametersGetDefaultViewParameters () const
 
G4double GetKernelVisitElapsedTimeSeconds () const
 
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers () const
 
void SetViewParameters (const G4ViewParameters &vp)
 
void SetDefaultViewParameters (const G4ViewParameters &vp)
 
const G4VisAttributesGetApplicableVisAttributes (const G4VisAttributes *) const
 
void SetNeedKernelVisit (G4bool need)
 
void NeedKernelVisit ()
 
void ProcessView ()
 

Additional Inherited Members

- Public Attributes inherited from G4VtkViewer
vtkNew< vtkTextActor > infoTextActor
 
vtkNew< vtkInfoCallbackinfoCallback
 
vtkNew< vtkGeant4Callbackgeant4Callback
 
vtkSmartPointer< vtkLight > light
 
vtkNew< vtkCamera > camera
 
vtkNew< vtkRenderer > renderer
 
vtkRenderWindow * _renderWindow
 
vtkRenderWindowInteractor * renderWindowInteractor
 
- Protected Member Functions inherited from G4VViewer
void SetTouchable (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath)
 
void TouchableSetVisibility (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, G4bool visibility)
 
void TouchableSetColour (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, const G4Colour &)
 
- Protected Attributes inherited from G4VViewer
G4VSceneHandlerfSceneHandler
 
G4int fViewId
 
G4String fName
 
G4String fShortName
 
G4ViewParameters fVP
 
G4ViewParameters fDefaultVP
 
G4double fKernelVisitElapsedTimeSeconds = 999.
 
G4bool fNeedKernelVisit
 

Detailed Description

Definition at line 39 of file G4VtkQtViewer.hh.

Constructor & Destructor Documentation

◆ G4VtkQtViewer()

G4VtkQtViewer::G4VtkQtViewer ( G4VSceneHandler sceneHandler,
const G4String name 
)

Definition at line 47 of file G4VtkQtViewer.cc.

47 :
48 G4VtkViewer(sceneHandler, name) {
49}

◆ ~G4VtkQtViewer()

G4VtkQtViewer::~G4VtkQtViewer ( )
virtual

Definition at line 51 of file G4VtkQtViewer.cc.

51{}

Member Function Documentation

◆ CreateMainWindow()

void G4VtkQtViewer::CreateMainWindow ( QVTKOpenGLNativeWidget *  vtkWidget,
const QString &  name 
)
virtual

Definition at line 73 of file G4VtkQtViewer.cc.

74 {
75 // G4Qt* interactorManager = G4Qt::getInstance ();
77 fUiQt = static_cast<G4UIQt*> (UI->GetG4UIWindow());
78 fUiQt->AddTabWidget((QWidget*)vtkWidget,name);
79}
G4bool AddTabWidget(QWidget *, QString)
Definition: G4UIQt.cc:1860
G4UIsession * GetG4UIWindow() const
Definition: G4UImanager.hh:188
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
const char * name(G4int ptype)

Referenced by Initialise().

◆ FinishView()

void G4VtkQtViewer::FinishView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 81 of file G4VtkQtViewer.cc.

82{
84 // force a widget repaint as there should already
85 // be a rendered buffer when visualiser starts up
86 // paintGL();
87 // repaint();
88}
void FinishView()
Definition: G4VtkViewer.cc:321

◆ Initialise()

void G4VtkQtViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 53 of file G4VtkQtViewer.cc.

54{
55 CreateMainWindow(this, QString(GetName()));
56
57 // Specific GL render window and interactor for Qt
58 _renderWindow = vtkGenericOpenGLRenderWindow::New();
59 renderWindowInteractor = vtkRenderWindowInteractor::New();
60
61 _renderWindow->AddRenderer(renderer);
62#if VTK_MAJOR_VERSION == 8
63 this->SetRenderWindow(_renderWindow);
64#else
65 this->setRenderWindow(_renderWindow);
66#endif
67
68 // Set callback to match VTK parameters to Geant4
69 geant4Callback->SetGeant4ViewParameters(&fVP);
70 renderer->AddObserver(vtkCommand::EndEvent, geant4Callback);
71}
const G4String & GetName() const
G4ViewParameters fVP
Definition: G4VViewer.hh:220
virtual void CreateMainWindow(QVTKOpenGLNativeWidget *, const QString &)
vtkNew< vtkGeant4Callback > geant4Callback
Definition: G4VtkViewer.hh:183
vtkRenderWindowInteractor * renderWindowInteractor
Definition: G4VtkViewer.hh:188
vtkNew< vtkRenderer > renderer
Definition: G4VtkViewer.hh:186
vtkRenderWindow * _renderWindow
Definition: G4VtkViewer.hh:187

The documentation for this class was generated from the following files: