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

#include <G4Qt3D.hh>

+ Inheritance diagram for G4Qt3D:

Public Member Functions

 G4Qt3D ()
 
virtual ~G4Qt3D ()
 
G4VSceneHandlerCreateSceneHandler (const G4String &name="")
 
G4VViewerCreateViewer (G4VSceneHandler &, const G4String &name="")
 
G4bool IsUISessionCompatible () const
 
- Public Member Functions inherited from G4VGraphicsSystem
 G4VGraphicsSystem (const G4String &name, Functionality f)
 
 G4VGraphicsSystem (const G4String &name, const G4String &nickname, Functionality f)
 
 G4VGraphicsSystem (const G4String &name, const G4String &nickname, const G4String &description, Functionality f)
 
virtual ~G4VGraphicsSystem ()
 
virtual G4VSceneHandlerCreateSceneHandler (const G4String &name)=0
 
virtual G4VViewerCreateViewer (G4VSceneHandler &, const G4String &name)=0
 
const G4StringGetName () const
 
const G4StringGetNickname () const
 
const std::vector< G4String > & GetNicknames () const
 
const G4StringGetDescription () const
 
Functionality GetFunctionality () const
 
virtual G4bool IsUISessionCompatible () const
 
void AddNickname (const G4String &nickname)
 

Additional Inherited Members

- Public Types inherited from G4VGraphicsSystem
enum  Functionality {
  noFunctionality , nonEuclidian , twoD , twoDStore ,
  threeD , threeDInteractive , virtualReality , fileWriter
}
 
- Protected Attributes inherited from G4VGraphicsSystem
G4String fName
 
std::vector< G4StringfNicknames
 
G4String fDescription
 
Functionality fFunctionality
 

Detailed Description

Definition at line 33 of file G4Qt3D.hh.

Constructor & Destructor Documentation

◆ G4Qt3D()

G4Qt3D::G4Qt3D ( )

Definition at line 38 of file G4Qt3D.cc.

38 :
40("Qt3D",
41 "Qt3D",
42 "Qt3D graphics driver",

◆ ~G4Qt3D()

G4Qt3D::~G4Qt3D ( )
virtual

Definition at line 45 of file G4Qt3D.cc.

45{}

Member Function Documentation

◆ CreateSceneHandler()

G4VSceneHandler * G4Qt3D::CreateSceneHandler ( const G4String name = "")
virtual

Implements G4VGraphicsSystem.

Definition at line 47 of file G4Qt3D.cc.

47 {
48 G4VSceneHandler* pScene = new G4Qt3DSceneHandler(*this, name);
49 return pScene;
50}

◆ CreateViewer()

G4VViewer * G4Qt3D::CreateViewer ( G4VSceneHandler scene,
const G4String name = "" 
)
virtual

Implements G4VGraphicsSystem.

Definition at line 52 of file G4Qt3D.cc.

53 {
54 G4VViewer* pView =
55 new G4Qt3DViewer((G4Qt3DSceneHandler&) scene, name);
56 if (pView) {
57 if (pView->GetViewId() < 0) {
58 G4warn <<
59 "G4Qt3D::CreateViewer: ERROR flagged by negative"
60 " view id in G4Qt3DViewer creation."
61 "\n Destroying view and returning null pointer."
62 << G4endl;
63 delete pView;
64 pView = 0;
65 }
66 }
67 if (!pView) {
68 G4warn <<
69 "G4Qt3D::CreateViewer: ERROR: null pointer on new G4Qt3DViewer."
70 << G4endl;
71 }
72 return pView;
73}
#define G4warn
Definition: G4Scene.cc:41
#define G4endl
Definition: G4ios.hh:57
G4int GetViewId() const

◆ IsUISessionCompatible()

G4bool G4Qt3D::IsUISessionCompatible ( ) const
virtual

Reimplemented from G4VGraphicsSystem.

Definition at line 75 of file G4Qt3D.cc.

76{
77 G4bool isCompatible = false;
80
81 // If session is a batch session, it may be:
82 // a) this is a batch job (the user has not instantiated any UI session);
83 // b) we are currently processing a UI command, in which case the UI
84 // manager creates a temporary batch session and to find out if there is
85 // a genuine UI session that the user has instantiated we must drill
86 // down through previous sessions to a possible non-batch session.
87 while (G4UIbatch* batch = dynamic_cast<G4UIbatch*>(session)) {
88 session = batch->GetPreviousSession();
89 }
90
91 // Qt windows are only appropriate in a Qt session.
92 if (session) {
93 // If non-zero, this is the originating non-batch session
94 // The user has instantiated a UI session...
95 if (dynamic_cast<G4UIQt*>(session)) {
96 // ...and it's a G4UIQt session, which is OK.
97 isCompatible = true;
98 }
99 }
100 return isCompatible;
101}
bool G4bool
Definition: G4Types.hh:86
G4UIsession * GetSession() const
Definition: G4UImanager.hh:187
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77

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