Geant4 11.2.2
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 G4Plotter &)
 
- Public Member Functions inherited from G4OpenGLSceneHandler
void AddPrimitivesCircle (const std::vector< G4VMarker > &)
 
void AddPrimitivesSquare (const std::vector< G4VMarker > &)
 
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 &)
 
- Public Member Functions inherited from G4VSceneHandler
 G4VSceneHandler (G4VGraphicsSystem &system, G4int id, const G4String &name="")
 
virtual ~G4VSceneHandler ()
 
virtual void PostAddSolid ()
 
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 *)
 
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 ()
 
void AddViewerToList (G4VViewer *pView)
 
void RemoveViewerFromList (G4VViewer *pView)
 
- Public Member Functions inherited from G4VGraphicsScene
 G4VGraphicsScene ()
 
virtual ~G4VGraphicsScene ()
 

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 ()
 
- 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 RequestPrimitives (const G4VSolid &solid)
 
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 = "" )

Definition at line 41 of file G4OpenGLStoredQtSceneHandler.cc.

43 :
44G4OpenGLStoredSceneHandler (system, name)
45{}
G4OpenGLStoredSceneHandler(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}

◆ 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)
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: