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

#include <G4OpenGLStoredQtSceneHandler.hh>

+ Inheritance diagram for G4OpenGLStoredQtSceneHandler:

Public Member Functions

 G4OpenGLStoredQtSceneHandler (G4VGraphicsSystem &system, const G4String &name="")
 
virtual ~G4OpenGLStoredQtSceneHandler ()
 
G4bool ExtraPOProcessing (const G4Visible &, size_t currentPOListIndex)
 
G4bool ExtraTOProcessing (const G4Visible &, size_t currentTOListIndex)
 
void ClearStore ()
 
void ClearTransientStore ()
 
void SetScene (G4Scene *)
 
- Public Member Functions inherited from G4OpenGLStoredSceneHandler
 G4OpenGLStoredSceneHandler (G4VGraphicsSystem &system, const G4String &name="")
 
virtual ~G4OpenGLStoredSceneHandler ()
 
void BeginPrimitives (const G4Transform3D &objectTransformation)
 
void EndPrimitives ()
 
void BeginPrimitives2D (const G4Transform3D &objectTransformation)
 
void EndPrimitives2D ()
 
void BeginModeling ()
 
void EndModeling ()
 
void AddPrimitive (const G4Polyline &)
 
void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Square &)
 
void AddPrimitive (const G4Text &)
 
void AddPrimitive (const G4Polyhedron &)
 
void ClearStore ()
 
void ClearTransientStore ()
 
virtual void AddPrimitive (const G4Polyline &)=0
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Square &)=0
 
virtual void AddPrimitive (const G4Polymarker &)
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
virtual void AddPrimitive (const G4Plotter &)
 
- Public Member Functions inherited from G4OpenGLSceneHandler
virtual void BeginPrimitives (const G4Transform3D &objectTransformation)
 
virtual void EndPrimitives ()
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation)
 
virtual void EndPrimitives2D ()
 
void AddPrimitive (const G4Polyline &)
 
void AddPrimitive (const G4Polymarker &)
 
void AddPrimitive (const G4Text &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Square &)
 
void AddPrimitivesCircle (const std::vector< G4VMarker > &)
 
void AddPrimitivesSquare (const std::vector< G4VMarker > &)
 
void AddPrimitive (const G4Polyhedron &)
 
void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
void AddSolid (const G4Box &)
 
void AddSolid (const G4Cons &)
 
void AddSolid (const G4Tubs &)
 
void AddSolid (const G4Trd &)
 
void AddSolid (const G4Trap &)
 
void AddSolid (const G4Sphere &)
 
void AddSolid (const G4Para &)
 
void AddSolid (const G4Torus &)
 
void AddSolid (const G4Polycone &)
 
void AddSolid (const G4Polyhedra &)
 
void AddSolid (const G4Orb &)
 
void AddSolid (const G4Ellipsoid &)
 
void AddSolid (const G4TessellatedSolid &)
 
void AddSolid (const G4VSolid &)
 
void AddCompound (const G4VTrajectory &)
 
void AddCompound (const G4VHit &)
 
void AddCompound (const G4VDigi &)
 
void AddCompound (const G4THitsMap< G4double > &)
 
void AddCompound (const G4THitsMap< G4StatDouble > &)
 
void AddCompound (const G4Mesh &)
 
virtual void AddPrimitive (const G4Polyline &)=0
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Square &)=0
 
virtual void AddPrimitive (const G4Polymarker &)
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
virtual void AddPrimitive (const G4Plotter &)
 
- Public Member Functions inherited from G4VSceneHandler
 G4VSceneHandler (G4VGraphicsSystem &system, G4int id, const G4String &name="")
 
virtual ~G4VSceneHandler ()
 
virtual void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
virtual void PostAddSolid ()
 
virtual void AddSolid (const G4Box &)
 
virtual void AddSolid (const G4Cons &)
 
virtual void AddSolid (const G4Orb &)
 
virtual void AddSolid (const G4Para &)
 
virtual void AddSolid (const G4Sphere &)
 
virtual void AddSolid (const G4Torus &)
 
virtual void AddSolid (const G4Trap &)
 
virtual void AddSolid (const G4Trd &)
 
virtual void AddSolid (const G4Tubs &)
 
virtual void AddSolid (const G4Ellipsoid &)
 
virtual void AddSolid (const G4Polycone &)
 
virtual void AddSolid (const G4Polyhedra &)
 
virtual void AddSolid (const G4TessellatedSolid &)
 
virtual void AddSolid (const G4VSolid &)
 
virtual void AddCompound (const G4VTrajectory &)
 
virtual void AddCompound (const G4VHit &)
 
virtual void AddCompound (const G4VDigi &)
 
virtual void AddCompound (const G4THitsMap< G4double > &)
 
virtual void AddCompound (const G4THitsMap< G4StatDouble > &)
 
virtual void AddCompound (const G4Mesh &)
 
virtual void BeginModeling ()
 
virtual void EndModeling ()
 
virtual void BeginPrimitives (const G4Transform3D &objectTransformation=G4Transform3D())
 
virtual void EndPrimitives ()
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation=G4Transform3D())
 
virtual void EndPrimitives2D ()
 
virtual void AddPrimitive (const G4Polyline &)=0
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Square &)=0
 
virtual void AddPrimitive (const G4Polymarker &)
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
virtual void AddPrimitive (const G4Plotter &)
 
virtual const G4VisExtentGetExtent () const
 
const G4StringGetName () const
 
G4int GetSceneHandlerId () const
 
G4int GetViewCount () const
 
G4VGraphicsSystemGetGraphicsSystem () const
 
G4SceneGetScene () const
 
const G4ViewerListGetViewerList () const
 
G4VModelGetModel () const
 
G4VViewerGetCurrentViewer () const
 
G4bool GetMarkForClearingTransientStore () const
 
G4bool IsReadyForTransients () const
 
G4bool GetTransientsDrawnThisEvent () const
 
G4bool GetTransientsDrawnThisRun () const
 
const G4Transform3DGetObjectTransformation () const
 
void SetName (const G4String &)
 
void SetCurrentViewer (G4VViewer *)
 
virtual void SetScene (G4Scene *)
 
G4ViewerListSetViewerList ()
 
void SetModel (G4VModel *)
 
void SetMarkForClearingTransientStore (G4bool)
 
void SetTransientsDrawnThisEvent (G4bool)
 
void SetTransientsDrawnThisRun (G4bool)
 
void SetObjectTransformation (const G4Transform3D &)
 
const G4ColourGetColour ()
 
const G4ColourGetColor ()
 
const G4ColourGetColour (const G4Visible &)
 
const G4ColourGetColor (const G4Visible &)
 
const G4ColourGetTextColour (const G4Text &)
 
const G4ColourGetTextColor (const G4Text &)
 
G4double GetLineWidth (const G4VisAttributes *)
 
G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes *)
 
G4int GetNumberOfCloudPoints (const G4VisAttributes *) const
 
G4bool GetAuxEdgeVisible (const G4VisAttributes *)
 
G4int GetNoOfSides (const G4VisAttributes *)
 
G4double GetMarkerSize (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerDiameter (const G4VMarker &, MarkerSizeType &)
 
G4double GetMarkerRadius (const G4VMarker &, MarkerSizeType &)
 
G4ModelingParametersCreateModelingParameters ()
 
void DrawEvent (const G4Event *)
 
void DrawEndOfRunModels ()
 
template<class T >
void AddSolidT (const T &solid)
 
template<class T >
void AddSolidWithAuxiliaryEdges (const T &solid)
 
G4int IncrementViewCount ()
 
virtual void ClearStore ()
 
virtual void ClearTransientStore ()
 
void AddViewerToList (G4VViewer *pView)
 
void RemoveViewerFromList (G4VViewer *pView)
 
- Public Member Functions inherited from G4VGraphicsScene
 G4VGraphicsScene ()
 
virtual ~G4VGraphicsScene ()
 
virtual void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &visAttribs)=0
 
virtual void PostAddSolid ()=0
 
virtual void AddSolid (const G4Box &)=0
 
virtual void AddSolid (const G4Cons &)=0
 
virtual void AddSolid (const G4Orb &)=0
 
virtual void AddSolid (const G4Para &)=0
 
virtual void AddSolid (const G4Sphere &)=0
 
virtual void AddSolid (const G4Torus &)=0
 
virtual void AddSolid (const G4Trap &)=0
 
virtual void AddSolid (const G4Trd &)=0
 
virtual void AddSolid (const G4Tubs &)=0
 
virtual void AddSolid (const G4Ellipsoid &)=0
 
virtual void AddSolid (const G4Polycone &)=0
 
virtual void AddSolid (const G4Polyhedra &)=0
 
virtual void AddSolid (const G4TessellatedSolid &)=0
 
virtual void AddSolid (const G4VSolid &)=0
 
virtual void AddCompound (const G4VTrajectory &)=0
 
virtual void AddCompound (const G4VHit &)=0
 
virtual void AddCompound (const G4VDigi &)=0
 
virtual void AddCompound (const G4THitsMap< G4double > &)=0
 
virtual void AddCompound (const G4THitsMap< G4StatDouble > &)=0
 
virtual void AddCompound (const G4Mesh &)=0
 
virtual void BeginPrimitives (const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void EndPrimitives ()=0
 
virtual void BeginPrimitives2D (const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void EndPrimitives2D ()=0
 
virtual void AddPrimitive (const G4Polyline &)=0
 
virtual void AddPrimitive (const G4Text &)=0
 
virtual void AddPrimitive (const G4Circle &)=0
 
virtual void AddPrimitive (const G4Square &)=0
 
virtual void AddPrimitive (const G4Polymarker &)=0
 
virtual void AddPrimitive (const G4Polyhedron &)=0
 
virtual void AddPrimitive (const G4Plotter &)=0
 
virtual const G4VisExtentGetExtent () const
 

Additional Inherited Members

- Public Types inherited from G4OpenGLSceneHandler
enum  FlushAction {
  endOfEvent , endOfRun , eachPrimitive , NthPrimitive ,
  NthEvent , never
}
 
- Public Types inherited from G4VSceneHandler
enum  MarkerSizeType { world , screen }
 
- Static Public Member Functions inherited from G4OpenGLSceneHandler
static G4int GetEntitiesFlushInterval ()
 
static FlushAction GetFlushAction ()
 
static void SetEntitiesFlushInterval (G4int interval)
 
static void SetFlushAction (FlushAction action)
 
- Protected Member Functions inherited from G4OpenGLStoredSceneHandler
G4bool AddPrimitivePreamble (const G4VMarker &visible)
 
G4bool AddPrimitivePreamble (const G4Polyline &visible)
 
G4bool AddPrimitivePreamble (const G4Polyhedron &visible)
 
void AddPrimitivePostamble ()
 
virtual G4bool ExtraPOProcessing (const G4Visible &, size_t)
 
virtual G4bool ExtraTOProcessing (const G4Visible &, size_t)
 
- Protected Member Functions inherited from G4OpenGLSceneHandler
 G4OpenGLSceneHandler (G4VGraphicsSystem &system, G4int id, const G4String &name="")
 
virtual ~G4OpenGLSceneHandler ()
 
void ProcessScene ()
 
G4DisplacedSolidCreateSectionSolid ()
 
G4DisplacedSolidCreateCutawaySolid ()
 
void ClearAndDestroyAtts ()
 
void ScaledFlush ()
 
- Protected Member Functions inherited from G4VSceneHandler
virtual void ProcessScene ()
 
virtual void RequestPrimitives (const G4VSolid &solid)
 
virtual G4DisplacedSolidCreateSectionSolid ()
 
virtual G4DisplacedSolidCreateCutawaySolid ()
 
void LoadAtts (const G4Visible &, G4AttHolder *)
 
void StandardSpecialMeshRendering (const G4Mesh &)
 
void Draw3DRectMeshAsDots (const G4Mesh &)
 
void Draw3DRectMeshAsSurfaces (const G4Mesh &)
 
void DrawTetMeshAsDots (const G4Mesh &)
 
void DrawTetMeshAsSurfaces (const G4Mesh &)
 
G4ThreeVector GetPointInBox (const G4ThreeVector &pos, G4double halfX, G4double halfY, G4double halfZ) const
 
G4ThreeVector GetPointInTet (const std::vector< G4ThreeVector > &vertices) const
 
- Protected Attributes inherited from G4OpenGLStoredSceneHandler
G4bool fDoNotUseDisplayList
 
GLint fTopPODL
 
std::vector< POfPOList
 
std::vector< TOfTOList
 
std::map< const G4VSolid *, G4int, std::less< const G4VSolid * > > fSolidMap
 
- Protected Attributes inherited from G4OpenGLSceneHandler
GLuint fPickName
 
std::map< GLuint, G4AttHolder * > fPickMap
 
G4bool fThreePassCapable
 
G4bool fSecondPassForTransparencyRequested
 
G4bool fSecondPassForTransparency
 
G4bool fThirdPassForNonHiddenMarkersRequested
 
G4bool fThirdPassForNonHiddenMarkers
 
bool fEdgeFlag
 
- Protected Attributes inherited from G4VSceneHandler
G4VGraphicsSystemfSystem
 
const G4int fSceneHandlerId
 
G4String fName
 
G4int fViewCount
 
G4ViewerList fViewerList
 
G4VViewerfpViewer
 
G4ScenefpScene
 
G4bool fMarkForClearingTransientStore
 
G4bool fReadyForTransients
 
G4bool fTransientsDrawnThisEvent
 
G4bool fTransientsDrawnThisRun
 
G4bool fProcessingSolid
 
G4bool fProcessing2D
 
G4VModelfpModel
 
G4Transform3D fObjectTransformation
 
G4int fNestingDepth
 
const G4VisAttributesfpVisAttribs
 
const G4Transform3D fIdentityTransformation
 
- Static Protected Attributes inherited from G4OpenGLStoredSceneHandler
static G4int fSceneIdCount = 0
 
static G4int fDisplayListId = 0
 
- Static Protected Attributes inherited from G4OpenGLSceneHandler
static FlushAction fFlushAction = G4OpenGLSceneHandler::NthEvent
 
static G4int fEntitiesFlushInterval = 100
 
static const GLubyte fStippleMaskHashed [128]
 

Detailed Description

Definition at line 36 of file G4OpenGLStoredQtSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4OpenGLStoredQtSceneHandler()

G4OpenGLStoredQtSceneHandler::G4OpenGLStoredQtSceneHandler ( G4VGraphicsSystem system,
const G4String name = "" 
)

◆ ~G4OpenGLStoredQtSceneHandler()

G4OpenGLStoredQtSceneHandler::~G4OpenGLStoredQtSceneHandler ( )
virtual

Definition at line 47 of file G4OpenGLStoredQtSceneHandler.cc.

48{}

Member Function Documentation

◆ ClearStore()

void G4OpenGLStoredQtSceneHandler::ClearStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 133 of file G4OpenGLStoredQtSceneHandler.cc.

133 {
134
135 //G4cout << "G4OpenGLStoredQtSceneHandler::ClearStore" << G4endl;
136
137 G4OpenGLStoredSceneHandler::ClearStore (); // Sets need kernel visit, etc.
138 // Should recreate the tree
139 G4OpenGLQtViewer* pGLQtViewer = dynamic_cast<G4OpenGLQtViewer*>(fpViewer);
140 if ( pGLQtViewer ) {
141 pGLQtViewer->clearTreeWidget();
142 }
143}
G4VViewer * fpViewer

◆ ClearTransientStore()

void G4OpenGLStoredQtSceneHandler::ClearTransientStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 145 of file G4OpenGLStoredQtSceneHandler.cc.

145 {
146
147 //G4cout << "G4OpenGLStoredQtSceneHandler::ClearTransientStore" << G4endl;
148
150
151 // Should recreate the tree
152 // Make sure screen corresponds to graphical database...
153 // FIXME : L.Garnier April 2012 : Could cause a infinite loop ?
154 if (fpViewer) {
155 fpViewer -> SetView ();
156 fpViewer -> ClearView ();
157 fpViewer -> DrawView ();
158 }
159}

◆ ExtraPOProcessing()

G4bool G4OpenGLStoredQtSceneHandler::ExtraPOProcessing ( const G4Visible visible,
size_t  currentPOListIndex 
)
virtual

Reimplemented from G4OpenGLStoredSceneHandler.

Definition at line 50 of file G4OpenGLStoredQtSceneHandler.cc.

52{
53 G4bool usesGLCommands = true;
54
55 try {
56 const G4Text& g4Text = dynamic_cast<const G4Text&>(visible);
57 G4TextPlus* pG4TextPlus = new G4TextPlus(g4Text);
58 pG4TextPlus->fProcessing2D = fProcessing2D;
59 fPOList[currentPOListIndex].fpG4TextPlus = pG4TextPlus;
60 usesGLCommands = false;
61 }
62 catch (const std::bad_cast&) {} // No special action if not text. Just carry on.
63
64 G4PhysicalVolumeModel* pPVModel =
65 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
66 G4LogicalVolumeModel* pLVModel =
67 dynamic_cast<G4LogicalVolumeModel*>(pPVModel);
68 if (pPVModel && !pLVModel) {
69
70 // This call comes from a G4PhysicalVolumeModel. drawnPVPath is
71 // the path of the current drawn (non-culled) volume in terms of
72 // drawn (non-culled) ancestors. Each node is identified by a
73 // PVNodeID object, which is a physical volume and copy number. It
74 // is a vector of PVNodeIDs corresponding to the geometry hierarchy
75 // actually selected, i.e., not culled.
76 // typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
77 // typedef std::vector<PVNodeID> PVPath;
78
79 // The simplest algorithm, used by the Open Inventor Driver
80 // developers, is to rely on the fact the G4PhysicalVolumeModel
81 // traverses the geometry hierarchy in an orderly manner. The last
82 // mother, if any, will be the node to which the volume should be
83 // added. So it is enough to keep a map of scene graph nodes keyed
84 // on the volume path ID. Actually, it is enough to use the logical
85 // volume as the key. (An alternative would be to keep the PVNodeID
86 // in the tree and match the PVPath from the root down.)
87
88 // BUT IN OPENGL, IF THERE ARE TRANSPARENT OBJECTS, VOLUMES DO NOT
89 // ARRIVE IN THE ABOVE ORDER. (TRANSPARENT OBJECTS ARE DRWAN
90 // LAST.) SO WE MUST BE MORE SOPHISTICATED IN CONSTRUCTING A
91 // TREE.
92
93 // build a path for tree viewer
94 G4OpenGLQtViewer* pGLViewer = dynamic_cast<G4OpenGLQtViewer*>(fpViewer);
95 if ( pGLViewer ) {
96 pGLViewer->addPVSceneTreeElement(fpModel->GetCurrentDescription(),pPVModel,(G4int)currentPOListIndex);
97 }
98
99 } else { // Not from a G4PhysicalVolumeModel.
100
101 if (fpModel) {
102
103
104 // build a path for tree viewer
105 G4OpenGLQtViewer* pGLViewer = dynamic_cast<G4OpenGLQtViewer*>(fpViewer);
106 if ( pGLViewer ) {
107 pGLViewer->addNonPVSceneTreeElement(fpModel->GetType(),(G4int)currentPOListIndex,fpModel->GetCurrentDescription().data(),visible);
108 }
109 }
110 }
111
112 return usesGLCommands;
113}
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
void addNonPVSceneTreeElement(const G4String &model, int currentPVPOIndex, const std::string &modelDescription, const G4Visible &visible)
void addPVSceneTreeElement(const G4String &model, G4PhysicalVolumeModel *pPVModel, int currentPVPOIndex)
Definition: G4Text.hh:72
virtual G4String GetCurrentDescription() const
Definition: G4VModel.cc:51
const G4String & GetType() const

◆ ExtraTOProcessing()

G4bool G4OpenGLStoredQtSceneHandler::ExtraTOProcessing ( const G4Visible visible,
size_t  currentTOListIndex 
)
virtual

Reimplemented from G4OpenGLStoredSceneHandler.

Definition at line 115 of file G4OpenGLStoredQtSceneHandler.cc.

117{
118
119 G4bool usesGLCommands = true;
120
121 try {
122 const G4Text& g4Text = dynamic_cast<const G4Text&>(visible);
123 G4TextPlus* pG4TextPlus = new G4TextPlus(g4Text);
124 pG4TextPlus->fProcessing2D = fProcessing2D;
125 fTOList[currentTOListIndex].fpG4TextPlus = pG4TextPlus;
126 usesGLCommands = false;
127 }
128 catch (const std::bad_cast&) {} // Do nothing if not text.
129
130 return usesGLCommands;
131}

◆ SetScene()

void G4OpenGLStoredQtSceneHandler::SetScene ( G4Scene pScene)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 161 of file G4OpenGLStoredQtSceneHandler.cc.

161 {
162
163 if (pScene != fpScene) {
164 G4OpenGLQtViewer* pGLQtViewer = dynamic_cast<G4OpenGLQtViewer*>(fpViewer);
165 if ( pGLQtViewer ) {
166 pGLQtViewer->clearTreeWidget();
167 }
168 }
170}
virtual void SetScene(G4Scene *)

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