Geant4  10.02.p03
G4VisCommandSceneAddTrajectories Class Reference

#include <G4VisCommandsSceneAdd.hh>

Inheritance diagram for G4VisCommandSceneAddTrajectories:
Collaboration diagram for G4VisCommandSceneAddTrajectories:

Public Member Functions

 G4VisCommandSceneAddTrajectories ()
 
virtual ~G4VisCommandSceneAddTrajectories ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandScene
 G4VVisCommandScene ()
 
virtual ~G4VVisCommandScene ()
 
- Public Member Functions inherited from G4VVisCommand
 G4VVisCommand ()
 
virtual ~G4VVisCommand ()
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Member Functions

 G4VisCommandSceneAddTrajectories (const G4VisCommandSceneAddTrajectories &)
 
G4VisCommandSceneAddTrajectoriesoperator= (const G4VisCommandSceneAddTrajectories &)
 

Private Attributes

G4UIcmdWithAStringfpCommand
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
static const G4ColourGetCurrentColour ()
 
static G4double GetCurrentLineWidth ()
 
static const G4ColourGetCurrentTextColour ()
 
static G4Text::Layout GetCurrentTextLayout ()
 
static G4double GetCurrentTextSize ()
 
- Protected Member Functions inherited from G4VVisCommandScene
G4String CurrentSceneName ()
 
- Protected Member Functions inherited from G4VVisCommand
void UpdateVisManagerScene (const G4String &sceneName="")
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Static Protected Member Functions inherited from G4VVisCommand
static G4String ConvertToString (G4double x, G4double y, const char *unitName)
 
static void ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4double fCurrentLineWidth = 1.
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentTextSize = 12.
 
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
 

Detailed Description

Definition at line 385 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddTrajectories() [1/2]

G4VisCommandSceneAddTrajectories::G4VisCommandSceneAddTrajectories ( )

Definition at line 2439 of file G4VisCommandsSceneAdd.cc.

2439  {
2440  G4bool omitable;
2442  ("/vis/scene/add/trajectories", this);
2443  fpCommand -> SetGuidance
2444  ("Adds trajectories to current scene.");
2445  fpCommand -> SetGuidance
2446  ("Causes trajectories, if any, to be drawn at the end of processing an"
2447  "\nevent. Switches on trajectory storing and sets the"
2448  "\ndefault trajectory type.");
2449  fpCommand -> SetGuidance
2450  ("The command line parameter list determines the default trajectory type."
2451  "\nIf it contains the string \"smooth\", auxiliary inter-step points will"
2452  "\nbe inserted to improve the smoothness of the drawing of a curved"
2453  "\ntrajectory."
2454  "\nIf it contains the string \"rich\", significant extra information will"
2455  "\nbe stored in the trajectory (G4RichTrajectory) amenable to modeling"
2456  "\nand filtering with \"/vis/modeling/trajectories/create/drawByAttribute\""
2457  "\nand \"/vis/filtering/trajectories/create/attributeFilter\" commands."
2458  "\nIt may contain both strings in any order.");
2459  fpCommand -> SetGuidance
2460  ("\nTo switch off trajectory storing: \"/tracking/storeTrajectory 0\"."
2461  "\nSee also \"/vis/scene/endOfEventAction\".");
2462  fpCommand -> SetGuidance
2463  ("Note: This only sets the default. Independently of the result of this"
2464  "\ncommand, a user may instantiate a trajectory that overrides this default"
2465  "\nin PreUserTrackingAction.");
2466  fpCommand -> SetParameterName ("default-trajectory-type", omitable = true);
2467  fpCommand -> SetDefaultValue ("");
2468 }
bool G4bool
Definition: G4Types.hh:79

◆ ~G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::~G4VisCommandSceneAddTrajectories ( )
virtual

Definition at line 2470 of file G4VisCommandsSceneAdd.cc.

2470  {
2471  delete fpCommand;
2472 }

◆ G4VisCommandSceneAddTrajectories() [2/2]

G4VisCommandSceneAddTrajectories::G4VisCommandSceneAddTrajectories ( const G4VisCommandSceneAddTrajectories )
private

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneAddTrajectories::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2474 of file G4VisCommandsSceneAdd.cc.

2474  {
2475  return "";
2476 }

◆ operator=()

G4VisCommandSceneAddTrajectories& G4VisCommandSceneAddTrajectories::operator= ( const G4VisCommandSceneAddTrajectories )
private

◆ SetNewValue()

void G4VisCommandSceneAddTrajectories::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 2478 of file G4VisCommandsSceneAdd.cc.

2479  {
2480 
2482  G4bool warn = verbosity >= G4VisManager::warnings;
2483 
2484  G4Scene* pScene = fpVisManager->GetCurrentScene();
2485  if (!pScene) {
2486  if (verbosity >= G4VisManager::errors) {
2487  G4cerr << "ERROR: No current scene. Please create one." << G4endl;
2488  }
2489  return;
2490  }
2491 
2492  G4bool smooth = false;
2493  G4bool rich = false;
2494  if (newValue.find("smooth") != std::string::npos) smooth = true;
2495  if (newValue.find("rich") != std::string::npos) rich = true;
2496  if (newValue.size() && !(rich || smooth)) {
2497  if (verbosity >= G4VisManager::errors) {
2498  G4cerr << "ERROR: Unrecognised parameter \"" << newValue << "\""
2499  "\n No action taken."
2500  << G4endl;
2501  }
2502  return;
2503  }
2504 
2505  G4UImanager* UImanager = G4UImanager::GetUIpointer();
2506  G4int keepVerbose = UImanager->GetVerboseLevel();
2507  G4int newVerbose = 2;
2508  UImanager->SetVerboseLevel(newVerbose);
2509  G4String defaultTrajectoryType;
2510  if (smooth && rich) {
2511  UImanager->ApplyCommand("/tracking/storeTrajectory 4");
2512  defaultTrajectoryType = "G4RichTrajectory configured for smooth steps";
2513  } else if (smooth) {
2514  UImanager->ApplyCommand("/tracking/storeTrajectory 2");
2515  defaultTrajectoryType = "G4SmoothTrajectory";
2516  } else if (rich) {
2517  UImanager->ApplyCommand("/tracking/storeTrajectory 3");
2518  defaultTrajectoryType = "G4RichTrajectory";
2519  } else {
2520  UImanager->ApplyCommand("/tracking/storeTrajectory 1");
2521  defaultTrajectoryType = "G4Trajectory";
2522  }
2523  UImanager->SetVerboseLevel(keepVerbose);
2524 
2525  if (verbosity >= G4VisManager::errors) {
2526  G4cout <<
2527  "Attributes available for modeling and filtering with"
2528  "\n \"/vis/modeling/trajectories/create/drawByAttribute\" and"
2529  "\n \"/vis/filtering/trajectories/create/attributeFilter\" commands:"
2530  << G4endl;
2532  if (rich) {
2535  } else if (smooth) {
2538  } else {
2540  << *G4TrajectoryPoint().GetAttDefs();
2541  }
2542  }
2543 
2545  const G4String& currentSceneName = pScene -> GetName ();
2546  pScene -> AddEndOfEventModel (model, warn);
2547 
2548  if (verbosity >= G4VisManager::confirmations) {
2549  G4cout << "Default trajectory type " << defaultTrajectoryType
2550  << "\n will be used to store trajectories for scene \""
2551  << currentSceneName << "\"."
2552  << G4endl;
2553  }
2554 
2555  if (verbosity >= G4VisManager::warnings) {
2556  G4cout <<
2557  "WARNING: Trajectory storing has been requested. This action may be"
2558  "\n reversed with \"/tracking/storeTrajectory 0\"."
2559  << G4endl;
2560  }
2561  UpdateVisManagerScene (currentSceneName);
2562 }
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:227
G4Scene * GetCurrentScene() const
void UpdateVisManagerScene(const G4String &sceneName="")
int G4int
Definition: G4Types.hh:78
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:225
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const std::map< G4String, G4AttDef > * GetAttDefs() const
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
G4GLOB_DLL std::ostream G4cerr
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4VisManager * fpVisManager
Here is the call graph for this function:

Member Data Documentation

◆ fpCommand

G4UIcmdWithAString* G4VisCommandSceneAddTrajectories::fpCommand
private

Definition at line 395 of file G4VisCommandsSceneAdd.hh.


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