Geant4 10.7.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())
 
void RegisterEndOfEventUserVisAction (const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent())
 
void RegisterEndOfRunUserVisAction (const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent())
 
void SetUserAction (G4VUserVisAction *pVisAction, const G4VisExtent &=G4VisExtent())
 
void SetUserActionExtent (const G4VisExtent &)
 
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 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 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 G4VTrajectory &)
 
void Draw (const G4VHit &)
 
void Draw (const G4VDigi &)
 
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 IgnoreStateChanges (G4bool)
 
void NotifyHandlers ()
 
void DispatchToModel (const G4VTrajectory &)
 
G4bool FilterTrajectory (const G4VTrajectory &)
 
G4bool FilterHit (const G4VHit &)
 
G4bool FilterDigi (const G4VDigi &)
 
void CreateSceneHandler (const G4String &name="")
 
void CreateViewer (const G4String &name="", const 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
 
G4bool GetDrawEventOnlyIfToBeKept () const
 
const G4EventGetRequestedEvent () const
 
G4int GetNKeepRequests () const
 
G4bool GetReviewingKeptEvents () const
 
G4bool GetAbortReviewKeptEvents () const
 
const G4ViewParametersGetDefaultViewParameters () const
 
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 SetTransientsDrawnThisRun (G4bool)
 
void SetTransientsDrawnThisEvent (G4bool)
 
void SetDrawEventOnlyIfToBeKept (G4bool)
 
void SetRequestedEvent (const G4Event *)
 
void SetReviewingKeptEvents (G4bool)
 
void SetAbortReviewKeptEvents (G4bool)
 
void SetDefaultViewParameters (const G4ViewParameters &)
 
G4String ViewerShortName (const G4String &viewerName) const
 
G4VViewerGetViewer (const G4String &viewerName) const
 
- Public Member Functions inherited from G4VVisManager
 G4VVisManager ()
 
virtual ~G4VVisManager ()
 
virtual void Draw (const G4Circle &, 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 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 G4VTrajectory &)=0
 
virtual void Draw (const G4VHit &)=0
 
virtual void Draw (const G4VDigi &)=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 IgnoreStateChanges (G4bool)
 
virtual void NotifyHandlers ()
 
virtual void DispatchToModel (const G4VTrajectory &)=0
 
virtual G4bool FilterTrajectory (const G4VTrajectory &)=0
 
virtual G4bool FilterHit (const G4VHit &)=0
 
virtual G4bool FilterDigi (const G4VDigi &)=0
 

Static Public Member Functions

static G4VisManagerGetInstance ()
 
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 (Verbosity) const
 

Protected Attributes

const G4int fVerbose
 

Friends

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 123 of file G4VisManager.hh.

Member Enumeration Documentation

◆ Verbosity

Enumerator
quiet 
startup 
errors 
warnings 
confirmations 
parameters 
all 

Definition at line 137 of file G4VisManager.hh.

137 {
138 quiet, // Nothing is printed.
139 startup, // Startup and endup messages are printed...
140 errors, // ...and errors...
141 warnings, // ...and warnings...
142 confirmations, // ...and confirming messages...
143 parameters, // ...and parameters of scenes and views...
144 all // ...and everything available.
145 };

Constructor & Destructor Documentation

◆ G4VisManager()

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

Definition at line 97 of file G4VisManager.cc.

97 :
98 fVerbose (1),
99 fInitialised (false),
100 fpGraphicsSystem (0),
101 fpScene (0),
102 fpSceneHandler (0),
103 fpViewer (0),
104 fpStateDependent (0),
105 fEventRefreshing (false),
106 fTransientsDrawnThisRun (false),
107 fTransientsDrawnThisEvent (false),
108 fNoOfEventsDrawnThisRun (0),
109 fNKeepRequests (0),
110 fEventKeepingSuspended (false),
111 fDrawEventOnlyIfToBeKept (false),
112 fpRequestedEvent (0),
113 fReviewingKeptEvents (false),
114 fAbortReviewKeptEvents (false),
115 fIsDrawGroup (false),
116 fDrawGroupNestingDepth (0),
117 fIgnoreStateChanges (false)
118#ifdef G4MULTITHREADED
119, fMaxEventQueueSize (100)
120, fWaitOnEventQueueFull (true)
121#endif
122 // All other objects use default constructors.
123{
124 fpTrajDrawModelMgr = new G4VisModelManager<G4VTrajectoryModel>("/vis/modeling/trajectories");
125 fpTrajFilterMgr = new G4VisFilterManager<G4VTrajectory>("/vis/filtering/trajectories");
126 fpHitFilterMgr = new G4VisFilterManager<G4VHit>("/vis/filtering/hits");
127 fpDigiFilterMgr = new G4VisFilterManager<G4VDigi>("/vis/filtering/digi");
128
130 ("Simple graded message scheme - digit or string (1st character defines):");
132 (" 0) quiet, // Nothing is printed.");
134 (" 1) startup, // Startup and endup messages are printed...");
136 (" 2) errors, // ...and errors...");
138 (" 3) warnings, // ...and warnings...");
140 (" 4) confirmations, // ...and confirming messages...");
142 (" 5) parameters, // ...and parameters of scenes and views...");
144 (" 6) all // ...and everything available.");
145
146 if (fpInstance) {
148 ("G4VisManager::G4VisManager",
149 "visman0001", FatalException,
150 "Attempt to Construct more than one VisManager");
151 }
152
153 fpInstance = this;
155
156 fpStateDependent = new G4VisStateDependent (this);
157 // No need to delete this; G4StateManager does this.
158
159 fVerbosity = GetVerbosityValue(verbosityString);
160 if (fVerbosity >= startup) {
161 G4cout
162 << "Visualization Manager instantiating with verbosity \""
163 << VerbosityString(fVerbosity)
164 << "\"..." << G4endl;
165 }
166
167 // Note: The specific graphics systems must be instantiated in a
168 // higher level library to avoid circular dependencies. Also,
169 // some specifically need additional external libararies that the
170 // user must supply. Therefore we ask the user to implement
171 // RegisterGraphicsSystems() and RegisterModelFactories()
172 // in a subclass. We have to wait for the subclass to instantiate
173 // so RegisterGraphicsSystems() cannot be called from this
174 // constructor; it is called from Initialise(). So we ask the
175 // user:
176 // (a) to write a subclass and implement RegisterGraphicsSystems()
177 // and RegisterModelFactories(). See
178 // visualization/include/G4VisExecutive.hh/icc as an example.
179 // (b) instantiate the subclass.
180 // (c) invoke the Initialise() method of the subclass.
181 // For example:
182 // ...
183 // // Instantiate and initialise Visualization Manager.
184 // G4VisManager* visManager = new G4VisExecutive;
185 // visManager -> SetVerboseLevel (Verbose);
186 // visManager -> Initialise ();
187 // // (Don't forget to delete visManager;)
188 // ...
189
190 // Make top level command directory...
191 // Vis commands should *not* be broadcast to threads (2nd argument).
192 G4UIcommand* directory = new G4UIdirectory ("/vis/",false);
193 directory -> SetGuidance ("Visualization commands.");
194 fDirectoryList.push_back (directory);
195
196 // Instantiate *basic* top level commands so that they can be used
197 // immediately after instantiation of the vis manager. Other top
198 // level and lower level commands are instantiated later in
199 // RegisterMessengers.
200 G4VVisCommand::SetVisManager (this); // Sets shared pointer
203}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static void SetVisManager(G4VisManager *pVisManager)
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

◆ ~G4VisManager()

G4VisManager::~G4VisManager ( )
virtual

Definition at line 205 of file G4VisManager.cc.

205 {
206 fpInstance = 0;
207 size_t i;
208 for (i = 0; i < fSceneList.size (); ++i) {
209 delete fSceneList[i];
210 }
211 for (i = 0; i < fAvailableSceneHandlers.size (); ++i) {
212 if (fAvailableSceneHandlers[i] != NULL) {
213 delete fAvailableSceneHandlers[i];
214 }
215 }
216 for (i = 0; i < fAvailableGraphicsSystems.size (); ++i) {
217 if (fAvailableGraphicsSystems[i]) {
218 delete fAvailableGraphicsSystems[i];
219 }
220 }
221 if (fVerbosity >= startup) {
222 G4cout << "Graphics systems deleted." << G4endl;
223 G4cout << "Visualization Manager deleting..." << G4endl;
224 }
225 for (i = 0; i < fMessengerList.size (); ++i) {
226 delete fMessengerList[i];
227 }
228 for (i = 0; i < fDirectoryList.size (); ++i) {
229 delete fDirectoryList[i];
230 }
231
232 delete fpDigiFilterMgr;
233 delete fpHitFilterMgr;
234 delete fpTrajFilterMgr;
235 delete fpTrajDrawModelMgr;
236}

Member Function Documentation

◆ BeginDraw()

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

Implements G4VVisManager.

Definition at line 810 of file G4VisManager.cc.

811{
812#ifdef G4MULTITHREADED
813 if (G4Threading::IsWorkerThread()) return;
814#endif
815 fDrawGroupNestingDepth++;
816 if (fDrawGroupNestingDepth > 1) {
818 ("G4VisManager::BeginDraw",
819 "visman0008", JustWarning,
820 "Nesting detected. It is illegal to nest Begin/EndDraw."
821 "\n Ignored");
822 return;
823 }
824 if (IsValidView ()) {
825 ClearTransientStoreIfMarked();
826 fpSceneHandler -> BeginPrimitives (objectTransform);
827 fIsDrawGroup = true;
828 }
829}
@ JustWarning
G4bool IsWorkerThread()
Definition: G4Threading.cc:123

◆ BeginDraw2D()

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

Implements G4VVisManager.

Definition at line 847 of file G4VisManager.cc.

848{
849#ifdef G4MULTITHREADED
850 if (G4Threading::IsWorkerThread()) return;
851#endif
852 fDrawGroupNestingDepth++;
853 if (fDrawGroupNestingDepth > 1) {
855 ("G4VisManager::BeginDraw2D",
856 "visman0009", JustWarning,
857 "Nesting detected. It is illegal to nest Begin/EndDraw2D."
858 "\n Ignored");
859 return;
860 }
861 if (IsValidView ()) {
862 ClearTransientStoreIfMarked();
863 fpSceneHandler -> BeginPrimitives2D (objectTransform);
864 fIsDrawGroup = true;
865 }
866}

◆ CreateSceneHandler()

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

Definition at line 1121 of file G4VisManager.cc.

1121 {
1122 if (!fInitialised) Initialise ();
1123 if (fpGraphicsSystem) {
1124 G4VSceneHandler* pSceneHandler =
1125 fpGraphicsSystem -> CreateSceneHandler (name);
1126 if (pSceneHandler) {
1127 fAvailableSceneHandlers.push_back (pSceneHandler);
1128 fpSceneHandler = pSceneHandler; // Make current.
1129 }
1130 else {
1131 if (fVerbosity >= errors) {
1132 G4cout << "ERROR in G4VisManager::CreateSceneHandler during "
1133 << fpGraphicsSystem -> GetName ()
1134 << " scene handler creation.\n No action taken."
1135 << G4endl;
1136 }
1137 }
1138 }
1139 else PrintInvalidPointers ();
1140}
void CreateSceneHandler(const G4String &name="")
void Initialise()

Referenced by CreateSceneHandler().

◆ CreateViewer()

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

Definition at line 1142 of file G4VisManager.cc.

1144{
1145
1146 if (!fInitialised) Initialise ();
1147
1148 if (!fpSceneHandler) {
1149 PrintInvalidPointers ();
1150 return;
1151 }
1152
1153 G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name);
1154
1155 if (!p) {
1156 if (fVerbosity >= errors) {
1157 G4cerr << "ERROR in G4VisManager::CreateViewer: null pointer during "
1158 << fpGraphicsSystem -> GetName ()
1159 << " viewer creation.\n No action taken."
1160 << G4endl;
1161 }
1162 return;
1163 }
1164
1165 if (p -> GetViewId() < 0) {
1166 if (fVerbosity >= errors) {
1167 G4cerr << "ERROR in G4VisManager::CreateViewer during "
1168 << fpGraphicsSystem -> GetName ()
1169 << " viewer instantiation.\n No action taken."
1170 << G4endl;
1171 }
1172 return;
1173 }
1174
1175 // Viewer is created, now we can set geometry parameters
1176 // Before 12/2008, it was done in G4VViewer.cc but it did not have to be there!
1177
1178 G4ViewParameters initialvp = p -> GetViewParameters();
1179 initialvp.SetXGeometryString(XGeometry); //parse string and store parameters
1180 p -> SetViewParameters(initialvp);
1181 p -> Initialise (); // (Viewer itself may change view parameters further.)
1182 if (p -> GetViewId() < 0) {
1183 if (fVerbosity >= errors) {
1184 G4cerr << "ERROR in G4VisManager::CreateViewer during "
1185 << fpGraphicsSystem -> GetName ()
1186 << " viewer initialisation.\n No action taken."
1187 << G4endl;
1188 }
1189 return;
1190 }
1191
1192 fpViewer = p; // Make current.
1193 fpSceneHandler -> AddViewerToList (fpViewer);
1194 fpSceneHandler -> SetCurrentViewer (fpViewer);
1195 if (fVerbosity >= confirmations) {
1196 G4cout << "G4VisManager::CreateViewer: new viewer created."
1197 << G4endl;
1198 }
1199
1200 const G4ViewParameters& vp = fpViewer->GetViewParameters();
1201 if (fVerbosity >= parameters) {
1202 G4cout << " view parameters are:\n " << vp << G4endl;
1203 }
1204
1205 if (vp.IsCulling () && vp.IsCullingInvisible ()) {
1206 static G4bool warned = false;
1207 if (fVerbosity >= confirmations) {
1208 if (!warned) {
1209 G4cout <<
1210 "NOTE: objects with visibility flag set to \"false\""
1211 " will not be drawn!"
1212 "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
1213 "\n Also see other \"/vis/viewer/set\" commands."
1214 << G4endl;
1215 warned = true;
1216 }
1217 }
1218 }
1219 if (vp.IsCullingCovered ()) {
1220 static G4bool warned = false;
1221 if (fVerbosity >= warnings) {
1222 if (!warned) {
1223 G4cout <<
1224 "WARNING: covered objects in solid mode will not be rendered!"
1225 "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1226 "\n Also see other \"/vis/viewer/set\" commands."
1227 << G4endl;
1228 warned = true;
1229 }
1230 }
1231 }
1232}
bool G4bool
Definition: G4Types.hh:86
G4GLOB_DLL std::ostream G4cerr
const G4ViewParameters & GetViewParameters() const
void SetXGeometryString(const G4String &)
G4bool IsCulling() const
G4bool IsCullingInvisible() const
G4bool IsCullingCovered() const
void SetCurrentViewer(G4VViewer *)
void CreateViewer(const G4String &name="", const G4String &XGeometry="")

Referenced by CreateViewer().

◆ CurrentTrajDrawModel()

const G4VTrajectoryModel * G4VisManager::CurrentTrajDrawModel ( ) const

Definition at line 739 of file G4VisManager.cc.

740{
741 assert (0 != fpTrajDrawModelMgr);
742
743 const G4VTrajectoryModel* model = fpTrajDrawModelMgr->Current();
744
745 if (0 == model) {
746 // No model was registered with the trajectory model manager.
747 // Use G4TrajectoryDrawByCharge as a fallback.
748 fpTrajDrawModelMgr->Register(new G4TrajectoryDrawByCharge("DefaultModel"));
749 if (fVerbosity >= warnings) {
750 G4cout<<"G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model."<<G4endl;
751 G4cout<<"See commands in /vis/modeling/trajectories/ for other options."<<G4endl;
752 }
753 }
754
755 model = fpTrajDrawModelMgr->Current();
756 assert (0 != model); // Should definitely exist now
757
758 return model;
759}
const Model * Current() const
void Register(Model *)

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

◆ Disable()

void G4VisManager::Disable ( )

Definition at line 670 of file G4VisManager.cc.

670 {
672 if (fVerbosity >= confirmations) {
673 G4cout <<
674 "G4VisManager::Disable: visualization disabled."
675 "\n The pointer returned by GetConcreteInstance will be zero."
676 "\n Note that it will become enabled after some valid vis commands."
677 << G4endl;
678 }
679 if (fVerbosity >= warnings) {
680 G4int currentTrajectoryType =
682 if (currentTrajectoryType > 0) {
683 G4cout <<
684 "You may wish to disable trajectory production too:"
685 "\n \"/tracking/storeTrajectory 0\""
686 "\nbut don't forget to re-enable with"
687 "\n \"/vis/enable\""
688 "\n \"/tracking/storeTrajectory " << currentTrajectoryType
689 << "\"\n and maybe \"/vis/viewer/rebuild\""
690 << G4endl;
691 }
692 }
693}
int G4int
Definition: G4Types.hh:85
static G4RunManagerKernel * GetRunManagerKernel()
G4TrackingManager * GetTrackingManager() const
G4int GetStoreTrajectory() const

Referenced by G4VisCommandEnable::SetNewValue(), and G4VisCommandReviewKeptEvents::SetNewValue().

◆ DispatchToModel()

void G4VisManager::DispatchToModel ( const G4VTrajectory trajectory)
virtual

Implements G4VVisManager.

Definition at line 1370 of file G4VisManager.cc.

1371{
1372 G4bool visible(true);
1373
1374 // See if trajectory passes filter
1375 G4bool passed = FilterTrajectory(trajectory);
1376
1377 if (!passed) {
1378 // Draw invisible trajectory if trajectory failed filter and
1379 // are filtering in soft mode
1380 if (fpTrajFilterMgr->GetMode() == FilterMode::Soft) visible = false;
1381 else {return;}
1382 }
1383
1384 // Go on to draw trajectory
1385 assert (0 != fpTrajDrawModelMgr);
1386
1387 const G4VTrajectoryModel* trajectoryModel = CurrentTrajDrawModel();
1388
1389 assert (0 != trajectoryModel); // Should exist
1390
1391 if (IsValidView()) {
1392 trajectoryModel->Draw(trajectory, visible);
1393 }
1394}
virtual void Draw(const G4VTrajectory &trajectory, const G4bool &visible=true) const =0
FilterMode::Mode GetMode() const
const G4VTrajectoryModel * CurrentTrajDrawModel() const
G4bool FilterTrajectory(const G4VTrajectory &)

◆ Draw() [1/13]

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

Implements G4VVisManager.

Definition at line 930 of file G4VisManager.cc.

932{
933 DrawT (circle, objectTransform);
934}

Referenced by Draw(), and G4VVisCommand::DrawExtent().

◆ Draw() [2/13]

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

Implements G4VVisManager.

Definition at line 1067 of file G4VisManager.cc.

1069 {
1070#ifdef G4MULTITHREADED
1071 if (G4Threading::IsWorkerThread()) return;
1072#endif
1073 // Find corresponding solid.
1074 G4VSolid* pSol = logicalVol.GetSolid ();
1075 Draw (*pSol, attribs, objectTransform);
1076}
G4VSolid * GetSolid() const
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())

◆ Draw() [3/13]

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

Implements G4VVisManager.

Definition at line 936 of file G4VisManager.cc.

938{
939 DrawT (polyhedron, objectTransform);
940}

◆ Draw() [4/13]

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

Implements G4VVisManager.

Definition at line 942 of file G4VisManager.cc.

944{
945 DrawT (line, objectTransform);
946}

◆ Draw() [5/13]

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

Implements G4VVisManager.

Definition at line 948 of file G4VisManager.cc.

950{
951 DrawT (polymarker, objectTransform);
952}

◆ Draw() [6/13]

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

Implements G4VVisManager.

Definition at line 954 of file G4VisManager.cc.

956{
957 DrawT (scale, objectTransform);
958}

◆ Draw() [7/13]

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

Implements G4VVisManager.

Definition at line 960 of file G4VisManager.cc.

962{
963 DrawT (square, objectTransform);
964}

◆ Draw() [8/13]

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

Implements G4VVisManager.

Definition at line 966 of file G4VisManager.cc.

968{
969 DrawT (text, objectTransform);
970}

◆ Draw() [9/13]

void G4VisManager::Draw ( const G4VDigi digi)
virtual

Implements G4VVisManager.

Definition at line 1022 of file G4VisManager.cc.

1022 {
1023#ifdef G4MULTITHREADED
1024 if (G4Threading::IsWorkerThread()) return;
1025#endif
1026 if (fIsDrawGroup) {
1027 fpSceneHandler -> AddCompound (digi);
1028 } else {
1029 if (IsValidView ()) {
1030 ClearTransientStoreIfMarked();
1031 fpSceneHandler -> AddCompound (digi);
1032 }
1033 }
1034}

◆ Draw() [10/13]

void G4VisManager::Draw ( const G4VHit hit)
virtual

Implements G4VVisManager.

Definition at line 1008 of file G4VisManager.cc.

1008 {
1009#ifdef G4MULTITHREADED
1010 if (G4Threading::IsWorkerThread()) return;
1011#endif
1012 if (fIsDrawGroup) {
1013 fpSceneHandler -> AddCompound (hit);
1014 } else {
1015 if (IsValidView ()) {
1016 ClearTransientStoreIfMarked();
1017 fpSceneHandler -> AddCompound (hit);
1018 }
1019 }
1020}

◆ Draw() [11/13]

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

Implements G4VVisManager.

Definition at line 1098 of file G4VisManager.cc.

1100 {
1101#ifdef G4MULTITHREADED
1102 if (G4Threading::IsWorkerThread()) return;
1103#endif
1104 // Note: It is tempting to use a temporary model here, as for
1105 // trajectories, in order to get at the G4Atts of the physical
1106 // volume. I tried it (JA). But it's not easy to pass the
1107 // vis attributes. Also other aspects of the model seem not to
1108 // be properly set up. So, the idea has been abandoned for the time
1109 // being. The model pointer will be null. So when picking there
1110 // will be no G4Atts from this physical volume.
1111 //
1112 // If this is called from DrawHit, for example, the user may G4Atts to the
1113 // hit and these will be available with "/vis/scene/add/hits".
1114 //
1115 // Find corresponding logical volume and solid.
1116 G4LogicalVolume* pLV = physicalVol.GetLogicalVolume ();
1117 G4VSolid* pSol = pLV -> GetSolid ();
1118 Draw (*pSol, attribs, objectTransform);
1119}
G4LogicalVolume * GetLogicalVolume() const

◆ Draw() [12/13]

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

Implements G4VVisManager.

Definition at line 1078 of file G4VisManager.cc.

1080 {
1081#ifdef G4MULTITHREADED
1082 if (G4Threading::IsWorkerThread()) return;
1083#endif
1084 if (fIsDrawGroup) {
1085 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
1086 solid.DescribeYourselfTo (*fpSceneHandler);
1087 fpSceneHandler -> PostAddSolid ();
1088 } else {
1089 if (IsValidView ()) {
1090 ClearTransientStoreIfMarked();
1091 fpSceneHandler -> PreAddSolid (objectTransform, attribs);
1092 solid.DescribeYourselfTo (*fpSceneHandler);
1093 fpSceneHandler -> PostAddSolid ();
1094 }
1095 }
1096}
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const =0

◆ Draw() [13/13]

void G4VisManager::Draw ( const G4VTrajectory traj)
virtual

Implements G4VVisManager.

Definition at line 1036 of file G4VisManager.cc.

1036 {
1037#ifdef G4MULTITHREADED
1038 if (G4Threading::IsWorkerThread()) return;
1039#endif
1040 // A trajectory needs a trajectories model to provide G4Atts, etc.
1041 static G4TrajectoriesModel trajectoriesModel;
1042 trajectoriesModel.SetCurrentTrajectory(&traj);
1044 const G4Run* currentRun = runManager->GetCurrentRun();
1045 if (currentRun) {
1046 trajectoriesModel.SetRunID(currentRun->GetRunID());
1047 }
1048 const G4Event* currentEvent =
1050 if (currentEvent) {
1051 trajectoriesModel.SetEventID(currentEvent->GetEventID());
1052 }
1053 if (fIsDrawGroup) {
1054 fpSceneHandler -> SetModel (&trajectoriesModel);
1055 fpSceneHandler -> AddCompound (traj);
1056 fpSceneHandler -> SetModel (0);
1057 } else {
1058 if (IsValidView ()) {
1059 ClearTransientStoreIfMarked();
1060 fpSceneHandler -> SetModel (&trajectoriesModel);
1061 fpSceneHandler -> AddCompound (traj);
1062 fpSceneHandler -> SetModel (0);
1063 }
1064 }
1065}
const G4Event * GetConstCurrentEvent()
static G4EventManager * GetEventManager()
G4int GetEventID() const
Definition: G4Event.hh:118
static G4RunManager * GetMasterRunManager()
const G4Run * GetCurrentRun() const
Definition: G4Run.hh:49
G4int GetRunID() const
Definition: G4Run.hh:82
void SetCurrentTrajectory(const G4VTrajectory *pTraj)
void SetEventID(G4int eventID)
void SetRunID(G4int runID)

◆ Draw2D() [1/6]

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

Implements G4VVisManager.

Definition at line 972 of file G4VisManager.cc.

974{
975 DrawT2D (circle, objectTransform);
976}

◆ Draw2D() [2/6]

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

Implements G4VVisManager.

Definition at line 978 of file G4VisManager.cc.

980{
981 DrawT2D (polyhedron, objectTransform);
982}

◆ Draw2D() [3/6]

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

Implements G4VVisManager.

Definition at line 984 of file G4VisManager.cc.

986{
987 DrawT2D (line, objectTransform);
988}

◆ Draw2D() [4/6]

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

Implements G4VVisManager.

Definition at line 990 of file G4VisManager.cc.

992{
993 DrawT2D (polymarker, objectTransform);
994}

◆ Draw2D() [5/6]

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

Implements G4VVisManager.

Definition at line 996 of file G4VisManager.cc.

998{
999 DrawT2D (square, objectTransform);
1000}

◆ Draw2D() [6/6]

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

Implements G4VVisManager.

Definition at line 1002 of file G4VisManager.cc.

1004{
1005 DrawT2D (text, objectTransform);
1006}

◆ Enable()

void G4VisManager::Enable ( )

Definition at line 642 of file G4VisManager.cc.

642 {
643 if (IsValidView ()) {
645 if (fVerbosity >= confirmations) {
646 G4cout << "G4VisManager::Enable: visualization enabled." << G4endl;
647 }
648 if (fVerbosity >= warnings) {
649 G4int nKeptEvents = 0;
651 if (run) nKeptEvents = run->GetEventVector()->size();
652 G4cout <<
653 "There are " << nKeptEvents << " kept events."
654 "\n \"/vis/reviewKeptEvents\" to review them one by one."
655 "\n \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\" to see them accumulated."
656 << G4endl;
657 }
658 }
659 else {
660 if (fVerbosity >= warnings) {
661 G4cout <<
662 "G4VisManager::Enable: WARNING: visualization remains disabled for"
663 "\n above reasons. Rectifying with valid vis commands will"
664 "\n automatically enable."
665 << G4endl;
666 }
667 }
668}
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:84
const std::vector< const G4Event * > * GetEventVector() const
Definition: G4Run.hh:119

Referenced by G4VisCommandEnable::SetNewValue(), and G4VisCommandReviewKeptEvents::SetNewValue().

◆ EndDraw()

void G4VisManager::EndDraw ( )
virtual

Implements G4VVisManager.

Definition at line 831 of file G4VisManager.cc.

832{
833#ifdef G4MULTITHREADED
834 if (G4Threading::IsWorkerThread()) return;
835#endif
836 fDrawGroupNestingDepth--;
837 if (fDrawGroupNestingDepth != 0) {
838 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
839 return;
840 }
841 if (IsValidView ()) {
842 fpSceneHandler -> EndPrimitives ();
843 }
844 fIsDrawGroup = false;
845}

◆ EndDraw2D()

void G4VisManager::EndDraw2D ( )
virtual

Implements G4VVisManager.

Definition at line 868 of file G4VisManager.cc.

869{
870#ifdef G4MULTITHREADED
871 if (G4Threading::IsWorkerThread()) return;
872#endif
873 fDrawGroupNestingDepth--;
874 if (fDrawGroupNestingDepth != 0) {
875 if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
876 return;
877 }
878 if (IsValidView ()) {
879 fpSceneHandler -> EndPrimitives2D ();
880 }
881 fIsDrawGroup = false;
882}

◆ FilterDigi()

G4bool G4VisManager::FilterDigi ( const G4VDigi digi)
virtual

Implements G4VVisManager.

Definition at line 1365 of file G4VisManager.cc.

1366{
1367 return fpDigiFilterMgr->Accept(digi);
1368}
bool Accept(const T &)

◆ FilterHit()

G4bool G4VisManager::FilterHit ( const G4VHit hit)
virtual

Implements G4VVisManager.

Definition at line 1360 of file G4VisManager.cc.

1361{
1362 return fpHitFilterMgr->Accept(hit);
1363}

◆ FilterTrajectory()

G4bool G4VisManager::FilterTrajectory ( const G4VTrajectory trajectory)
virtual

Implements G4VVisManager.

Definition at line 1355 of file G4VisManager.cc.

1356{
1357 return fpTrajFilterMgr->Accept(trajectory);
1358}

Referenced by DispatchToModel().

◆ GeometryHasChanged()

void G4VisManager::GeometryHasChanged ( )
virtual

Implements G4VVisManager.

Definition at line 1234 of file G4VisManager.cc.

1234 {
1235 if (fVerbosity >= confirmations) {
1236 G4cout << "G4VisManager::GeometryHasChanged() called." << G4endl;
1237 }
1238
1239 // Change the world...
1240 G4VPhysicalVolume* pWorld =
1242 -> GetNavigatorForTracking () -> GetWorldVolume ();
1243 if (!pWorld) {
1244 if (fVerbosity >= warnings) {
1245 G4cout << "WARNING: There is no world volume!" << G4endl;
1246 }
1247 }
1248
1249 // Check scenes.
1250 G4SceneList& sceneList = fSceneList;
1251 G4int iScene, nScenes = sceneList.size ();
1252 for (iScene = 0; iScene < nScenes; iScene++) {
1253 G4Scene* pScene = sceneList [iScene];
1254 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1255 if (modelList.size ()) {
1256 G4bool modelInvalid;
1257 do { // Remove, if required, one at a time.
1258 modelInvalid = false;
1259 std::vector<G4Scene::Model>::iterator iterModel;
1260 for (iterModel = modelList.begin();
1261 iterModel != modelList.end();
1262 ++iterModel) {
1263 modelInvalid = !(iterModel->fpModel->Validate(fVerbosity>=warnings));
1264 if (modelInvalid) {
1265 // Model invalid - remove and break.
1266 if (fVerbosity >= warnings) {
1267 G4cout << "WARNING: Model \""
1268 << iterModel->fpModel->GetGlobalDescription ()
1269 <<
1270 "\" is no longer valid - being removed\n from scene \""
1271 << pScene -> GetName () << "\""
1272 << G4endl;
1273 }
1274 modelList.erase (iterModel);
1275 break;
1276 }
1277 }
1278 } while (modelInvalid);
1279
1280 if (modelList.size () == 0) {
1281 if (fVerbosity >= warnings) {
1282 G4cout << "WARNING: No models left in this scene \""
1283 << pScene -> GetName ()
1284 << "\"."
1285 << G4endl;
1286 }
1287 }
1288 else {
1289 pScene->CalculateExtent();
1291 ApplyCommand (G4String("/vis/scene/notifyHandlers " + pScene->GetName()));
1292 }
1293 }
1294 }
1295
1296 // Check the manager's current scene...
1297 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1298 if (fVerbosity >= warnings) {
1299 G4cout << "WARNING: The current scene \""
1300 << fpScene -> GetName ()
1301 << "\" has no run duration models."
1302 << "\n Use \"/vis/scene/add/volume\" or create a new scene."
1303 << G4endl;
1304 }
1305 fpSceneHandler->ClearTransientStore();
1306 fpSceneHandler->ClearStore();
1307 fpViewer->NeedKernelVisit();
1308 fpViewer->SetView();
1309 fpViewer->ClearView();
1310 fpViewer->FinishView();
1311 }
1312}
void CalculateExtent()
Definition: G4Scene.cc:109
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
virtual void ClearTransientStore()
virtual void ClearStore()
void NeedKernelVisit()
Definition: G4VViewer.cc:77
virtual void FinishView()
Definition: G4VViewer.cc:100
virtual void ClearView()=0
virtual void SetView()=0

◆ GetAbortReviewKeptEvents()

G4bool G4VisManager::GetAbortReviewKeptEvents ( ) const

◆ GetAvailableGraphicsSystems()

const G4GraphicsSystemList & G4VisManager::GetAvailableGraphicsSystems ( )

Definition at line 695 of file G4VisManager.cc.

695 {
696 G4int nSystems = fAvailableGraphicsSystems.size ();
697 if (nSystems == 0) {
698 if (fVerbosity >= warnings) {
699 G4cout << "G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
700 "\n graphics system available!"
701 "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
702 "\n when you compiled/built the visualization code?"
703 "\n 2) Did you instantiate your own Visualization Manager and forget"
704 "\n to implement RegisterGraphicsSystems correctly?"
705 "\n 3) You can register your own graphics system, e.g.,"
706 "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
707 "\n after instantiating your vis manager and before"
708 "\n visManager->Initialize()."
709 << G4endl;
710 }
711 }
712 return fAvailableGraphicsSystems;
713}

◆ GetAvailableSceneHandlers()

const G4SceneHandlerList & G4VisManager::GetAvailableSceneHandlers ( ) const

◆ GetCurrentGraphicsSystem()

G4VGraphicsSystem * G4VisManager::GetCurrentGraphicsSystem ( ) const

◆ GetCurrentScene()

◆ GetCurrentSceneHandler()

◆ GetCurrentViewer()

◆ GetDefaultViewParameters()

◆ GetDrawEventOnlyIfToBeKept()

G4bool G4VisManager::GetDrawEventOnlyIfToBeKept ( ) const

◆ GetEndOfEventUserVisActions()

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

◆ GetEndOfRunUserVisActions()

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

◆ GetInstance()

G4VisManager * G4VisManager::GetInstance ( )
static

◆ GetNKeepRequests()

G4int G4VisManager::GetNKeepRequests ( ) const

◆ GetRequestedEvent()

const G4Event * G4VisManager::GetRequestedEvent ( ) const

◆ GetReviewingKeptEvents()

G4bool G4VisManager::GetReviewingKeptEvents ( ) 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 2436 of file G4VisManager.cc.

2436 {
2437 return fVerbosity;
2438}

Referenced by G4GMocrenFileSceneHandler::AddPrimitive(), G4GMocrenFileSceneHandler::AddSolid(), G4GMocrenFileSceneHandler::BeginPrimitives(), G4DAWNFILESceneHandler::BeginSavingG4Prim(), G4GMocrenFileSceneHandler::BeginSavingGdd(), G4RayTracerSceneHandler::BuildVisAttsMap(), G4VVisCommand::CheckSceneAndNotifyHandlers(), G4VVisCommand::CheckView(), G4DAWNFILEViewer::ClearView(), G4GMocrenFileViewer::ClearView(), G4VRML1FileViewer::ClearView(), G4VRML2FileViewer::ClearView(), G4VRML1FileSceneHandler::closePort(), G4VRML2FileSceneHandler::closePort(), G4VRML1FileSceneHandler::connectPort(), G4VRML2FileSceneHandler::connectPort(), G4VVisCommand::ConvertToColour(), G4VVisCommand::ConvertToDoublePair(), 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(), G4VVisCommand::ProvideValueOfUnit(), G4VVisCommand::RefreshIfRequired(), G4VSceneHandler::RequestPrimitives(), G4GMocrenIO::retrieveData(), G4GMocrenIO::retrieveData2(), G4GMocrenIO::retrieveData3(), G4GMocrenIO::retrieveData4(), G4DAWNFILEViewer::SendViewParameters(), G4VVisCommandGeometrySet::Set(), G4DAWNFILESceneHandler::SetG4PrimFileName(), G4GMocrenFileSceneHandler::SetGddFileName(), G4VVisCommandGeometrySet::SetLVVisAtts(), G4VisCommandDrawOnlyToBeKeptEvents::SetNewValue(), G4VisCommandReviewKeptEvents::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawLogicalVolume::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandGeometryList::SetNewValue(), G4VisCommandGeometryRestore::SetNewValue(), G4VisCommandGeometrySetDaughtersInvisible::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValue(), G4VisCommandSceneActivateModel::SetNewValue(), G4VisCommandSceneCreate::SetNewValue(), G4VisCommandSceneEndOfEventAction::SetNewValue(), G4VisCommandSceneEndOfRunAction::SetNewValue(), G4VisCommandSceneNotifyHandlers::SetNewValue(), G4VisCommandSceneSelect::SetNewValue(), G4VisCommandSceneShowExtents::SetNewValue(), G4VisCommandSceneAddArrow::SetNewValue(), G4VisCommandSceneAddArrow2D::SetNewValue(), G4VisCommandSceneAddAxes::SetNewValue(), G4VisCommandSceneAddDate::SetNewValue(), G4VisCommandSceneAddDigis::SetNewValue(), G4VisCommandSceneAddEventID::SetNewValue(), G4VisCommandSceneAddExtent::SetNewValue(), G4VisCommandSceneAddElectricField::SetNewValue(), G4VisCommandSceneAddFrame::SetNewValue(), G4VisCommandSceneAddGPS::SetNewValue(), G4VisCommandSceneAddHits::SetNewValue(), G4VisCommandSceneAddLine::SetNewValue(), G4VisCommandSceneAddLine2D::SetNewValue(), G4VisCommandSceneAddLogicalVolume::SetNewValue(), G4VisCommandSceneAddLogo::SetNewValue(), G4VisCommandSceneAddLogo2D::SetNewValue(), G4VisCommandSceneAddMagneticField::SetNewValue(), G4VisCommandSceneAddPSHits::SetNewValue(), G4VisCommandSceneAddScale::SetNewValue(), G4VisCommandSceneAddText::SetNewValue(), G4VisCommandSceneAddText2D::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSceneAddUserAction::SetNewValue(), G4VisCommandSceneAddVolume::SetNewValue(), G4VisCommandSceneHandlerAttach::SetNewValue(), G4VisCommandSceneHandlerCreate::SetNewValue(), G4VisCommandSceneHandlerSelect::SetNewValue(), G4VisCommandSetArrow3DLineSegmentsPerCircle::SetNewValue(), G4VisCommandSetColour::SetNewValue(), G4VisCommandSetExtentForField::SetNewValue(), G4VisCommandSetLineWidth::SetNewValue(), G4VisCommandSetTextColour::SetNewValue(), G4VisCommandSetTextLayout::SetNewValue(), G4VisCommandSetTextSize::SetNewValue(), G4VisCommandSetTouchable::SetNewValue(), G4VisCommandSetVolumeForField::SetNewValue(), G4VisCommandsTouchable::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandViewerAddCutawayPlane::SetNewValue(), G4VisCommandViewerCentreOn::SetNewValue(), G4VisCommandViewerChangeCutawayPlane::SetNewValue(), G4VisCommandViewerClear::SetNewValue(), G4VisCommandViewerClearCutawayPlanes::SetNewValue(), G4VisCommandViewerClearTransients::SetNewValue(), G4VisCommandViewerClearVisAttributesModifiers::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandViewerColourByDensity::SetNewValue(), G4VisCommandViewerCopyViewFrom::SetNewValue(), G4VisCommandViewerCreate::SetNewValue(), G4VisCommandViewerDolly::SetNewValue(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerInterpolate::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(), G4DAWNFILESceneHandler::~G4DAWNFILESceneHandler(), G4GMocrenFileSceneHandler::~G4GMocrenFileSceneHandler(), G4VRML1FileSceneHandler::~G4VRML1FileSceneHandler(), and G4VRML2FileSceneHandler::~G4VRML2FileSceneHandler().

◆ GetVerbosityValue() [1/2]

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

Definition at line 2397 of file G4VisManager.cc.

2397 {
2398 G4String ss(verbosityString); ss.toLower();
2399 Verbosity verbosity;
2400 if (ss(0) == 'q') verbosity = quiet;
2401 else if (ss(0) == 's') verbosity = startup;
2402 else if (ss(0) == 'e') verbosity = errors;
2403 else if (ss(0) == 'w') verbosity = warnings;
2404 else if (ss(0) == 'c') verbosity = confirmations;
2405 else if (ss(0) == 'p') verbosity = parameters;
2406 else if (ss(0) == 'a') verbosity = all;
2407 else {
2408 G4int intVerbosity;
2409 std::istringstream is(ss);
2410 is >> intVerbosity;
2411 if (!is) {
2412 G4cerr << "ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
2413 << verbosityString << "\"";
2414 for (size_t i = 0; i < VerbosityGuidanceStrings.size(); ++i) {
2415 G4cerr << '\n' << VerbosityGuidanceStrings[i];
2416 }
2417 verbosity = warnings;
2418 G4cerr << "\n Returning " << VerbosityString(verbosity)
2419 << G4endl;
2420 }
2421 else {
2422 verbosity = GetVerbosityValue(intVerbosity);
2423 }
2424 }
2425 return verbosity;
2426}

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 2428 of file G4VisManager.cc.

2428 {
2429 Verbosity verbosity;
2430 if (intVerbosity < quiet) verbosity = quiet;
2431 else if (intVerbosity > all) verbosity = all;
2432 else verbosity = Verbosity(intVerbosity);
2433 return verbosity;
2434}

◆ GetViewer()

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

Definition at line 2358 of file G4VisManager.cc.

2358 {
2359 G4String viewerShortName = ViewerShortName (viewerName);
2360 size_t nHandlers = fAvailableSceneHandlers.size ();
2361 size_t iHandler, iViewer;
2362 G4VViewer* viewer = 0;
2363 G4bool found = false;
2364 for (iHandler = 0; iHandler < nHandlers; iHandler++) {
2365 G4VSceneHandler* sceneHandler = fAvailableSceneHandlers [iHandler];
2366 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
2367 for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
2368 viewer = viewerList [iViewer];
2369 if (viewerShortName == viewer -> GetShortName ()) {
2370 found = true;
2371 break;
2372 }
2373 }
2374 if (found) break;
2375 }
2376 if (found) return viewer;
2377 else return 0;
2378}
G4String ViewerShortName(const G4String &viewerName) const

Referenced by G4VisCommandsViewerSet::SetNewValue().

◆ IgnoreStateChanges()

void G4VisManager::IgnoreStateChanges ( G4bool  val)
virtual

Reimplemented from G4VVisManager.

Definition at line 2574 of file G4VisManager.cc.

2575{
2576 fIgnoreStateChanges = val;
2577}

◆ Initialise()

void G4VisManager::Initialise ( )

Definition at line 247 of file G4VisManager.cc.

247 {
248
249 if (fInitialised && fVerbosity >= warnings) {
250 G4cout << "WARNING: G4VisManager::Initialise: already initialised."
251 << G4endl;
252 return;
253 }
254
255 if (fVerbosity >= startup) {
256 G4cout << "Visualization Manager initialising..." << G4endl;
257 }
258
259 if (fVerbosity >= parameters) {
260 G4cout <<
261 "\nYou have instantiated your own Visualization Manager, inheriting"
262 "\n G4VisManager and implementing RegisterGraphicsSystems(), in which"
263 "\n you should, normally, instantiate drivers which do not need"
264 "\n external packages or libraries, and, optionally, drivers under"
265 "\n control of environment variables."
266 "\n Also you should implement RegisterModelFactories()."
267 "\n See visualization/management/include/G4VisExecutive.hh/icc, for example."
268 "\n In your main() you will have something like:"
269 "\n G4VisManager* visManager = new G4VisExecutive;"
270 "\n visManager -> SetVerboseLevel (Verbose);"
271 "\n visManager -> Initialize ();"
272 "\n (Don't forget to delete visManager;)"
273 "\n"
274 << G4endl;
275 }
276
277 if (fVerbosity >= startup) {
278 G4cout << "Registering graphics systems..." << G4endl;
279 }
280
282
283 if (fVerbosity >= startup) {
284 G4cout <<
285 "\nYou have successfully registered the following graphics systems."
286 << G4endl;
288 G4cout << G4endl;
289 }
290
291 // Make command directories for commands instantiated in the
292 // modeling subcategory...
293 G4UIcommand* directory;
294 directory = new G4UIdirectory ("/vis/modeling/");
295 directory -> SetGuidance ("Modeling commands.");
296 fDirectoryList.push_back (directory);
297 directory = new G4UIdirectory ("/vis/modeling/trajectories/");
298 directory -> SetGuidance ("Trajectory model commands.");
299 fDirectoryList.push_back (directory);
300 directory = new G4UIdirectory ("/vis/modeling/trajectories/create/");
301 directory -> SetGuidance ("Create trajectory models and messengers.");
302 fDirectoryList.push_back (directory);
303
304 // Filtering command directory
305 directory = new G4UIdirectory ("/vis/filtering/");
306 directory -> SetGuidance ("Filtering commands.");
307 fDirectoryList.push_back (directory);
308 directory = new G4UIdirectory ("/vis/filtering/trajectories/");
309 directory -> SetGuidance ("Trajectory filtering commands.");
310 fDirectoryList.push_back (directory);
311 directory = new G4UIdirectory ("/vis/filtering/trajectories/create/");
312 directory -> SetGuidance ("Create trajectory filters and messengers.");
313 fDirectoryList.push_back (directory);
314 directory = new G4UIdirectory ("/vis/filtering/hits/");
315 directory -> SetGuidance ("Hit filtering commands.");
316 fDirectoryList.push_back (directory);
317 directory = new G4UIdirectory ("/vis/filtering/hits/create/");
318 directory -> SetGuidance ("Create hit filters and messengers.");
319 fDirectoryList.push_back (directory);
320 directory = new G4UIdirectory ("/vis/filtering/digi/");
321 directory -> SetGuidance ("Digi filtering commands.");
322 fDirectoryList.push_back (directory);
323 directory = new G4UIdirectory ("/vis/filtering/digi/create/");
324 directory -> SetGuidance ("Create digi filters and messengers.");
325 fDirectoryList.push_back (directory);
326
328
329 if (fVerbosity >= startup) {
330 G4cout << "Registering model factories..." << G4endl;
331 }
332
334
335 if (fVerbosity >= startup) {
336 G4cout <<
337 "\nYou have successfully registered the following model factories."
338 << G4endl;
339 PrintAvailableModels (fVerbosity);
340 G4cout << G4endl;
341 }
342
343 if (fVerbosity >= startup) {
344 PrintAvailableUserVisActions (fVerbosity);
345 G4cout << G4endl;
346 }
347
348 InitialiseG4ColourMap();
349
350 if (fVerbosity >= startup) {
351 G4cout <<
352 "Some /vis commands (optionally) take a string to specify colour."
353 "\n\"/vis/list\" to see available colours."
354 << G4endl;
355 }
356
357 fInitialised = true;
358}
virtual void RegisterGraphicsSystems()=0
void PrintAvailableGraphicsSystems(Verbosity) const
virtual void RegisterModelFactories()
void RegisterMessengers()

Referenced by CreateSceneHandler(), and CreateViewer().

◆ Initialize()

void G4VisManager::Initialize ( )

◆ NotifyHandlers()

void G4VisManager::NotifyHandlers ( )
virtual

Reimplemented from G4VVisManager.

Definition at line 1314 of file G4VisManager.cc.

1314 {
1315
1316 if (fVerbosity >= confirmations) {
1317 G4cout << "G4VisManager::NotifyHandler() called." << G4endl;
1318 }
1319
1320 if (IsValidView()) {
1321
1322 // Check scenes.
1323 G4SceneList& sceneList = fSceneList;
1324 G4int iScene, nScenes = sceneList.size ();
1325 for (iScene = 0; iScene < nScenes; iScene++) {
1326 G4Scene* pScene = sceneList [iScene];
1327 std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1328
1329 if (modelList.size ()) {
1330 pScene->CalculateExtent();
1332 ApplyCommand (G4String("/vis/scene/notifyHandlers " + pScene->GetName()));
1333 }
1334 }
1335
1336 // Check the manager's current scene...
1337 if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1338 if (fVerbosity >= warnings) {
1339 G4cout << "WARNING: The current scene \""
1340 << fpScene -> GetName ()
1341 << "\" has no run duration models."
1342 << "\n Use \"/vis/scene/add/volume\" or create a new scene."
1343 << G4endl;
1344 }
1345 fpSceneHandler->ClearTransientStore();
1346 fpSceneHandler->ClearStore();
1347 fpViewer->NeedKernelVisit();
1348 fpViewer->SetView();
1349 fpViewer->ClearView();
1350 fpViewer->FinishView();
1351 }
1352 }
1353}

◆ PrintAvailableGraphicsSystems()

void G4VisManager::PrintAvailableGraphicsSystems ( Verbosity  verbosity) const
protected

Definition at line 1608 of file G4VisManager.cc.

1609{
1610 G4cout << "Registered graphics systems are:\n";
1611 if (fAvailableGraphicsSystems.size ()) {
1612 for (const auto& gs: fAvailableGraphicsSystems) {
1613 const G4String& name = gs->GetName();
1614 const std::vector<G4String>& nicknames = gs->GetNicknames();
1615 if (verbosity <= warnings) {
1616 // Brief output
1617 G4cout << " " << name << " (";
1618 for (size_t i = 0; i < nicknames.size(); ++i) {
1619 if (i != 0) {
1620 G4cout << ", ";
1621 }
1622 G4cout << nicknames[i];
1623 }
1624 G4cout << ')';
1625 } else {
1626 // Full output
1627 G4cout << *gs;
1628 }
1629 G4cout << G4endl;
1630 }
1631 } else {
1632 G4cout << " NONE!!! None registered - yet! Mmmmm!" << G4endl;
1633 }
1634}
const char * name(G4int ptype)

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

◆ RegisterEndOfEventUserVisAction()

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

Definition at line 1428 of file G4VisManager.cc.

1431 {
1432 fEndOfEventUserVisActions.push_back(UserVisAction(name,pVisAction));
1433 if (extent.GetExtentRadius() > 0.) {
1434 fUserVisActionExtents[pVisAction] = extent;
1435 } else {
1436 if (fVerbosity >= warnings) {
1437 G4cout <<
1438 "WARNING: No extent set for user vis action \"" << name << "\"."
1439 << G4endl;
1440 }
1441 }
1442 if (fVerbosity >= confirmations) {
1443 G4cout
1444 << "End of event user vis action \"" << name << "\" registered"
1445 << G4endl;
1446 }
1447}
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:75

◆ RegisterEndOfRunUserVisAction()

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

Definition at line 1449 of file G4VisManager.cc.

1452 {
1453 fEndOfRunUserVisActions.push_back(UserVisAction(name,pVisAction));
1454 if (extent.GetExtentRadius() > 0.) {
1455 fUserVisActionExtents[pVisAction] = extent;
1456 } else {
1457 if (fVerbosity >= warnings) {
1458 G4cout <<
1459 "WARNING: No extent set for user vis action \"" << name << "\"."
1460 << G4endl;
1461 }
1462 }
1463 if (fVerbosity >= confirmations) {
1464 G4cout
1465 << "End of run user vis action \"" << name << "\" registered"
1466 << G4endl;
1467 }
1468}

◆ RegisterGraphicsSystem()

G4bool G4VisManager::RegisterGraphicsSystem ( G4VGraphicsSystem pSystem)

Definition at line 715 of file G4VisManager.cc.

715 {
716 G4bool happy = true;
717 if (pSystem) {
718 fAvailableGraphicsSystems.push_back (pSystem);
719 if (fVerbosity >= confirmations) {
720 G4cout << "G4VisManager::RegisterGraphicsSystem: "
721 << pSystem -> GetName ();
722 if (pSystem -> GetNickname () != "") {
723 G4cout << " (" << pSystem -> GetNickname () << ")";
724 }
725 G4cout << " registered." << G4endl;
726 }
727 }
728 else {
729 if (fVerbosity >= errors) {
730 G4cout << "G4VisManager::RegisterGraphicsSystem: null pointer!"
731 << G4endl;
732 }
733 happy=false;
734 }
735 return happy;
736}

◆ 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 454 of file G4VisManager.cc.

454 {
455
456 // Instantiate individual messengers/commands (often - but not
457 // always - one command per messenger).
458
459 G4UIcommand* directory;
460
461 directory = new G4UIdirectory ("/vis/geometry/");
462 directory -> SetGuidance("Operations on vis attributes of Geant4 geometry.");
463 fDirectoryList.push_back (directory);
466
467 directory = new G4UIdirectory ("/vis/geometry/set/");
468 directory -> SetGuidance("Set vis attributes of Geant4 geometry.");
469 fDirectoryList.push_back (directory);
480
481#ifdef G4MULTITHREADED
482 directory = new G4UIdirectory ("/vis/multithreading/");
483 directory -> SetGuidance("Commands unique to multithreading mode.");
484 fDirectoryList.push_back (directory);
485 RegisterMessenger(new G4VisCommandMultithreadingActionOnEventQueueFull);
486 RegisterMessenger(new G4VisCommandMultithreadingMaxEventQueueSize);
487#endif
488
489 directory = new G4UIdirectory ("/vis/set/");
490 directory -> SetGuidance
491 ("Set quantities for use in future commands where appropriate.");
492 fDirectoryList.push_back (directory);
502
503 directory = new G4UIdirectory ("/vis/scene/");
504 directory -> SetGuidance ("Operations on Geant4 scenes.");
505 fDirectoryList.push_back (directory);
514
515 directory = new G4UIdirectory ("/vis/scene/add/");
516 directory -> SetGuidance ("Add model to current scene.");
517 fDirectoryList.push_back (directory);
542
543 directory = new G4UIdirectory ("/vis/sceneHandler/");
544 directory -> SetGuidance ("Operations on Geant4 scene handlers.");
545 fDirectoryList.push_back (directory);
550
551 directory = new G4UIdirectory ("/vis/touchable/");
552 directory -> SetGuidance ("Operations on touchables.");
553 fDirectoryList.push_back (directory);
555
556 directory = new G4UIdirectory ("/vis/touchable/set/");
557 directory -> SetGuidance ("Set vis attributes of current touchable.");
558 fDirectoryList.push_back (directory);
560
561 directory = new G4UIdirectory ("/vis/viewer/");
562 directory -> SetGuidance ("Operations on Geant4 viewers.");
563 fDirectoryList.push_back (directory);
588
589 directory = new G4UIdirectory ("/vis/viewer/default/");
590 directory -> SetGuidance("Set default values for future viewers.");
591 fDirectoryList.push_back (directory);
594
595 directory = new G4UIdirectory ("/vis/viewer/set/");
596 directory -> SetGuidance ("Set view parameters of current viewer.");
597 fDirectoryList.push_back (directory);
599
600 // *Basic* top level commands were instantiated in the constructor
601 // so that they can be used immediately after instantiation of the
602 // vis manager. Other top level commands, including "compound commands"
603 // (i.e., commands that invoke other commands) are instantiated here.
604
616
617 // List manager commands
619 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
621 (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
622
623 // Trajectory filter manager commands
625 (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
627 (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
628
629 // Hit filter manager commands
631 (fpHitFilterMgr, fpHitFilterMgr->Placement()));
633 (fpHitFilterMgr, fpHitFilterMgr->Placement()));
634
635 // Digi filter manager commands
637 (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
639 (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
640}
G4String Placement() const
G4String Placement() const

Referenced by Initialise().

◆ RegisterModel() [1/4]

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

Definition at line 794 of file G4VisManager.cc.

795{
796 fpDigiFilterMgr->Register(model);
797}

◆ RegisterModel() [2/4]

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

Definition at line 783 of file G4VisManager.cc.

784{
785 fpHitFilterMgr->Register(model);
786}

◆ RegisterModel() [3/4]

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

Definition at line 772 of file G4VisManager.cc.

773{
774 fpTrajFilterMgr->Register(model);
775}

◆ RegisterModel() [4/4]

void G4VisManager::RegisterModel ( G4VTrajectoryModel model)

Definition at line 761 of file G4VisManager.cc.

762{
763 fpTrajDrawModelMgr->Register(model);
764}

◆ RegisterModelFactories()

void G4VisManager::RegisterModelFactories ( )
protectedvirtual

Definition at line 2558 of file G4VisManager.cc.

2559{
2560 if (fVerbosity >= warnings) {
2561 G4cout<<"G4VisManager: No model factories registered with G4VisManager."<<G4endl;
2562 G4cout<<"G4VisManager::RegisterModelFactories() should be overridden in derived"<<G4endl;
2563 G4cout<<"class. See G4VisExecutive for an example."<<G4endl;
2564 }
2565}

Referenced by Initialise().

◆ RegisterModelFactory() [1/4]

void G4VisManager::RegisterModelFactory ( G4DigiFilterFactory factory)

Definition at line 800 of file G4VisManager.cc.

801{
802 fpDigiFilterMgr->Register(factory);
803}

◆ RegisterModelFactory() [2/4]

void G4VisManager::RegisterModelFactory ( G4HitFilterFactory factory)

Definition at line 789 of file G4VisManager.cc.

790{
791 fpHitFilterMgr->Register(factory);
792}

◆ RegisterModelFactory() [3/4]

void G4VisManager::RegisterModelFactory ( G4TrajDrawModelFactory factory)

Definition at line 767 of file G4VisManager.cc.

768{
769 fpTrajDrawModelMgr->Register(factory);
770}

◆ RegisterModelFactory() [4/4]

void G4VisManager::RegisterModelFactory ( G4TrajFilterFactory factory)

Definition at line 778 of file G4VisManager.cc.

779{
780 fpTrajFilterMgr->Register(factory);
781}

◆ RegisterRunDurationUserVisAction()

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

Definition at line 1407 of file G4VisManager.cc.

1410 {
1411 fRunDurationUserVisActions.push_back(UserVisAction(name,pVisAction));
1412 if (extent.GetExtentRadius() > 0.) {
1413 fUserVisActionExtents[pVisAction] = extent;
1414 } else {
1415 if (fVerbosity >= warnings) {
1416 G4cout <<
1417 "WARNING: No extent set for user vis action \"" << name << "\"."
1418 << G4endl;
1419 }
1420 }
1421 if (fVerbosity >= confirmations) {
1422 G4cout
1423 << "Run duration user vis action \"" << name << "\" registered"
1424 << G4endl;
1425 }
1426}

Referenced by SetUserAction().

◆ ResetTransientsDrawnFlags()

void G4VisManager::ResetTransientsDrawnFlags ( )

Definition at line 2340 of file G4VisManager.cc.

2341{
2342 fTransientsDrawnThisRun = false;
2343 fTransientsDrawnThisEvent = false;
2345 for (i = fAvailableSceneHandlers.begin();
2346 i != fAvailableSceneHandlers.end(); ++i) {
2347 (*i)->SetTransientsDrawnThisEvent(false);
2348 (*i)->SetTransientsDrawnThisRun(false);
2349 }
2350}
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 805 of file G4VisManager.cc.

806{
807 fpTrajDrawModelMgr->SetCurrent(model);
808}
void SetCurrent(const G4String &)

◆ SetAbortReviewKeptEvents()

void G4VisManager::SetAbortReviewKeptEvents ( G4bool  )

◆ SetAvailableSceneHandlers()

G4SceneHandlerList & G4VisManager::SetAvailableSceneHandlers ( )

◆ SetCurrentGraphicsSystem()

void G4VisManager::SetCurrentGraphicsSystem ( G4VGraphicsSystem pSystem)

Definition at line 1479 of file G4VisManager.cc.

1479 {
1480 fpGraphicsSystem = pSystem;
1481 if (fVerbosity >= confirmations) {
1482 G4cout << "G4VisManager::SetCurrentGraphicsSystem: system now "
1483 << pSystem -> GetName () << G4endl;
1484 }
1485 // If current scene handler is of same graphics system, leave unchanged.
1486 // Else find the most recent scene handler of same graphics system.
1487 // Or clear pointers.
1488 if (!(fpSceneHandler && fpSceneHandler -> GetGraphicsSystem () == pSystem)) {
1489 const G4SceneHandlerList& sceneHandlerList = fAvailableSceneHandlers;
1490 G4int nSH = sceneHandlerList.size (); // No. of scene handlers.
1491 G4int iSH;
1492 for (iSH = nSH - 1; iSH >= 0; iSH--) {
1493 if (sceneHandlerList [iSH] -> GetGraphicsSystem () == pSystem) break;
1494 }
1495 if (iSH >= 0) {
1496 fpSceneHandler = sceneHandlerList [iSH];
1497 if (fVerbosity >= confirmations) {
1498 G4cout << " Scene Handler now "
1499 << fpSceneHandler -> GetName () << G4endl;
1500 }
1501 if (fpScene != fpSceneHandler -> GetScene ()) {
1502 fpScene = fpSceneHandler -> GetScene ();
1503 if (fVerbosity >= confirmations) {
1504 G4cout << " Scene now \""
1505 << fpScene -> GetName () << "\"" << G4endl;
1506 }
1507 }
1508 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1509 if (viewerList.size ()) {
1510 fpViewer = viewerList [0];
1511 if (fVerbosity >= confirmations) {
1512 G4cout << " Viewer now " << fpViewer -> GetName () << G4endl;
1513 }
1514 }
1515 else {
1516 fpViewer = 0;
1517 }
1518 }
1519 else {
1520 fpSceneHandler = 0;
1521 fpViewer = 0;
1522 }
1523 }
1524}

Referenced by G4VisCommandDrawTree::SetNewValue().

◆ SetCurrentScene()

void G4VisManager::SetCurrentScene ( G4Scene pScene)

Definition at line 1470 of file G4VisManager.cc.

1470 {
1471 if (pScene != fpScene) {
1472 // A change of scene. Therefore reset transients drawn flags. All
1473 // memory of previous transient proceessing thereby erased...
1475 }
1476 fpScene = pScene;
1477}
void ResetTransientsDrawnFlags()

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

◆ SetCurrentSceneHandler()

void G4VisManager::SetCurrentSceneHandler ( G4VSceneHandler pSceneHandler)

Definition at line 1526 of file G4VisManager.cc.

1526 {
1527 fpSceneHandler = pSceneHandler;
1528 if (fVerbosity >= confirmations) {
1529 G4cout << "G4VisManager::SetCurrentSceneHandler: scene handler now \""
1530 << pSceneHandler -> GetName () << "\"" << G4endl;
1531 }
1532 if (fpScene != fpSceneHandler -> GetScene ()) {
1533 fpScene = fpSceneHandler -> GetScene ();
1534 if (fVerbosity >= confirmations) {
1535 G4cout << " Scene now \""
1536 << fpScene -> GetName () << "\"" << G4endl;
1537 }
1538 }
1539 if (fpGraphicsSystem != pSceneHandler -> GetGraphicsSystem ()) {
1540 fpGraphicsSystem = pSceneHandler -> GetGraphicsSystem ();
1541 if (fVerbosity >= confirmations) {
1542 G4cout << " Graphics system now \""
1543 << fpGraphicsSystem -> GetName () << "\"" << G4endl;
1544 }
1545 }
1546 const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1547 G4int nViewers = viewerList.size ();
1548 if (nViewers) {
1549 G4int iViewer;
1550 for (iViewer = 0; iViewer < nViewers; iViewer++) {
1551 if (fpViewer == viewerList [iViewer]) break;
1552 }
1553 if (iViewer >= nViewers) {
1554 fpViewer = viewerList [0];
1555 if (fVerbosity >= confirmations) {
1556 G4cout << " Viewer now \"" << fpViewer -> GetName () << "\""
1557 << G4endl;
1558 }
1559 }
1560 if (!IsValidView ()) {
1561 if (fVerbosity >= warnings) {
1562 G4cout <<
1563 "WARNING: Problem setting scene handler - please report circumstances."
1564 << G4endl;
1565 }
1566 }
1567 }
1568 else {
1569 fpViewer = 0;
1570 if (fVerbosity >= warnings) {
1571 G4cout <<
1572 "WARNING: No viewers for this scene handler - please create one."
1573 << G4endl;
1574 }
1575 }
1576}

Referenced by G4VisCommandDrawTree::SetNewValue().

◆ SetCurrentViewer()

void G4VisManager::SetCurrentViewer ( G4VViewer pViewer)

Definition at line 1578 of file G4VisManager.cc.

1578 {
1579 fpViewer = pViewer;
1580 if (fVerbosity >= confirmations) {
1581 G4cout << "G4VisManager::SetCurrentViewer: viewer now "
1582 << pViewer -> GetName ()
1583 << G4endl;
1584 }
1585 fpSceneHandler = fpViewer -> GetSceneHandler ();
1586 if (!fpSceneHandler) {
1587 if (fVerbosity >= warnings) {
1588 G4cout <<
1589 "WARNING: No scene handler for this viewer - please create one."
1590 << G4endl;
1591 }
1592 return;
1593 }
1594 // JA: I don't think we need this. Setview will be called when needed.
1595 // fpViewer->SetView();
1596 fpSceneHandler -> SetCurrentViewer (pViewer);
1597 fpScene = fpSceneHandler -> GetScene ();
1598 fpGraphicsSystem = fpSceneHandler -> GetGraphicsSystem ();
1599 if (!IsValidView ()) {
1600 if (fVerbosity >= warnings) {
1601 G4cout <<
1602 "WARNING: Problem setting viewer - please report circumstances."
1603 << G4endl;
1604 }
1605 }
1606}

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

◆ SetDefaultViewParameters()

void G4VisManager::SetDefaultViewParameters ( const G4ViewParameters )

◆ SetDrawEventOnlyIfToBeKept()

void G4VisManager::SetDrawEventOnlyIfToBeKept ( G4bool  )

◆ SetEventRefreshing()

void G4VisManager::SetEventRefreshing ( G4bool  )

◆ SetRequestedEvent()

void G4VisManager::SetRequestedEvent ( const G4Event )

◆ SetReviewingKeptEvents()

void G4VisManager::SetReviewingKeptEvents ( G4bool  )

◆ SetSceneList()

G4SceneList & G4VisManager::SetSceneList ( )

◆ SetTransientsDrawnThisEvent()

void G4VisManager::SetTransientsDrawnThisEvent ( G4bool  )

◆ SetTransientsDrawnThisRun()

void G4VisManager::SetTransientsDrawnThisRun ( G4bool  )

◆ SetUserAction()

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

Definition at line 1396 of file G4VisManager.cc.

1398 {
1399 if (fVerbosity >= warnings) {
1400 G4cout <<
1401 "WARNING: SetUserAction is deprecated. Use RegisterRunDurationUserVisAction."
1402 << G4endl;
1403 }
1404 RegisterRunDurationUserVisAction("SetUserAction",pVisAction,extent);
1405}
void RegisterRunDurationUserVisAction(const G4String &name, G4VUserVisAction *, const G4VisExtent &=G4VisExtent())

◆ SetUserActionExtent()

void G4VisManager::SetUserActionExtent ( const G4VisExtent )

◆ SetVerboseLevel() [1/3]

void G4VisManager::SetVerboseLevel ( const G4String verbosityString)

Definition at line 2444 of file G4VisManager.cc.

2444 {
2445 fVerbosity = GetVerbosityValue(verbosityString);
2446}

◆ SetVerboseLevel() [2/3]

void G4VisManager::SetVerboseLevel ( G4int  intVerbosity)

Definition at line 2440 of file G4VisManager.cc.

2440 {
2441 fVerbosity = GetVerbosityValue(intVerbosity);
2442}

Referenced by G4VisCommandVerbose::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), and G4VisCommandViewerInterpolate::SetNewValue().

◆ SetVerboseLevel() [3/3]

void G4VisManager::SetVerboseLevel ( Verbosity  )

◆ VerbosityString()

G4String G4VisManager::VerbosityString ( Verbosity  verbosity)
static

Definition at line 2382 of file G4VisManager.cc.

2382 {
2383 G4String rs;
2384 switch (verbosity) {
2385 case quiet: rs = "quiet (0)"; break;
2386 case startup: rs = "startup (1)"; break;
2387 case errors: rs = "errors (2)"; break;
2388 case warnings: rs = "warnings (3)"; break;
2389 case confirmations: rs = "confirmations (4)"; break;
2390 case parameters: rs = "parameters (5)"; break;
2391 case all: rs = "all (6)"; break;
2392 }
2393 return rs;
2394}

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

◆ ViewerShortName()

G4String G4VisManager::ViewerShortName ( const G4String viewerName) const

Definition at line 2352 of file G4VisManager.cc.

2352 {
2353 G4String viewerShortName (viewerName);
2354 viewerShortName = viewerShortName (0, viewerShortName.find (' '));
2355 return viewerShortName.strip ();
2356}

Referenced by GetViewer().

Friends And Related Function Documentation

◆ G4VisCommandList

friend class G4VisCommandList
friend

Definition at line 129 of file G4VisManager.hh.

◆ G4VisStateDependent

friend class G4VisStateDependent
friend

Definition at line 128 of file G4VisManager.hh.

Referenced by G4VisManager().

◆ G4VSceneHandler

friend class G4VSceneHandler
friend

Definition at line 126 of file G4VisManager.hh.

◆ G4VViewer

friend class G4VViewer
friend

Definition at line 127 of file G4VisManager.hh.

◆ operator<< [1/2]

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

Definition at line 73 of file G4VGraphicsSystem.cc.

74{
75 os << "Graphics System: " << gs.GetName ();
76 os << ", nicknames:"; for (const auto& nickname: gs.GetNicknames())
77 {os << ' ' << nickname;}
78 os << "\n Description: " << gs.GetDescription ();
79 os << "\n Functionality: ";
80 switch (gs.GetFunctionality()) {
82 os << "None";
83 break;
85 os << "nonEuclidian, e.g., tree representation of geometry hierarchy.";
86 break;
88 os << "twoD: Simple 2D, e.g., X (no stored structures).";
89 break;
91 os << "twoDStore: 2D with stored structures.";
92 break;
94 os << "threeD: Passive 3D (with stored structures)";
95 break;
97 os << "threeDInteractive: 3D with mouse control and \"pick\" functionality.";
98 break;
100 os << "virtualReality";
101 break;
103 os << "fileWriter";
104 break;
105 default:
106 os << "unknown";
107 break;
108 }
109
111 const G4SceneHandlerList& scenes = pVMan -> GetAvailableSceneHandlers ();
112 if (pVMan -> GetVerbosity() >= G4VisManager::parameters) {
113 size_t nScenes = scenes.size ();
114 if (nScenes) {
115 G4int nScenesOfThisSystem = 0;
116 for (size_t i = 0; i < nScenes; i++) {
117 if (scenes [i] -> GetGraphicsSystem () == &gs) {
118 nScenesOfThisSystem++;
119 }
120 }
121 if (nScenesOfThisSystem) {
122 os << "\n Its scenes are: ";
123 for (size_t i = 0; i < nScenes; i++) {
124 if (scenes [i] -> GetGraphicsSystem () == &gs) {
125 os << "\n " << *(scenes [i]);
126 }
127 }
128 }
129 else {
130 os << "\n It has no scenes at present.";
131 }
132 }
133 else {
134 os << "\n There are no scenes instantiated at present.";
135 }
136 }
137
138 return os;
139}
const std::vector< G4String > & GetNicknames() const
Functionality GetFunctionality() const
const G4String & GetDescription() const
const G4String & GetName() const
static Verbosity GetVerbosity()
const G4SceneHandlerList & GetAvailableSceneHandlers() const
static G4VisManager * GetInstance()

◆ operator<< [2/2]

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

Definition at line 1168 of file G4VSceneHandler.cc.

1168 {
1169
1170 os << "Scene handler " << sh.fName << " has "
1171 << sh.fViewerList.size () << " viewer(s):";
1172 for (size_t i = 0; i < sh.fViewerList.size (); i++) {
1173 os << "\n " << *(sh.fViewerList [i]);
1174 }
1175
1176 if (sh.fpScene) {
1177 os << "\n " << *sh.fpScene;
1178 }
1179 else {
1180 os << "\n This scene handler currently has no scene.";
1181 }
1182
1183 return os;
1184}
G4ViewerList fViewerList

Member Data Documentation

◆ fVerbose

const G4int G4VisManager::fVerbose
protected

Definition at line 477 of file G4VisManager.hh.

◆ VerbosityGuidanceStrings

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

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