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

#include <G4XXXSGSceneHandler.hh>

+ Inheritance diagram for G4XXXSGSceneHandler:

Public Member Functions

 G4XXXSGSceneHandler (G4VGraphicsSystem &system, const G4String &name)
 
virtual ~G4XXXSGSceneHandler ()
 
void AddSolid (const G4Box &)
 
void AddSolid (const G4Cons &cons)
 
void AddSolid (const G4Tubs &tubs)
 
void AddSolid (const G4Trd &trd)
 
void AddSolid (const G4Trap &trap)
 
void AddSolid (const G4Sphere &sphere)
 
void AddSolid (const G4Para &para)
 
void AddSolid (const G4Torus &torus)
 
void AddSolid (const G4Polycone &polycone)
 
void AddSolid (const G4Polyhedra &polyhedra)
 
void AddSolid (const G4Orb &orb)
 
void AddSolid (const G4Ellipsoid &ellipsoid)
 
void AddSolid (const G4TessellatedSolid &tess)
 
void AddSolid (const G4VSolid &solid)
 
void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
 
void PostAddSolid ()
 
void AddPrimitive (const G4Polyline &)
 
void AddPrimitive (const G4Text &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Square &)
 
void AddPrimitive (const G4Polyhedron &)
 
void AddPrimitive (const G4Polymarker &polymarker)
 
void AddPrimitive (const G4Scale &scale)
 
void BeginPrimitives (const G4Transform3D &objectTransformation)
 
void EndPrimitives ()
 
void ClearStore ()
 
void ClearTransientStore ()
 
- 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 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 G4Scale &)
 
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 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 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 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 G4Scale &)=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 const G4VisExtentGetExtent () const
 

Protected Member Functions

void CreateCurrentItem (const G4String &)
 
- Protected Member Functions inherited from G4VSceneHandler
virtual void ProcessScene ()
 
virtual void RequestPrimitives (const G4VSolid &solid)
 
virtual G4DisplacedSolidCreateSectionSolid ()
 
virtual G4DisplacedSolidCreateCutawaySolid ()
 
void LoadAtts (const G4Visible &, G4AttHolder *)
 

Protected Attributes

SceneGraph fSceneGraph
 
- 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

static G4int fSceneIdCount = 0
 

Friends

class G4XXXSGViewer
 

Additional Inherited Members

- Public Types inherited from G4VSceneHandler
enum  MarkerSizeType { world , screen }
 

Detailed Description

Definition at line 65 of file G4XXXSGSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4XXXSGSceneHandler()

G4XXXSGSceneHandler::G4XXXSGSceneHandler ( G4VGraphicsSystem system,
const G4String name 
)

Definition at line 53 of file G4XXXSGSceneHandler.cc.

54 :
55 G4VSceneHandler(system, fSceneIdCount++, name)
56{}

◆ ~G4XXXSGSceneHandler()

G4XXXSGSceneHandler::~G4XXXSGSceneHandler ( )
virtual

Definition at line 58 of file G4XXXSGSceneHandler.cc.

58{}

Member Function Documentation

◆ AddPrimitive() [1/7]

void G4XXXSGSceneHandler::AddPrimitive ( const G4Circle circle)
virtual

Implements G4VSceneHandler.

Definition at line 279 of file G4XXXSGSceneHandler.cc.

279 {
280#ifdef G4XXXSGDEBUG
281 G4cout <<
282 "G4XXXSGSceneHandler::AddPrimitive(const G4Circle& circle) called.\n"
283 << circle
284 << G4endl;
285 MarkerSizeType sizeType;
286 G4double size = GetMarkerSize (circle, sizeType);
287 switch (sizeType) {
288 default:
289 case screen:
290 // Draw in screen coordinates.
291 G4cout << "screen";
292 break;
293 case world:
294 // Draw in world coordinates.
295 G4cout << "world";
296 break;
297 }
298 G4cout << " size: " << size << G4endl;
299#endif
300 // Get vis attributes - pick up defaults if none.
301 //const G4VisAttributes* pVA =
302 // fpViewer -> GetApplicableVisAttributes (circle.GetVisAttributes ());
303 //?? Process circle.
304 std::ostringstream oss;
305 oss << circle << std::endl;
306 //*fCurrentItem += oss.str();
307}
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double GetMarkerSize(const G4VMarker &, MarkerSizeType &)

◆ AddPrimitive() [2/7]

void G4XXXSGSceneHandler::AddPrimitive ( const G4Polyhedron polyhedron)
virtual

Implements G4VSceneHandler.

Definition at line 339 of file G4XXXSGSceneHandler.cc.

339 {
340#ifdef G4XXXSGDEBUG
341 G4cout <<
342 "G4XXXSGSceneHandler::AddPrimitive(const G4Polyhedron& polyhedron) called.\n"
343 << polyhedron
344 << G4endl;
345#endif
346 //?? Process polyhedron.
347 std::ostringstream oss;
348 oss << polyhedron;
349 //*fCurrentItem += oss.str();
350
351 //?? Or... here are some ideas for decomposing into polygons...
352 //Assume all facets are convex quadrilaterals.
353 //Draw each G4Facet individually
354
355 //Get colour, etc..
356 if (polyhedron.GetNoFacets() == 0) return;
357
358 // Get vis attributes - pick up defaults if none.
359 const G4VisAttributes* pVA =
360 fpViewer -> GetApplicableVisAttributes (polyhedron.GetVisAttributes ());
361
362 // Get view parameters that the user can force through the vis
363 // attributes, thereby over-riding the current view parameter.
365 //G4bool isAuxEdgeVisible = GetAuxEdgeVisible (pVA);
366
367 //Get colour, etc..
368 //const G4Colour& c = pVA -> GetColour ();
369
370 // Initial action depending on drawing style.
371 switch (drawing_style) {
373 {
374 break;
375 }
377 {
378 break;
379 }
381 {
382 break;
383 }
384 default:
385 {
386 break;
387 }
388 }
389
390 // Loop through all the facets...
391
392 // Look at G4OpenGLSceneHandler::AddPrimitive(const G4Polyhedron&)
393 // for an example of how to get facets out of a G4Polyhedron,
394 // including how to cope with triangles if that's a problem.
395}
G4VViewer * fpViewer
G4ViewParameters::DrawingStyle GetDrawingStyle(const G4VisAttributes *)

◆ AddPrimitive() [3/7]

void G4XXXSGSceneHandler::AddPrimitive ( const G4Polyline polyline)
virtual

Implements G4VSceneHandler.

Definition at line 245 of file G4XXXSGSceneHandler.cc.

245 {
246#ifdef G4XXXSGDEBUG
247 G4cout <<
248 "G4XXXSGSceneHandler::AddPrimitive(const G4Polyline& polyline) called.\n"
249 << polyline
250 << G4endl;
251#endif
252 // Get vis attributes - pick up defaults if none.
253 //const G4VisAttributes* pVA =
254 // fpViewer -> GetApplicableVisAttributes (polyline.GetVisAttributes ());
255 //?? Process polyline.
256 std::ostringstream oss;
257 oss << polyline << std::endl;
258 //*fCurrentItem += oss.str();
259}

◆ AddPrimitive() [4/7]

void G4XXXSGSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 126 of file G4XXXSGSceneHandler.hh.

127 {G4VSceneHandler::AddPrimitive (polymarker);}
virtual void AddPrimitive(const G4Polyline &)=0

◆ AddPrimitive() [5/7]

void G4XXXSGSceneHandler::AddPrimitive ( const G4Scale scale)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 128 of file G4XXXSGSceneHandler.hh.

◆ AddPrimitive() [6/7]

void G4XXXSGSceneHandler::AddPrimitive ( const G4Square square)
virtual

Implements G4VSceneHandler.

Definition at line 309 of file G4XXXSGSceneHandler.cc.

309 {
310#ifdef G4XXXSGDEBUG
311 G4cout <<
312 "G4XXXSGSceneHandler::AddPrimitive(const G4Square& square) called.\n"
313 << square
314 << G4endl;
315 MarkerSizeType sizeType;
316 G4double size = GetMarkerSize (square, sizeType);
317 switch (sizeType) {
318 default:
319 case screen:
320 // Draw in screen coordinates.
321 G4cout << "screen";
322 break;
323 case world:
324 // Draw in world coordinates.
325 G4cout << "world";
326 break;
327 }
328 G4cout << " size: " << size << G4endl;
329#endif
330 // Get vis attributes - pick up defaults if none.
331 //const G4VisAttributes* pVA =
332 // fpViewer -> GetApplicableVisAttributes (square.GetVisAttributes ());
333 //?? Process square.
334 std::ostringstream oss;
335 oss << square << std::endl;
336 //*fCurrentItem += oss.str();
337}

◆ AddPrimitive() [7/7]

void G4XXXSGSceneHandler::AddPrimitive ( const G4Text text)
virtual

Implements G4VSceneHandler.

Definition at line 261 of file G4XXXSGSceneHandler.cc.

261 {
262#ifdef G4XXXSGDEBUG
263 G4cout <<
264 "G4XXXSGSceneHandler::AddPrimitive(const G4Text& text) called.\n"
265 << text
266 << G4endl;
267#endif
268 // Get text colour - special method since default text colour is
269 // determined by the default text vis attributes, which may be
270 // specified independent of default vis attributes of other types of
271 // visible objects.
272 //const G4Colour& c = GetTextColour (text); // Picks up default if none.
273 //?? Process text.
274 std::ostringstream oss;
275 oss << text << std::endl;
276 //*fCurrentItem += oss.str();
277}

◆ AddSolid() [1/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Box box)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 227 of file G4XXXSGSceneHandler.cc.

227 {
228#ifdef G4XXXSGDEBUG
229 G4cout <<
230 "G4XXXSGSceneHandler::AddSolid(const G4Box& box) called for "
231 << box.GetName()
232 << G4endl;
233#endif
234 //?? Process your box...
235 std::ostringstream oss;
236 oss << "G4Box(" <<
240 (box.GetXHalfLength(), box.GetYHalfLength(), box.GetZHalfLength()),
241 "Length")).strip() << ')' << std::endl;
242 //*fCurrentItem += oss.str();
243}
G4double GetYHalfLength() const
G4double GetZHalfLength() const
G4double GetXHalfLength() const
G4String strip(G4int strip_Type=trailing, char c=' ')
G4String GetName() const

◆ AddSolid() [2/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Cons cons)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 80 of file G4XXXSGSceneHandler.hh.

virtual void AddSolid(const G4Box &)

◆ AddSolid() [3/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Ellipsoid ellipsoid)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 100 of file G4XXXSGSceneHandler.hh.

101 {G4VSceneHandler::AddSolid(ellipsoid);}

◆ AddSolid() [4/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Orb orb)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 98 of file G4XXXSGSceneHandler.hh.

◆ AddSolid() [5/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Para para)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 90 of file G4XXXSGSceneHandler.hh.

◆ AddSolid() [6/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Polycone polycone)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 94 of file G4XXXSGSceneHandler.hh.

95 {G4VSceneHandler::AddSolid(polycone);}

◆ AddSolid() [7/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Polyhedra polyhedra)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 96 of file G4XXXSGSceneHandler.hh.

97 {G4VSceneHandler::AddSolid(polyhedra);}

◆ AddSolid() [8/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Sphere sphere)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 88 of file G4XXXSGSceneHandler.hh.

◆ AddSolid() [9/14]

void G4XXXSGSceneHandler::AddSolid ( const G4TessellatedSolid tess)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 102 of file G4XXXSGSceneHandler.hh.

◆ AddSolid() [10/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Torus torus)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 92 of file G4XXXSGSceneHandler.hh.

◆ AddSolid() [11/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Trap trap)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 86 of file G4XXXSGSceneHandler.hh.

◆ AddSolid() [12/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Trd trd)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 84 of file G4XXXSGSceneHandler.hh.

◆ AddSolid() [13/14]

void G4XXXSGSceneHandler::AddSolid ( const G4Tubs tubs)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 82 of file G4XXXSGSceneHandler.hh.

◆ AddSolid() [14/14]

void G4XXXSGSceneHandler::AddSolid ( const G4VSolid solid)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 104 of file G4XXXSGSceneHandler.hh.

◆ BeginPrimitives()

void G4XXXSGSceneHandler::BeginPrimitives ( const G4Transform3D objectTransformation)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 207 of file G4XXXSGSceneHandler.cc.

209{
210 G4VSceneHandler::BeginPrimitives(objectTransformation);
211}
virtual void BeginPrimitives(const G4Transform3D &objectTransformation=G4Transform3D())

◆ ClearStore()

void G4XXXSGSceneHandler::ClearStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 397 of file G4XXXSGSceneHandler.cc.

398{
400}
void Clear(Node *)

◆ ClearTransientStore()

void G4XXXSGSceneHandler::ClearTransientStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 402 of file G4XXXSGSceneHandler.cc.

403{
405}

◆ CreateCurrentItem()

void G4XXXSGSceneHandler::CreateCurrentItem ( const G4String )
protected

Definition at line 89 of file G4XXXSGSceneHandler.cc.

89 {
90 // Utility for PreAddSolid and BeginPrimitives.
91
92 G4PhysicalVolumeModel* pPVModel =
93 dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
94 G4LogicalVolumeModel* pLVModel =
95 dynamic_cast<G4LogicalVolumeModel*>(pPVModel);
96 if (pPVModel && !pLVModel) {
97
98 // This call comes from a G4PhysicalVolumeModel. drawnPVPath is
99 // the path of the current drawn (non-culled) volume in terms of
100 // drawn (non-culled) ancestors. Each node is identified by a
101 // PVNodeID object, which is a physical volume and copy number. It
102 // is a vector of PVNodeIDs corresponding to the geometry hierarchy
103 // actually selected, i.e., not culled.
105 typedef std::vector<PVNodeID> PVPath;
106 const PVPath& drawnPVPath = pPVModel->GetDrawnPVPath();
107 //G4int currentDepth = pPVModel->GetCurrentDepth();
108 //G4VPhysicalVolume* pCurrentPV = pPVModel->GetCurrentPV();
109 //G4LogicalVolume* pCurrentLV = pPVModel->GetCurrentLV();
110 //G4Material* pCurrentMaterial = pPVModel->GetCurrentMaterial();
111 // Note: pCurrentMaterial may be zero (parallel world).
112
113 // The simplest algorithm, used by the Open Inventor Driver
114 // developers, is to rely on the fact the G4PhysicalVolumeModel
115 // traverses the geometry hierarchy in an orderly manner. The last
116 // mother, if any, will be the node to which the volume should be
117 // added. So it is enough to keep a map of scene graph nodes keyed
118 // on the volume path ID. Actually, it is enough to use the logical
119 // volume as the key. (An alternative would be to keep the PVNodeID
120 // in the tree and match the PVPath from the root down.)
121
122 // BUT IN OPENGL, IF THERE ARE TRANSPARENT OBJECTS, VOLUMES DO NOT
123 // ARRIVE IN THE ABOVE ORDER. (TRANSPARENT OBJECTS ARE DRWAN
124 // LAST.) SO WE MUST BE MORE SOPHISTICATED IN CONSTRUCTING A
125 // TREE.
126
127 /* Debug
128 G4cout << drawnPVPath << G4endl;
129 */
130
131 static G4int index = 0; // Some index for future reference
132 JA::Insert(&drawnPVPath[0],drawnPVPath.size(),index++,&fSceneGraph);
133 //JA::PrintTree(std::cout,&root);
134
135 /*** Old algorithm, left here for historical interest!!
136 // Find mother. ri points to drawn mother, if any.
137 PVPath::const_reverse_iterator ri = ++drawnPVPath.rbegin();
138 if (ri != drawnPVPath.rend()) {
139 // This volume has a mother.
140 G4LogicalVolume* drawnMotherLV =
141 ri->GetPhysicalVolume()->GetLogicalVolume();
142 LVMapIterator mother = fLVMap.find(drawnMotherLV);
143 if (mother != fLVMap.end()) {
144 // This adds a child in Troy's tree...
145 fCurrentItem = mother->second.push_back(header);
146 } else {
147 // Mother not previously encountered. Shouldn't happen, since
148 // G4PhysicalVolumeModel sends volumes as it encounters them,
149 // i.e., mothers before daughters, in its descent of the
150 // geometry tree. Error!
151 G4cout << "ERROR: G4XXXSGSceneHandler::PreAddSolid: Mother "
152 << ri->GetPhysicalVolume()->GetName()
153 << ':' << ri->GetCopyNo()
154 << " not previously encountered."
155 "\nShouldn't happen! Please report to visualization coordinator."
156 << G4endl;
157 // Continue anyway. Add to root of scene graph tree...
158 fCurrentItem = fPermanentsRoot.push_back(header);
159 }
160 } else {
161 // This volume has no mother. Must be a top level un-culled
162 // volume. Add to root of scene graph tree...
163 fCurrentItem = fPermanentsRoot.push_back(header);
164 }
165
166 std::ostringstream oss;
167 oss << "Path of drawn PVs: ";
168 for (PVPath::const_iterator i = drawnPVPath.begin();
169 i != drawnPVPath.end(); ++i) {
170 oss << '/' << i->GetPhysicalVolume()->GetName()
171 << ':' << i->GetCopyNo();
172 }
173 oss << std::endl;
174 *fCurrentItem += oss.str();
175
176 // Store for future searches. Overwrites previous entries for this
177 // LV, so entry is always the *last* LV.
178 fLVMap[pCurrentLV] = fCurrentItem;
179 ***/
180
181 } else { // Not from a G4PhysicalVolumeModel.
182
183 /***
184 // Create a place for current solid in root...
185 if (fReadyForTransients) {
186 fCurrentItem = fTransientsRoot.push_back(header);
187 } else {
188 fCurrentItem = fPermanentsRoot.push_back(header);
189 }
190 ***/
191 }
192}
int G4int
Definition: G4Types.hh:85
const std::vector< G4PhysicalVolumeNodeID > & GetDrawnPVPath() const
G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID
void Insert(const PVNodeID *pvPath, size_t pathLength, G4int index, Node *node)
std::vector< PVNodeID > PVPath

Referenced by PreAddSolid().

◆ EndPrimitives()

void G4XXXSGSceneHandler::EndPrimitives ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 213 of file G4XXXSGSceneHandler.cc.

214{
216}
virtual void EndPrimitives()

◆ PostAddSolid()

void G4XXXSGSceneHandler::PostAddSolid ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 202 of file G4XXXSGSceneHandler.cc.

203{
205}
virtual void PostAddSolid()

◆ PreAddSolid()

void G4XXXSGSceneHandler::PreAddSolid ( const G4Transform3D objectTransformation,
const G4VisAttributes visAttribs 
)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 194 of file G4XXXSGSceneHandler.cc.

197{
198 G4VSceneHandler::PreAddSolid(objectTransformation, visAttribs);
199 CreateCurrentItem(G4String("\nPreAddSolid:\n"));
200}
virtual void PreAddSolid(const G4Transform3D &objectTransformation, const G4VisAttributes &)
void CreateCurrentItem(const G4String &)

Friends And Related Function Documentation

◆ G4XXXSGViewer

friend class G4XXXSGViewer
friend

Definition at line 67 of file G4XXXSGSceneHandler.hh.

Member Data Documentation

◆ fSceneGraph

SceneGraph G4XXXSGSceneHandler::fSceneGraph
protected

Definition at line 154 of file G4XXXSGSceneHandler.hh.

Referenced by ClearStore(), ClearTransientStore(), and CreateCurrentItem().

◆ fSceneIdCount

G4int G4XXXSGSceneHandler::fSceneIdCount = 0
staticprotected

Definition at line 148 of file G4XXXSGSceneHandler.hh.


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