G4VTreeSceneHandler Class Reference

#include <G4VTreeSceneHandler.hh>

Inheritance diagram for G4VTreeSceneHandler:

G4VSceneHandler G4VGraphicsScene G4ASCIITreeSceneHandler

Public Member Functions

 G4VTreeSceneHandler (G4VGraphicsSystem &system, const G4String &name)
virtual ~G4VTreeSceneHandler ()
void PreAddSolid (const G4Transform3D &objectTransformation, const G4VisAttributes &)
void PostAddSolid ()
virtual void AddPrimitive (const G4Polyline &)
virtual void AddPrimitive (const G4Text &)
virtual void AddPrimitive (const G4Circle &)
virtual void AddPrimitive (const G4Square &)
virtual void AddPrimitive (const G4Polyhedron &)
virtual void AddPrimitive (const G4NURBS &)
virtual void AddPrimitive (const G4Polymarker &)
virtual void AddPrimitive (const G4Scale &)
virtual void BeginModeling ()
virtual void EndModeling ()

Protected Attributes

const G4Transform3DfpCurrentObjectTransformation
std::set< G4LogicalVolume * > fDrawnLVStore

Static Protected Attributes

static G4int fSceneIdCount = 0

Detailed Description

Definition at line 48 of file G4VTreeSceneHandler.hh.


Constructor & Destructor Documentation

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

Definition at line 44 of file G4VTreeSceneHandler.cc.

00045                                                               :
00046   G4VSceneHandler(system, fSceneIdCount++, name),
00047   fpCurrentObjectTransformation (0)
00048 {}

G4VTreeSceneHandler::~G4VTreeSceneHandler (  )  [virtual]

Definition at line 50 of file G4VTreeSceneHandler.cc.

00050 {}


Member Function Documentation

virtual void G4VTreeSceneHandler::AddPrimitive ( const G4Scale  )  [inline, virtual]

Reimplemented from G4VSceneHandler.

Definition at line 68 of file G4VTreeSceneHandler.hh.

00068 {}

virtual void G4VTreeSceneHandler::AddPrimitive ( const G4Polymarker  )  [inline, virtual]

Reimplemented from G4VSceneHandler.

Definition at line 67 of file G4VTreeSceneHandler.hh.

00067 {}

virtual void G4VTreeSceneHandler::AddPrimitive ( const G4NURBS  )  [inline, virtual]

Implements G4VSceneHandler.

Definition at line 66 of file G4VTreeSceneHandler.hh.

00066 {}

virtual void G4VTreeSceneHandler::AddPrimitive ( const G4Polyhedron  )  [inline, virtual]

Implements G4VSceneHandler.

Definition at line 65 of file G4VTreeSceneHandler.hh.

00065 {}

virtual void G4VTreeSceneHandler::AddPrimitive ( const G4Square  )  [inline, virtual]

Implements G4VSceneHandler.

Definition at line 64 of file G4VTreeSceneHandler.hh.

00064 {}

virtual void G4VTreeSceneHandler::AddPrimitive ( const G4Circle  )  [inline, virtual]

Implements G4VSceneHandler.

Definition at line 63 of file G4VTreeSceneHandler.hh.

00063 {}

virtual void G4VTreeSceneHandler::AddPrimitive ( const G4Text  )  [inline, virtual]

Implements G4VSceneHandler.

Definition at line 62 of file G4VTreeSceneHandler.hh.

00062 {}

virtual void G4VTreeSceneHandler::AddPrimitive ( const G4Polyline  )  [inline, virtual]

Implements G4VSceneHandler.

Definition at line 61 of file G4VTreeSceneHandler.hh.

00061 {}

void G4VTreeSceneHandler::BeginModeling (  )  [virtual]

Reimplemented from G4VSceneHandler.

Reimplemented in G4ASCIITreeSceneHandler.

Definition at line 52 of file G4VTreeSceneHandler.cc.

References G4VSceneHandler::BeginModeling().

Referenced by G4ASCIITreeSceneHandler::BeginModeling().

00052                                         {
00053   G4VSceneHandler::BeginModeling();  // Required: see G4VSceneHandler.hh.
00054 }

void G4VTreeSceneHandler::EndModeling (  )  [virtual]

Reimplemented from G4VSceneHandler.

Reimplemented in G4ASCIITreeSceneHandler.

Definition at line 56 of file G4VTreeSceneHandler.cc.

References G4VSceneHandler::EndModeling(), and fDrawnLVStore.

Referenced by G4ASCIITreeSceneHandler::EndModeling().

00056                                       {
00057   fDrawnLVStore.clear();
00058   G4VSceneHandler::EndModeling();  // Required: see G4VSceneHandler.hh.
00059 }

void G4VTreeSceneHandler::PostAddSolid (  )  [inline, virtual]

Reimplemented from G4VSceneHandler.

Definition at line 33 of file G4VTreeSceneHandler.icc.

00033 {}

void G4VTreeSceneHandler::PreAddSolid ( const G4Transform3D objectTransformation,
const G4VisAttributes  
) [virtual]

Reimplemented from G4VSceneHandler.

Definition at line 62 of file G4VTreeSceneHandler.cc.

References G4cout, G4endl, G4PhysicalVolumeModel::GetDrawnPVPath(), and G4VSceneHandler::PreAddSolid().

00063 {
00064   G4VSceneHandler::PreAddSolid (objectTransformation, visAttribs);
00065 
00066   G4PhysicalVolumeModel* pPVModel =
00067     dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
00068   if (!pPVModel) return;  // Not from a G4PhysicalVolumeModel.
00069 
00070   // This call comes from a G4PhysicalVolumeModel, drawnPVPath is
00071   // the path of the current drawn (non-culled) volume in terms of
00072   // drawn (non-culled) ancesters.  Each node is identified by a
00073   // PVNodeID object, which is a physical volume and copy number.  It
00074   // is a vector of PVNodeIDs corresponding to the geometry hierarchy
00075   // actually selected, i.e., not culled.
00076   typedef G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID;
00077   typedef std::vector<PVNodeID> PVPath;
00078   const PVPath& drawnPVPath = pPVModel->GetDrawnPVPath();
00079   //G4int currentDepth = pPVModel->GetCurrentDepth();
00080   //G4VPhysicalVolume* pCurrentPV = pPVModel->GetCurrentPV();
00081   //G4LogicalVolume* pCurrentLV = pPVModel->GetCurrentLV();
00082   //G4Material* pCurrentMaterial = pPVModel->GetCurrentMaterial();
00083 
00084   // Actually, it is enough to store the logical volume of current
00085   // physical volume...
00086   fDrawnLVStore.insert
00087     (drawnPVPath.back().GetPhysicalVolume()->GetLogicalVolume());
00088 
00089   // Find mother.  ri points to drawn mother, if any.
00090   PVPath::const_reverse_iterator ri = ++drawnPVPath.rbegin();
00091   if (ri != drawnPVPath.rend()) {
00092     // This volume has a mother.
00093     G4LogicalVolume* drawnMotherLV =
00094       ri->GetPhysicalVolume()->GetLogicalVolume();
00095     if (fDrawnLVStore.find(drawnMotherLV) != fDrawnLVStore.end()) {
00096       // Mother previously encountered.  Add this volume to
00097       // appropriate node in scene graph tree.
00098       // ...
00099     } else {
00100       // Mother not previously encountered.  Shouldn't happen, since
00101       // G4PhysicalVolumeModel sends volumes as it encounters them,
00102       // i.e., mothers before daughters, in its descent of the
00103       // geometry tree.  Error!
00104       G4cout << "ERROR: G4XXXSceneHandler::PreAddSolid: Mother "
00105              << ri->GetPhysicalVolume()->GetName()
00106              << ':' << ri->GetCopyNo()
00107              << " not previously encountered."
00108         "\nShouldn't happen!  Please report to visualization coordinator."
00109              << G4endl;
00110       // Continue anyway.  Add to root of scene graph tree.
00111       // ...
00112     }
00113   } else {
00114     // This volume has no mother.  Must be a top level un-culled
00115     // volume.  Add to root of scene graph tree.
00116     // ...
00117   }
00118 }


Field Documentation

std::set<G4LogicalVolume*> G4VTreeSceneHandler::fDrawnLVStore [protected]

Definition at line 79 of file G4VTreeSceneHandler.hh.

Referenced by EndModeling().

const G4Transform3D* G4VTreeSceneHandler::fpCurrentObjectTransformation [protected]

Definition at line 78 of file G4VTreeSceneHandler.hh.

G4int G4VTreeSceneHandler::fSceneIdCount = 0 [static, protected]

Definition at line 77 of file G4VTreeSceneHandler.hh.


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:57 2013 for Geant4 by  doxygen 1.4.7