Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandSceneAddTrajectories Class Reference

#include <G4VisCommandsSceneAdd.hh>

+ Inheritance 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)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
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)
 
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 354 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::G4VisCommandSceneAddTrajectories ( )

Definition at line 2280 of file G4VisCommandsSceneAdd.cc.

2280 {
2281 G4bool omitable;
2282 fpCommand = new G4UIcmdWithAString
2283 ("/vis/scene/add/trajectories", this);
2284 fpCommand -> SetGuidance
2285 ("Adds trajectories to current scene.");
2286 fpCommand -> SetGuidance
2287 ("Causes trajectories, if any, to be drawn at the end of processing an"
2288 "\nevent. Switches on trajectory storing and sets the"
2289 "\ndefault trajectory type.");
2290 fpCommand -> SetGuidance
2291 ("The command line parameter list determines the default trajectory type."
2292 "\nIf it contains the string \"smooth\", auxiliary inter-step points will"
2293 "\nbe inserted to improve the smoothness of the drawing of a curved"
2294 "\ntrajectory."
2295 "\nIf it contains the string \"rich\", significant extra information will"
2296 "\nbe stored in the trajectory (G4RichTrajectory) amenable to modeling"
2297 "\nand filtering with \"/vis/modeling/trajectories/create/drawByAttribute\""
2298 "\nand \"/vis/filtering/trajectories/create/attributeFilter\" commands."
2299 "\nIt may contain both strings in any order.");
2300 fpCommand -> SetGuidance
2301 ("\nTo switch off trajectory storing: \"/tracking/storeTrajectory 0\"."
2302 "\nSee also \"/vis/scene/endOfEventAction\".");
2303 fpCommand -> SetGuidance
2304 ("Note: This only sets the default. Independently of the result of this"
2305 "\ncommand, a user may instantiate a trajectory that overrides this default"
2306 "\nin PreUserTrackingAction.");
2307 fpCommand -> SetParameterName ("default-trajectory-type", omitable = true);
2308 fpCommand -> SetDefaultValue ("");
2309}
bool G4bool
Definition: G4Types.hh:67

◆ ~G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::~G4VisCommandSceneAddTrajectories ( )
virtual

Definition at line 2311 of file G4VisCommandsSceneAdd.cc.

2311 {
2312 delete fpCommand;
2313}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneAddTrajectories::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2315 of file G4VisCommandsSceneAdd.cc.

2315 {
2316 return "";
2317}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 2319 of file G4VisCommandsSceneAdd.cc.

2320 {
2321
2323 G4bool warn = verbosity >= G4VisManager::warnings;
2324
2326 if (!pScene) {
2327 if (verbosity >= G4VisManager::errors) {
2328 G4cout << "ERROR: No current scene. Please create one." << G4endl;
2329 }
2330 return;
2331 }
2332
2333 G4bool smooth = false, rich = false;
2334 if (newValue.find("smooth") != std::string::npos) smooth = true;
2335 if (newValue.find("rich") != std::string::npos) rich = true;
2336
2338 G4int keepVerbose = UImanager->GetVerboseLevel();
2339 G4int newVerbose = 2;
2340 UImanager->SetVerboseLevel(newVerbose);
2341 G4PropagatorInField* propagatorInField =
2343 GetPropagatorInField();
2344 propagatorInField->SetTrajectoryFilter(0); // Switch off smooth trajectories.
2345 static G4IdentityTrajectoryFilter auxiliaryPointsFilter;
2346 G4String defaultTrajectoryType;
2347 G4bool i_mode_found = false;
2348 G4int i_mode = 0;
2349 if (smooth && rich) {
2350 UImanager->ApplyCommand("/tracking/storeTrajectory 3");
2351 propagatorInField->SetTrajectoryFilter(&auxiliaryPointsFilter);
2352 defaultTrajectoryType = "G4RichTrajectory configured for smooth steps";
2353 } else if (smooth) {
2354 UImanager->ApplyCommand("/tracking/storeTrajectory 2");
2355 propagatorInField->SetTrajectoryFilter(&auxiliaryPointsFilter);
2356 defaultTrajectoryType = "G4SmoothTrajectory";
2357 } else if (rich) {
2358 UImanager->ApplyCommand("/tracking/storeTrajectory 3");
2359 defaultTrajectoryType = "G4RichTrajectory";
2360 } else {
2361 if (!newValue.empty()) {
2362 std::istringstream iss(newValue);
2363 iss >> i_mode;
2364 if (iss) {
2365 i_mode_found = true;
2366 if (verbosity >= G4VisManager::warnings) {
2367 G4cout <<
2368 "WARNING: Integer parameter " << i_mode << " found."
2369 "\n DEPRECATED - its use in this command will be removed at a future major"
2370 "\n release. Use \"/vis/modeling/trajectories\" commands."
2371 << G4endl;
2372 }
2373 } else {
2374 if (verbosity >= G4VisManager::errors) {
2375 G4cout << "ERROR: Unrecognised parameter \"" << newValue << "\""
2376 "\n No action taken."
2377 << G4endl;
2378 }
2379 return;
2380 }
2381 }
2382 UImanager->ApplyCommand("/tracking/storeTrajectory 1");
2383 defaultTrajectoryType = "G4Trajectory";
2384 }
2385 UImanager->SetVerboseLevel(keepVerbose);
2386
2387 if (verbosity >= G4VisManager::errors) {
2388 G4cout <<
2389 "Attributes available for modeling and filtering with"
2390 "\n \"/vis/modeling/trajectories/create/drawByAttribute\" and"
2391 "\n \"/vis/filtering/trajectories/create/attributeFilter\" commands:"
2392 << G4endl;
2394 if (rich) {
2397 } else if (smooth) {
2400 } else {
2403 }
2404 }
2405
2406 G4TrajectoriesModel* model = 0;
2407 if (i_mode_found) {
2408 model = new G4TrajectoriesModel(i_mode);
2409 } else {
2410 model = new G4TrajectoriesModel();
2411 }
2412 const G4String& currentSceneName = pScene -> GetName ();
2413 pScene -> AddEndOfEventModel (model, warn);
2414
2415 if (verbosity >= G4VisManager::confirmations) {
2416 G4cout << "Default trajectory type " << defaultTrajectoryType
2417 << "\n will be used to store trajectories for scene \""
2418 << currentSceneName << "\"."
2419 << G4endl;
2420 }
2421
2422 if (verbosity >= G4VisManager::warnings) {
2423 G4cout <<
2424 "WARNING: Trajectory storing has been requested. This action may be"
2425 "\n reversed with \"/tracking/storeTrajectory 0\"."
2426 << G4endl;
2427 }
2428 UpdateVisManagerScene (currentSceneName);
2429}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void SetTrajectoryFilter(G4VCurvedTrajectoryFilter *filter)
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
const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
static G4TransportationManager * GetTransportationManager()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:369
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:218
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:51
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:216
static G4VisManager * fpVisManager
void UpdateVisManagerScene(const G4String &sceneName="")
G4Scene * GetCurrentScene() const
static Verbosity GetVerbosity()

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