Geant4 10.7.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, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *pVisManager)
 
static const G4ColourGetCurrentTextColour ()
 
- Protected Member Functions inherited from G4VVisCommandScene
G4String CurrentSceneName ()
 
- Protected Member Functions inherited from G4VVisCommand
void SetViewParameters (G4VViewer *viewer, const G4ViewParameters &viewParams)
 
void RefreshIfRequired (G4VViewer *viewer)
 
void InterpolateViews (G4VViewer *currentViewer, std::vector< G4ViewParameters > viewVector, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
 
void InterpolateToNewView (G4VViewer *currentViewer, const G4ViewParameters &oldVP, const G4ViewParameters &newVP, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
 
const G4StringConvertToColourGuidance ()
 
void ConvertToColour (G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
 
G4bool ProvideValueOfUnit (const G4String &where, const G4String &unit, const G4String &category, G4double &value)
 
void CheckSceneAndNotifyHandlers (G4Scene *=nullptr)
 
G4bool CheckView ()
 
void G4VisCommandsSceneAddUnsuccessful (G4VisManager::Verbosity verbosity)
 
void CopyGuidanceFrom (const G4UIcommand *fromCmd, G4UIcommand *toCmd, G4int startLine=0)
 
void CopyParametersFrom (const G4UIcommand *fromCmd, G4UIcommand *toCmd)
 
void DrawExtent (const G4VisExtent &)
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4long StoL (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 G4bool ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4int fCurrentArrow3DLineSegmentsPerCircle = 6
 
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 G4PhysicalVolumeModel::TouchableProperties fCurrentTouchableProperties
 
static G4VisExtent fCurrentExtentForField
 
static std::vector< G4PhysicalVolumesSearchScene::FindingsfCurrrentPVFindingsForField
 

Detailed Description

Definition at line 411 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::G4VisCommandSceneAddTrajectories ( )

Definition at line 2613 of file G4VisCommandsSceneAdd.cc.

2613 {
2614 G4bool omitable;
2615 fpCommand = new G4UIcmdWithAString
2616 ("/vis/scene/add/trajectories", this);
2617 fpCommand -> SetGuidance
2618 ("Adds trajectories to current scene.");
2619 fpCommand -> SetGuidance
2620 ("Causes trajectories, if any, to be drawn at the end of processing an"
2621 "\nevent. Switches on trajectory storing and sets the"
2622 "\ndefault trajectory type.");
2623 fpCommand -> SetGuidance
2624 ("The command line parameter list determines the default trajectory type."
2625 "\nIf it contains the string \"smooth\", auxiliary inter-step points will"
2626 "\nbe inserted to improve the smoothness of the drawing of a curved"
2627 "\ntrajectory."
2628 "\nIf it contains the string \"rich\", significant extra information will"
2629 "\nbe stored in the trajectory (G4RichTrajectory) amenable to modeling"
2630 "\nand filtering with \"/vis/modeling/trajectories/create/drawByAttribute\""
2631 "\nand \"/vis/filtering/trajectories/create/attributeFilter\" commands."
2632 "\nIt may contain both strings in any order.");
2633 fpCommand -> SetGuidance
2634 ("\nTo switch off trajectory storing: \"/tracking/storeTrajectory 0\"."
2635 "\nSee also \"/vis/scene/endOfEventAction\".");
2636 fpCommand -> SetGuidance
2637 ("Note: This only sets the default. Independently of the result of this"
2638 "\ncommand, a user may instantiate a trajectory that overrides this default"
2639 "\nin PreUserTrackingAction.");
2640 fpCommand -> SetParameterName ("default-trajectory-type", omitable = true);
2641 fpCommand -> SetDefaultValue ("");
2642}
bool G4bool
Definition: G4Types.hh:86

◆ ~G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::~G4VisCommandSceneAddTrajectories ( )
virtual

Definition at line 2644 of file G4VisCommandsSceneAdd.cc.

2644 {
2645 delete fpCommand;
2646}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneAddTrajectories::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2648 of file G4VisCommandsSceneAdd.cc.

2648 {
2649 return "";
2650}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 2652 of file G4VisCommandsSceneAdd.cc.

2653 {
2654
2656 G4bool warn = verbosity >= G4VisManager::warnings;
2657
2659 if (!pScene) {
2660 if (verbosity >= G4VisManager::errors) {
2661 G4cerr << "ERROR: No current scene. Please create one." << G4endl;
2662 }
2663 return;
2664 }
2665 const G4String& currentSceneName = pScene -> GetName ();
2666
2667 G4bool smooth = false;
2668 G4bool rich = false;
2669 if (newValue.find("smooth") != std::string::npos) smooth = true;
2670 if (newValue.find("rich") != std::string::npos) rich = true;
2671 if (newValue.size() && !(rich || smooth)) {
2672 if (verbosity >= G4VisManager::errors) {
2673 G4cerr << "ERROR: Unrecognised parameter \"" << newValue << "\""
2674 "\n No action taken."
2675 << G4endl;
2676 }
2677 return;
2678 }
2679
2681 G4int keepVerbose = UImanager->GetVerboseLevel();
2682 G4int newVerbose = 2;
2683 UImanager->SetVerboseLevel(newVerbose);
2684 G4String defaultTrajectoryType;
2685 if (smooth && rich) {
2686 UImanager->ApplyCommand("/tracking/storeTrajectory 4");
2687 defaultTrajectoryType = "G4RichTrajectory configured for smooth steps";
2688 } else if (smooth) {
2689 UImanager->ApplyCommand("/tracking/storeTrajectory 2");
2690 defaultTrajectoryType = "G4SmoothTrajectory";
2691 } else if (rich) {
2692 UImanager->ApplyCommand("/tracking/storeTrajectory 3");
2693 defaultTrajectoryType = "G4RichTrajectory";
2694 } else {
2695 UImanager->ApplyCommand("/tracking/storeTrajectory 1");
2696 defaultTrajectoryType = "G4Trajectory";
2697 }
2698 UImanager->SetVerboseLevel(keepVerbose);
2699
2700 if (verbosity >= G4VisManager::errors) {
2701 G4cout <<
2702 "Attributes available for modeling and filtering with"
2703 "\n \"/vis/modeling/trajectories/create/drawByAttribute\" and"
2704 "\n \"/vis/filtering/trajectories/create/attributeFilter\" commands:"
2705 << G4endl;
2707 if (rich) {
2710 } else if (smooth) {
2713 } else {
2716 }
2717 }
2718
2719 const auto& eoeList = pScene->GetEndOfEventModelList();
2720 auto eoeModel = eoeList.begin();
2721 for (; eoeModel != eoeList.end(); ++eoeModel) {
2722 const auto* actualModel = eoeModel->fpModel;
2723 if (dynamic_cast<const G4TrajectoriesModel*>(actualModel)) break;
2724 }
2725 if (eoeModel == eoeList.end()) {
2726 // No trajectories model exists in the scene so create a new one...
2727 G4VModel* model = new G4TrajectoriesModel();
2728 pScene -> AddEndOfEventModel (model, warn);
2729 } // ...else it already exists and there is no need to add a new one
2730 // because G4TrajectoriesModel simply describes trajectories in the
2731 // trajectories store whatever the type.
2732
2733 if (verbosity >= G4VisManager::confirmations) {
2734 G4cout << "Default trajectory type " << defaultTrajectoryType
2735 << "\n will be used to store trajectories for scene \""
2736 << currentSceneName << "\"."
2737 << G4endl;
2738 }
2739
2740 if (verbosity >= G4VisManager::warnings) {
2741 G4cout <<
2742 "WARNING: Trajectory storing has been requested. This action may be"
2743 "\n reversed with \"/tracking/storeTrajectory 0\"."
2744 << G4endl;
2745 }
2746
2748}
int G4int
Definition: G4Types.hh:85
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
virtual const std::map< G4String, G4AttDef > * GetAttDefs() const
const std::vector< Model > & GetEndOfEventModelList() 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
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:193
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:192
void CheckSceneAndNotifyHandlers(G4Scene *=nullptr)
static G4VisManager * fpVisManager
G4Scene * GetCurrentScene() const
static Verbosity GetVerbosity()

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