Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
 

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 G4int fErrorCode = 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::G4VisCommandSceneAddTrajectories ( )

Definition at line 2451 of file G4VisCommandsSceneAdd.cc.

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

Definition at line 2482 of file G4VisCommandsSceneAdd.cc.

2482  {
2483  delete fpCommand;
2484 }

Member Function Documentation

G4String G4VisCommandSceneAddTrajectories::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2486 of file G4VisCommandsSceneAdd.cc.

2486  {
2487  return "";
2488 }
void G4VisCommandSceneAddTrajectories::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 2490 of file G4VisCommandsSceneAdd.cc.

2491  {
2492 
2494  G4bool warn = verbosity >= G4VisManager::warnings;
2495 
2496  G4Scene* pScene = fpVisManager->GetCurrentScene();
2497  if (!pScene) {
2498  if (verbosity >= G4VisManager::errors) {
2499  G4cerr << "ERROR: No current scene. Please create one." << G4endl;
2500  }
2501  return;
2502  }
2503 
2504  G4bool smooth = false;
2505  G4bool rich = false;
2506  if (newValue.find("smooth") != std::string::npos) smooth = true;
2507  if (newValue.find("rich") != std::string::npos) rich = true;
2508  if (newValue.size() && !(rich || smooth)) {
2509  if (verbosity >= G4VisManager::errors) {
2510  G4cerr << "ERROR: Unrecognised parameter \"" << newValue << "\""
2511  "\n No action taken."
2512  << G4endl;
2513  }
2514  return;
2515  }
2516 
2517  G4UImanager* UImanager = G4UImanager::GetUIpointer();
2518  G4int keepVerbose = UImanager->GetVerboseLevel();
2519  G4int newVerbose = 2;
2520  UImanager->SetVerboseLevel(newVerbose);
2521  G4String defaultTrajectoryType;
2522  if (smooth && rich) {
2523  UImanager->ApplyCommand("/tracking/storeTrajectory 4");
2524  defaultTrajectoryType = "G4RichTrajectory configured for smooth steps";
2525  } else if (smooth) {
2526  UImanager->ApplyCommand("/tracking/storeTrajectory 2");
2527  defaultTrajectoryType = "G4SmoothTrajectory";
2528  } else if (rich) {
2529  UImanager->ApplyCommand("/tracking/storeTrajectory 3");
2530  defaultTrajectoryType = "G4RichTrajectory";
2531  } else {
2532  UImanager->ApplyCommand("/tracking/storeTrajectory 1");
2533  defaultTrajectoryType = "G4Trajectory";
2534  }
2535  UImanager->SetVerboseLevel(keepVerbose);
2536 
2537  if (verbosity >= G4VisManager::errors) {
2538  G4cout <<
2539  "Attributes available for modeling and filtering with"
2540  "\n \"/vis/modeling/trajectories/create/drawByAttribute\" and"
2541  "\n \"/vis/filtering/trajectories/create/attributeFilter\" commands:"
2542  << G4endl;
2544  if (rich) {
2547  } else if (smooth) {
2550  } else {
2552  << *G4TrajectoryPoint().GetAttDefs();
2553  }
2554  }
2555 
2557  const G4String& currentSceneName = pScene -> GetName ();
2558  pScene -> AddEndOfEventModel (model, warn);
2559 
2560  if (verbosity >= G4VisManager::confirmations) {
2561  G4cout << "Default trajectory type " << defaultTrajectoryType
2562  << "\n will be used to store trajectories for scene \""
2563  << currentSceneName << "\"."
2564  << G4endl;
2565  }
2566 
2567  if (verbosity >= G4VisManager::warnings) {
2568  G4cout <<
2569  "WARNING: Trajectory storing has been requested. This action may be"
2570  "\n reversed with \"/tracking/storeTrajectory 0\"."
2571  << G4endl;
2572  }
2573  UpdateVisManagerScene (currentSceneName);
2574 }
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
void UpdateVisManagerScene(const G4String &sceneName="")
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:227
int G4int
Definition: G4Types.hh:78
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:225
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
const XML_Char XML_Content * model
Definition: expat.h:151
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
G4Scene * GetCurrentScene() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const

Here is the call graph for this function:


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