Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4VisCommandSceneAddTrajectories Class Reference

#include <G4VisCommandsSceneAdd.hh>

Inheritance diagram for G4VisCommandSceneAddTrajectories:
G4VVisCommandScene G4VVisCommand G4UImessenger

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
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
- 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
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentLineWidth = 1.
 
static
G4ModelingParameters::PVNameCopyNoPath 
fCurrentTouchablePath
 

Detailed Description

Definition at line 366 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

G4VisCommandSceneAddTrajectories::G4VisCommandSceneAddTrajectories ( )

Definition at line 2215 of file G4VisCommandsSceneAdd.cc.

2215  {
2216  G4bool omitable;
2217  fpCommand = new G4UIcmdWithAString
2218  ("/vis/scene/add/trajectories", this);
2219  fpCommand -> SetGuidance
2220  ("Adds trajectories to current scene.");
2221  fpCommand -> SetGuidance
2222  ("Causes trajectories, if any, to be drawn at the end of processing an"
2223  "\nevent. Switches on trajectory storing and sets the"
2224  "\ndefault trajectory type.");
2225  fpCommand -> SetGuidance
2226  ("The command line parameter list determines the default trajectory type."
2227  "\nIf it contains the string \"smooth\", auxiliary inter-step points will"
2228  "\nbe inserted to improve the smoothness of the drawing of a curved"
2229  "\ntrajectory."
2230  "\nIf it contains the string \"rich\", significant extra information will"
2231  "\nbe stored in the trajectory (G4RichTrajectory) amenable to modeling"
2232  "\nand filtering with \"/vis/modeling/trajectories/create/drawByAttribute\""
2233  "\nand \"/vis/filtering/trajectories/create/attributeFilter\" commands."
2234  "\nIt may contain both strings in any order.");
2235  fpCommand -> SetGuidance
2236  ("\nTo switch off trajectory storing: \"/tracking/storeTrajectory 0\"."
2237  "\nSee also \"/vis/scene/endOfEventAction\".");
2238  fpCommand -> SetGuidance
2239  ("Note: This only sets the default. Independently of the result of this"
2240  "\ncommand, a user may instantiate a trajectory that overrides this default"
2241  "\nin PreUserTrackingAction.");
2242  fpCommand -> SetParameterName ("default-trajectory-type", omitable = true);
2243  fpCommand -> SetDefaultValue ("");
2244 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandSceneAddTrajectories::~G4VisCommandSceneAddTrajectories ( )
virtual

Definition at line 2246 of file G4VisCommandsSceneAdd.cc.

2246  {
2247  delete fpCommand;
2248 }

Member Function Documentation

G4String G4VisCommandSceneAddTrajectories::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2250 of file G4VisCommandsSceneAdd.cc.

2250  {
2251  return "";
2252 }
void G4VisCommandSceneAddTrajectories::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 2254 of file G4VisCommandsSceneAdd.cc.

References G4UImanager::ApplyCommand(), G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4TrajectoriesModel::GetAttDefs(), G4SmoothTrajectoryPoint::GetAttDefs(), G4TrajectoryPoint::GetAttDefs(), G4RichTrajectory::GetAttDefs(), G4RichTrajectoryPoint::GetAttDefs(), G4SmoothTrajectory::GetAttDefs(), G4Trajectory::GetAttDefs(), G4VisManager::GetCurrentScene(), G4UImanager::GetUIpointer(), G4UImanager::GetVerboseLevel(), G4VisManager::GetVerbosity(), G4UImanager::SetVerboseLevel(), G4VVisCommand::UpdateVisManagerScene(), and G4VisManager::warnings.

2255  {
2256 
2258  G4bool warn = verbosity >= G4VisManager::warnings;
2259 
2260  G4Scene* pScene = fpVisManager->GetCurrentScene();
2261  if (!pScene) {
2262  if (verbosity >= G4VisManager::errors) {
2263  G4cout << "ERROR: No current scene. Please create one." << G4endl;
2264  }
2265  return;
2266  }
2267 
2268  G4bool smooth = false;
2269  G4bool rich = false;
2270  if (newValue.find("smooth") != std::string::npos) smooth = true;
2271  if (newValue.find("rich") != std::string::npos) rich = true;
2272  if (newValue.size() && !(rich || smooth)) {
2273  if (verbosity >= G4VisManager::errors) {
2274  G4cout << "ERROR: Unrecognised parameter \"" << newValue << "\""
2275  "\n No action taken."
2276  << G4endl;
2277  }
2278  return;
2279  }
2280 
2281  G4UImanager* UImanager = G4UImanager::GetUIpointer();
2282  G4int keepVerbose = UImanager->GetVerboseLevel();
2283  G4int newVerbose = 2;
2284  UImanager->SetVerboseLevel(newVerbose);
2285  G4String defaultTrajectoryType;
2286  if (smooth && rich) {
2287  UImanager->ApplyCommand("/tracking/storeTrajectory 4");
2288  defaultTrajectoryType = "G4RichTrajectory configured for smooth steps";
2289  } else if (smooth) {
2290  UImanager->ApplyCommand("/tracking/storeTrajectory 2");
2291  defaultTrajectoryType = "G4SmoothTrajectory";
2292  } else if (rich) {
2293  UImanager->ApplyCommand("/tracking/storeTrajectory 3");
2294  defaultTrajectoryType = "G4RichTrajectory";
2295  } else {
2296  UImanager->ApplyCommand("/tracking/storeTrajectory 1");
2297  defaultTrajectoryType = "G4Trajectory";
2298  }
2299  UImanager->SetVerboseLevel(keepVerbose);
2300 
2301  if (verbosity >= G4VisManager::errors) {
2302  G4cout <<
2303  "Attributes available for modeling and filtering with"
2304  "\n \"/vis/modeling/trajectories/create/drawByAttribute\" and"
2305  "\n \"/vis/filtering/trajectories/create/attributeFilter\" commands:"
2306  << G4endl;
2308  if (rich) {
2311  } else if (smooth) {
2314  } else {
2317  }
2318  }
2319 
2321  const G4String& currentSceneName = pScene -> GetName ();
2322  pScene -> AddEndOfEventModel (model, warn);
2323 
2324  if (verbosity >= G4VisManager::confirmations) {
2325  G4cout << "Default trajectory type " << defaultTrajectoryType
2326  << "\n will be used to store trajectories for scene \""
2327  << currentSceneName << "\"."
2328  << G4endl;
2329  }
2330 
2331  if (verbosity >= G4VisManager::warnings) {
2332  G4cout <<
2333  "WARNING: Trajectory storing has been requested. This action may be"
2334  "\n reversed with \"/tracking/storeTrajectory 0\"."
2335  << G4endl;
2336  }
2337  UpdateVisManagerScene (currentSceneName);
2338 }
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:58
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const XML_Char XML_Content * model
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::map< G4String, G4AttDef > * GetAttDefs() const
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419
G4Scene * GetCurrentScene() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4VisManager * fpVisManager
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const

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