Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisManager Class Referenceabstract

#include <G4VisManager.hh>

+ Inheritance diagram for G4VisManager:

Classes

struct  UserVisAction
 

Public Types

enum  Verbosity {
  quiet , startup , errors , warnings ,
  confirmations , parameters , all
}
 

Public Member Functions

virtual ~G4VisManager ()
 
void Initialise ()
 
void Initialize ()
 
void RegisterRunDurationUserVisAction (const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent::NullExtent)
 
void RegisterEndOfEventUserVisAction (const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent::NullExtent)
 
void RegisterEndOfRunUserVisAction (const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent::NullExtent)
 
G4bool RegisterGraphicsSystem (G4VGraphicsSystem *)
 
void RegisterModelFactory (G4TrajDrawModelFactory *factory)
 
void RegisterModel (G4VTrajectoryModel *model)
 
void RegisterModelFactory (G4TrajFilterFactory *factory)
 
void RegisterModel (G4VFilter< G4VTrajectory > *filter)
 
void RegisterModelFactory (G4HitFilterFactory *factory)
 
void RegisterModel (G4VFilter< G4VHit > *filter)
 
void RegisterModelFactory (G4DigiFilterFactory *factory)
 
void RegisterModel (G4VFilter< G4VDigi > *filter)
 
void SelectTrajectoryModel (const G4String &model)
 
void RegisterMessenger (G4UImessenger *messenger)
 
void Draw (const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4NURBS &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4Polyhedron &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4Polyline &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4Polymarker &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4Scale &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4Square &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4Text &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw2D (const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw2D (const G4NURBS &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw2D (const G4Polyhedron &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw2D (const G4Polyline &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw2D (const G4Polymarker &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw2D (const G4Square &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw2D (const G4Text &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4VHit &)
 
void Draw (const G4VDigi &)
 
void Draw (const G4VTrajectory &, G4int i_mode)
 
void Draw (const G4LogicalVolume &, const G4VisAttributes &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4VPhysicalVolume &, const G4VisAttributes &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void Draw (const G4VSolid &, const G4VisAttributes &, const G4Transform3D &objectTransformation=G4Transform3D())
 
void BeginDraw (const G4Transform3D &objectTransformation=G4Transform3D())
 
void EndDraw ()
 
void BeginDraw2D (const G4Transform3D &objectTransformation=G4Transform3D())
 
void EndDraw2D ()
 
void GeometryHasChanged ()
 
void NotifyHandlers ()
 
void DispatchToModel (const G4VTrajectory &)
 
void DispatchToModel (const G4VTrajectory &, G4int i_mode)
 
G4bool FilterTrajectory (const G4VTrajectory &)
 
G4bool FilterHit (const G4VHit &)
 
G4bool FilterDigi (const G4VDigi &)
 
void CreateSceneHandler (G4String name="")
 
void CreateViewer (G4String name="", G4String XGeometry="")
 
void Enable ()
 
void Disable ()
 
const G4VTrajectoryModelCurrentTrajDrawModel () const
 
const std::vector< UserVisAction > & GetRunDurationUserVisActions () const
 
const std::vector< UserVisAction > & GetEndOfEventUserVisActions () const
 
const std::vector< UserVisAction > & GetEndOfRunUserVisActions () const
 
const std::map< G4VUserVisAction *, G4VisExtent > & GetUserVisActionExtents () const
 
G4VGraphicsSystemGetCurrentGraphicsSystem () const
 
G4SceneGetCurrentScene () const
 
G4VSceneHandlerGetCurrentSceneHandler () const
 
G4VViewerGetCurrentViewer () const
 
const G4GraphicsSystemListGetAvailableGraphicsSystems ()
 
const G4SceneHandlerListGetAvailableSceneHandlers () const
 
const G4SceneListGetSceneList () const
 
G4bool GetTransientsDrawnThisRun () const
 
G4bool GetTransientsDrawnThisEvent () const
 
const G4EventGetRequestedEvent () const
 
G4bool GetAbortReviewKeptEvents () const
 
const G4ViewParametersGetDefaultViewParameters () const
 
void SetUserAction (G4VUserVisAction *pVisAction, const G4VisExtent &=G4VisExtent::NullExtent)
 
void SetUserActionExtent (const G4VisExtent &)
 
void SetCurrentGraphicsSystem (G4VGraphicsSystem *)
 
void SetCurrentScene (G4Scene *)
 
void SetCurrentSceneHandler (G4VSceneHandler *)
 
void SetCurrentViewer (G4VViewer *)
 
G4SceneHandlerListSetAvailableSceneHandlers ()
 
G4SceneListSetSceneList ()
 
void SetVerboseLevel (G4int)
 
void SetVerboseLevel (const G4String &)
 
void SetVerboseLevel (Verbosity)
 
void SetEventRefreshing (G4bool)
 
void ResetTransientsDrawnFlags ()
 
void SetRequestedEvent (const G4Event *)
 
void SetAbortReviewKeptEvents (G4bool)
 
void SetDefaultViewParameters (const G4ViewParameters &)
 
G4String ViewerShortName (const G4String &viewerName) const
 
G4VViewerGetViewer (const G4String &viewerName) const
 
- Public Member Functions inherited from G4VVisManager
virtual ~G4VVisManager ()
 
virtual void Draw (const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4NURBS &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4Polyhedron &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4Polyline &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4Polymarker &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4Scale &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4Square &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4Text &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw2D (const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw2D (const G4NURBS &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw2D (const G4Polyhedron &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw2D (const G4Polyline &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw2D (const G4Polymarker &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw2D (const G4Square &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw2D (const G4Text &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4VHit &)=0
 
virtual void Draw (const G4VDigi &)=0
 
virtual void Draw (const G4VTrajectory &, G4int i_mode=0)=0
 
virtual void Draw (const G4LogicalVolume &, const G4VisAttributes &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4VPhysicalVolume &, const G4VisAttributes &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void Draw (const G4VSolid &, const G4VisAttributes &, const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void BeginDraw (const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void EndDraw ()=0
 
virtual void BeginDraw2D (const G4Transform3D &objectTransformation=G4Transform3D())=0
 
virtual void EndDraw2D ()=0
 
virtual void GeometryHasChanged ()=0
 
virtual void NotifyHandlers ()
 
virtual void DispatchToModel (const G4VTrajectory &)=0
 
virtual void DispatchToModel (const G4VTrajectory &, G4int i_mode)=0
 
virtual G4bool FilterTrajectory (const G4VTrajectory &)=0
 
virtual G4bool FilterHit (const G4VHit &)=0
 
virtual G4bool FilterDigi (const G4VDigi &)=0
 

Static Public Member Functions

static Verbosity GetVerbosity ()
 
static Verbosity GetVerbosityValue (const G4String &)
 
static Verbosity GetVerbosityValue (G4int)
 
static G4String VerbosityString (Verbosity)
 
- Static Public Member Functions inherited from G4VVisManager
static G4VVisManagerGetConcreteInstance ()
 

Static Public Attributes

static std::vector< G4StringVerbosityGuidanceStrings
 

Protected Member Functions

 G4VisManager (const G4String &verbosityString="warnings")
 
virtual void RegisterGraphicsSystems ()=0
 
virtual void RegisterModelFactories ()
 
void RegisterMessengers ()
 
void PrintAvailableGraphicsSystems () const
 

Protected Attributes

const G4int fVerbose
 

Friends

class G4RTSteppingAction
 
class G4RayTrajectory
 
class G4RayTracerSceneHandler
 
class G4RTMessenger
 
class G4OpenGLViewerMessenger
 
class G4OpenGLXmViewerMessenger
 
class G4HepRepFileSceneHandler
 
class G4VSceneHandler
 
class G4VViewer
 
class G4VisStateDependent
 
class G4VisCommandList
 
std::ostream & operator<< (std::ostream &, const G4VGraphicsSystem &)
 
std::ostream & operator<< (std::ostream &, const G4VSceneHandler &)
 

Additional Inherited Members

- Static Protected Member Functions inherited from G4VVisManager
static void SetConcreteInstance (G4VVisManager *)
 
- Static Protected Attributes inherited from G4VVisManager
static G4VVisManagerfpConcreteInstance = 0
 

Detailed Description

Definition at line 117 of file G4VisManager.hh.

Member Enumeration Documentation

◆ Verbosity

Enumerator
quiet 
startup 
errors 
warnings 
confirmations 
parameters 
all 

Definition at line 147 of file G4VisManager.hh.

147 {
148 quiet, // Nothing is printed.
149 startup, // Startup and endup messages are printed...
150 errors, // ...and errors...
151 warnings, // ...and warnings...
152 confirmations, // ...and confirming messages...
153 parameters, // ...and parameters of scenes and views...
154 all // ...and everything available.
155 };

Constructor & Destructor Documentation

◆ G4VisManager()

G4VisManager::G4VisManager ( const G4String verbosityString = "warnings")
protected

Definition at line 84 of file G4VisManager.cc.

84 :
85 fVerbose (1),
86 fInitialised (false),
87 fpGraphicsSystem (0),
88 fpScene (0),
89 fpSceneHandler (0),
90 fpViewer (0),
91 fpStateDependent (0),
92 fEventRefreshing (false),
93 fTransientsDrawnThisRun (false),
94 fTransientsDrawnThisEvent (false),
95 fEventKeepingSuspended (false),
96 fKeptLastEvent (false),
97 fpRequestedEvent (0),
98 fAbortReviewKeptEvents (false),
99 fIsDrawGroup (false),
100 fDrawGroupNestingDepth (0)
101 // All other objects use default constructors.
102{
103 fpTrajDrawModelMgr = new G4VisModelManager<G4VTrajectoryModel>("/vis/modeling/trajectories");
104 fpTrajFilterMgr = new G4VisFilterManager<G4VTrajectory>("/vis/filtering/trajectories");
105 fpHitFilterMgr = new G4VisFilterManager<G4VHit>("/vis/filtering/hits");
106 fpDigiFilterMgr = new G4VisFilterManager<G4VDigi>("/vis/filtering/digi");
107
109 ("Simple graded message scheme - digit or string (1st character defines):");
111 (" 0) quiet, // Nothing is printed.");
113 (" 1) startup, // Startup and endup messages are printed...");
115 (" 2) errors, // ...and errors...");
117 (" 3) warnings, // ...and warnings...");
119 (" 4) confirmations, // ...and confirming messages...");
121 (" 5) parameters, // ...and parameters of scenes and views...");
123 (" 6) all // ...and everything available.");
124
125 if (fpInstance) {
127 ("G4VisManager::G4VisManager",
128 "visman0001", FatalException,
129 "Attempt to Construct more than one VisManager");
130 }
131
132 fpInstance = this;
134
135 fpStateDependent = new G4VisStateDependent (this);
136 // No need to delete this; G4StateManager does this.
137
138 fVerbosity = GetVerbosityValue(verbosityString);
139 if (fVerbosity >= startup) {
140 G4cout
141 << "Visualization Manager instantiating with verbosity \""
142 << VerbosityString(fVerbosity)
143 << "\"..." << G4endl;
144 }
145
146 // Note: The specific graphics systems must be instantiated in a
147 // higher level library to avoid circular dependencies. Also,
148 // some specifically need additional external libararies that the
149 // user must supply. Therefore we ask the user to implement
150 // RegisterGraphicsSystems() and RegisterModelFactories()
151 // in a subclass. We have to wait for the subclass to instantiate
152 // so RegisterGraphicsSystems() cannot be called from this
153 // constructor; it is called from Initialise(). So we ask the
154 // user:
155 // (a) to write a subclass and implement RegisterGraphicsSystems()
156 // and RegisterModelFactories(). See
157 // visualization/include/G4VisExecutive.hh/icc as an example.
158 // (b) instantiate the subclass.
159 // (c) invoke the Initialise() method of the subclass.
160 // For example:
161 // ...
162 // #ifdef G4VIS_USE
163 // // Instantiate and initialise Visualization Manager.
164 // G4VisManager* visManager = new G4VisExecutive;
165 // visManager -> SetVerboseLevel (Verbose);
166 // visManager -> Initialise ();
167 // #endif
168 // // (Don't forget to delete visManager;)
169 // ...
170
171 // Make top level command directory...
172 G4UIcommand* directory;
173 directory = new G4UIdirectory ("/vis/");
174 directory -> SetGuidance ("Visualization commands.");
175 fDirectoryList.push_back (directory);
176
177 // Instantiate *basic* top level commands so that they can be used
178 // immediately after instantiation of the vis manager. Other top
179 // level and lower level commands are instantiated later in
180 // RegisterMessengers.
181 G4VVisCommand::SetVisManager (this); // Sets shared pointer
184}
@ FatalException
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static void SetVisManager(G4VisManager *)
static void SetConcreteInstance(G4VVisManager *)
static std::vector< G4String > VerbosityGuidanceStrings
static G4String VerbosityString(Verbosity)
void RegisterMessenger(G4UImessenger *messenger)
friend class G4VisStateDependent
static Verbosity GetVerbosityValue(const G4String &)
const G4int fVerbose
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ ~G4VisManager()

G4VisManager::~G4VisManager ( )
virtual

Definition at line 186 of file G4VisManager.cc.

186 {
187 fpInstance = 0;
188 size_t i;
189 for (i = 0; i < fSceneList.size (); ++i) {
190 delete fSceneList[i];
191 }
192 for (i = 0; i < fAvailableSceneHandlers.size (); ++i) {
193 if (fAvailableSceneHandlers[i] != NULL) {
194 delete fAvailableSceneHandlers[i];
195 }
196 }
197 for (i = 0; i < fAvailableGraphicsSystems.size (); ++i) {
198 if (fAvailableGraphicsSystems[i]) {
199 delete fAvailableGraphicsSystems[i];
200 }
201 }
202 if (fVerbosity >= startup) {
203 G4cout << "Graphics systems deleted." << G4endl;
204 G4cout << "Visualization Manager deleting..." << G4endl;
205 }
206 for (i = 0; i < fMessengerList.size (); ++i) {
207 delete fMessengerList[i];
208 }
209 for (i = 0; i < fDirectoryList.size (); ++i) {
210 delete fDirectoryList[i];
211 }
212
213 delete fpDigiFilterMgr;
214 delete fpHitFilterMgr;
215 delete fpTrajFilterMgr;
216 delete fpTrajDrawModelMgr;
217}

Member Function Documentation

◆ BeginDraw()

void G4VisManager::BeginDraw ( const G4Transform3D objectTransformation = G4Transform3D())
virtual

Implements G4VVisManager.

Definition at line 648 of file G4VisManager.cc.

649{
650 fDrawGroupNestingDepth++;
651 if (fDrawGroupNestingDepth > 1) {
653 ("G4VSceneHandler::BeginDraw",
654 "visman0008", JustWarning,
655 "Nesting detected. It is illegal to nest Begin/EndDraw."
656 "\n Ignored");
657 return;
658 }
659 if (IsValidView ()) {
660 ClearTransientStoreIfMarked();
661 fpSceneHandler -> BeginPrimitives (objectTransform);
662 fIsDrawGroup = true;
663 }
664}
@ JustWarning

◆ BeginDraw2D()

void G4VisManager::BeginDraw2D ( const G4Transform3D objectTransformation = G4Transform3D())
virtual

Implements G4VVisManager.

Definition at line 679 of file G4VisManager.cc.

680{
681 fDrawGroupNestingDepth++;
682 if (fDrawGroupNestingDepth > 1) {
684 ("G4VSceneHandler::BeginDraw2D",
685 "visman0009", JustWarning,
686 "Nesting detected. It is illegal to nest Begin/EndDraw2D."
687 "\n Ignored");
688 return;
689 }
690 if (IsValidView ()) {
691 ClearTransientStoreIfMarked();
692 fpSceneHandler -> BeginPrimitives2D (objectTransform);
693 fIsDrawGroup = true;
694 }
695}

◆ CreateSceneHandler()

void G4VisManager::CreateSceneHandler ( G4String  name = "")

Definition at line 912 of file G4VisManager.cc.

912 {
913 if (!fInitialised) Initialise ();
914 if (fpGraphicsSystem) {
915 G4VSceneHandler* pSceneHandler =
916 fpGraphicsSystem -> CreateSceneHandler (name);
917 if (pSceneHandler) {
918 fAvailableSceneHandlers.push_back (pSceneHandler);
919 fpSceneHandler = pSceneHandler; // Make current.
920 }
921 else {
922 if(fVerbosity >= errors) {
923 G4cout << "ERROR in G4VisManager::CreateSceneHandler during "
924 << fpGraphicsSystem -> GetName ()
925 << " scene handler creation.\n No action taken."
926 << G4endl;
927 }
928 }
929 }
930 else PrintInvalidPointers ();
931}
void CreateSceneHandler(G4String name="")
void Initialise()

Referenced by CreateSceneHandler().

◆ CreateViewer()

void G4VisManager::CreateViewer ( G4String  name = "",
G4String  XGeometry = "" 
)

Definition at line 933 of file G4VisManager.cc.

933 {
934
935 if (!fInitialised) Initialise ();
936
937 if (!fpSceneHandler) {
938 PrintInvalidPointers ();
939 return;
940 }
941
942 G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name);
943
944 if (!p) {
945 if (fVerbosity >= errors) {
946 G4cout << "ERROR in G4VisManager::CreateViewer during "
947 << fpGraphicsSystem -> GetName ()
948 << " viewer creation.\n No action taken."
949 << G4endl;
950 }
951 return;
952 }
953
954 if (p -> GetViewId() < 0) {
955 if (fVerbosity >= errors) {
956 G4cout << "ERROR in G4VisManager::CreateViewer during "
957 << fpGraphicsSystem -> GetName ()
958 << " viewer initialisation.\n No action taken."
959 << G4endl;
960 }
961 return;
962 }
963
964 // Viewer is created, now we can set geometry parameters
965 // Before 12/2008, it was done in G4VViewer.cc but it did not have to be there!
966
967 G4ViewParameters initialvp = p -> GetViewParameters();
968 initialvp.SetXGeometryString(XGeometry); //parse string and store parameters
969 p -> SetViewParameters(initialvp);
970 p -> Initialise (); // (Viewer itself may change view parameters further.)
971
972 fpViewer = p; // Make current.
973 fpSceneHandler -> AddViewerToList (fpViewer);
974 fpSceneHandler -> SetCurrentViewer (fpViewer);
975 if (fVerbosity >= confirmations) {
976 G4cout << "G4VisManager::CreateViewer: new viewer created."
977 << G4endl;
978 }
979
980 const G4ViewParameters& vp = fpViewer->GetViewParameters();
981 if (fVerbosity >= parameters) {
982 G4cout << " view parameters are:\n " << vp << G4endl;
983 }
984
985 if (vp.IsCulling () && vp.IsCullingInvisible ()) {
986 static G4bool warned = false;
987 if (fVerbosity >= confirmations) {
988 if (!warned) {
989 G4cout <<
990 "NOTE: objects with visibility flag set to \"false\""
991 " will not be drawn!"
992 "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
993 "\n Also see other \"/vis/viewer/set\" commands."
994 << G4endl;
995 warned = true;
996 }
997 }
998 }
999 if (vp.IsCullingCovered ()) {
1000 static G4bool warned = false;
1001 if (fVerbosity >= warnings) {
1002 if (!warned) {
1003 G4cout <<
1004 "WARNING: covered objects in solid mode will not be rendered!"
1005 "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1006 "\n Also see other \"/vis/viewer/set\" commands."
1007 << G4endl;
1008 warned = true;
1009 }
1010 }
1011 }
1012}
bool G4bool
Definition: G4Types.hh:67
const G4ViewParameters & GetViewParameters() const
void SetXGeometryString(const G4String &)
G4bool IsCulling() const
G4bool IsCullingInvisible() const
G4bool IsCullingCovered() const
void SetCurrentViewer(G4VViewer *)
void CreateViewer(G4String name="", G4String XGeometry="")

Referenced by CreateViewer().

◆ CurrentTrajDrawModel()

const G4VTrajectoryModel * G4VisManager::CurrentTrajDrawModel ( ) const

Definition at line 576 of file G4VisManager.cc.

577{
578 assert (0 != fpTrajDrawModelMgr);
579
580 const G4VTrajectoryModel* model = fpTrajDrawModelMgr->Current();
581
582 if (0 == model) {
583 // No model was registered with the trajectory model manager.
584 // Use G4TrajectoryDrawByCharge as a default.
585 fpTrajDrawModelMgr->Register(new G4TrajectoryDrawByCharge("AutoGenerated"));
586
587 if (fVerbosity >= warnings) {
588 G4cout<<"G4VisManager: Using G4TrajectoryDrawByCharge as default trajectory model."<<G4endl;
589 G4cout<<"See commands in /vis/modeling/trajectories/ for other options."<<G4endl;
590 }
591 }
592
593 model = fpTrajDrawModelMgr->Current();
594 assert (0 != model); // Should definitely exist now
595
596 return model;
597}
const Model * Current() const
void Register(Model *)

Referenced by G4HepRepFileSceneHandler::BeginModeling(), and DispatchToModel().

◆ Disable()

void G4VisManager::Disable ( )

Definition at line 521 of file G4VisManager.cc.

521 {
523 if (fVerbosity >= confirmations) {
524 G4cout <<
525 "G4VisManager::Disable: visualization disabled."
526 "\n The pointer returned by GetConcreteInstance will be zero."
527 "\n Note that it will become enabled after some valid vis commands."
528 << G4endl;
529 }
530}

Referenced by G4VisCommandEnable::SetNewValue().

◆ DispatchToModel() [1/2]

void G4VisManager::DispatchToModel ( const G4VTrajectory trajectory)
virtual

Implements G4VVisManager.

Definition at line 1134 of file G4VisManager.cc.

1135{
1136 G4bool visible(true);
1137
1138 // See if trajectory passes filter
1139 G4bool passed = FilterTrajectory(trajectory);
1140
1141 if (!passed) {
1142 // Draw invisible trajectory if trajectory failed filter and
1143 // are filtering in soft mode
1144 if (fpTrajFilterMgr->GetMode() == FilterMode::Soft) visible = false;
1145 else {return;}
1146 }
1147
1148 // Go on to draw trajectory
1149 assert (0 != fpTrajDrawModelMgr);
1150
1151 const G4VTrajectoryModel* trajectoryModel = CurrentTrajDrawModel();
1152
1153 assert (0 != trajectoryModel); // Should exist
1154
1155 trajectoryModel->Draw(trajectory, visible);
1156}
virtual void Draw(const G4VTrajectory &trajectory, const G4int &i_mode=0, const G4bool &visible=true) const =0
FilterMode::Mode GetMode() const
const G4VTrajectoryModel * CurrentTrajDrawModel() const
G4bool FilterTrajectory(const G4VTrajectory &)

◆ DispatchToModel() [2/2]

void G4VisManager::DispatchToModel ( const G4VTrajectory trajectory,
G4int  i_mode 
)
virtual

Implements G4VVisManager.

Definition at line 1158 of file G4VisManager.cc.

1159{
1160 G4bool visible(true);
1161
1162 // See if trajectory passes filter
1163 G4bool passed = FilterTrajectory(trajectory);
1164
1165 if (!passed) {
1166 // Draw invisible trajectory if trajectory failed filter and
1167 // are filtering in soft mode
1168 if (fpTrajFilterMgr->GetMode() == FilterMode::Soft) visible = false;
1169 else {return;}
1170 }
1171
1172 // Go on to draw trajectory
1173 assert (0 != fpTrajDrawModelMgr);
1174
1175 const G4VTrajectoryModel* trajectoryModel = CurrentTrajDrawModel();
1176
1177 assert (0 != trajectoryModel); // Should exist
1178
1179 if (IsValidView()) {
1180 G4TrajectoriesModel* trajectoriesModel =
1181 dynamic_cast<G4TrajectoriesModel*>(fpSceneHandler->GetModel());
1182 if (trajectoriesModel) {
1183 if (trajectoriesModel->IsDrawingModeSet()) {
1184 trajectoryModel->Draw(trajectory, i_mode, visible);
1185 } else {
1186 trajectoryModel->Draw(trajectory, visible);
1187 }
1188 } else {
1189 // Just draw at user's request
1190 trajectoryModel->Draw(trajectory, i_mode, visible);
1191 }
1192 }
1193}
G4bool IsDrawingModeSet() const
G4VModel * GetModel() const

◆ Draw() [1/14]

void G4VisManager::Draw ( const G4Circle circle,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 750 of file G4VisManager.cc.

752{
753 DrawT (circle, objectTransform);
754}

Referenced by Draw().

◆ Draw() [2/14]

void G4VisManager::Draw ( const G4LogicalVolume logicalVol,
const G4VisAttributes attribs,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 878 of file G4VisManager.cc.

880 {
881 // Find corresponding solid.
882 G4VSolid* pSol = logicalVol.GetSolid ();
883 Draw (*pSol, attribs, objectTransform);
884}
G4VSolid * GetSolid() const
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())

◆ Draw() [3/14]

void G4VisManager::Draw ( const G4NURBS nurbs,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 756 of file G4VisManager.cc.

758{
759 DrawT (nurbs, objectTransform);
760}

◆ Draw() [4/14]

void G4VisManager::Draw ( const G4Polyhedron polyhedron,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 762 of file G4VisManager.cc.

764{
765 DrawT (polyhedron, objectTransform);
766}

◆ Draw() [5/14]

void G4VisManager::Draw ( const G4Polyline line,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 768 of file G4VisManager.cc.

770{
771 DrawT (line, objectTransform);
772}

◆ Draw() [6/14]

void G4VisManager::Draw ( const G4Polymarker polymarker,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 774 of file G4VisManager.cc.

776{
777 DrawT (polymarker, objectTransform);
778}

◆ Draw() [7/14]

void G4VisManager::Draw ( const G4Scale scale,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 780 of file G4VisManager.cc.

782{
783 DrawT (scale, objectTransform);
784}

◆ Draw() [8/14]

void G4VisManager::Draw ( const G4Square square,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 786 of file G4VisManager.cc.

788{
789 DrawT (square, objectTransform);
790}

◆ Draw() [9/14]

void G4VisManager::Draw ( const G4Text text,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 792 of file G4VisManager.cc.

794{
795 DrawT (text, objectTransform);
796}

◆ Draw() [10/14]

void G4VisManager::Draw ( const G4VDigi digi)
virtual

Implements G4VVisManager.

Definition at line 851 of file G4VisManager.cc.

851 {
852 if (fIsDrawGroup) {
853 fpSceneHandler -> AddCompound (digi);
854 } else {
855 if (IsValidView ()) {
856 ClearTransientStoreIfMarked();
857 fpSceneHandler -> AddCompound (digi);
858 }
859 }
860}

◆ Draw() [11/14]

void G4VisManager::Draw ( const G4VHit hit)
virtual

Implements G4VVisManager.

Definition at line 840 of file G4VisManager.cc.

840 {
841 if (fIsDrawGroup) {
842 fpSceneHandler -> AddCompound (hit);
843 } else {
844 if (IsValidView ()) {
845 ClearTransientStoreIfMarked();
846 fpSceneHandler -> AddCompound (hit);
847 }
848 }
849}

◆ Draw() [12/14]

void G4VisManager::Draw ( const G4VPhysicalVolume physicalVol,
const G4VisAttributes attribs,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 903 of file G4VisManager.cc.

905 {
906 // Find corresponding logical volume and solid.
907 G4LogicalVolume* pLV = physicalVol.GetLogicalVolume ();
908 G4VSolid* pSol = pLV -> GetSolid ();
909 Draw (*pSol, attribs, objectTransform);
910}
G4LogicalVolume * GetLogicalVolume() const

◆ Draw() [13/14]

void G4VisManager::Draw ( const G4VSolid solid,
const G4VisAttributes attribs,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 886 of file G4VisManager.cc.

888 {
889 if (fIsDrawGroup) {
890 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
891 solid.DescribeYourselfTo (*fpSceneHandler);
892 fpSceneHandler -> PostAddSolid ();
893 } else {
894 if (IsValidView ()) {
895 ClearTransientStoreIfMarked();
896 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
897 solid.DescribeYourselfTo (*fpSceneHandler);
898 fpSceneHandler -> PostAddSolid ();
899 }
900 }
901}
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const =0

◆ Draw() [14/14]

void G4VisManager::Draw ( const G4VTrajectory traj,
G4int  i_mode 
)
virtual

Implements G4VVisManager.

Definition at line 862 of file G4VisManager.cc.

863 {
864 if (fIsDrawGroup) {
865 fpSceneHandler -> SetModel (&dummyTrajectoriesModel);
866 dummyTrajectoriesModel.SetDrawingMode(i_mode);
867 fpSceneHandler -> AddCompound (traj);
868 } else {
869 if (IsValidView ()) {
870 ClearTransientStoreIfMarked();
871 fpSceneHandler -> SetModel (&dummyTrajectoriesModel);
872 dummyTrajectoriesModel.SetDrawingMode(i_mode);
873 fpSceneHandler -> AddCompound (traj);
874 }
875 }
876}
void SetDrawingMode(G4int drawingMode)

◆ Draw2D() [1/7]

void G4VisManager::Draw2D ( const G4Circle circle,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 798 of file G4VisManager.cc.

800{
801 DrawT2D (circle, objectTransform);
802}

◆ Draw2D() [2/7]

void G4VisManager::Draw2D ( const G4NURBS nurbs,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 804 of file G4VisManager.cc.

806{
807 DrawT2D (nurbs, objectTransform);
808}

◆ Draw2D() [3/7]

void G4VisManager::Draw2D ( const G4Polyhedron polyhedron,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 810 of file G4VisManager.cc.

812{
813 DrawT2D (polyhedron, objectTransform);
814}

◆ Draw2D() [4/7]

void G4VisManager::Draw2D ( const G4Polyline line,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 816 of file G4VisManager.cc.

818{
819 DrawT2D (line, objectTransform);
820}

◆ Draw2D() [5/7]

void G4VisManager::Draw2D ( const G4Polymarker polymarker,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 822 of file G4VisManager.cc.

824{
825 DrawT2D (polymarker, objectTransform);
826}

◆ Draw2D() [6/7]

void G4VisManager::Draw2D ( const G4Square square,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 828 of file G4VisManager.cc.

830{
831 DrawT2D (square, objectTransform);
832}

◆ Draw2D() [7/7]

void G4VisManager::Draw2D ( const G4Text text,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 834 of file G4VisManager.cc.

836{
837 DrawT2D (text, objectTransform);
838}

◆ Enable()

void G4VisManager::Enable ( )

Definition at line 504 of file G4VisManager.cc.

504 {
505 if (IsValidView ()) {
506 if (fVerbosity >= confirmations) {
507 G4cout << "G4VisManager::Enable: visualization enabled." << G4endl;
508 }
509 }
510 else {
511 if (fVerbosity >= warnings) {
512 G4cout <<
513 "G4VisManager::Enable: WARNING: visualization remains disabled for"
514 "\n above reasons. Rectifying with valid vis commands will"
515 "\n automatically enable."
516 << G4endl;
517 }
518 }
519}

Referenced by G4VisCommandEnable::SetNewValue().

◆ EndDraw()

void G4VisManager::EndDraw ( )
virtual

Implements G4VVisManager.

Definition at line 666 of file G4VisManager.cc.

667{
668 fDrawGroupNestingDepth--;
669 if (fDrawGroupNestingDepth != 0) {
670 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
671 return;
672 }
673 if (IsValidView ()) {
674 fpSceneHandler -> EndPrimitives ();
675 }
676 fIsDrawGroup = false;
677}

◆ EndDraw2D()

void G4VisManager::EndDraw2D ( )
virtual

Implements G4VVisManager.

Definition at line 697 of file G4VisManager.cc.

698{
699 fDrawGroupNestingDepth--;
700 if (fDrawGroupNestingDepth != 0) {
701 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
702 return;
703 }
704 if (IsValidView ()) {
705 fpSceneHandler -> EndPrimitives2D ();
706 }
707 fIsDrawGroup = false;
708}

◆ FilterDigi()

G4bool G4VisManager::FilterDigi ( const G4VDigi digi)
virtual

Implements G4VVisManager.

Definition at line 1129 of file G4VisManager.cc.

1130{
1131 return fpDigiFilterMgr->Accept(digi);
1132}
bool Accept(const T &)

◆ FilterHit()

G4bool G4VisManager::FilterHit ( const G4VHit hit)
virtual

Implements G4VVisManager.

Definition at line 1124 of file G4VisManager.cc.

1125{
1126 return fpHitFilterMgr->Accept(hit);
1127}

◆ FilterTrajectory()

G4bool G4VisManager::FilterTrajectory ( const G4VTrajectory trajectory)
virtual

Implements G4VVisManager.

Definition at line 1119 of file G4VisManager.cc.

1120{
1121 return fpTrajFilterMgr->Accept(trajectory);
1122}

Referenced by DispatchToModel().

◆ GeometryHasChanged()

void G4VisManager::GeometryHasChanged ( )
virtual

Implements G4VVisManager.

Definition at line 1014 of file G4VisManager.cc.

1014 {
1015 if (fVerbosity >= confirmations) {
1016 G4cout << "G4VisManager::GeometryHasChanged() called." << G4endl;
1017 }
1018
1019 // Change the world...
1020 G4VPhysicalVolume* pWorld =
1022 -> GetNavigatorForTracking () -> GetWorldVolume ();
1023 if (!pWorld) {
1024 if (fVerbosity >= warnings) {
1025 G4cout << "WARNING: There is no world volume!" << G4endl;
1026 }
1027 }
1028
1029 // Check scenes.
1030 G4SceneList& sceneList = fSceneList;
1031 G4int iScene, nScenes = sceneList.size ();
1032 for (iScene = 0; iScene < nScenes; iScene++) {
1033 G4Scene* pScene = sceneList [iScene];
1034 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1035 if (modelList.size ()) {
1036 G4bool modelInvalid;
1037 do { // Remove, if required, one at a time.
1038 modelInvalid = false;
1039 std::vector<G4Scene::Model>::iterator iterModel;
1040 for (iterModel = modelList.begin();
1041 iterModel != modelList.end();
1042 ++iterModel) {
1043 modelInvalid = !(iterModel->fpModel->Validate(fVerbosity>=warnings));
1044 if (modelInvalid) {
1045 // Model invalid - remove and break.
1046 if (fVerbosity >= warnings) {
1047 G4cout << "WARNING: Model \""
1048 << iterModel->fpModel->GetGlobalDescription ()
1049 <<
1050 "\" is no longer valid - being removed\n from scene \""
1051 << pScene -> GetName () << "\""
1052 << G4endl;
1053 }
1054 modelList.erase (iterModel);
1055 break;
1056 }
1057 }
1058 } while (modelInvalid);
1059
1060 if (modelList.size () == 0) {
1061 if (fVerbosity >= warnings) {
1062 G4cout << "WARNING: No models left in this scene \""
1063 << pScene -> GetName ()
1064 << "\"."
1065 << G4endl;
1066 }
1067 }
1068 else {
1069 pScene->CalculateExtent();
1071 ApplyCommand (G4String("/vis/scene/notifyHandlers " + pScene->GetName()));
1072 }
1073 }
1074 }
1075
1076 // Check the manager's current scene...
1077 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1078 if (fVerbosity >= warnings) {
1079 G4cout << "WARNING: The current scene \""
1080 << fpScene -> GetName ()
1081 << "\" has no models."
1082 << G4endl;
1083 }
1084 }
1085
1086}
int G4int
Definition: G4Types.hh:66
void CalculateExtent()
Definition: G4Scene.cc:72
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:51

◆ GetAbortReviewKeptEvents()

G4bool G4VisManager::GetAbortReviewKeptEvents ( ) const

◆ GetAvailableGraphicsSystems()

const G4GraphicsSystemList & G4VisManager::GetAvailableGraphicsSystems ( )

Definition at line 532 of file G4VisManager.cc.

532 {
533 G4int nSystems = fAvailableGraphicsSystems.size ();
534 if (nSystems == 0) {
535 if (fVerbosity >= warnings) {
536 G4cout << "G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
537 "\n graphics system available!"
538 "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
539 "\n when you compiled/built the visualization code?"
540 "\n 2) Did you instantiate your own Visualization Manager and forget"
541 "\n to implement RegisterGraphicsSystems correctly?"
542 "\n 3) You can register your own graphics system, e.g.,"
543 "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
544 "\n after instantiating your vis manager and before"
545 "\n visManager->Initialize()."
546 << G4endl;
547 }
548 }
549 return fAvailableGraphicsSystems;
550}

Referenced by G4VisCommandOpen::G4VisCommandOpen().

◆ GetAvailableSceneHandlers()

const G4SceneHandlerList & G4VisManager::GetAvailableSceneHandlers ( ) const

◆ GetCurrentGraphicsSystem()

G4VGraphicsSystem * G4VisManager::GetCurrentGraphicsSystem ( ) const

◆ GetCurrentScene()

◆ GetCurrentSceneHandler()

◆ GetCurrentViewer()

◆ GetDefaultViewParameters()

◆ GetEndOfEventUserVisActions()

const std::vector< UserVisAction > & G4VisManager::GetEndOfEventUserVisActions ( ) const

◆ GetEndOfRunUserVisActions()

const std::vector< UserVisAction > & G4VisManager::GetEndOfRunUserVisActions ( ) const

◆ GetRequestedEvent()

const G4Event * G4VisManager::GetRequestedEvent ( ) const

◆ GetRunDurationUserVisActions()

const std::vector< UserVisAction > & G4VisManager::GetRunDurationUserVisActions ( ) const

◆ GetSceneList()

const G4SceneList & G4VisManager::GetSceneList ( ) const

◆ GetTransientsDrawnThisEvent()

G4bool G4VisManager::GetTransientsDrawnThisEvent ( ) const

◆ GetTransientsDrawnThisRun()

G4bool G4VisManager::GetTransientsDrawnThisRun ( ) const

◆ GetUserVisActionExtents()

const std::map< G4VUserVisAction *, G4VisExtent > & G4VisManager::GetUserVisActionExtents ( ) const

◆ GetVerbosity()

G4VisManager::Verbosity G4VisManager::GetVerbosity ( )
static

Definition at line 1816 of file G4VisManager.cc.

1816 {
1817 return fVerbosity;
1818}

Referenced by G4GMocrenFileSceneHandler::AddPrimitive(), G4GMocrenFileSceneHandler::AddSolid(), G4GMocrenFileSceneHandler::BeginPrimitives(), G4DAWNFILESceneHandler::BeginSavingG4Prim(), G4GMocrenFileSceneHandler::BeginSavingGdd(), G4DAWNFILEViewer::ClearView(), G4GMocrenFileViewer::ClearView(), G4VRML1FileViewer::ClearView(), G4VRML2FileViewer::ClearView(), G4VRML1FileSceneHandler::closePort(), G4VRML2FileSceneHandler::closePort(), G4VRML1FileSceneHandler::connectPort(), G4VRML2FileSceneHandler::connectPort(), G4VSceneHandler::CreateModelingParameters(), G4DAWNFILEViewer::DrawView(), G4GMocrenFileViewer::DrawView(), G4VRML1FileViewer::DrawView(), G4VRML2FileViewer::DrawView(), G4GMocrenFileSceneHandler::EndPrimitives(), G4DAWNFILESceneHandler::EndSavingG4Prim(), G4GMocrenFileSceneHandler::EndSavingGdd(), G4VRML1FileViewer::FinishView(), G4VRML2FileViewer::FinishView(), G4DAWNFILESceneHandler::FRBeginModeling(), G4GMocrenIO::getDetector(), GMocrenDetector::getEdge(), G4GMocrenIO::getShortDoseDist(), GMocrenTrack::getStep(), G4GMocrenIO::getTrack(), G4GMocrenFileSceneHandler::GFBeginModeling(), G4GMocrenFileSceneHandler::GFEndModeling(), G4GMocrenIO::mergeDoseDist(), GMocrenDataPrimitive< T >::operator+(), GMocrenDataPrimitive< T >::operator+=(), G4VSceneHandler::ProcessScene(), G4VVisCommandViewer::RefreshIfRequired(), G4VSceneHandler::RequestPrimitives(), G4GMocrenIO::retrieveData(), G4GMocrenIO::retrieveData2(), G4GMocrenIO::retrieveData3(), G4GMocrenIO::retrieveData4(), G4DAWNFILEViewer::SendViewParameters(), G4VVisCommandGeometrySet::Set(), G4DAWNFILESceneHandler::SetG4PrimFileName(), G4GMocrenFileSceneHandler::SetGddFileName(), G4VVisCommandGeometrySet::SetLVVisAtts(), G4VisCommandReviewKeptEvents::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandGeometryList::SetNewValue(), G4VisCommandGeometryRestore::SetNewValue(), G4VisCommandGeometrySetColour::SetNewValue(), G4VisCommandGeometrySetDaughtersInvisible::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValue(), G4VisCommandSceneActivateModel::SetNewValue(), G4VisCommandSceneCreate::SetNewValue(), G4VisCommandSceneEndOfEventAction::SetNewValue(), G4VisCommandSceneEndOfRunAction::SetNewValue(), G4VisCommandSceneNotifyHandlers::SetNewValue(), G4VisCommandSceneSelect::SetNewValue(), G4VisCommandSceneAddArrow::SetNewValue(), G4VisCommandSceneAddArrow2D::SetNewValue(), G4VisCommandSceneAddAxes::SetNewValue(), G4VisCommandSceneAddDate::SetNewValue(), G4VisCommandSceneAddDigis::SetNewValue(), G4VisCommandSceneAddEventID::SetNewValue(), G4VisCommandSceneAddFrame::SetNewValue(), G4VisCommandSceneAddGhosts::SetNewValue(), G4VisCommandSceneAddHits::SetNewValue(), G4VisCommandSceneAddLine::SetNewValue(), G4VisCommandSceneAddLine2D::SetNewValue(), G4VisCommandSceneAddLogicalVolume::SetNewValue(), G4VisCommandSceneAddLogo::SetNewValue(), G4VisCommandSceneAddLogo2D::SetNewValue(), G4VisCommandSceneAddPSHits::SetNewValue(), G4VisCommandSceneAddScale::SetNewValue(), G4VisCommandSceneAddText::SetNewValue(), G4VisCommandSceneAddText2D::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSceneAddUserAction::SetNewValue(), G4VisCommandSceneAddVolume::SetNewValue(), G4VisCommandSceneHandlerAttach::SetNewValue(), G4VisCommandSceneHandlerCreate::SetNewValue(), G4VisCommandSceneHandlerSelect::SetNewValue(), G4VisCommandSetColour::SetNewValue(), G4VisCommandSetTextColour::SetNewValue(), G4VisCommandSetLineWidth::SetNewValue(), G4VisCommandSetTextLayout::SetNewValue(), G4VisCommandSetTouchable::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandViewerAddCutawayPlane::SetNewValue(), G4VisCommandViewerChangeCutawayPlane::SetNewValue(), G4VisCommandViewerClear::SetNewValue(), G4VisCommandViewerClearCutawayPlanes::SetNewValue(), G4VisCommandViewerClearTransients::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandViewerCopyViewFrom::SetNewValue(), G4VisCommandViewerCreate::SetNewValue(), G4VisCommandViewerDolly::SetNewValue(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerPan::SetNewValue(), G4VisCommandViewerReset::SetNewValue(), G4VisCommandViewerRefresh::SetNewValue(), G4VisCommandViewerRebuild::SetNewValue(), G4VisCommandViewerSave::SetNewValue(), G4VisCommandViewerScale::SetNewValue(), G4VisCommandViewerSelect::SetNewValue(), G4VisCommandViewerUpdate::SetNewValue(), G4VisCommandViewerZoom::SetNewValue(), G4VisCommandViewerDefaultHiddenEdge::SetNewValue(), G4VisCommandViewerDefaultStyle::SetNewValue(), G4VisCommandsViewerSet::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValueOnLV(), G4DAWNFILEViewer::SetView(), G4GMocrenFileViewer::SetView(), G4DAWNFILEViewer::ShowView(), G4GMocrenFileViewer::ShowView(), G4VRML1FileViewer::ShowView(), G4VRML2FileViewer::ShowView(), G4GMocrenIO::storeData3(), G4VVisCommand::UpdateVisManagerScene(), G4DAWNFILESceneHandler::~G4DAWNFILESceneHandler(), G4GMocrenFileSceneHandler::~G4GMocrenFileSceneHandler(), G4VRML1FileSceneHandler::~G4VRML1FileSceneHandler(), and G4VRML2FileSceneHandler::~G4VRML2FileSceneHandler().

◆ GetVerbosityValue() [1/2]

G4VisManager::Verbosity G4VisManager::GetVerbosityValue ( const G4String verbosityString)
static

Definition at line 1777 of file G4VisManager.cc.

1777 {
1778 G4String ss(verbosityString); ss.toLower();
1779 Verbosity verbosity;
1780 if (ss(0) == 'q') verbosity = quiet;
1781 else if (ss(0) == 's') verbosity = startup;
1782 else if (ss(0) == 'e') verbosity = errors;
1783 else if (ss(0) == 'w') verbosity = warnings;
1784 else if (ss(0) == 'c') verbosity = confirmations;
1785 else if (ss(0) == 'p') verbosity = parameters;
1786 else if (ss(0) == 'a') verbosity = all;
1787 else {
1788 G4int intVerbosity;
1789 std::istringstream is(ss);
1790 is >> intVerbosity;
1791 if (!is) {
1792 G4cout << "ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
1793 << verbosityString << "\"";
1794 for (size_t i = 0; i < VerbosityGuidanceStrings.size(); ++i) {
1795 G4cout << '\n' << VerbosityGuidanceStrings[i];
1796 }
1797 verbosity = warnings;
1798 G4cout << "\n Returning " << VerbosityString(verbosity)
1799 << G4endl;
1800 }
1801 else {
1802 verbosity = GetVerbosityValue(intVerbosity);
1803 }
1804 }
1805 return verbosity;
1806}

Referenced by G4VisManager(), GetVerbosityValue(), G4VisCommandList::SetNewValue(), G4VisCommandVerbose::SetNewValue(), G4VisCommandSceneList::SetNewValue(), G4VisCommandSceneHandlerList::SetNewValue(), G4VisCommandViewerList::SetNewValue(), and SetVerboseLevel().

◆ GetVerbosityValue() [2/2]

G4VisManager::Verbosity G4VisManager::GetVerbosityValue ( G4int  intVerbosity)
static

Definition at line 1808 of file G4VisManager.cc.

1808 {
1809 Verbosity verbosity;
1810 if (intVerbosity < quiet) verbosity = quiet;
1811 else if (intVerbosity > all) verbosity = all;
1812 else verbosity = Verbosity(intVerbosity);
1813 return verbosity;
1814}

◆ GetViewer()

G4VViewer * G4VisManager::GetViewer ( const G4String viewerName) const

Definition at line 1738 of file G4VisManager.cc.

1738 {
1739 G4String viewerShortName = ViewerShortName (viewerName);
1740 size_t nHandlers = fAvailableSceneHandlers.size ();
1741 size_t iHandler, iViewer;
1742 G4VViewer* viewer = 0;
1743 G4bool found = false;
1744 for (iHandler = 0; iHandler < nHandlers; iHandler++) {
1745 G4VSceneHandler* sceneHandler = fAvailableSceneHandlers [iHandler];
1746 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
1747 for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
1748 viewer = viewerList [iViewer];
1749 if (viewerShortName == viewer -> GetShortName ()) {
1750 found = true;
1751 break;
1752 }
1753 }
1754 if (found) break;
1755 }
1756 if (found) return viewer;
1757 else return 0;
1758}
G4String ViewerShortName(const G4String &viewerName) const

Referenced by G4VisCommandsViewerSet::SetNewValue().

◆ Initialise()

void G4VisManager::Initialise ( )

Definition at line 228 of file G4VisManager.cc.

228 {
229
230 if (fInitialised && fVerbosity >= warnings) {
231 G4cout << "WARNING: G4VisManager::Initialise: already initialised."
232 << G4endl;
233 return;
234 }
235
236 if (fVerbosity >= startup) {
237 G4cout << "Visualization Manager initialising..." << G4endl;
238 }
239
240 if (fVerbosity >= parameters) {
241 G4cout <<
242 "\nYou have instantiated your own Visualization Manager, inheriting"
243 "\n G4VisManager and implementing RegisterGraphicsSystems(), in which"
244 "\n you should, normally, instantiate drivers which do not need"
245 "\n external packages or libraries, and, optionally, drivers under"
246 "\n control of environment variables."
247 "\n Also you should implement RegisterModelFactories()."
248 "\n See visualization/include/G4VisExecutive.hh/icc, for example."
249 "\n In your main() you will have something like:"
250 "\n #ifdef G4VIS_USE"
251 "\n G4VisManager* visManager = new G4VisExecutive;"
252 "\n visManager -> SetVerboseLevel (Verbose);"
253 "\n visManager -> Initialize ();"
254 "\n #endif"
255 "\n (Don't forget to delete visManager;)"
256 "\n"
257 << G4endl;
258 }
259
260 if (fVerbosity >= startup) {
261 G4cout << "Registering graphics systems..." << G4endl;
262 }
263
265
266 if (fVerbosity >= startup) {
267 G4cout <<
268 "\nYou have successfully registered the following graphics systems."
269 << G4endl;
271 G4cout << G4endl;
272 }
273
274 // Make command directories for commands instantiated in the
275 // modeling subcategory...
276 G4UIcommand* directory;
277 directory = new G4UIdirectory ("/vis/modeling/");
278 directory -> SetGuidance ("Modeling commands.");
279 fDirectoryList.push_back (directory);
280 directory = new G4UIdirectory ("/vis/modeling/trajectories/");
281 directory -> SetGuidance ("Trajectory model commands.");
282 fDirectoryList.push_back (directory);
283 directory = new G4UIdirectory ("/vis/modeling/trajectories/create/");
284 directory -> SetGuidance ("Create trajectory models and messengers.");
285 fDirectoryList.push_back (directory);
286
287 // Filtering command directory
288 directory = new G4UIdirectory ("/vis/filtering/");
289 directory -> SetGuidance ("Filtering commands.");
290 fDirectoryList.push_back (directory);
291 directory = new G4UIdirectory ("/vis/filtering/trajectories/");
292 directory -> SetGuidance ("Trajectory filtering commands.");
293 fDirectoryList.push_back (directory);
294 directory = new G4UIdirectory ("/vis/filtering/trajectories/create/");
295 directory -> SetGuidance ("Create trajectory filters and messengers.");
296 fDirectoryList.push_back (directory);
297 directory = new G4UIdirectory ("/vis/filtering/hits/");
298 directory -> SetGuidance ("Hit filtering commands.");
299 fDirectoryList.push_back (directory);
300 directory = new G4UIdirectory ("/vis/filtering/hits/create/");
301 directory -> SetGuidance ("Create hit filters and messengers.");
302 fDirectoryList.push_back (directory);
303 directory = new G4UIdirectory ("/vis/filtering/digi/");
304 directory -> SetGuidance ("Digi filtering commands.");
305 fDirectoryList.push_back (directory);
306 directory = new G4UIdirectory ("/vis/filtering/digi/create/");
307 directory -> SetGuidance ("Create digi filters and messengers.");
308 fDirectoryList.push_back (directory);
309
311
312 if (fVerbosity >= startup) {
313 G4cout << "Registering model factories..." << G4endl;
314 }
315
317
318 if (fVerbosity >= startup) {
319 G4cout <<
320 "\nYou have successfully registered the following model factories."
321 << G4endl;
322 PrintAvailableModels (fVerbosity);
323 G4cout << G4endl;
324 }
325
326 if (fVerbosity >= startup) {
327 PrintAvailableUserVisActions (fVerbosity);
328 G4cout << G4endl;
329 }
330
331 if (fVerbosity >= startup) {
332 PrintAvailableColours (fVerbosity);
333 G4cout << G4endl;
334 }
335
336 fInitialised = true;
337}
virtual void RegisterGraphicsSystems()=0
virtual void RegisterModelFactories()
void RegisterMessengers()
void PrintAvailableGraphicsSystems() const

Referenced by CreateSceneHandler(), and CreateViewer().

◆ Initialize()

void G4VisManager::Initialize ( )

◆ NotifyHandlers()

void G4VisManager::NotifyHandlers ( )
virtual

Reimplemented from G4VVisManager.

Definition at line 1087 of file G4VisManager.cc.

1087 {
1088
1089 if (fVerbosity >= confirmations) {
1090 G4cout << "G4VisManager::NotifyHandler() called." << G4endl;
1091 }
1092
1093 // Check scenes.
1094 G4SceneList& sceneList = fSceneList;
1095 G4int iScene, nScenes = sceneList.size ();
1096 for (iScene = 0; iScene < nScenes; iScene++) {
1097 G4Scene* pScene = sceneList [iScene];
1098 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1099
1100 if (modelList.size ()) {
1101 pScene->CalculateExtent();
1103 ApplyCommand (G4String("/vis/scene/notifyHandlers " + pScene->GetName()));
1104 }
1105 }
1106
1107 // Check the manager's current scene...
1108 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1109 if (fVerbosity >= warnings) {
1110 G4cout << "WARNING: The current scene \""
1111 << fpScene -> GetName ()
1112 << "\" has no models."
1113 << G4endl;
1114 }
1115 }
1116
1117}

◆ PrintAvailableGraphicsSystems()

void G4VisManager::PrintAvailableGraphicsSystems ( ) const
protected

Definition at line 1377 of file G4VisManager.cc.

1377 {
1378 G4int nSystems = fAvailableGraphicsSystems.size ();
1379 G4cout << "Current available graphics systems are:";
1380 if (nSystems) {
1381 // Make a map of graphics systems names (there may be repeated systems)
1382 // and for each name a set of nicknames. The nicknames are ordered
1383 // by length - see struct NicknameComparison above.
1384 std::map<G4String,std::set<G4String,NicknameComparison> > systemMap;
1385 for (G4int i = 0; i < nSystems; i++) {
1386 const G4VGraphicsSystem* pSystem = fAvailableGraphicsSystems[i];
1387 systemMap[pSystem->GetName()].insert(pSystem->GetNickname());
1388 }
1389 // Print the map.
1390 std::map<G4String,std::set<G4String,NicknameComparison> >::const_iterator i;
1391 for (i = systemMap.begin(); i != systemMap.end(); ++i) {
1392 G4cout << "\n " << i->first << " (";
1393 const std::set<G4String,NicknameComparison>& nicknames = i->second;
1394 std::set<G4String,NicknameComparison>::const_iterator j;
1395 for (j = nicknames.begin(); j != nicknames.end(); ++j) {
1396 if (j != nicknames.begin()) G4cout << ", ";
1397 G4cout << *j;
1398 }
1399 G4cout << ')';
1400 }
1401 }
1402 else {
1403 G4cout << "\n NONE!!! None registered - yet! Mmmmm!";
1404 }
1405 G4cout << G4endl;
1406}
const G4String & GetNickname() const
const G4String & GetName() const

Referenced by Initialise(), and G4VisCommandList::SetNewValue().

◆ RegisterEndOfEventUserVisAction()

void G4VisManager::RegisterEndOfEventUserVisAction ( const G4String name,
G4VUserVisAction pVisAction,
const G4VisExtent extent = G4VisExtent::NullExtent 
)

Definition at line 1211 of file G4VisManager.cc.

1214 {
1215 fEndOfEventUserVisActions.push_back(UserVisAction(name,pVisAction));
1216 if (extent.GetExtentRadius() > 0.) {
1217 fUserVisActionExtents[pVisAction] = extent;
1218 } else {
1219 if (fVerbosity >= warnings) {
1220 G4cout <<
1221 "WARNING: No extent set for user vis action \"" << name << "\"."
1222 << G4endl;
1223 }
1224 }
1225}
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:73

◆ RegisterEndOfRunUserVisAction()

void G4VisManager::RegisterEndOfRunUserVisAction ( const G4String name,
G4VUserVisAction pVisAction,
const G4VisExtent extent = G4VisExtent::NullExtent 
)

Definition at line 1227 of file G4VisManager.cc.

1230 {
1231 fEndOfRunUserVisActions.push_back(UserVisAction(name,pVisAction));
1232 fUserVisActionExtents[pVisAction] = extent;
1233 if (extent.GetExtentRadius() <= 0.) {
1234 if (fVerbosity >= warnings) {
1235 G4cout <<
1236 "WARNING: No extent set for user vis action \"" << name << "\"."
1237 << G4endl;
1238 }
1239 }
1240}

◆ RegisterGraphicsSystem()

G4bool G4VisManager::RegisterGraphicsSystem ( G4VGraphicsSystem pSystem)

Definition at line 552 of file G4VisManager.cc.

552 {
553 G4bool happy = true;
554 if (pSystem) {
555 fAvailableGraphicsSystems.push_back (pSystem);
556 if (fVerbosity >= confirmations) {
557 G4cout << "G4VisManager::RegisterGraphicsSystem: "
558 << pSystem -> GetName ();
559 if (pSystem -> GetNickname () != "") {
560 G4cout << " (" << pSystem -> GetNickname () << ")";
561 }
562 G4cout << " registered." << G4endl;
563 }
564 }
565 else {
566 if (fVerbosity >= errors) {
567 G4cout << "G4VisManager::RegisterGraphicsSystem: null pointer!"
568 << G4endl;
569 }
570 happy=false;
571 }
572 return happy;
573}

◆ RegisterGraphicsSystems()

virtual void G4VisManager::RegisterGraphicsSystems ( )
protectedpure virtual

Referenced by Initialise().

◆ RegisterMessenger()

void G4VisManager::RegisterMessenger ( G4UImessenger messenger)

Referenced by G4VisManager(), and RegisterMessengers().

◆ RegisterMessengers()

void G4VisManager::RegisterMessengers ( )
protected

Definition at line 339 of file G4VisManager.cc.

339 {
340
341 // Instantiate individual messengers/commands (often - but not
342 // always - one command per messenger).
343
344 G4UIcommand* directory;
345
346 // *Basic* top level commands were instantiated in the constructor
347 // so that they can be used immediately after instantiation of the
348 // vis manager. Other top level and lower level commands are
349 // instantiated here.
350
351 // Other top level commands...
356
357 // Compound commands...
363
364 directory = new G4UIdirectory ("/vis/geometry/");
365 directory -> SetGuidance("Operations on vis attributes of Geant4 geometry.");
366 fDirectoryList.push_back (directory);
369
370 directory = new G4UIdirectory ("/vis/geometry/set/");
371 directory -> SetGuidance("Set vis attributes of Geant4 geometry.");
372 fDirectoryList.push_back (directory);
382
383 directory = new G4UIdirectory ("/vis/set/");
384 directory -> SetGuidance
385 ("Set quantities for use in future commands where appropriate.");
386 fDirectoryList.push_back (directory);
392
393 directory = new G4UIdirectory ("/vis/scene/");
394 directory -> SetGuidance ("Operations on Geant4 scenes.");
395 fDirectoryList.push_back (directory);
403
404 directory = new G4UIdirectory ("/vis/scene/add/");
405 directory -> SetGuidance ("Add model to current scene.");
406 fDirectoryList.push_back (directory);
428
429 directory = new G4UIdirectory ("/vis/sceneHandler/");
430 directory -> SetGuidance ("Operations on Geant4 scene handlers.");
431 fDirectoryList.push_back (directory);
436
437 directory = new G4UIdirectory ("/vis/touchable/");
438 directory -> SetGuidance ("Operations on touchables.");
439 directory = new G4UIdirectory ("/vis/touchable/set/");
440 directory -> SetGuidance ("Set vis attributes of current touchable.");
441 fDirectoryList.push_back (directory);
443
444 directory = new G4UIdirectory ("/vis/viewer/");
445 directory -> SetGuidance ("Operations on Geant4 viewers.");
446 fDirectoryList.push_back (directory);
467
468 directory = new G4UIdirectory ("/vis/viewer/default/");
469 directory -> SetGuidance("Set default values for future viewers.");
470 fDirectoryList.push_back (directory);
473
474 directory = new G4UIdirectory ("/vis/viewer/set/");
475 directory -> SetGuidance ("Set view parameters of current viewer.");
476 fDirectoryList.push_back (directory);
478
479 // List manager commands
481 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
483 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
484
485 // Trajectory filter manager commands
487 (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
489 (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
490
491 // Hit filter manager commands
493 (fpHitFilterMgr, fpHitFilterMgr->Placement()));
495 (fpHitFilterMgr, fpHitFilterMgr->Placement()));
496
497 // Digi filter manager commands
499 (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
501 (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
502}
G4String Placement() const
G4String Placement() const

Referenced by Initialise().

◆ RegisterModel() [1/4]

void G4VisManager::RegisterModel ( G4VFilter< G4VDigi > *  filter)

Definition at line 632 of file G4VisManager.cc.

633{
634 fpDigiFilterMgr->Register(model);
635}

◆ RegisterModel() [2/4]

void G4VisManager::RegisterModel ( G4VFilter< G4VHit > *  filter)

Definition at line 621 of file G4VisManager.cc.

622{
623 fpHitFilterMgr->Register(model);
624}

◆ RegisterModel() [3/4]

void G4VisManager::RegisterModel ( G4VFilter< G4VTrajectory > *  filter)

Definition at line 610 of file G4VisManager.cc.

611{
612 fpTrajFilterMgr->Register(model);
613}

◆ RegisterModel() [4/4]

void G4VisManager::RegisterModel ( G4VTrajectoryModel model)

Definition at line 599 of file G4VisManager.cc.

600{
601 fpTrajDrawModelMgr->Register(model);
602}

◆ RegisterModelFactories()

void G4VisManager::RegisterModelFactories ( )
protectedvirtual

Definition at line 1939 of file G4VisManager.cc.

1940{
1941 if (fVerbosity >= warnings) {
1942 G4cout<<"G4VisManager: No model factories registered with G4VisManager."<<G4endl;
1943 G4cout<<"G4VisManager::RegisterModelFactories() should be overridden in derived"<<G4endl;
1944 G4cout<<"class. See G4VisExecutive for an example."<<G4endl;
1945 }
1946}

Referenced by Initialise().

◆ RegisterModelFactory() [1/4]

void G4VisManager::RegisterModelFactory ( G4DigiFilterFactory factory)

Definition at line 638 of file G4VisManager.cc.

639{
640 fpDigiFilterMgr->Register(factory);
641}

◆ RegisterModelFactory() [2/4]

void G4VisManager::RegisterModelFactory ( G4HitFilterFactory factory)

Definition at line 627 of file G4VisManager.cc.

628{
629 fpHitFilterMgr->Register(factory);
630}

◆ RegisterModelFactory() [3/4]

void G4VisManager::RegisterModelFactory ( G4TrajDrawModelFactory factory)

Definition at line 605 of file G4VisManager.cc.

606{
607 fpTrajDrawModelMgr->Register(factory);
608}

◆ RegisterModelFactory() [4/4]

void G4VisManager::RegisterModelFactory ( G4TrajFilterFactory factory)

Definition at line 616 of file G4VisManager.cc.

617{
618 fpTrajFilterMgr->Register(factory);
619}

◆ RegisterRunDurationUserVisAction()

void G4VisManager::RegisterRunDurationUserVisAction ( const G4String name,
G4VUserVisAction pVisAction,
const G4VisExtent extent = G4VisExtent::NullExtent 
)

Definition at line 1195 of file G4VisManager.cc.

1198 {
1199 fRunDurationUserVisActions.push_back(UserVisAction(name,pVisAction));
1200 if (extent.GetExtentRadius() > 0.) {
1201 fUserVisActionExtents[pVisAction] = extent;
1202 } else {
1203 if (fVerbosity >= warnings) {
1204 G4cout <<
1205 "WARNING: No extent set for user vis action \"" << name << "\"."
1206 << G4endl;
1207 }
1208 }
1209}

◆ ResetTransientsDrawnFlags()

void G4VisManager::ResetTransientsDrawnFlags ( )

Definition at line 1720 of file G4VisManager.cc.

1721{
1722 fTransientsDrawnThisRun = false;
1723 fTransientsDrawnThisEvent = false;
1725 for (i = fAvailableSceneHandlers.begin();
1726 i != fAvailableSceneHandlers.end(); ++i) {
1727 (*i)->SetTransientsDrawnThisEvent(false);
1728 (*i)->SetTransientsDrawnThisRun(false);
1729 }
1730}
std::vector< G4VSceneHandler * >::const_iterator G4SceneHandlerListConstIterator

Referenced by SetCurrentScene(), G4VisCommandSceneEndOfEventAction::SetNewValue(), G4VisCommandSceneEndOfRunAction::SetNewValue(), and G4VisCommandViewerClearTransients::SetNewValue().

◆ SelectTrajectoryModel()

void G4VisManager::SelectTrajectoryModel ( const G4String model)

Definition at line 643 of file G4VisManager.cc.

644{
645 fpTrajDrawModelMgr->SetCurrent(model);
646}
void SetCurrent(const G4String &)

◆ SetAbortReviewKeptEvents()

void G4VisManager::SetAbortReviewKeptEvents ( G4bool  )

◆ SetAvailableSceneHandlers()

G4SceneHandlerList & G4VisManager::SetAvailableSceneHandlers ( )

◆ SetCurrentGraphicsSystem()

void G4VisManager::SetCurrentGraphicsSystem ( G4VGraphicsSystem pSystem)

Definition at line 1251 of file G4VisManager.cc.

1251 {
1252 fpGraphicsSystem = pSystem;
1253 if (fVerbosity >= confirmations) {
1254 G4cout << "G4VisManager::SetCurrentGraphicsSystem: system now "
1255 << pSystem -> GetName () << G4endl;
1256 }
1257 // If current scene handler is of same graphics system, leave unchanged.
1258 // Else find the most recent scene handler of same graphics system.
1259 // Or clear pointers.
1260 if (!(fpSceneHandler && fpSceneHandler -> GetGraphicsSystem () == pSystem)) {
1261 const G4SceneHandlerList& sceneHandlerList = fAvailableSceneHandlers;
1262 G4int nSH = sceneHandlerList.size (); // No. of scene handlers.
1263 G4int iSH;
1264 for (iSH = nSH - 1; iSH >= 0; iSH--) {
1265 if (sceneHandlerList [iSH] -> GetGraphicsSystem () == pSystem) break;
1266 }
1267 if (iSH >= 0) {
1268 fpSceneHandler = sceneHandlerList [iSH];
1269 if (fVerbosity >= confirmations) {
1270 G4cout << " Scene Handler now "
1271 << fpSceneHandler -> GetName () << G4endl;
1272 }
1273 if (fpScene != fpSceneHandler -> GetScene ()) {
1274 fpScene = fpSceneHandler -> GetScene ();
1275 if (fVerbosity >= confirmations) {
1276 G4cout << " Scene now \""
1277 << fpScene -> GetName () << "\"" << G4endl;
1278 }
1279 }
1280 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1281 if (viewerList.size ()) {
1282 fpViewer = viewerList [0];
1283 if (fVerbosity >= confirmations) {
1284 G4cout << " Viewer now " << fpViewer -> GetName () << G4endl;
1285 }
1286 }
1287 else {
1288 fpViewer = 0;
1289 }
1290 }
1291 else {
1292 fpSceneHandler = 0;
1293 fpViewer = 0;
1294 }
1295 }
1296}

Referenced by G4VisCommandDrawTree::SetNewValue().

◆ SetCurrentScene()

void G4VisManager::SetCurrentScene ( G4Scene pScene)

Definition at line 1242 of file G4VisManager.cc.

1242 {
1243 if (pScene != fpScene) {
1244 // A change of scene. Therefore reset transients drawn flags. All
1245 // memory of previous transient proceessing thereby erased...
1247 }
1248 fpScene = pScene;
1249}
void ResetTransientsDrawnFlags()

Referenced by G4RayTracerSceneHandler::G4RayTracerSceneHandler(), and G4VisCommandDrawTree::SetNewValue().

◆ SetCurrentSceneHandler()

void G4VisManager::SetCurrentSceneHandler ( G4VSceneHandler pSceneHandler)

Definition at line 1298 of file G4VisManager.cc.

1298 {
1299 fpSceneHandler = pSceneHandler;
1300 if (fVerbosity >= confirmations) {
1301 G4cout << "G4VisManager::SetCurrentSceneHandler: scene handler now \""
1302 << pSceneHandler -> GetName () << "\"" << G4endl;
1303 }
1304 if (fpScene != fpSceneHandler -> GetScene ()) {
1305 fpScene = fpSceneHandler -> GetScene ();
1306 if (fVerbosity >= confirmations) {
1307 G4cout << " Scene now \""
1308 << fpScene -> GetName () << "\"" << G4endl;
1309 }
1310 }
1311 if (fpGraphicsSystem != pSceneHandler -> GetGraphicsSystem ()) {
1312 fpGraphicsSystem = pSceneHandler -> GetGraphicsSystem ();
1313 if (fVerbosity >= confirmations) {
1314 G4cout << " Graphics system now \""
1315 << fpGraphicsSystem -> GetName () << "\"" << G4endl;
1316 }
1317 }
1318 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1319 G4int nViewers = viewerList.size ();
1320 if (nViewers) {
1321 G4int iViewer;
1322 for (iViewer = 0; iViewer < nViewers; iViewer++) {
1323 if (fpViewer == viewerList [iViewer]) break;
1324 }
1325 if (iViewer >= nViewers) {
1326 fpViewer = viewerList [0];
1327 if (fVerbosity >= confirmations) {
1328 G4cout << " Viewer now \"" << fpViewer -> GetName () << "\""
1329 << G4endl;
1330 }
1331 }
1332 if (!IsValidView ()) {
1333 if (fVerbosity >= warnings) {
1334 G4cout <<
1335 "WARNING: Problem setting scene handler - please report circumstances."
1336 << G4endl;
1337 }
1338 }
1339 }
1340 else {
1341 fpViewer = 0;
1342 if (fVerbosity >= warnings) {
1343 G4cout <<
1344 "WARNING: No viewers for this scene handler - please create one."
1345 << G4endl;
1346 }
1347 }
1348}

Referenced by G4VisCommandDrawTree::SetNewValue().

◆ SetCurrentViewer()

void G4VisManager::SetCurrentViewer ( G4VViewer pViewer)

Definition at line 1350 of file G4VisManager.cc.

1350 {
1351 fpViewer = pViewer;
1352 if (fVerbosity >= confirmations) {
1353 G4cout << "G4VisManager::SetCurrentViewer: viewer now "
1354 << pViewer -> GetName ()
1355 << G4endl;
1356 }
1357 fpSceneHandler = fpViewer -> GetSceneHandler ();
1358 fpSceneHandler -> SetCurrentViewer (pViewer);
1359 fpScene = fpSceneHandler -> GetScene ();
1360 fpGraphicsSystem = fpSceneHandler -> GetGraphicsSystem ();
1361 if (!IsValidView ()) {
1362 if (fVerbosity >= warnings) {
1363 G4cout <<
1364 "WARNING: Problem setting viewer - please report circumstances."
1365 << G4endl;
1366 }
1367 }
1368}

Referenced by CreateViewer(), SetCurrentViewer(), and G4VisCommandDrawTree::SetNewValue().

◆ SetDefaultViewParameters()

◆ SetEventRefreshing()

void G4VisManager::SetEventRefreshing ( G4bool  )

◆ SetRequestedEvent()

void G4VisManager::SetRequestedEvent ( const G4Event )

◆ SetSceneList()

G4SceneList & G4VisManager::SetSceneList ( )

◆ SetUserAction()

void G4VisManager::SetUserAction ( G4VUserVisAction pVisAction,
const G4VisExtent = G4VisExtent::NullExtent 
)

◆ SetUserActionExtent()

void G4VisManager::SetUserActionExtent ( const G4VisExtent )

◆ SetVerboseLevel() [1/3]

void G4VisManager::SetVerboseLevel ( const G4String verbosityString)

Definition at line 1824 of file G4VisManager.cc.

1824 {
1825 fVerbosity = GetVerbosityValue(verbosityString);
1826}

◆ SetVerboseLevel() [2/3]

void G4VisManager::SetVerboseLevel ( G4int  intVerbosity)

Definition at line 1820 of file G4VisManager.cc.

1820 {
1821 fVerbosity = GetVerbosityValue(intVerbosity);
1822}

Referenced by G4VisCommandVerbose::SetNewValue().

◆ SetVerboseLevel() [3/3]

void G4VisManager::SetVerboseLevel ( Verbosity  )

◆ VerbosityString()

G4String G4VisManager::VerbosityString ( Verbosity  verbosity)
static

Definition at line 1762 of file G4VisManager.cc.

1762 {
1763 G4String rs;
1764 switch (verbosity) {
1765 case quiet: rs = "quiet (0)"; break;
1766 case startup: rs = "startup (1)"; break;
1767 case errors: rs = "errors (2)"; break;
1768 case warnings: rs = "warnings (3)"; break;
1769 case confirmations: rs = "confirmations (4)"; break;
1770 case parameters: rs = "parameters (5)"; break;
1771 case all: rs = "all (6)"; break;
1772 }
1773 return rs;
1774}

Referenced by G4VisManager(), GetVerbosityValue(), and G4VisCommandVerbose::SetNewValue().

◆ ViewerShortName()

G4String G4VisManager::ViewerShortName ( const G4String viewerName) const

Definition at line 1732 of file G4VisManager.cc.

1732 {
1733 G4String viewerShortName (viewerName);
1734 viewerShortName = viewerShortName (0, viewerShortName.find (' '));
1735 return viewerShortName.strip ();
1736}

Referenced by GetViewer().

Friends And Related Function Documentation

◆ G4HepRepFileSceneHandler

friend class G4HepRepFileSceneHandler
friend

Definition at line 133 of file G4VisManager.hh.

◆ G4OpenGLViewerMessenger

friend class G4OpenGLViewerMessenger
friend

Definition at line 131 of file G4VisManager.hh.

◆ G4OpenGLXmViewerMessenger

friend class G4OpenGLXmViewerMessenger
friend

Definition at line 132 of file G4VisManager.hh.

◆ G4RayTracerSceneHandler

friend class G4RayTracerSceneHandler
friend

Definition at line 129 of file G4VisManager.hh.

◆ G4RayTrajectory

friend class G4RayTrajectory
friend

Definition at line 128 of file G4VisManager.hh.

◆ G4RTMessenger

friend class G4RTMessenger
friend

Definition at line 130 of file G4VisManager.hh.

◆ G4RTSteppingAction

friend class G4RTSteppingAction
friend

Definition at line 127 of file G4VisManager.hh.

◆ G4VisCommandList

friend class G4VisCommandList
friend

Definition at line 139 of file G4VisManager.hh.

◆ G4VisStateDependent

friend class G4VisStateDependent
friend

Definition at line 138 of file G4VisManager.hh.

Referenced by G4VisManager().

◆ G4VSceneHandler

friend class G4VSceneHandler
friend

Definition at line 136 of file G4VisManager.hh.

◆ G4VViewer

friend class G4VViewer
friend

Definition at line 137 of file G4VisManager.hh.

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  os,
const G4VGraphicsSystem gs 
)
friend

Definition at line 68 of file G4VGraphicsSystem.cc.

68 {
69 G4VisManager* pVMan = G4VisManager::GetInstance ();
70 const G4SceneHandlerList& scenes = pVMan -> GetAvailableSceneHandlers ();
71 os << "Graphics System: " << gs.GetName ();
72 if (gs.GetNickname () != "") {
73 os << ", nickname: " << gs.GetNickname ();
74 }
75 if (gs.GetDescription () != "") {
76 os << "\n Description: " << gs.GetDescription ();
77 }
78 os << "\n Functionality: " << G4int(gs.GetFunctionality());
79 if (pVMan -> GetVerbosity() >= G4VisManager::parameters) {
80 size_t nScenes = scenes.size ();
81 if (nScenes) {
82 G4int nScenesOfThisSystem = 0;
83 for (size_t i = 0; i < nScenes; i++) {
84 if (scenes [i] -> GetGraphicsSystem () == &gs) {
85 nScenesOfThisSystem++;
86 }
87 }
88 if (nScenesOfThisSystem) {
89 os << "\n Its scenes are: ";
90 for (size_t i = 0; i < nScenes; i++) {
91 if (scenes [i] -> GetGraphicsSystem () == &gs) {
92 os << "\n " << *(scenes [i]);
93 }
94 }
95 }
96 else {
97 os << "\n It has no scenes at present.";
98 }
99 }
100 else {
101 os << "\n There are no scenes instantiated at present.";
102 }
103 }
104 return os;
105}
Functionality GetFunctionality() const
const G4String & GetDescription() const
static Verbosity GetVerbosity()
const G4SceneHandlerList & GetAvailableSceneHandlers() const

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  os,
const G4VSceneHandler sh 
)
friend

Definition at line 963 of file G4VSceneHandler.cc.

963 {
964
965 os << "Scene handler " << sh.fName << " has "
966 << sh.fViewerList.size () << " viewer(s):";
967 for (size_t i = 0; i < sh.fViewerList.size (); i++) {
968 os << "\n " << *(sh.fViewerList [i]);
969 }
970
971 if (sh.fpScene) {
972 os << "\n " << *sh.fpScene;
973 }
974 else {
975 os << "\n This scene handler currently has no scene.";
976 }
977
978 return os;
979}
G4ViewerList fViewerList

Member Data Documentation

◆ fVerbose

const G4int G4VisManager::fVerbose
protected

Definition at line 461 of file G4VisManager.hh.

◆ VerbosityGuidanceStrings

std::vector< G4String > G4VisManager::VerbosityGuidanceStrings
static

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