Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VisManager Class Referenceabstract

#include <G4VisManager.hh>

Inheritance diagram for G4VisManager:
Collaboration 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 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
 
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 SetTransientsDrawnThisRun (G4bool)
 
void SetTransientsDrawnThisEvent (G4bool)
 
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 ()
 

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

Member Enumeration Documentation

Enumerator
quiet 
startup 
errors 
warnings 
confirmations 
parameters 
all 

Definition at line 138 of file G4VisManager.hh.

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

Constructor & Destructor Documentation

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

Definition at line 99 of file G4VisManager.cc.

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

Here is the call graph for this function:

G4VisManager::~G4VisManager ( )
virtual

Definition at line 208 of file G4VisManager.cc.

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

Member Function Documentation

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

Implements G4VVisManager.

Definition at line 707 of file G4VisManager.cc.

708 {
709 #ifdef G4MULTITHREADED
710  if (G4Threading::IsWorkerThread()) return;
711 #endif
712  fDrawGroupNestingDepth++;
713  if (fDrawGroupNestingDepth > 1) {
715  ("G4VisManager::BeginDraw",
716  "visman0008", JustWarning,
717  "Nesting detected. It is illegal to nest Begin/EndDraw."
718  "\n Ignored");
719  return;
720  }
721  if (IsValidView ()) {
722  ClearTransientStoreIfMarked();
723  fpSceneHandler -> BeginPrimitives (objectTransform);
724  fIsDrawGroup = true;
725  }
726 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4bool IsWorkerThread()
Definition: G4Threading.cc:145

Here is the call graph for this function:

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

Implements G4VVisManager.

Definition at line 744 of file G4VisManager.cc.

745 {
746 #ifdef G4MULTITHREADED
747  if (G4Threading::IsWorkerThread()) return;
748 #endif
749  fDrawGroupNestingDepth++;
750  if (fDrawGroupNestingDepth > 1) {
752  ("G4VisManager::BeginDraw2D",
753  "visman0009", JustWarning,
754  "Nesting detected. It is illegal to nest Begin/EndDraw2D."
755  "\n Ignored");
756  return;
757  }
758  if (IsValidView ()) {
759  ClearTransientStoreIfMarked();
760  fpSceneHandler -> BeginPrimitives2D (objectTransform);
761  fIsDrawGroup = true;
762  }
763 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4bool IsWorkerThread()
Definition: G4Threading.cc:145

Here is the call graph for this function:

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

Definition at line 1023 of file G4VisManager.cc.

1023  {
1024  if (!fInitialised) Initialise ();
1025  if (fpGraphicsSystem) {
1026  G4VSceneHandler* pSceneHandler =
1027  fpGraphicsSystem -> CreateSceneHandler (name);
1028  if (pSceneHandler) {
1029  fAvailableSceneHandlers.push_back (pSceneHandler);
1030  fpSceneHandler = pSceneHandler; // Make current.
1031  }
1032  else {
1033  if (fVerbosity >= errors) {
1034  G4cout << "ERROR in G4VisManager::CreateSceneHandler during "
1035  << fpGraphicsSystem -> GetName ()
1036  << " scene handler creation.\n No action taken."
1037  << G4endl;
1038  }
1039  }
1040  }
1041  else PrintInvalidPointers ();
1042 }
void Initialise()
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void CreateSceneHandler(const G4String &name="")

Here is the call graph for this function:

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

Definition at line 1045 of file G4VisManager.cc.

1046 {
1047 
1048  if (!fInitialised) Initialise ();
1049 
1050  if (!fpSceneHandler) {
1051  PrintInvalidPointers ();
1052  return;
1053  }
1054 
1055  G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name);
1056 
1057  if (!p) {
1058  if (fVerbosity >= errors) {
1059  G4cerr << "ERROR in G4VisManager::CreateViewer during "
1060  << fpGraphicsSystem -> GetName ()
1061  << " viewer creation.\n No action taken."
1062  << G4endl;
1063  }
1064  return;
1065  }
1066 
1067  if (p -> GetViewId() < 0) {
1068  if (fVerbosity >= errors) {
1069  G4cerr << "ERROR in G4VisManager::CreateViewer during "
1070  << fpGraphicsSystem -> GetName ()
1071  << " viewer initialisation.\n No action taken."
1072  << G4endl;
1073  }
1074  return;
1075  }
1076 
1077  // Viewer is created, now we can set geometry parameters
1078  // Before 12/2008, it was done in G4VViewer.cc but it did not have to be there!
1079 
1080  G4ViewParameters initialvp = p -> GetViewParameters();
1081  initialvp.SetXGeometryString(XGeometry); //parse string and store parameters
1082  p -> SetViewParameters(initialvp);
1083  p -> Initialise (); // (Viewer itself may change view parameters further.)
1084 
1085  fpViewer = p; // Make current.
1086  fpSceneHandler -> AddViewerToList (fpViewer);
1087  fpSceneHandler -> SetCurrentViewer (fpViewer);
1088  if (fVerbosity >= confirmations) {
1089  G4cout << "G4VisManager::CreateViewer: new viewer created."
1090  << G4endl;
1091  }
1092 
1093  const G4ViewParameters& vp = fpViewer->GetViewParameters();
1094  if (fVerbosity >= parameters) {
1095  G4cout << " view parameters are:\n " << vp << G4endl;
1096  }
1097 
1098  if (vp.IsCulling () && vp.IsCullingInvisible ()) {
1099  static G4bool warned = false;
1100  if (fVerbosity >= confirmations) {
1101  if (!warned) {
1102  G4cout <<
1103  "NOTE: objects with visibility flag set to \"false\""
1104  " will not be drawn!"
1105  "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
1106  "\n Also see other \"/vis/viewer/set\" commands."
1107  << G4endl;
1108  warned = true;
1109  }
1110  }
1111  }
1112  if (vp.IsCullingCovered ()) {
1113  static G4bool warned = false;
1114  if (fVerbosity >= warnings) {
1115  if (!warned) {
1116  G4cout <<
1117  "WARNING: covered objects in solid mode will not be rendered!"
1118  "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1119  "\n Also see other \"/vis/viewer/set\" commands."
1120  << G4endl;
1121  warned = true;
1122  }
1123  }
1124  }
1125 }
void Initialise()
G4bool IsCullingInvisible() const
const char * p
Definition: xmltok.h:285
const G4ViewParameters & GetViewParameters() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void SetXGeometryString(const G4String &)
G4bool IsCullingCovered() const
void SetCurrentViewer(G4VViewer *)
#define G4endl
Definition: G4ios.hh:61
void CreateViewer(const G4String &name="", const G4String &XGeometry="")
G4bool IsCulling() const
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

const G4VTrajectoryModel * G4VisManager::CurrentTrajDrawModel ( ) const

Definition at line 636 of file G4VisManager.cc.

637 {
638  assert (0 != fpTrajDrawModelMgr);
639 
640  const G4VTrajectoryModel* model = fpTrajDrawModelMgr->Current();
641 
642  if (0 == model) {
643  // No model was registered with the trajectory model manager.
644  // Use G4TrajectoryDrawByCharge as a fallback.
645  fpTrajDrawModelMgr->Register(new G4TrajectoryDrawByCharge("DefaultModel"));
646  if (fVerbosity >= warnings) {
647  G4cout<<"G4VisManager: Using G4TrajectoryDrawByCharge as fallback trajectory model."<<G4endl;
648  G4cout<<"See commands in /vis/modeling/trajectories/ for other options."<<G4endl;
649  }
650  }
651 
652  model = fpTrajDrawModelMgr->Current();
653  assert (0 != model); // Should definitely exist now
654 
655  return model;
656 }
void Register(Model *)
const Model * Current() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const XML_Char XML_Content * model
Definition: expat.h:151

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::Disable ( )

Definition at line 568 of file G4VisManager.cc.

568  {
570  if (fVerbosity >= confirmations) {
571  G4cout <<
572  "G4VisManager::Disable: visualization disabled."
573  "\n The pointer returned by GetConcreteInstance will be zero."
574  "\n Note that it will become enabled after some valid vis commands."
575  << G4endl;
576  }
577  if (fVerbosity >= warnings) {
578  G4int currentTrajectoryType =
580  if (currentTrajectoryType > 0) {
581  G4cout <<
582  "You may wish to disable trajectory production too:"
583  "\n \"/tracking/storeTrajectory 0\""
584  "\nbut don't forget to re-enable with"
585  "\n \"/vis/enable\""
586  "\n \"/tracking/storeTrajectory " << currentTrajectoryType << "\" (for your case)."
587  << G4endl;
588  }
589  }
590 }
G4TrackingManager * GetTrackingManager() const
int G4int
Definition: G4Types.hh:78
static G4RunManagerKernel * GetRunManagerKernel()
G4GLOB_DLL std::ostream G4cout
G4int GetStoreTrajectory() const
#define G4endl
Definition: G4ios.hh:61
static void SetConcreteInstance(G4VVisManager *)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::DispatchToModel ( const G4VTrajectory trajectory)
virtual

Implements G4VVisManager.

Definition at line 1246 of file G4VisManager.cc.

1247 {
1248  G4bool visible(true);
1249 
1250  // See if trajectory passes filter
1251  G4bool passed = FilterTrajectory(trajectory);
1252 
1253  if (!passed) {
1254  // Draw invisible trajectory if trajectory failed filter and
1255  // are filtering in soft mode
1256  if (fpTrajFilterMgr->GetMode() == FilterMode::Soft) visible = false;
1257  else {return;}
1258  }
1259 
1260  // Go on to draw trajectory
1261  assert (0 != fpTrajDrawModelMgr);
1262 
1263  const G4VTrajectoryModel* trajectoryModel = CurrentTrajDrawModel();
1264 
1265  assert (0 != trajectoryModel); // Should exist
1266 
1267  if (IsValidView()) {
1268  trajectoryModel->Draw(trajectory, visible);
1269  }
1270 }
const G4VTrajectoryModel * CurrentTrajDrawModel() const
bool G4bool
Definition: G4Types.hh:79
G4bool FilterTrajectory(const G4VTrajectory &)
virtual void Draw(const G4VTrajectory &trajectory, const G4bool &visible=true) const =0
FilterMode::Mode GetMode() const

Here is the call graph for this function:

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

Implements G4VVisManager.

Definition at line 827 of file G4VisManager.cc.

829 {
830  DrawT (circle, objectTransform);
831 }

Here is the caller graph for this function:

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

Implements G4VVisManager.

Definition at line 833 of file G4VisManager.cc.

835 {
836  DrawT (polyhedron, objectTransform);
837 }
void G4VisManager::Draw ( const G4Polyline line,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 839 of file G4VisManager.cc.

841 {
842  DrawT (line, objectTransform);
843 }
void G4VisManager::Draw ( const G4Polymarker polymarker,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 845 of file G4VisManager.cc.

847 {
848  DrawT (polymarker, objectTransform);
849 }
void G4VisManager::Draw ( const G4Scale scale,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 851 of file G4VisManager.cc.

853 {
854  DrawT (scale, objectTransform);
855 }
void G4VisManager::Draw ( const G4Square square,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 857 of file G4VisManager.cc.

859 {
860  DrawT (square, objectTransform);
861 }
void G4VisManager::Draw ( const G4Text text,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 863 of file G4VisManager.cc.

865 {
866  DrawT (text, objectTransform);
867 }
void G4VisManager::Draw ( const G4VTrajectory traj)
virtual

Implements G4VVisManager.

Definition at line 933 of file G4VisManager.cc.

933  {
934 #ifdef G4MULTITHREADED
935  if (G4Threading::IsWorkerThread()) return;
936 #endif
937  // A trajectory needs a trajectories model to provide G4Atts, etc.
938  static G4TrajectoriesModel trajectoriesModel;
939  trajectoriesModel.SetCurrentTrajectory(&traj);
941 #ifdef G4MULTITHREADED
944  }
945 #endif
946  const G4Run* currentRun = runManager->GetCurrentRun();
947  if (currentRun) {
948  trajectoriesModel.SetRunID(currentRun->GetRunID());
949  }
950  const G4Event* currentEvent =
952  if (currentEvent) {
953  trajectoriesModel.SetEventID(currentEvent->GetEventID());
954  }
955  if (fIsDrawGroup) {
956  fpSceneHandler -> SetModel (&trajectoriesModel);
957  fpSceneHandler -> AddCompound (traj);
958  fpSceneHandler -> SetModel (0);
959  } else {
960  if (IsValidView ()) {
961  ClearTransientStoreIfMarked();
962  fpSceneHandler -> SetModel (&trajectoriesModel);
963  fpSceneHandler -> AddCompound (traj);
964  fpSceneHandler -> SetModel (0);
965  }
966  }
967 }
void SetEventID(G4int eventID)
void SetRunID(G4int runID)
const G4Run * GetCurrentRun() const
G4int GetEventID() const
Definition: G4Event.hh:151
void SetCurrentTrajectory(const G4VTrajectory *pTraj)
static G4MTRunManager * GetMasterRunManager()
G4int GetRunID() const
Definition: G4Run.hh:76
Definition: G4Run.hh:46
G4bool IsMultithreadedApplication()
Definition: G4Threading.cc:152
G4bool IsWorkerThread()
Definition: G4Threading.cc:145
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
static G4EventManager * GetEventManager()
const G4Event * GetConstCurrentEvent()

Here is the call graph for this function:

void G4VisManager::Draw ( const G4VHit hit)
virtual

Implements G4VVisManager.

Definition at line 905 of file G4VisManager.cc.

905  {
906 #ifdef G4MULTITHREADED
907  if (G4Threading::IsWorkerThread()) return;
908 #endif
909  if (fIsDrawGroup) {
910  fpSceneHandler -> AddCompound (hit);
911  } else {
912  if (IsValidView ()) {
913  ClearTransientStoreIfMarked();
914  fpSceneHandler -> AddCompound (hit);
915  }
916  }
917 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:145

Here is the call graph for this function:

void G4VisManager::Draw ( const G4VDigi digi)
virtual

Implements G4VVisManager.

Definition at line 919 of file G4VisManager.cc.

919  {
920 #ifdef G4MULTITHREADED
921  if (G4Threading::IsWorkerThread()) return;
922 #endif
923  if (fIsDrawGroup) {
924  fpSceneHandler -> AddCompound (digi);
925  } else {
926  if (IsValidView ()) {
927  ClearTransientStoreIfMarked();
928  fpSceneHandler -> AddCompound (digi);
929  }
930  }
931 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:145

Here is the call graph for this function:

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

Implements G4VVisManager.

Definition at line 969 of file G4VisManager.cc.

971  {
972 #ifdef G4MULTITHREADED
973  if (G4Threading::IsWorkerThread()) return;
974 #endif
975  // Find corresponding solid.
976  G4VSolid* pSol = logicalVol.GetSolid ();
977  Draw (*pSol, attribs, objectTransform);
978 }
G4VSolid * GetSolid() const
G4bool IsWorkerThread()
Definition: G4Threading.cc:145
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())

Here is the call graph for this function:

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

Implements G4VVisManager.

Definition at line 1000 of file G4VisManager.cc.

1002  {
1003 #ifdef G4MULTITHREADED
1004  if (G4Threading::IsWorkerThread()) return;
1005 #endif
1006  // Note: It is tempting to use a temporary model here, as for
1007  // trajectories, in order to get at the G4Atts of the physical
1008  // volume. I tried it (JA). But it's not easy to pass the
1009  // vis attributes. Also other aspects of the model seem not to
1010  // be properly set up. So, the idea has been abandoned for the time
1011  // being. The model pointer will be null. So when picking there
1012  // will be no G4Atts from this physical volume.
1013  //
1014  // If this is called from DrawHit, for example, the user may G4Atts to the
1015  // hit and these will be available with "/vis/scene/add/hits".
1016  //
1017  // Find corresponding logical volume and solid.
1018  G4LogicalVolume* pLV = physicalVol.GetLogicalVolume ();
1019  G4VSolid* pSol = pLV -> GetSolid ();
1020  Draw (*pSol, attribs, objectTransform);
1021 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:145
G4LogicalVolume * GetLogicalVolume() const
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())

Here is the call graph for this function:

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

Implements G4VVisManager.

Definition at line 980 of file G4VisManager.cc.

982  {
983 #ifdef G4MULTITHREADED
984  if (G4Threading::IsWorkerThread()) return;
985 #endif
986  if (fIsDrawGroup) {
987  fpSceneHandler -> PreAddSolid (objectTransform, attribs);
988  solid.DescribeYourselfTo (*fpSceneHandler);
989  fpSceneHandler -> PostAddSolid ();
990  } else {
991  if (IsValidView ()) {
992  ClearTransientStoreIfMarked();
993  fpSceneHandler -> PreAddSolid (objectTransform, attribs);
994  solid.DescribeYourselfTo (*fpSceneHandler);
995  fpSceneHandler -> PostAddSolid ();
996  }
997  }
998 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:145
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const =0

Here is the call graph for this function:

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

Implements G4VVisManager.

Definition at line 869 of file G4VisManager.cc.

871 {
872  DrawT2D (circle, objectTransform);
873 }
void G4VisManager::Draw2D ( const G4Polyhedron polyhedron,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 875 of file G4VisManager.cc.

877 {
878  DrawT2D (polyhedron, objectTransform);
879 }
void G4VisManager::Draw2D ( const G4Polyline line,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 881 of file G4VisManager.cc.

883 {
884  DrawT2D (line, objectTransform);
885 }
void G4VisManager::Draw2D ( const G4Polymarker polymarker,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 887 of file G4VisManager.cc.

889 {
890  DrawT2D (polymarker, objectTransform);
891 }
void G4VisManager::Draw2D ( const G4Square square,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 893 of file G4VisManager.cc.

895 {
896  DrawT2D (square, objectTransform);
897 }
void G4VisManager::Draw2D ( const G4Text text,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 899 of file G4VisManager.cc.

901 {
902  DrawT2D (text, objectTransform);
903 }
void G4VisManager::Enable ( )

Definition at line 541 of file G4VisManager.cc.

541  {
542  if (IsValidView ()) {
543  SetConcreteInstance(this);
544  if (fVerbosity >= confirmations) {
545  G4cout << "G4VisManager::Enable: visualization enabled." << G4endl;
546  }
547  if (fVerbosity >= warnings) {
548  auto nKeptEvents =
550  G4cout <<
551  "There are " << nKeptEvents << " kept events."
552  "\n \"/vis/reviewKeptEvents\" to review them one by one."
553  "\n \"/vis/viewer/flush\" or \"/vis/viewer/rebuild\" to see them accumulated."
554  << G4endl;
555  }
556  }
557  else {
558  if (fVerbosity >= warnings) {
559  G4cout <<
560  "G4VisManager::Enable: WARNING: visualization remains disabled for"
561  "\n above reasons. Rectifying with valid vis commands will"
562  "\n automatically enable."
563  << G4endl;
564  }
565  }
566 }
const std::vector< const G4Event * > * GetEventVector() const
Definition: G4Run.hh:115
const G4Run * GetCurrentRun() const
G4GLOB_DLL std::ostream G4cout
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
#define G4endl
Definition: G4ios.hh:61
static void SetConcreteInstance(G4VVisManager *)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::EndDraw ( )
virtual

Implements G4VVisManager.

Definition at line 728 of file G4VisManager.cc.

729 {
730 #ifdef G4MULTITHREADED
731  if (G4Threading::IsWorkerThread()) return;
732 #endif
733  fDrawGroupNestingDepth--;
734  if (fDrawGroupNestingDepth != 0) {
735  if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
736  return;
737  }
738  if (IsValidView ()) {
739  fpSceneHandler -> EndPrimitives ();
740  }
741  fIsDrawGroup = false;
742 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:145

Here is the call graph for this function:

void G4VisManager::EndDraw2D ( )
virtual

Implements G4VVisManager.

Definition at line 765 of file G4VisManager.cc.

766 {
767 #ifdef G4MULTITHREADED
768  if (G4Threading::IsWorkerThread()) return;
769 #endif
770  fDrawGroupNestingDepth--;
771  if (fDrawGroupNestingDepth != 0) {
772  if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
773  return;
774  }
775  if (IsValidView ()) {
776  fpSceneHandler -> EndPrimitives2D ();
777  }
778  fIsDrawGroup = false;
779 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:145

Here is the call graph for this function:

G4bool G4VisManager::FilterDigi ( const G4VDigi digi)
virtual

Implements G4VVisManager.

Definition at line 1241 of file G4VisManager.cc.

1242 {
1243  return fpDigiFilterMgr->Accept(digi);
1244 }
bool Accept(const T &)

Here is the call graph for this function:

G4bool G4VisManager::FilterHit ( const G4VHit hit)
virtual

Implements G4VVisManager.

Definition at line 1236 of file G4VisManager.cc.

1237 {
1238  return fpHitFilterMgr->Accept(hit);
1239 }
bool Accept(const T &)

Here is the call graph for this function:

G4bool G4VisManager::FilterTrajectory ( const G4VTrajectory trajectory)
virtual

Implements G4VVisManager.

Definition at line 1231 of file G4VisManager.cc.

1232 {
1233  return fpTrajFilterMgr->Accept(trajectory);
1234 }
bool Accept(const T &)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::GeometryHasChanged ( )
virtual

Implements G4VVisManager.

Definition at line 1127 of file G4VisManager.cc.

1127  {
1128  if (fVerbosity >= confirmations) {
1129  G4cout << "G4VisManager::GeometryHasChanged() called." << G4endl;
1130  }
1131 
1132  // Change the world...
1133  G4VPhysicalVolume* pWorld =
1135  -> GetNavigatorForTracking () -> GetWorldVolume ();
1136  if (!pWorld) {
1137  if (fVerbosity >= warnings) {
1138  G4cout << "WARNING: There is no world volume!" << G4endl;
1139  }
1140  }
1141 
1142  // Check scenes.
1143  G4SceneList& sceneList = fSceneList;
1144  G4int iScene, nScenes = sceneList.size ();
1145  for (iScene = 0; iScene < nScenes; iScene++) {
1146  G4Scene* pScene = sceneList [iScene];
1147  std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1148  if (modelList.size ()) {
1149  G4bool modelInvalid;
1150  do { // Remove, if required, one at a time.
1151  modelInvalid = false;
1152  std::vector<G4Scene::Model>::iterator iterModel;
1153  for (iterModel = modelList.begin();
1154  iterModel != modelList.end();
1155  ++iterModel) {
1156  modelInvalid = !(iterModel->fpModel->Validate(fVerbosity>=warnings));
1157  if (modelInvalid) {
1158  // Model invalid - remove and break.
1159  if (fVerbosity >= warnings) {
1160  G4cout << "WARNING: Model \""
1161  << iterModel->fpModel->GetGlobalDescription ()
1162  <<
1163  "\" is no longer valid - being removed\n from scene \""
1164  << pScene -> GetName () << "\""
1165  << G4endl;
1166  }
1167  modelList.erase (iterModel);
1168  break;
1169  }
1170  }
1171  } while (modelInvalid);
1172 
1173  if (modelList.size () == 0) {
1174  if (fVerbosity >= warnings) {
1175  G4cout << "WARNING: No models left in this scene \""
1176  << pScene -> GetName ()
1177  << "\"."
1178  << G4endl;
1179  }
1180  }
1181  else {
1182  pScene->CalculateExtent();
1184  ApplyCommand (G4String("/vis/scene/notifyHandlers " + pScene->GetName()));
1185  }
1186  }
1187  }
1188 
1189  // Check the manager's current scene...
1190  if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1191  if (fVerbosity >= warnings) {
1192  G4cout << "WARNING: The current scene \""
1193  << fpScene -> GetName ()
1194  << "\" has no models."
1195  << G4endl;
1196  }
1197  }
1198 }
const G4String & GetName() const
int G4int
Definition: G4Types.hh:78
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void CalculateExtent()
Definition: G4Scene.cc:72
static G4TransportationManager * GetTransportationManager()
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

G4bool G4VisManager::GetAbortReviewKeptEvents ( ) const

Here is the caller graph for this function:

const G4GraphicsSystemList & G4VisManager::GetAvailableGraphicsSystems ( )

Definition at line 592 of file G4VisManager.cc.

592  {
593  G4int nSystems = fAvailableGraphicsSystems.size ();
594  if (nSystems == 0) {
595  if (fVerbosity >= warnings) {
596  G4cout << "G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
597  "\n graphics system available!"
598  "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
599  "\n when you compiled/built the visualization code?"
600  "\n 2) Did you instantiate your own Visualization Manager and forget"
601  "\n to implement RegisterGraphicsSystems correctly?"
602  "\n 3) You can register your own graphics system, e.g.,"
603  "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
604  "\n after instantiating your vis manager and before"
605  "\n visManager->Initialize()."
606  << G4endl;
607  }
608  }
609  return fAvailableGraphicsSystems;
610 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
const G4SceneHandlerList& G4VisManager::GetAvailableSceneHandlers ( ) const
G4VGraphicsSystem* G4VisManager::GetCurrentGraphicsSystem ( ) const

Here is the caller graph for this function:

G4Scene* G4VisManager::GetCurrentScene ( ) const

Here is the caller graph for this function:

G4VSceneHandler* G4VisManager::GetCurrentSceneHandler ( ) const

Here is the caller graph for this function:

G4VViewer* G4VisManager::GetCurrentViewer ( ) const

Here is the caller graph for this function:

const G4ViewParameters& G4VisManager::GetDefaultViewParameters ( ) const

Here is the caller graph for this function:

const std::vector<UserVisAction>& G4VisManager::GetEndOfEventUserVisActions ( ) const
const std::vector<UserVisAction>& G4VisManager::GetEndOfRunUserVisActions ( ) const
G4VisManager * G4VisManager::GetInstance ( )
static

Definition at line 241 of file G4VisManager.cc.

241  {
242  if (!fpInstance) {
244  ("G4VisManager::GetInstance",
245  "visman0002", FatalException, "VisManager not yet instantiated");
246  }
247  return fpInstance;
248 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Here is the call graph for this function:

Here is the caller graph for this function:

const G4Event* G4VisManager::GetRequestedEvent ( ) const

Here is the caller graph for this function:

const std::vector<UserVisAction>& G4VisManager::GetRunDurationUserVisActions ( ) const
const G4SceneList& G4VisManager::GetSceneList ( ) const
G4bool G4VisManager::GetTransientsDrawnThisEvent ( ) const

Here is the caller graph for this function:

G4bool G4VisManager::GetTransientsDrawnThisRun ( ) const

Here is the caller graph for this function:

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

Definition at line 2282 of file G4VisManager.cc.

2282  {
2283  return fVerbosity;
2284 }
G4VisManager::Verbosity G4VisManager::GetVerbosityValue ( const G4String verbosityString)
static

Definition at line 2243 of file G4VisManager.cc.

2243  {
2244  G4String ss(verbosityString); ss.toLower();
2245  Verbosity verbosity;
2246  if (ss(0) == 'q') verbosity = quiet;
2247  else if (ss(0) == 's') verbosity = startup;
2248  else if (ss(0) == 'e') verbosity = errors;
2249  else if (ss(0) == 'w') verbosity = warnings;
2250  else if (ss(0) == 'c') verbosity = confirmations;
2251  else if (ss(0) == 'p') verbosity = parameters;
2252  else if (ss(0) == 'a') verbosity = all;
2253  else {
2254  G4int intVerbosity;
2255  std::istringstream is(ss);
2256  is >> intVerbosity;
2257  if (!is) {
2258  G4cerr << "ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
2259  << verbosityString << "\"";
2260  for (size_t i = 0; i < VerbosityGuidanceStrings.size(); ++i) {
2261  G4cerr << '\n' << VerbosityGuidanceStrings[i];
2262  }
2263  verbosity = warnings;
2264  G4cerr << "\n Returning " << VerbosityString(verbosity)
2265  << G4endl;
2266  }
2267  else {
2268  verbosity = GetVerbosityValue(intVerbosity);
2269  }
2270  }
2271  return verbosity;
2272 }
static std::vector< G4String > VerbosityGuidanceStrings
int G4int
Definition: G4Types.hh:78
static Verbosity GetVerbosityValue(const G4String &)
static G4String VerbosityString(Verbosity)
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2274 of file G4VisManager.cc.

2274  {
2275  Verbosity verbosity;
2276  if (intVerbosity < quiet) verbosity = quiet;
2277  else if (intVerbosity > all) verbosity = all;
2278  else verbosity = Verbosity(intVerbosity);
2279  return verbosity;
2280 }
G4VViewer * G4VisManager::GetViewer ( const G4String viewerName) const

Definition at line 2204 of file G4VisManager.cc.

2204  {
2205  G4String viewerShortName = ViewerShortName (viewerName);
2206  size_t nHandlers = fAvailableSceneHandlers.size ();
2207  size_t iHandler, iViewer;
2208  G4VViewer* viewer = 0;
2209  G4bool found = false;
2210  for (iHandler = 0; iHandler < nHandlers; iHandler++) {
2211  G4VSceneHandler* sceneHandler = fAvailableSceneHandlers [iHandler];
2212  const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
2213  for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
2214  viewer = viewerList [iViewer];
2215  if (viewerShortName == viewer -> GetShortName ()) {
2216  found = true;
2217  break;
2218  }
2219  }
2220  if (found) break;
2221  }
2222  if (found) return viewer;
2223  else return 0;
2224 }
G4String ViewerShortName(const G4String &viewerName) const
bool G4bool
Definition: G4Types.hh:79

Here is the call graph for this function:

void G4VisManager::IgnoreStateChanges ( G4bool  val)
virtual

Reimplemented from G4VVisManager.

Definition at line 2421 of file G4VisManager.cc.

2422 {
2423  fIgnoreStateChanges = val;
2424 }
void G4VisManager::Initialise ( )

Definition at line 250 of file G4VisManager.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::Initialize ( )

Here is the caller graph for this function:

void G4VisManager::NotifyHandlers ( )
virtual

Reimplemented from G4VVisManager.

Definition at line 1200 of file G4VisManager.cc.

1200  {
1201 
1202  if (fVerbosity >= confirmations) {
1203  G4cout << "G4VisManager::NotifyHandler() called." << G4endl;
1204  }
1205 
1206  // Check scenes.
1207  G4SceneList& sceneList = fSceneList;
1208  G4int iScene, nScenes = sceneList.size ();
1209  for (iScene = 0; iScene < nScenes; iScene++) {
1210  G4Scene* pScene = sceneList [iScene];
1211  std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1212 
1213  if (modelList.size ()) {
1214  pScene->CalculateExtent();
1216  ApplyCommand (G4String("/vis/scene/notifyHandlers " + pScene->GetName()));
1217  }
1218  }
1219 
1220  // Check the manager's current scene...
1221  if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1222  if (fVerbosity >= warnings) {
1223  G4cout << "WARNING: The current scene \""
1224  << fpScene -> GetName ()
1225  << "\" has no models."
1226  << G4endl;
1227  }
1228  }
1229 }
const G4String & GetName() const
int G4int
Definition: G4Types.hh:78
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4GLOB_DLL std::ostream G4cout
void CalculateExtent()
Definition: G4Scene.cc:72
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4VisManager::PrintAvailableGraphicsSystems ( Verbosity  verbosity) const
protected

Definition at line 1457 of file G4VisManager.cc.

1458 {
1459  G4cout << "Current available graphics systems are:\n";
1460  if (fAvailableGraphicsSystems.size ()) {
1461  for (const auto& gs: fAvailableGraphicsSystems) {
1462  const G4String& name = gs->GetName();
1463  const std::vector<G4String>& nicknames = gs->GetNicknames();
1464  if (verbosity <= warnings) {
1465  // Brief output
1466  G4cout << name << " (";
1467  for (size_t i = 0; i < nicknames.size(); ++i) {
1468  if (i != 0) {
1469  G4cout << ", ";
1470  }
1471  G4cout << nicknames[i];
1472  }
1473  G4cout << ')';
1474  } else {
1475  // Full output
1476  G4cout << *gs;
1477  }
1478  G4cout << G4endl;
1479  }
1480  } else {
1481  G4cout << "\n NONE!!! None registered - yet! Mmmmm!" << G4endl;
1482  }
1483 }
const XML_Char * name
Definition: expat.h:151
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

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

Definition at line 1289 of file G4VisManager.cc.

1291  {
1292  fEndOfEventUserVisActions.push_back(UserVisAction(name,pVisAction));
1293  if (extent.GetExtentRadius() > 0.) {
1294  fUserVisActionExtents[pVisAction] = extent;
1295  } else {
1296  if (fVerbosity >= warnings) {
1297  G4cout <<
1298  "WARNING: No extent set for user vis action \"" << name << "\"."
1299  << G4endl;
1300  }
1301  }
1302 }
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:73
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

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

Definition at line 1305 of file G4VisManager.cc.

1307  {
1308  fEndOfRunUserVisActions.push_back(UserVisAction(name,pVisAction));
1309  if (extent.GetExtentRadius() > 0.) {
1310  fUserVisActionExtents[pVisAction] = extent;
1311  } else {
1312  if (fVerbosity >= warnings) {
1313  G4cout <<
1314  "WARNING: No extent set for user vis action \"" << name << "\"."
1315  << G4endl;
1316  }
1317  }
1318 }
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:73
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

G4bool G4VisManager::RegisterGraphicsSystem ( G4VGraphicsSystem pSystem)

Definition at line 612 of file G4VisManager.cc.

612  {
613  G4bool happy = true;
614  if (pSystem) {
615  fAvailableGraphicsSystems.push_back (pSystem);
616  if (fVerbosity >= confirmations) {
617  G4cout << "G4VisManager::RegisterGraphicsSystem: "
618  << pSystem -> GetName ();
619  if (pSystem -> GetNickname () != "") {
620  G4cout << " (" << pSystem -> GetNickname () << ")";
621  }
622  G4cout << " registered." << G4endl;
623  }
624  }
625  else {
626  if (fVerbosity >= errors) {
627  G4cout << "G4VisManager::RegisterGraphicsSystem: null pointer!"
628  << G4endl;
629  }
630  happy=false;
631  }
632  return happy;
633 }
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61
virtual void G4VisManager::RegisterGraphicsSystems ( )
protectedpure virtual

Here is the caller graph for this function:

void G4VisManager::RegisterMessenger ( G4UImessenger messenger)

Here is the caller graph for this function:

void G4VisManager::RegisterMessengers ( )
protected

Definition at line 361 of file G4VisManager.cc.

361  {
362 
363  // Instantiate individual messengers/commands (often - but not
364  // always - one command per messenger).
365 
366  G4UIcommand* directory;
367 
368  // *Basic* top level commands were instantiated in the constructor
369  // so that they can be used immediately after instantiation of the
370  // vis manager. Other top level and lower level commands are
371  // instantiated here.
372 
373  // Other top level commands...
378 
379  // Compound commands...
385 
386  directory = new G4UIdirectory ("/vis/geometry/");
387  directory -> SetGuidance("Operations on vis attributes of Geant4 geometry.");
388  fDirectoryList.push_back (directory);
391 
392  directory = new G4UIdirectory ("/vis/geometry/set/");
393  directory -> SetGuidance("Set vis attributes of Geant4 geometry.");
394  fDirectoryList.push_back (directory);
404 
405 #ifdef G4MULTITHREADED
406  directory = new G4UIdirectory ("/vis/multithreading/");
407  directory -> SetGuidance("Commands unique to multithreading mode.");
408  fDirectoryList.push_back (directory);
409  RegisterMessenger(new G4VisCommandMultithreadingActionOnEventQueueFull);
410  RegisterMessenger(new G4VisCommandMultithreadingMaxEventQueueSize);
411 #endif
412 
413  directory = new G4UIdirectory ("/vis/set/");
414  directory -> SetGuidance
415  ("Set quantities for use in future commands where appropriate.");
416  fDirectoryList.push_back (directory);
423 
424  directory = new G4UIdirectory ("/vis/scene/");
425  directory -> SetGuidance ("Operations on Geant4 scenes.");
426  fDirectoryList.push_back (directory);
434 
435  directory = new G4UIdirectory ("/vis/scene/add/");
436  directory -> SetGuidance ("Add model to current scene.");
437  fDirectoryList.push_back (directory);
460 
461  directory = new G4UIdirectory ("/vis/sceneHandler/");
462  directory -> SetGuidance ("Operations on Geant4 scene handlers.");
463  fDirectoryList.push_back (directory);
468 
469  directory = new G4UIdirectory ("/vis/touchable/");
470  directory -> SetGuidance ("Operations on touchables.");
471  fDirectoryList.push_back (directory);
473 
474  directory = new G4UIdirectory ("/vis/touchable/set/");
475  directory -> SetGuidance ("Set vis attributes of current touchable.");
476  fDirectoryList.push_back (directory);
478 
479  directory = new G4UIdirectory ("/vis/viewer/");
480  directory -> SetGuidance ("Operations on Geant4 viewers.");
481  fDirectoryList.push_back (directory);
504 
505  directory = new G4UIdirectory ("/vis/viewer/default/");
506  directory -> SetGuidance("Set default values for future viewers.");
507  fDirectoryList.push_back (directory);
510 
511  directory = new G4UIdirectory ("/vis/viewer/set/");
512  directory -> SetGuidance ("Set view parameters of current viewer.");
513  fDirectoryList.push_back (directory);
515 
516  // List manager commands
518  (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
520  (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
521 
522  // Trajectory filter manager commands
524  (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
526  (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
527 
528  // Hit filter manager commands
530  (fpHitFilterMgr, fpHitFilterMgr->Placement()));
532  (fpHitFilterMgr, fpHitFilterMgr->Placement()));
533 
534  // Digi filter manager commands
536  (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
538  (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
539 }
G4String Placement() const
void RegisterMessenger(G4UImessenger *messenger)
G4String Placement() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::RegisterModel ( G4VTrajectoryModel model)

Definition at line 658 of file G4VisManager.cc.

659 {
660  fpTrajDrawModelMgr->Register(model);
661 }
void Register(Model *)

Here is the call graph for this function:

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

Definition at line 669 of file G4VisManager.cc.

670 {
671  fpTrajFilterMgr->Register(model);
672 }
const XML_Char XML_Content * model
Definition: expat.h:151

Here is the call graph for this function:

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

Definition at line 680 of file G4VisManager.cc.

681 {
682  fpHitFilterMgr->Register(model);
683 }
const XML_Char XML_Content * model
Definition: expat.h:151

Here is the call graph for this function:

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

Definition at line 691 of file G4VisManager.cc.

692 {
693  fpDigiFilterMgr->Register(model);
694 }
const XML_Char XML_Content * model
Definition: expat.h:151

Here is the call graph for this function:

void G4VisManager::RegisterModelFactories ( )
protectedvirtual

Definition at line 2405 of file G4VisManager.cc.

2406 {
2407  if (fVerbosity >= warnings) {
2408  G4cout<<"G4VisManager: No model factories registered with G4VisManager."<<G4endl;
2409  G4cout<<"G4VisManager::RegisterModelFactories() should be overridden in derived"<<G4endl;
2410  G4cout<<"class. See G4VisExecutive for an example."<<G4endl;
2411  }
2412 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4VisManager::RegisterModelFactory ( G4TrajDrawModelFactory factory)

Definition at line 664 of file G4VisManager.cc.

665 {
666  fpTrajDrawModelMgr->Register(factory);
667 }
void Register(Model *)

Here is the call graph for this function:

void G4VisManager::RegisterModelFactory ( G4TrajFilterFactory factory)

Definition at line 675 of file G4VisManager.cc.

676 {
677  fpTrajFilterMgr->Register(factory);
678 }

Here is the call graph for this function:

void G4VisManager::RegisterModelFactory ( G4HitFilterFactory factory)

Definition at line 686 of file G4VisManager.cc.

687 {
688  fpHitFilterMgr->Register(factory);
689 }

Here is the call graph for this function:

void G4VisManager::RegisterModelFactory ( G4DigiFilterFactory factory)

Definition at line 697 of file G4VisManager.cc.

698 {
699  fpDigiFilterMgr->Register(factory);
700 }

Here is the call graph for this function:

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

Definition at line 1273 of file G4VisManager.cc.

1275  {
1276  fRunDurationUserVisActions.push_back(UserVisAction(name,pVisAction));
1277  if (extent.GetExtentRadius() > 0.) {
1278  fUserVisActionExtents[pVisAction] = extent;
1279  } else {
1280  if (fVerbosity >= warnings) {
1281  G4cout <<
1282  "WARNING: No extent set for user vis action \"" << name << "\"."
1283  << G4endl;
1284  }
1285  }
1286 }
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:73
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

void G4VisManager::ResetTransientsDrawnFlags ( )

Definition at line 2186 of file G4VisManager.cc.

2187 {
2188  fTransientsDrawnThisRun = false;
2189  fTransientsDrawnThisEvent = false;
2191  for (i = fAvailableSceneHandlers.begin();
2192  i != fAvailableSceneHandlers.end(); ++i) {
2193  (*i)->SetTransientsDrawnThisEvent(false);
2194  (*i)->SetTransientsDrawnThisRun(false);
2195  }
2196 }
std::vector< G4VSceneHandler * >::const_iterator G4SceneHandlerListConstIterator

Here is the caller graph for this function:

void G4VisManager::SelectTrajectoryModel ( const G4String model)

Definition at line 702 of file G4VisManager.cc.

703 {
704  fpTrajDrawModelMgr->SetCurrent(model);
705 }
void SetCurrent(const G4String &)

Here is the call graph for this function:

void G4VisManager::SetAbortReviewKeptEvents ( G4bool  )

Here is the caller graph for this function:

G4SceneHandlerList& G4VisManager::SetAvailableSceneHandlers ( )
void G4VisManager::SetCurrentGraphicsSystem ( G4VGraphicsSystem pSystem)

Definition at line 1329 of file G4VisManager.cc.

1329  {
1330  fpGraphicsSystem = pSystem;
1331  if (fVerbosity >= confirmations) {
1332  G4cout << "G4VisManager::SetCurrentGraphicsSystem: system now "
1333  << pSystem -> GetName () << G4endl;
1334  }
1335  // If current scene handler is of same graphics system, leave unchanged.
1336  // Else find the most recent scene handler of same graphics system.
1337  // Or clear pointers.
1338  if (!(fpSceneHandler && fpSceneHandler -> GetGraphicsSystem () == pSystem)) {
1339  const G4SceneHandlerList& sceneHandlerList = fAvailableSceneHandlers;
1340  G4int nSH = sceneHandlerList.size (); // No. of scene handlers.
1341  G4int iSH;
1342  for (iSH = nSH - 1; iSH >= 0; iSH--) {
1343  if (sceneHandlerList [iSH] -> GetGraphicsSystem () == pSystem) break;
1344  }
1345  if (iSH >= 0) {
1346  fpSceneHandler = sceneHandlerList [iSH];
1347  if (fVerbosity >= confirmations) {
1348  G4cout << " Scene Handler now "
1349  << fpSceneHandler -> GetName () << G4endl;
1350  }
1351  if (fpScene != fpSceneHandler -> GetScene ()) {
1352  fpScene = fpSceneHandler -> GetScene ();
1353  if (fVerbosity >= confirmations) {
1354  G4cout << " Scene now \""
1355  << fpScene -> GetName () << "\"" << G4endl;
1356  }
1357  }
1358  const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1359  if (viewerList.size ()) {
1360  fpViewer = viewerList [0];
1361  if (fVerbosity >= confirmations) {
1362  G4cout << " Viewer now " << fpViewer -> GetName () << G4endl;
1363  }
1364  }
1365  else {
1366  fpViewer = 0;
1367  }
1368  }
1369  else {
1370  fpSceneHandler = 0;
1371  fpViewer = 0;
1372  }
1373  }
1374 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4VisManager::SetCurrentScene ( G4Scene pScene)

Definition at line 1320 of file G4VisManager.cc.

1320  {
1321  if (pScene != fpScene) {
1322  // A change of scene. Therefore reset transients drawn flags. All
1323  // memory of previous transient proceessing thereby erased...
1325  }
1326  fpScene = pScene;
1327 }
void ResetTransientsDrawnFlags()

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::SetCurrentSceneHandler ( G4VSceneHandler pSceneHandler)

Definition at line 1376 of file G4VisManager.cc.

1376  {
1377  fpSceneHandler = pSceneHandler;
1378  if (fVerbosity >= confirmations) {
1379  G4cout << "G4VisManager::SetCurrentSceneHandler: scene handler now \""
1380  << pSceneHandler -> GetName () << "\"" << G4endl;
1381  }
1382  if (fpScene != fpSceneHandler -> GetScene ()) {
1383  fpScene = fpSceneHandler -> GetScene ();
1384  if (fVerbosity >= confirmations) {
1385  G4cout << " Scene now \""
1386  << fpScene -> GetName () << "\"" << G4endl;
1387  }
1388  }
1389  if (fpGraphicsSystem != pSceneHandler -> GetGraphicsSystem ()) {
1390  fpGraphicsSystem = pSceneHandler -> GetGraphicsSystem ();
1391  if (fVerbosity >= confirmations) {
1392  G4cout << " Graphics system now \""
1393  << fpGraphicsSystem -> GetName () << "\"" << G4endl;
1394  }
1395  }
1396  const G4ViewerList& viewerList = fpSceneHandler -> GetViewerList ();
1397  G4int nViewers = viewerList.size ();
1398  if (nViewers) {
1399  G4int iViewer;
1400  for (iViewer = 0; iViewer < nViewers; iViewer++) {
1401  if (fpViewer == viewerList [iViewer]) break;
1402  }
1403  if (iViewer >= nViewers) {
1404  fpViewer = viewerList [0];
1405  if (fVerbosity >= confirmations) {
1406  G4cout << " Viewer now \"" << fpViewer -> GetName () << "\""
1407  << G4endl;
1408  }
1409  }
1410  if (!IsValidView ()) {
1411  if (fVerbosity >= warnings) {
1412  G4cout <<
1413  "WARNING: Problem setting scene handler - please report circumstances."
1414  << G4endl;
1415  }
1416  }
1417  }
1418  else {
1419  fpViewer = 0;
1420  if (fVerbosity >= warnings) {
1421  G4cout <<
1422  "WARNING: No viewers for this scene handler - please create one."
1423  << G4endl;
1424  }
1425  }
1426 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void G4VisManager::SetCurrentViewer ( G4VViewer pViewer)

Definition at line 1428 of file G4VisManager.cc.

1428  {
1429  fpViewer = pViewer;
1430  if (fVerbosity >= confirmations) {
1431  G4cout << "G4VisManager::SetCurrentViewer: viewer now "
1432  << pViewer -> GetName ()
1433  << G4endl;
1434  }
1435  fpSceneHandler = fpViewer -> GetSceneHandler ();
1436  if (!fpSceneHandler) {
1437  if (fVerbosity >= warnings) {
1438  G4cout <<
1439  "WARNING: No scene handler for this viewer - please create one."
1440  << G4endl;
1441  }
1442  return;
1443  }
1444  fpViewer->SetView();
1445  fpSceneHandler -> SetCurrentViewer (pViewer);
1446  fpScene = fpSceneHandler -> GetScene ();
1447  fpGraphicsSystem = fpSceneHandler -> GetGraphicsSystem ();
1448  if (!IsValidView ()) {
1449  if (fVerbosity >= warnings) {
1450  G4cout <<
1451  "WARNING: Problem setting viewer - please report circumstances."
1452  << G4endl;
1453  }
1454  }
1455 }
virtual void SetView()=0
G4GLOB_DLL std::ostream G4cout
void SetCurrentViewer(G4VViewer *)
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::SetDefaultViewParameters ( const G4ViewParameters )

Here is the caller graph for this function:

void G4VisManager::SetEventRefreshing ( G4bool  )

Here is the caller graph for this function:

void G4VisManager::SetRequestedEvent ( const G4Event )

Here is the caller graph for this function:

G4SceneList& G4VisManager::SetSceneList ( )

Here is the caller graph for this function:

void G4VisManager::SetTransientsDrawnThisEvent ( G4bool  )
void G4VisManager::SetTransientsDrawnThisRun ( G4bool  )
void G4VisManager::SetUserAction ( G4VUserVisAction pVisAction,
const G4VisExtent = G4VisExtent::NullExtent 
)
void G4VisManager::SetUserActionExtent ( const G4VisExtent )
void G4VisManager::SetVerboseLevel ( G4int  intVerbosity)

Definition at line 2286 of file G4VisManager.cc.

2286  {
2287  fVerbosity = GetVerbosityValue(intVerbosity);
2288 }
static Verbosity GetVerbosityValue(const G4String &)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4VisManager::SetVerboseLevel ( const G4String verbosityString)

Definition at line 2290 of file G4VisManager.cc.

2290  {
2291  fVerbosity = GetVerbosityValue(verbosityString);
2292 }
static Verbosity GetVerbosityValue(const G4String &)

Here is the call graph for this function:

void G4VisManager::SetVerboseLevel ( Verbosity  )
G4String G4VisManager::VerbosityString ( Verbosity  verbosity)
static

Definition at line 2228 of file G4VisManager.cc.

2228  {
2229  G4String rs;
2230  switch (verbosity) {
2231  case quiet: rs = "quiet (0)"; break;
2232  case startup: rs = "startup (1)"; break;
2233  case errors: rs = "errors (2)"; break;
2234  case warnings: rs = "warnings (3)"; break;
2235  case confirmations: rs = "confirmations (4)"; break;
2236  case parameters: rs = "parameters (5)"; break;
2237  case all: rs = "all (6)"; break;
2238  }
2239  return rs;
2240 }

Here is the caller graph for this function:

G4String G4VisManager::ViewerShortName ( const G4String viewerName) const

Definition at line 2198 of file G4VisManager.cc.

2198  {
2199  G4String viewerShortName (viewerName);
2200  viewerShortName = viewerShortName (0, viewerShortName.find (' '));
2201  return viewerShortName.strip ();
2202 }

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class G4VisCommandList
friend

Definition at line 130 of file G4VisManager.hh.

friend class G4VisStateDependent
friend

Definition at line 129 of file G4VisManager.hh.

friend class G4VSceneHandler
friend

Definition at line 127 of file G4VisManager.hh.

friend class G4VViewer
friend

Definition at line 128 of file G4VisManager.hh.

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

Definition at line 74 of file G4VGraphicsSystem.cc.

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

Definition at line 1060 of file G4VSceneHandler.cc.

1060  {
1061 
1062  os << "Scene handler " << sh.fName << " has "
1063  << sh.fViewerList.size () << " viewer(s):";
1064  for (size_t i = 0; i < sh.fViewerList.size (); i++) {
1065  os << "\n " << *(sh.fViewerList [i]);
1066  }
1067 
1068  if (sh.fpScene) {
1069  os << "\n " << *sh.fpScene;
1070  }
1071  else {
1072  os << "\n This scene handler currently has no scene.";
1073  }
1074 
1075  return os;
1076 }
G4ViewerList fViewerList

Member Data Documentation

const G4int G4VisManager::fVerbose
protected

Definition at line 471 of file G4VisManager.hh.

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

Definition at line 457 of file G4VisManager.hh.


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