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

#include <G4RayTracerSceneHandler.hh>

+ Inheritance diagram for G4RayTracerSceneHandler:

Classes

struct  PathLessThan
 

Public Member Functions

 G4RayTracerSceneHandler (G4VGraphicsSystem &system, const G4String &name="")
 
virtual ~G4RayTracerSceneHandler ()
 
void BuildVisAttsMap (const G4VSolid &solid)
 
void RequestPrimitives (const G4VSolid &solid)
 
void AddPrimitive (const G4Polyline &)
 
void AddPrimitive (const G4Text &)
 
void AddPrimitive (const G4Circle &)
 
void AddPrimitive (const G4Square &)
 
void AddPrimitive (const G4Polyhedron &)
 
void AddPrimitive (const G4Polymarker &)
 
void ClearStore ()
 
const std::map< G4ModelingParameters::PVPointerCopyNoPath, G4VisAttributes, PathLessThan > & GetSceneVisAttsMap () const
 
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 G4VSceneHandler
enum  MarkerSizeType { world , screen }
 
- 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 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
 

Detailed Description

Definition at line 38 of file G4RayTracerSceneHandler.hh.

Constructor & Destructor Documentation

◆ G4RayTracerSceneHandler()

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

Definition at line 36 of file G4RayTracerSceneHandler.cc.

38: G4VSceneHandler(system, fSceneIdCount++, name)
39{
40 // Keep vis manager happy when someone opens a ray tracer with "/vis/open
41 // RayTracer" but uses the ray tracer with "/vis/rayTracer" commands
42 // before creating any scenes, for example, instead of using
43 // "/vis/drawVolume"...
45 if(visManager) {
46 G4Scene* pScene = visManager->GetCurrentScene();
47 if (!pScene) {
48 // Create new scene like /vis/scene/create...
49 fpScene = new G4Scene("dummy-ray-tracer-scene");
50 // Add dummy run-duration model to avoid world being added and
51 // notifyHandler being invoked...
53 // Add to vis manager list; ownership thereby passes to vis manager...
54 visManager->SetSceneList().push_back(fpScene);
55 // ...and make current...
56 visManager->SetCurrentScene(fpScene);
57 }
58 }
59}
G4bool AddWorldIfEmpty(G4bool warn=false)
Definition: G4Scene.cc:124
G4Scene * GetCurrentScene() const
void SetCurrentScene(G4Scene *)
G4SceneList & SetSceneList()
static G4VisManager * GetInstance()

◆ ~G4RayTracerSceneHandler()

G4RayTracerSceneHandler::~G4RayTracerSceneHandler ( )
virtual

Definition at line 61 of file G4RayTracerSceneHandler.cc.

62{}

Member Function Documentation

◆ AddPrimitive() [1/13]

void G4RayTracerSceneHandler::AddPrimitive ( const G4Circle )
inlinevirtual

Implements G4VSceneHandler.

Definition at line 56 of file G4RayTracerSceneHandler.hh.

56{}

◆ AddPrimitive() [2/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Circle )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [3/13]

void G4VSceneHandler::AddPrimitive ( const G4Plotter )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 193 of file G4VSceneHandler.cc.

510 {
511 G4warn << "WARNING: Plotter not implemented for " << fSystem.GetName() << G4endl;
512 G4warn << " Open a plotter-aware graphics system or remove plotter with" << G4endl;
513 G4warn << " /vis/scene/removeModel Plotter" << G4endl;
514}
#define G4warn
Definition: G4Scene.cc:41
#define G4endl
Definition: G4ios.hh:57
const G4String & GetName() const
G4VGraphicsSystem & fSystem

◆ AddPrimitive() [4/13]

void G4RayTracerSceneHandler::AddPrimitive ( const G4Polyhedron )
inlinevirtual

Implements G4VSceneHandler.

Definition at line 58 of file G4RayTracerSceneHandler.hh.

58{}

◆ AddPrimitive() [5/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyhedron )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [6/13]

void G4RayTracerSceneHandler::AddPrimitive ( const G4Polyline )
inlinevirtual

Implements G4VSceneHandler.

Definition at line 54 of file G4RayTracerSceneHandler.hh.

54{}

◆ AddPrimitive() [7/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Polyline )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [8/13]

void G4VSceneHandler::AddPrimitive ( const G4Polymarker polymarker)
virtual

Reimplemented from G4VSceneHandler.

Definition at line 191 of file G4VSceneHandler.cc.

467 {
468 switch (polymarker.GetMarkerType()) {
469 default:
471 {
472 G4Circle dot (polymarker);
473 dot.SetWorldSize (0.);
474 dot.SetScreenSize (0.1); // Very small circle.
475 for (std::size_t iPoint = 0; iPoint < polymarker.size (); ++iPoint) {
476 dot.SetPosition (polymarker[iPoint]);
477 AddPrimitive (dot);
478 }
479 }
480 break;
482 {
483 G4Circle circle (polymarker); // Default circle
484 for (std::size_t iPoint = 0; iPoint < polymarker.size (); ++iPoint) {
485 circle.SetPosition (polymarker[iPoint]);
486 AddPrimitive (circle);
487 }
488 }
489 break;
491 {
492 G4Square square (polymarker); // Default square
493 for (std::size_t iPoint = 0; iPoint < polymarker.size (); ++iPoint) {
494 square.SetPosition (polymarker[iPoint]);
495 AddPrimitive (square);
496 }
497 }
498 break;
499 }
500}
MarkerType GetMarkerType() const
void AddPrimitive(const G4Polyline &)

◆ AddPrimitive() [9/13]

void G4RayTracerSceneHandler::AddPrimitive ( const G4Polymarker )
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 59 of file G4RayTracerSceneHandler.hh.

59{}

◆ AddPrimitive() [10/13]

void G4RayTracerSceneHandler::AddPrimitive ( const G4Square )
inlinevirtual

Implements G4VSceneHandler.

Definition at line 57 of file G4RayTracerSceneHandler.hh.

57{}

◆ AddPrimitive() [11/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Square )
virtual

Implements G4VSceneHandler.

◆ AddPrimitive() [12/13]

void G4RayTracerSceneHandler::AddPrimitive ( const G4Text )
inlinevirtual

Implements G4VSceneHandler.

Definition at line 55 of file G4RayTracerSceneHandler.hh.

55{}

◆ AddPrimitive() [13/13]

virtual void G4VSceneHandler::AddPrimitive ( const G4Text )
virtual

Implements G4VSceneHandler.

◆ BuildVisAttsMap()

void G4RayTracerSceneHandler::BuildVisAttsMap ( const G4VSolid solid)

Definition at line 88 of file G4RayTracerSceneHandler.cc.

89{
90 // Build map of vis attributes
91
92 G4PhysicalVolumeModel* fpPVModel = dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
93 if (fpPVModel) {
95 for (const auto& nodeID: fpPVModel->GetFullPVPath()) {
96 // Build an element from the nodeid.
97 temp.push_back(G4ModelingParameters::PVPointerCopyNo(nodeID.GetPhysicalVolume(),nodeID.GetCopyNo()));
98 }
99 const G4VisAttributes* pVisAtts = fpVisAttribs;
100 if (!pVisAtts) {
101 // Shouldn't happen.
103 G4warn <<
104 "WARNING: G4RayTracerSceneHandler::BuildVisAttsMap: null vis atts pointer."
105 "\n Using a default vis atts."
106 << G4endl;
107 }
108 static const G4VisAttributes defaultVisAtts;
109 pVisAtts = &defaultVisAtts;
110 }
111 // Copy vis atts into the vis atts map
112 fSceneVisAttsMap[temp] = *pVisAtts;
113 }
114}
std::vector< PVPointerCopyNo > PVPointerCopyNoPath
const std::vector< G4PhysicalVolumeNodeID > & GetFullPVPath() const
const G4VisAttributes * fpVisAttribs
static Verbosity GetVerbosity()

Referenced by RequestPrimitives().

◆ ClearStore()

void G4RayTracerSceneHandler::ClearStore ( )
virtual

Reimplemented from G4VSceneHandler.

Definition at line 64 of file G4RayTracerSceneHandler.cc.

65{
66 fSceneVisAttsMap.clear();
67}

◆ GetSceneVisAttsMap()

const std::map< G4ModelingParameters::PVPointerCopyNoPath, G4VisAttributes, PathLessThan > & G4RayTracerSceneHandler::GetSceneVisAttsMap ( ) const
inline

Definition at line 71 of file G4RayTracerSceneHandler.hh.

72 {return fSceneVisAttsMap;}

Referenced by G4RayTrajectory::AppendStep(), and G4RTSteppingAction::UserSteppingAction().

◆ RequestPrimitives()

void G4RayTracerSceneHandler::RequestPrimitives ( const G4VSolid solid)
inlinevirtual

Reimplemented from G4VSceneHandler.

Definition at line 49 of file G4RayTracerSceneHandler.hh.

50 {BuildVisAttsMap(solid);}
void BuildVisAttsMap(const G4VSolid &solid)

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