Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends
G4VisManager Class Referenceabstract

#include <G4VisManager.hh>

Inheritance diagram for G4VisManager:
G4VVisManager G4VisExecutive PyG4VisManager

Data Structures

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 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 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 Verbosity GetVerbosity ()
 
static Verbosity GetVerbosityValue (const G4String &)
 
static Verbosity GetVerbosityValue (G4int)
 
static G4String VerbosityString (Verbosity)
 
- Static Public Member Functions inherited from G4VVisManager
static G4VVisManagerGetConcreteInstance ()
 

Static Public Attributes

static std::vector< G4StringVerbosityGuidanceStrings
 

Protected Member Functions

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

Protected Attributes

const G4int fVerbose
 
G4bool fIgnoreStateChanges
 

Friends

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

Additional Inherited Members

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

Detailed Description

Definition at line 119 of file G4VisManager.hh.

Member Enumeration Documentation

Enumerator
quiet 
startup 
errors 
warnings 
confirmations 
parameters 
all 

Definition at line 149 of file G4VisManager.hh.

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

Constructor & Destructor Documentation

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

Definition at line 88 of file G4VisManager.cc.

References FatalException, G4cout, G4endl, G4Exception(), G4VisStateDependent, GetVerbosityValue(), RegisterMessenger(), G4VVisManager::SetConcreteInstance(), G4VVisCommand::SetVisManager(), startup, VerbosityGuidanceStrings, and VerbosityString().

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

Definition at line 192 of file G4VisManager.cc.

References G4cout, G4endl, and startup.

192  {
193  fpInstance = 0;
194  size_t i;
195  for (i = 0; i < fSceneList.size (); ++i) {
196  delete fSceneList[i];
197  }
198  for (i = 0; i < fAvailableSceneHandlers.size (); ++i) {
199  if (fAvailableSceneHandlers[i] != NULL) {
200  delete fAvailableSceneHandlers[i];
201  }
202  }
203  for (i = 0; i < fAvailableGraphicsSystems.size (); ++i) {
204  if (fAvailableGraphicsSystems[i]) {
205  delete fAvailableGraphicsSystems[i];
206  }
207  }
208  if (fVerbosity >= startup) {
209  G4cout << "Graphics systems deleted." << G4endl;
210  G4cout << "Visualization Manager deleting..." << G4endl;
211  }
212  for (i = 0; i < fMessengerList.size (); ++i) {
213  delete fMessengerList[i];
214  }
215  for (i = 0; i < fDirectoryList.size (); ++i) {
216  delete fDirectoryList[i];
217  }
218 
219  delete fpDigiFilterMgr;
220  delete fpHitFilterMgr;
221  delete fpTrajFilterMgr;
222  delete fpTrajDrawModelMgr;
223 }
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 656 of file G4VisManager.cc.

References G4Exception(), G4Threading::IsWorkerThread(), and JustWarning.

657 {
658 #ifdef G4MULTITHREADED
659  if (G4Threading::IsWorkerThread()) return;
660 #endif
661  fDrawGroupNestingDepth++;
662  if (fDrawGroupNestingDepth > 1) {
664  ("G4VSceneHandler::BeginDraw",
665  "visman0008", JustWarning,
666  "Nesting detected. It is illegal to nest Begin/EndDraw."
667  "\n Ignored");
668  return;
669  }
670  if (IsValidView ()) {
671  ClearTransientStoreIfMarked();
672  fpSceneHandler -> BeginPrimitives (objectTransform);
673  fIsDrawGroup = true;
674  }
675 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
void G4VisManager::BeginDraw2D ( const G4Transform3D objectTransformation = G4Transform3D())
virtual

Implements G4VVisManager.

Definition at line 693 of file G4VisManager.cc.

References G4Exception(), G4Threading::IsWorkerThread(), and JustWarning.

694 {
695 #ifdef G4MULTITHREADED
696  if (G4Threading::IsWorkerThread()) return;
697 #endif
698  fDrawGroupNestingDepth++;
699  if (fDrawGroupNestingDepth > 1) {
701  ("G4VSceneHandler::BeginDraw2D",
702  "visman0009", JustWarning,
703  "Nesting detected. It is illegal to nest Begin/EndDraw2D."
704  "\n Ignored");
705  return;
706  }
707  if (IsValidView ()) {
708  ClearTransientStoreIfMarked();
709  fpSceneHandler -> BeginPrimitives2D (objectTransform);
710  fIsDrawGroup = true;
711  }
712 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
void G4VisManager::CreateSceneHandler ( const G4String name = "")

Definition at line 941 of file G4VisManager.cc.

References errors, G4cout, G4endl, and Initialise().

941  {
942  if (!fInitialised) Initialise ();
943  if (fpGraphicsSystem) {
944  G4VSceneHandler* pSceneHandler =
945  fpGraphicsSystem -> CreateSceneHandler (name);
946  if (pSceneHandler) {
947  fAvailableSceneHandlers.push_back (pSceneHandler);
948  fpSceneHandler = pSceneHandler; // Make current.
949  }
950  else {
951  if (fVerbosity >= errors) {
952  G4cout << "ERROR in G4VisManager::CreateSceneHandler during "
953  << fpGraphicsSystem -> GetName ()
954  << " scene handler creation.\n No action taken."
955  << G4endl;
956  }
957  }
958  }
959  else PrintInvalidPointers ();
960 }
void Initialise()
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void CreateSceneHandler(const G4String &name="")
void G4VisManager::CreateViewer ( const G4String name = "",
const G4String XGeometry = "" 
)

Definition at line 963 of file G4VisManager.cc.

References G4cout, G4endl, G4ViewParameters::IsCulling(), G4ViewParameters::IsCullingCovered(), G4ViewParameters::IsCullingInvisible(), and G4ViewParameters::SetXGeometryString().

964 {
965 
966  if (!fInitialised) Initialise ();
967 
968  if (!fpSceneHandler) {
969  PrintInvalidPointers ();
970  return;
971  }
972 
973  G4VViewer* p = fpGraphicsSystem -> CreateViewer (*fpSceneHandler, name);
974 
975  if (!p) {
976  if (fVerbosity >= errors) {
977  G4cout << "ERROR in G4VisManager::CreateViewer during "
978  << fpGraphicsSystem -> GetName ()
979  << " viewer creation.\n No action taken."
980  << G4endl;
981  }
982  return;
983  }
984 
985  if (p -> GetViewId() < 0) {
986  if (fVerbosity >= errors) {
987  G4cout << "ERROR in G4VisManager::CreateViewer during "
988  << fpGraphicsSystem -> GetName ()
989  << " viewer initialisation.\n No action taken."
990  << G4endl;
991  }
992  return;
993  }
994 
995  // Viewer is created, now we can set geometry parameters
996  // Before 12/2008, it was done in G4VViewer.cc but it did not have to be there!
997 
998  G4ViewParameters initialvp = p -> GetViewParameters();
999  initialvp.SetXGeometryString(XGeometry); //parse string and store parameters
1000  p -> SetViewParameters(initialvp);
1001  p -> Initialise (); // (Viewer itself may change view parameters further.)
1002 
1003  fpViewer = p; // Make current.
1004  fpSceneHandler -> AddViewerToList (fpViewer);
1005  fpSceneHandler -> SetCurrentViewer (fpViewer);
1006  if (fVerbosity >= confirmations) {
1007  G4cout << "G4VisManager::CreateViewer: new viewer created."
1008  << G4endl;
1009  }
1010 
1011  const G4ViewParameters& vp = fpViewer->GetViewParameters();
1012  if (fVerbosity >= parameters) {
1013  G4cout << " view parameters are:\n " << vp << G4endl;
1014  }
1015 
1016  if (vp.IsCulling () && vp.IsCullingInvisible ()) {
1017  static G4bool warned = false;
1018  if (fVerbosity >= confirmations) {
1019  if (!warned) {
1020  G4cout <<
1021  "NOTE: objects with visibility flag set to \"false\""
1022  " will not be drawn!"
1023  "\n \"/vis/viewer/set/culling global false\" to Draw such objects."
1024  "\n Also see other \"/vis/viewer/set\" commands."
1025  << G4endl;
1026  warned = true;
1027  }
1028  }
1029  }
1030  if (vp.IsCullingCovered ()) {
1031  static G4bool warned = false;
1032  if (fVerbosity >= warnings) {
1033  if (!warned) {
1034  G4cout <<
1035  "WARNING: covered objects in solid mode will not be rendered!"
1036  "\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
1037  "\n Also see other \"/vis/viewer/set\" commands."
1038  << G4endl;
1039  warned = true;
1040  }
1041  }
1042  }
1043 }
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
const G4VTrajectoryModel * G4VisManager::CurrentTrajDrawModel ( ) const

Definition at line 584 of file G4VisManager.cc.

References assert, G4VisModelManager< typename >::Current(), G4cout, G4endl, G4VisModelManager< typename >::Register(), and warnings.

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

585 {
586  assert (0 != fpTrajDrawModelMgr);
587 
588  const G4VTrajectoryModel* model = fpTrajDrawModelMgr->Current();
589 
590  if (0 == model) {
591  // No model was registered with the trajectory model manager.
592  // Use G4TrajectoryDrawByCharge as a default.
593  fpTrajDrawModelMgr->Register(new G4TrajectoryDrawByCharge("AutoGenerated"));
594 
595  if (fVerbosity >= warnings) {
596  G4cout<<"G4VisManager: Using G4TrajectoryDrawByCharge as default trajectory model."<<G4endl;
597  G4cout<<"See commands in /vis/modeling/trajectories/ for other options."<<G4endl;
598  }
599  }
600 
601  model = fpTrajDrawModelMgr->Current();
602  assert (0 != model); // Should definitely exist now
603 
604  return model;
605 }
#define assert(x)
Definition: mymalloc.cc:1309
void Register(Model *)
const Model * Current() const
G4GLOB_DLL std::ostream G4cout
const XML_Char XML_Content * model
#define G4endl
Definition: G4ios.hh:61
void G4VisManager::Disable ( )

Definition at line 529 of file G4VisManager.cc.

References confirmations, G4cout, G4endl, and G4VVisManager::SetConcreteInstance().

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

529  {
531  if (fVerbosity >= confirmations) {
532  G4cout <<
533  "G4VisManager::Disable: visualization disabled."
534  "\n The pointer returned by GetConcreteInstance will be zero."
535  "\n Note that it will become enabled after some valid vis commands."
536  << G4endl;
537  }
538 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
static void SetConcreteInstance(G4VVisManager *)
void G4VisManager::DispatchToModel ( const G4VTrajectory trajectory)
virtual

Implements G4VVisManager.

Definition at line 1164 of file G4VisManager.cc.

References assert, CurrentTrajDrawModel(), G4VTrajectoryModel::Draw(), FilterTrajectory(), G4VisFilterManager< T >::GetMode(), and FilterMode::Soft.

1165 {
1166  G4bool visible(true);
1167 
1168  // See if trajectory passes filter
1169  G4bool passed = FilterTrajectory(trajectory);
1170 
1171  if (!passed) {
1172  // Draw invisible trajectory if trajectory failed filter and
1173  // are filtering in soft mode
1174  if (fpTrajFilterMgr->GetMode() == FilterMode::Soft) visible = false;
1175  else {return;}
1176  }
1177 
1178  // Go on to draw trajectory
1179  assert (0 != fpTrajDrawModelMgr);
1180 
1181  const G4VTrajectoryModel* trajectoryModel = CurrentTrajDrawModel();
1182 
1183  assert (0 != trajectoryModel); // Should exist
1184 
1185  if (IsValidView()) {
1186  trajectoryModel->Draw(trajectory, visible);
1187  }
1188 }
#define assert(x)
Definition: mymalloc.cc:1309
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
void G4VisManager::Draw ( const G4Circle circle,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 776 of file G4VisManager.cc.

Referenced by Draw().

778 {
779  DrawT (circle, objectTransform);
780 }
void G4VisManager::Draw ( const G4Polyhedron polyhedron,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 782 of file G4VisManager.cc.

784 {
785  DrawT (polyhedron, objectTransform);
786 }
void G4VisManager::Draw ( const G4Polyline line,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 788 of file G4VisManager.cc.

790 {
791  DrawT (line, objectTransform);
792 }
void G4VisManager::Draw ( const G4Polymarker polymarker,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 794 of file G4VisManager.cc.

796 {
797  DrawT (polymarker, objectTransform);
798 }
void G4VisManager::Draw ( const G4Scale scale,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 800 of file G4VisManager.cc.

802 {
803  DrawT (scale, objectTransform);
804 }
void G4VisManager::Draw ( const G4Square square,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 806 of file G4VisManager.cc.

808 {
809  DrawT (square, objectTransform);
810 }
void G4VisManager::Draw ( const G4Text text,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 812 of file G4VisManager.cc.

814 {
815  DrawT (text, objectTransform);
816 }
void G4VisManager::Draw ( const G4VTrajectory traj)
virtual

Implements G4VVisManager.

Definition at line 882 of file G4VisManager.cc.

References G4Threading::IsWorkerThread().

882  {
883 #ifdef G4MULTITHREADED
884  if (G4Threading::IsWorkerThread()) return;
885 #endif
886  if (fIsDrawGroup) {
887  fpSceneHandler -> SetModel (&dummyTrajectoriesModel);
888  fpSceneHandler -> AddCompound (traj);
889  } else {
890  if (IsValidView ()) {
891  ClearTransientStoreIfMarked();
892  fpSceneHandler -> SetModel (&dummyTrajectoriesModel);
893  fpSceneHandler -> AddCompound (traj);
894  }
895  }
896 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
void G4VisManager::Draw ( const G4VHit hit)
virtual

Implements G4VVisManager.

Definition at line 854 of file G4VisManager.cc.

References G4Threading::IsWorkerThread().

854  {
855 #ifdef G4MULTITHREADED
856  if (G4Threading::IsWorkerThread()) return;
857 #endif
858  if (fIsDrawGroup) {
859  fpSceneHandler -> AddCompound (hit);
860  } else {
861  if (IsValidView ()) {
862  ClearTransientStoreIfMarked();
863  fpSceneHandler -> AddCompound (hit);
864  }
865  }
866 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
void G4VisManager::Draw ( const G4VDigi digi)
virtual

Implements G4VVisManager.

Definition at line 868 of file G4VisManager.cc.

References G4Threading::IsWorkerThread().

868  {
869 #ifdef G4MULTITHREADED
870  if (G4Threading::IsWorkerThread()) return;
871 #endif
872  if (fIsDrawGroup) {
873  fpSceneHandler -> AddCompound (digi);
874  } else {
875  if (IsValidView ()) {
876  ClearTransientStoreIfMarked();
877  fpSceneHandler -> AddCompound (digi);
878  }
879  }
880 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
void G4VisManager::Draw ( const G4LogicalVolume logicalVol,
const G4VisAttributes attribs,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 898 of file G4VisManager.cc.

References Draw(), G4LogicalVolume::GetSolid(), and G4Threading::IsWorkerThread().

900  {
901 #ifdef G4MULTITHREADED
902  if (G4Threading::IsWorkerThread()) return;
903 #endif
904  // Find corresponding solid.
905  G4VSolid* pSol = logicalVol.GetSolid ();
906  Draw (*pSol, attribs, objectTransform);
907 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
G4VSolid * GetSolid() const
void G4VisManager::Draw ( const G4VPhysicalVolume physicalVol,
const G4VisAttributes attribs,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 929 of file G4VisManager.cc.

References Draw(), G4VPhysicalVolume::GetLogicalVolume(), and G4Threading::IsWorkerThread().

931  {
932  // Find corresponding logical volume and solid.
933 #ifdef G4MULTITHREADED
934  if (G4Threading::IsWorkerThread()) return;
935 #endif
936  G4LogicalVolume* pLV = physicalVol.GetLogicalVolume ();
937  G4VSolid* pSol = pLV -> GetSolid ();
938  Draw (*pSol, attribs, objectTransform);
939 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
G4LogicalVolume * GetLogicalVolume() const
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())
void G4VisManager::Draw ( const G4VSolid solid,
const G4VisAttributes attribs,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 909 of file G4VisManager.cc.

References G4VSolid::DescribeYourselfTo(), and G4Threading::IsWorkerThread().

911  {
912 #ifdef G4MULTITHREADED
913  if (G4Threading::IsWorkerThread()) return;
914 #endif
915  if (fIsDrawGroup) {
916  fpSceneHandler -> PreAddSolid (objectTransform, attribs);
917  solid.DescribeYourselfTo (*fpSceneHandler);
918  fpSceneHandler -> PostAddSolid ();
919  } else {
920  if (IsValidView ()) {
921  ClearTransientStoreIfMarked();
922  fpSceneHandler -> PreAddSolid (objectTransform, attribs);
923  solid.DescribeYourselfTo (*fpSceneHandler);
924  fpSceneHandler -> PostAddSolid ();
925  }
926  }
927 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
virtual void DescribeYourselfTo(G4VGraphicsScene &scene) const =0
void G4VisManager::Draw2D ( const G4Circle circle,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 818 of file G4VisManager.cc.

820 {
821  DrawT2D (circle, objectTransform);
822 }
void G4VisManager::Draw2D ( const G4Polyhedron polyhedron,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 824 of file G4VisManager.cc.

826 {
827  DrawT2D (polyhedron, objectTransform);
828 }
void G4VisManager::Draw2D ( const G4Polyline line,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 830 of file G4VisManager.cc.

832 {
833  DrawT2D (line, objectTransform);
834 }
void G4VisManager::Draw2D ( const G4Polymarker polymarker,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 836 of file G4VisManager.cc.

838 {
839  DrawT2D (polymarker, objectTransform);
840 }
void G4VisManager::Draw2D ( const G4Square square,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 842 of file G4VisManager.cc.

844 {
845  DrawT2D (square, objectTransform);
846 }
void G4VisManager::Draw2D ( const G4Text text,
const G4Transform3D objectTransformation = G4Transform3D() 
)
virtual

Implements G4VVisManager.

Definition at line 848 of file G4VisManager.cc.

850 {
851  DrawT2D (text, objectTransform);
852 }
void G4VisManager::Enable ( )

Definition at line 511 of file G4VisManager.cc.

References confirmations, G4cout, G4endl, G4VVisManager::SetConcreteInstance(), and warnings.

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

511  {
512  if (IsValidView ()) {
513  SetConcreteInstance(this);
514  if (fVerbosity >= confirmations) {
515  G4cout << "G4VisManager::Enable: visualization enabled." << G4endl;
516  }
517  }
518  else {
519  if (fVerbosity >= warnings) {
520  G4cout <<
521  "G4VisManager::Enable: WARNING: visualization remains disabled for"
522  "\n above reasons. Rectifying with valid vis commands will"
523  "\n automatically enable."
524  << G4endl;
525  }
526  }
527 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
static void SetConcreteInstance(G4VVisManager *)
void G4VisManager::EndDraw ( )
virtual

Implements G4VVisManager.

Definition at line 677 of file G4VisManager.cc.

References G4Threading::IsWorkerThread().

678 {
679 #ifdef G4MULTITHREADED
680  if (G4Threading::IsWorkerThread()) return;
681 #endif
682  fDrawGroupNestingDepth--;
683  if (fDrawGroupNestingDepth != 0) {
684  if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
685  return;
686  }
687  if (IsValidView ()) {
688  fpSceneHandler -> EndPrimitives ();
689  }
690  fIsDrawGroup = false;
691 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
void G4VisManager::EndDraw2D ( )
virtual

Implements G4VVisManager.

Definition at line 714 of file G4VisManager.cc.

References G4Threading::IsWorkerThread().

715 {
716 #ifdef G4MULTITHREADED
717  if (G4Threading::IsWorkerThread()) return;
718 #endif
719  fDrawGroupNestingDepth--;
720  if (fDrawGroupNestingDepth != 0) {
721  if (fDrawGroupNestingDepth < 0) fDrawGroupNestingDepth = 0;
722  return;
723  }
724  if (IsValidView ()) {
725  fpSceneHandler -> EndPrimitives2D ();
726  }
727  fIsDrawGroup = false;
728 }
G4bool IsWorkerThread()
Definition: G4Threading.cc:104
G4bool G4VisManager::FilterDigi ( const G4VDigi digi)
virtual

Implements G4VVisManager.

Definition at line 1159 of file G4VisManager.cc.

References G4VisFilterManager< T >::Accept().

1160 {
1161  return fpDigiFilterMgr->Accept(digi);
1162 }
bool Accept(const T &)
G4bool G4VisManager::FilterHit ( const G4VHit hit)
virtual

Implements G4VVisManager.

Definition at line 1154 of file G4VisManager.cc.

References G4VisFilterManager< T >::Accept().

1155 {
1156  return fpHitFilterMgr->Accept(hit);
1157 }
bool Accept(const T &)
G4bool G4VisManager::FilterTrajectory ( const G4VTrajectory trajectory)
virtual

Implements G4VVisManager.

Definition at line 1149 of file G4VisManager.cc.

References G4VisFilterManager< T >::Accept().

Referenced by DispatchToModel().

1150 {
1151  return fpTrajFilterMgr->Accept(trajectory);
1152 }
bool Accept(const T &)
void G4VisManager::GeometryHasChanged ( )
virtual

Implements G4VVisManager.

Definition at line 1045 of file G4VisManager.cc.

References G4Scene::CalculateExtent(), confirmations, G4cout, G4endl, G4Scene::GetName(), G4TransportationManager::GetTransportationManager(), G4UImanager::GetUIpointer(), and warnings.

1045  {
1046  if (fVerbosity >= confirmations) {
1047  G4cout << "G4VisManager::GeometryHasChanged() called." << G4endl;
1048  }
1049 
1050  // Change the world...
1051  G4VPhysicalVolume* pWorld =
1053  -> GetNavigatorForTracking () -> GetWorldVolume ();
1054  if (!pWorld) {
1055  if (fVerbosity >= warnings) {
1056  G4cout << "WARNING: There is no world volume!" << G4endl;
1057  }
1058  }
1059 
1060  // Check scenes.
1061  G4SceneList& sceneList = fSceneList;
1062  G4int iScene, nScenes = sceneList.size ();
1063  for (iScene = 0; iScene < nScenes; iScene++) {
1064  G4Scene* pScene = sceneList [iScene];
1065  std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1066  if (modelList.size ()) {
1067  G4bool modelInvalid;
1068  do { // Remove, if required, one at a time.
1069  modelInvalid = false;
1070  std::vector<G4Scene::Model>::iterator iterModel;
1071  for (iterModel = modelList.begin();
1072  iterModel != modelList.end();
1073  ++iterModel) {
1074  modelInvalid = !(iterModel->fpModel->Validate(fVerbosity>=warnings));
1075  if (modelInvalid) {
1076  // Model invalid - remove and break.
1077  if (fVerbosity >= warnings) {
1078  G4cout << "WARNING: Model \""
1079  << iterModel->fpModel->GetGlobalDescription ()
1080  <<
1081  "\" is no longer valid - being removed\n from scene \""
1082  << pScene -> GetName () << "\""
1083  << G4endl;
1084  }
1085  modelList.erase (iterModel);
1086  break;
1087  }
1088  }
1089  } while (modelInvalid);
1090 
1091  if (modelList.size () == 0) {
1092  if (fVerbosity >= warnings) {
1093  G4cout << "WARNING: No models left in this scene \""
1094  << pScene -> GetName ()
1095  << "\"."
1096  << G4endl;
1097  }
1098  }
1099  else {
1100  pScene->CalculateExtent();
1102  ApplyCommand (G4String("/vis/scene/notifyHandlers " + pScene->GetName()));
1103  }
1104  }
1105  }
1106 
1107  // Check the manager's current scene...
1108  if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1109  if (fVerbosity >= warnings) {
1110  G4cout << "WARNING: The current scene \""
1111  << fpScene -> GetName ()
1112  << "\" has no models."
1113  << G4endl;
1114  }
1115  }
1116 }
const G4String & GetName() const
int G4int
Definition: G4Types.hh:78
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
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
G4bool G4VisManager::GetAbortReviewKeptEvents ( ) const
const G4GraphicsSystemList & G4VisManager::GetAvailableGraphicsSystems ( )

Definition at line 540 of file G4VisManager.cc.

References G4cout, G4endl, and warnings.

Referenced by G4VisCommandOpen::G4VisCommandOpen().

540  {
541  G4int nSystems = fAvailableGraphicsSystems.size ();
542  if (nSystems == 0) {
543  if (fVerbosity >= warnings) {
544  G4cout << "G4VisManager::GetAvailableGraphicsSystems: WARNING: no"
545  "\n graphics system available!"
546  "\n 1) Did you have environment variables G4VIS_BUILD_xxxx_DRIVER set"
547  "\n when you compiled/built the visualization code?"
548  "\n 2) Did you instantiate your own Visualization Manager and forget"
549  "\n to implement RegisterGraphicsSystems correctly?"
550  "\n 3) You can register your own graphics system, e.g.,"
551  "\n visManager->RegisterGraphicsSystem(new MyGraphicsSystem);)"
552  "\n after instantiating your vis manager and before"
553  "\n visManager->Initialize()."
554  << G4endl;
555  }
556  }
557  return fAvailableGraphicsSystems;
558 }
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
G4Scene* G4VisManager::GetCurrentScene ( ) const
G4VSceneHandler* G4VisManager::GetCurrentSceneHandler ( ) const
G4VViewer* G4VisManager::GetCurrentViewer ( ) const
const G4ViewParameters& G4VisManager::GetDefaultViewParameters ( ) const
const std::vector<UserVisAction>& G4VisManager::GetEndOfEventUserVisActions ( ) const
const std::vector<UserVisAction>& G4VisManager::GetEndOfRunUserVisActions ( ) const
const G4Event* G4VisManager::GetRequestedEvent ( ) const
const std::vector<UserVisAction>& G4VisManager::GetRunDurationUserVisActions ( ) const
const G4SceneList& G4VisManager::GetSceneList ( ) const
G4bool G4VisManager::GetTransientsDrawnThisEvent ( ) const
G4bool G4VisManager::GetTransientsDrawnThisRun ( ) const
const std::map<G4VUserVisAction*,G4VisExtent>& G4VisManager::GetUserVisActionExtents ( ) const
G4VisManager::Verbosity G4VisManager::GetVerbosity ( )
static

Definition at line 2077 of file G4VisManager.cc.

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

2077  {
2078  return fVerbosity;
2079 }
G4VisManager::Verbosity G4VisManager::GetVerbosityValue ( const G4String verbosityString)
static

Definition at line 2038 of file G4VisManager.cc.

References all, confirmations, errors, G4cout, G4endl, parameters, quiet, startup, G4String::toLower(), VerbosityGuidanceStrings, VerbosityString(), and warnings.

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

2038  {
2039  G4String ss(verbosityString); ss.toLower();
2040  Verbosity verbosity;
2041  if (ss(0) == 'q') verbosity = quiet;
2042  else if (ss(0) == 's') verbosity = startup;
2043  else if (ss(0) == 'e') verbosity = errors;
2044  else if (ss(0) == 'w') verbosity = warnings;
2045  else if (ss(0) == 'c') verbosity = confirmations;
2046  else if (ss(0) == 'p') verbosity = parameters;
2047  else if (ss(0) == 'a') verbosity = all;
2048  else {
2049  G4int intVerbosity;
2050  std::istringstream is(ss);
2051  is >> intVerbosity;
2052  if (!is) {
2053  G4cout << "ERROR: G4VisManager::GetVerbosityValue: invalid verbosity \""
2054  << verbosityString << "\"";
2055  for (size_t i = 0; i < VerbosityGuidanceStrings.size(); ++i) {
2056  G4cout << '\n' << VerbosityGuidanceStrings[i];
2057  }
2058  verbosity = warnings;
2059  G4cout << "\n Returning " << VerbosityString(verbosity)
2060  << G4endl;
2061  }
2062  else {
2063  verbosity = GetVerbosityValue(intVerbosity);
2064  }
2065  }
2066  return verbosity;
2067 }
static std::vector< G4String > VerbosityGuidanceStrings
int G4int
Definition: G4Types.hh:78
static Verbosity GetVerbosityValue(const G4String &)
G4GLOB_DLL std::ostream G4cout
static G4String VerbosityString(Verbosity)
#define G4endl
Definition: G4ios.hh:61
G4VisManager::Verbosity G4VisManager::GetVerbosityValue ( G4int  intVerbosity)
static

Definition at line 2069 of file G4VisManager.cc.

References all, and quiet.

2069  {
2070  Verbosity verbosity;
2071  if (intVerbosity < quiet) verbosity = quiet;
2072  else if (intVerbosity > all) verbosity = all;
2073  else verbosity = Verbosity(intVerbosity);
2074  return verbosity;
2075 }
G4VViewer * G4VisManager::GetViewer ( const G4String viewerName) const

Definition at line 1999 of file G4VisManager.cc.

References ViewerShortName().

1999  {
2000  G4String viewerShortName = ViewerShortName (viewerName);
2001  size_t nHandlers = fAvailableSceneHandlers.size ();
2002  size_t iHandler, iViewer;
2003  G4VViewer* viewer = 0;
2004  G4bool found = false;
2005  for (iHandler = 0; iHandler < nHandlers; iHandler++) {
2006  G4VSceneHandler* sceneHandler = fAvailableSceneHandlers [iHandler];
2007  const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
2008  for (iViewer = 0; iViewer < viewerList.size (); iViewer++) {
2009  viewer = viewerList [iViewer];
2010  if (viewerShortName == viewer -> GetShortName ()) {
2011  found = true;
2012  break;
2013  }
2014  }
2015  if (found) break;
2016  }
2017  if (found) return viewer;
2018  else return 0;
2019 }
G4String ViewerShortName(const G4String &viewerName) const
bool G4bool
Definition: G4Types.hh:79
void G4VisManager::Initialise ( )

Definition at line 234 of file G4VisManager.cc.

References G4cout, G4endl, parameters, PrintAvailableGraphicsSystems(), RegisterGraphicsSystems(), RegisterMessengers(), RegisterModelFactories(), startup, and warnings.

Referenced by CreateSceneHandler(), and main().

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

Reimplemented from G4VVisManager.

Definition at line 1118 of file G4VisManager.cc.

References G4Scene::CalculateExtent(), confirmations, G4cout, G4endl, G4Scene::GetName(), G4UImanager::GetUIpointer(), and warnings.

1118  {
1119 
1120  if (fVerbosity >= confirmations) {
1121  G4cout << "G4VisManager::NotifyHandler() called." << G4endl;
1122  }
1123 
1124  // Check scenes.
1125  G4SceneList& sceneList = fSceneList;
1126  G4int iScene, nScenes = sceneList.size ();
1127  for (iScene = 0; iScene < nScenes; iScene++) {
1128  G4Scene* pScene = sceneList [iScene];
1129  std::vector<G4Scene::Model>& modelList = pScene -> SetRunDurationModelList ();
1130 
1131  if (modelList.size ()) {
1132  pScene->CalculateExtent();
1134  ApplyCommand (G4String("/vis/scene/notifyHandlers " + pScene->GetName()));
1135  }
1136  }
1137 
1138  // Check the manager's current scene...
1139  if (fpScene && fpScene -> GetRunDurationModelList ().size () == 0) {
1140  if (fVerbosity >= warnings) {
1141  G4cout << "WARNING: The current scene \""
1142  << fpScene -> GetName ()
1143  << "\" has no models."
1144  << G4endl;
1145  }
1146  }
1147 }
const G4String & GetName() const
int G4int
Definition: G4Types.hh:78
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
void CalculateExtent()
Definition: G4Scene.cc:72
#define G4endl
Definition: G4ios.hh:61
void G4VisManager::PrintAvailableGraphicsSystems ( ) const
protected

Definition at line 1373 of file G4VisManager.cc.

References G4cout, G4endl, G4VGraphicsSystem::GetName(), and G4VGraphicsSystem::GetNickname().

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

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

Definition at line 1207 of file G4VisManager.cc.

References G4cout, G4endl, and G4VisExtent::GetExtentRadius().

1209  {
1210  fEndOfEventUserVisActions.push_back(UserVisAction(name,pVisAction));
1211  if (extent.GetExtentRadius() > 0.) {
1212  fUserVisActionExtents[pVisAction] = extent;
1213  } else {
1214  if (fVerbosity >= warnings) {
1215  G4cout <<
1216  "WARNING: No extent set for user vis action \"" << name << "\"."
1217  << G4endl;
1218  }
1219  }
1220 }
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:73
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4VisManager::RegisterEndOfRunUserVisAction ( const G4String name,
G4VUserVisAction pVisAction,
const G4VisExtent extent = G4VisExtent::NullExtent 
)

Definition at line 1223 of file G4VisManager.cc.

References G4cout, G4endl, and G4VisExtent::GetExtentRadius().

1225  {
1226  fEndOfRunUserVisActions.push_back(UserVisAction(name,pVisAction));
1227  if (extent.GetExtentRadius() > 0.) {
1228  fUserVisActionExtents[pVisAction] = extent;
1229  } else {
1230  if (fVerbosity >= warnings) {
1231  G4cout <<
1232  "WARNING: No extent set for user vis action \"" << name << "\"."
1233  << G4endl;
1234  }
1235  }
1236 }
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:73
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4bool G4VisManager::RegisterGraphicsSystem ( G4VGraphicsSystem pSystem)

Definition at line 560 of file G4VisManager.cc.

References confirmations, errors, G4cout, and G4endl.

Referenced by export_G4VisManager().

560  {
561  G4bool happy = true;
562  if (pSystem) {
563  fAvailableGraphicsSystems.push_back (pSystem);
564  if (fVerbosity >= confirmations) {
565  G4cout << "G4VisManager::RegisterGraphicsSystem: "
566  << pSystem -> GetName ();
567  if (pSystem -> GetNickname () != "") {
568  G4cout << " (" << pSystem -> GetNickname () << ")";
569  }
570  G4cout << " registered." << G4endl;
571  }
572  }
573  else {
574  if (fVerbosity >= errors) {
575  G4cout << "G4VisManager::RegisterGraphicsSystem: null pointer!"
576  << G4endl;
577  }
578  happy=false;
579  }
580  return happy;
581 }
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61
virtual void G4VisManager::RegisterGraphicsSystems ( )
protectedpure virtual

Implemented in PyG4VisManager.

Referenced by Initialise().

void G4VisManager::RegisterMessenger ( G4UImessenger messenger)

Referenced by G4VisManager(), and RegisterMessengers().

void G4VisManager::RegisterMessengers ( )
protected

Definition at line 345 of file G4VisManager.cc.

References G4VisModelManager< typename >::Placement(), G4VisFilterManager< T >::Placement(), and RegisterMessenger().

Referenced by Initialise().

345  {
346 
347  // Instantiate individual messengers/commands (often - but not
348  // always - one command per messenger).
349 
350  G4UIcommand* directory;
351 
352  // *Basic* top level commands were instantiated in the constructor
353  // so that they can be used immediately after instantiation of the
354  // vis manager. Other top level and lower level commands are
355  // instantiated here.
356 
357  // Other top level commands...
362 
363  // Compound commands...
369 
370  directory = new G4UIdirectory ("/vis/geometry/");
371  directory -> SetGuidance("Operations on vis attributes of Geant4 geometry.");
372  fDirectoryList.push_back (directory);
375 
376  directory = new G4UIdirectory ("/vis/geometry/set/");
377  directory -> SetGuidance("Set vis attributes of Geant4 geometry.");
378  fDirectoryList.push_back (directory);
388 
389  directory = new G4UIdirectory ("/vis/set/");
390  directory -> SetGuidance
391  ("Set quantities for use in future commands where appropriate.");
392  fDirectoryList.push_back (directory);
398 
399  directory = new G4UIdirectory ("/vis/scene/");
400  directory -> SetGuidance ("Operations on Geant4 scenes.");
401  fDirectoryList.push_back (directory);
409 
410  directory = new G4UIdirectory ("/vis/scene/add/");
411  directory -> SetGuidance ("Add model to current scene.");
412  fDirectoryList.push_back (directory);
434 
435  directory = new G4UIdirectory ("/vis/sceneHandler/");
436  directory -> SetGuidance ("Operations on Geant4 scene handlers.");
437  fDirectoryList.push_back (directory);
442 
443  directory = new G4UIdirectory ("/vis/touchable/");
444  directory -> SetGuidance ("Operations on touchables.");
445  fDirectoryList.push_back (directory);
446  directory = new G4UIdirectory ("/vis/touchable/set/");
447  directory -> SetGuidance ("Set vis attributes of current touchable.");
448  fDirectoryList.push_back (directory);
450 
451  directory = new G4UIdirectory ("/vis/viewer/");
452  directory -> SetGuidance ("Operations on Geant4 viewers.");
453  fDirectoryList.push_back (directory);
474 
475  directory = new G4UIdirectory ("/vis/viewer/default/");
476  directory -> SetGuidance("Set default values for future viewers.");
477  fDirectoryList.push_back (directory);
480 
481  directory = new G4UIdirectory ("/vis/viewer/set/");
482  directory -> SetGuidance ("Set view parameters of current viewer.");
483  fDirectoryList.push_back (directory);
485 
486  // List manager commands
488  (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
490  (fpTrajDrawModelMgr, fpTrajDrawModelMgr->Placement()));
491 
492  // Trajectory filter manager commands
494  (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
496  (fpTrajFilterMgr, fpTrajFilterMgr->Placement()));
497 
498  // Hit filter manager commands
500  (fpHitFilterMgr, fpHitFilterMgr->Placement()));
502  (fpHitFilterMgr, fpHitFilterMgr->Placement()));
503 
504  // Digi filter manager commands
506  (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
508  (fpDigiFilterMgr, fpDigiFilterMgr->Placement()));
509 }
G4String Placement() const
void RegisterMessenger(G4UImessenger *messenger)
G4String Placement() const
void G4VisManager::RegisterModel ( G4VTrajectoryModel model)

Definition at line 607 of file G4VisManager.cc.

References G4VisModelManager< typename >::Register().

608 {
609  fpTrajDrawModelMgr->Register(model);
610 }
void Register(Model *)
void G4VisManager::RegisterModel ( G4VFilter< G4VTrajectory > *  filter)

Definition at line 618 of file G4VisManager.cc.

References G4VisFilterManager< T >::Register().

619 {
620  fpTrajFilterMgr->Register(model);
621 }
const XML_Char XML_Content * model
void G4VisManager::RegisterModel ( G4VFilter< G4VHit > *  filter)

Definition at line 629 of file G4VisManager.cc.

References G4VisFilterManager< T >::Register().

630 {
631  fpHitFilterMgr->Register(model);
632 }
const XML_Char XML_Content * model
void G4VisManager::RegisterModel ( G4VFilter< G4VDigi > *  filter)

Definition at line 640 of file G4VisManager.cc.

References G4VisFilterManager< T >::Register().

641 {
642  fpDigiFilterMgr->Register(model);
643 }
const XML_Char XML_Content * model
void G4VisManager::RegisterModelFactories ( )
protectedvirtual

Reimplemented in PyG4VisManager.

Definition at line 2199 of file G4VisManager.cc.

References G4cout, G4endl, and warnings.

Referenced by Initialise().

2200 {
2201  if (fVerbosity >= warnings) {
2202  G4cout<<"G4VisManager: No model factories registered with G4VisManager."<<G4endl;
2203  G4cout<<"G4VisManager::RegisterModelFactories() should be overridden in derived"<<G4endl;
2204  G4cout<<"class. See G4VisExecutive for an example."<<G4endl;
2205  }
2206 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4VisManager::RegisterModelFactory ( G4TrajDrawModelFactory factory)

Definition at line 613 of file G4VisManager.cc.

References G4VisModelManager< typename >::Register().

614 {
615  fpTrajDrawModelMgr->Register(factory);
616 }
void Register(Model *)
void G4VisManager::RegisterModelFactory ( G4TrajFilterFactory factory)

Definition at line 624 of file G4VisManager.cc.

References G4VisFilterManager< T >::Register().

625 {
626  fpTrajFilterMgr->Register(factory);
627 }
void G4VisManager::RegisterModelFactory ( G4HitFilterFactory factory)

Definition at line 635 of file G4VisManager.cc.

References G4VisFilterManager< T >::Register().

636 {
637  fpHitFilterMgr->Register(factory);
638 }
void G4VisManager::RegisterModelFactory ( G4DigiFilterFactory factory)

Definition at line 646 of file G4VisManager.cc.

References G4VisFilterManager< T >::Register().

647 {
648  fpDigiFilterMgr->Register(factory);
649 }
void G4VisManager::RegisterRunDurationUserVisAction ( const G4String name,
G4VUserVisAction pVisAction,
const G4VisExtent extent = G4VisExtent::NullExtent 
)

Definition at line 1191 of file G4VisManager.cc.

References G4cout, G4endl, and G4VisExtent::GetExtentRadius().

Referenced by main().

1193  {
1194  fRunDurationUserVisActions.push_back(UserVisAction(name,pVisAction));
1195  if (extent.GetExtentRadius() > 0.) {
1196  fUserVisActionExtents[pVisAction] = extent;
1197  } else {
1198  if (fVerbosity >= warnings) {
1199  G4cout <<
1200  "WARNING: No extent set for user vis action \"" << name << "\"."
1201  << G4endl;
1202  }
1203  }
1204 }
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:73
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4VisManager::ResetTransientsDrawnFlags ( )

Definition at line 1981 of file G4VisManager.cc.

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

1982 {
1983  fTransientsDrawnThisRun = false;
1984  fTransientsDrawnThisEvent = false;
1986  for (i = fAvailableSceneHandlers.begin();
1987  i != fAvailableSceneHandlers.end(); ++i) {
1988  (*i)->SetTransientsDrawnThisEvent(false);
1989  (*i)->SetTransientsDrawnThisRun(false);
1990  }
1991 }
std::vector< G4VSceneHandler * >::const_iterator G4SceneHandlerListConstIterator
void G4VisManager::SelectTrajectoryModel ( const G4String model)

Definition at line 651 of file G4VisManager.cc.

References G4VisModelManager< typename >::SetCurrent().

652 {
653  fpTrajDrawModelMgr->SetCurrent(model);
654 }
void SetCurrent(const G4String &)
void G4VisManager::SetAbortReviewKeptEvents ( G4bool  )
G4SceneHandlerList& G4VisManager::SetAvailableSceneHandlers ( )
void G4VisManager::SetCurrentGraphicsSystem ( G4VGraphicsSystem pSystem)

Definition at line 1247 of file G4VisManager.cc.

References confirmations, G4cout, and G4endl.

Referenced by G4VisCommandDrawTree::SetNewValue().

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

Definition at line 1238 of file G4VisManager.cc.

References ResetTransientsDrawnFlags().

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

1238  {
1239  if (pScene != fpScene) {
1240  // A change of scene. Therefore reset transients drawn flags. All
1241  // memory of previous transient proceessing thereby erased...
1243  }
1244  fpScene = pScene;
1245 }
void ResetTransientsDrawnFlags()
void G4VisManager::SetCurrentSceneHandler ( G4VSceneHandler pSceneHandler)

Definition at line 1294 of file G4VisManager.cc.

References confirmations, G4cout, G4endl, and warnings.

Referenced by G4VisCommandDrawTree::SetNewValue().

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

Definition at line 1346 of file G4VisManager.cc.

References confirmations, G4cout, G4endl, and warnings.

Referenced by G4VisCommandDrawTree::SetNewValue().

1346  {
1347  fpViewer = pViewer;
1348  if (fVerbosity >= confirmations) {
1349  G4cout << "G4VisManager::SetCurrentViewer: viewer now "
1350  << pViewer -> GetName ()
1351  << G4endl;
1352  }
1353  fpSceneHandler = fpViewer -> GetSceneHandler ();
1354  fpSceneHandler -> SetCurrentViewer (pViewer);
1355  fpScene = fpSceneHandler -> GetScene ();
1356  fpGraphicsSystem = fpSceneHandler -> GetGraphicsSystem ();
1357  if (!IsValidView ()) {
1358  if (fVerbosity >= warnings) {
1359  G4cout <<
1360  "WARNING: Problem setting viewer - please report circumstances."
1361  << G4endl;
1362  }
1363  }
1364 }
G4GLOB_DLL std::ostream G4cout
void SetCurrentViewer(G4VViewer *)
#define G4endl
Definition: G4ios.hh:61
void G4VisManager::SetDefaultViewParameters ( const G4ViewParameters )
void G4VisManager::SetEventRefreshing ( G4bool  )
void G4VisManager::SetRequestedEvent ( const G4Event )
G4SceneList& G4VisManager::SetSceneList ( )
void G4VisManager::SetUserAction ( G4VUserVisAction pVisAction,
const G4VisExtent = G4VisExtent::NullExtent 
)

Referenced by main().

void G4VisManager::SetUserActionExtent ( const G4VisExtent )
void G4VisManager::SetVerboseLevel ( G4int  intVerbosity)

Definition at line 2081 of file G4VisManager.cc.

References GetVerbosityValue().

Referenced by main(), and G4VisCommandVerbose::SetNewValue().

2081  {
2082  fVerbosity = GetVerbosityValue(intVerbosity);
2083 }
static Verbosity GetVerbosityValue(const G4String &)
void G4VisManager::SetVerboseLevel ( const G4String verbosityString)

Definition at line 2085 of file G4VisManager.cc.

References GetVerbosityValue().

2085  {
2086  fVerbosity = GetVerbosityValue(verbosityString);
2087 }
static Verbosity GetVerbosityValue(const G4String &)
void G4VisManager::SetVerboseLevel ( Verbosity  )
G4String G4VisManager::VerbosityString ( Verbosity  verbosity)
static

Definition at line 2023 of file G4VisManager.cc.

References all, confirmations, errors, parameters, quiet, startup, and warnings.

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

2023  {
2024  G4String rs;
2025  switch (verbosity) {
2026  case quiet: rs = "quiet (0)"; break;
2027  case startup: rs = "startup (1)"; break;
2028  case errors: rs = "errors (2)"; break;
2029  case warnings: rs = "warnings (3)"; break;
2030  case confirmations: rs = "confirmations (4)"; break;
2031  case parameters: rs = "parameters (5)"; break;
2032  case all: rs = "all (6)"; break;
2033  }
2034  return rs;
2035 }
G4String G4VisManager::ViewerShortName ( const G4String viewerName) const

Definition at line 1993 of file G4VisManager.cc.

References G4String::strip().

Referenced by GetViewer().

1993  {
1994  G4String viewerShortName (viewerName);
1995  viewerShortName = viewerShortName (0, viewerShortName.find (' '));
1996  return viewerShortName.strip ();
1997 }

Friends And Related Function Documentation

friend class G4HepRepFileSceneHandler
friend

Definition at line 135 of file G4VisManager.hh.

friend class G4OpenGLViewerMessenger
friend

Definition at line 133 of file G4VisManager.hh.

friend class G4OpenGLXmViewerMessenger
friend

Definition at line 134 of file G4VisManager.hh.

friend class G4RayTracerSceneHandler
friend

Definition at line 131 of file G4VisManager.hh.

friend class G4RayTrajectory
friend

Definition at line 130 of file G4VisManager.hh.

friend class G4RTMessenger
friend

Definition at line 132 of file G4VisManager.hh.

friend class G4RTSteppingAction
friend

Definition at line 129 of file G4VisManager.hh.

friend class G4VisCommandList
friend

Definition at line 141 of file G4VisManager.hh.

friend class G4VisStateDependent
friend

Definition at line 140 of file G4VisManager.hh.

Referenced by G4VisManager().

friend class G4VSceneHandler
friend

Definition at line 138 of file G4VisManager.hh.

friend class G4VViewer
friend

Definition at line 139 of file G4VisManager.hh.

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

Definition at line 68 of file G4VGraphicsSystem.cc.

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

933  {
934 
935  os << "Scene handler " << sh.fName << " has "
936  << sh.fViewerList.size () << " viewer(s):";
937  for (size_t i = 0; i < sh.fViewerList.size (); i++) {
938  os << "\n " << *(sh.fViewerList [i]);
939  }
940 
941  if (sh.fpScene) {
942  os << "\n " << *sh.fpScene;
943  }
944  else {
945  os << "\n This scene handler currently has no scene.";
946  }
947 
948  return os;
949 }
G4ViewerList fViewerList

Field Documentation

G4bool G4VisManager::fIgnoreStateChanges
protected

Definition at line 530 of file G4VisManager.hh.

const G4int G4VisManager::fVerbose
protected

Definition at line 453 of file G4VisManager.hh.

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

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