Geant4 11.1.1
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 ()=default
 
 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 G4VisManagerGetVisManager ()
 
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="")
 
void Twinkle (G4VViewer *currentViewer, const G4ViewParameters &baseVP, const std::vector< std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > > &paths)
 
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 CopyCameraParameters (G4ViewParameters &target, const G4ViewParameters &from)
 
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 (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const 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 = nullptr
 
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
 
static G4bool fThereWasAViewer = false
 
static G4ViewParameters fExistingVP
 

Detailed Description

Definition at line 451 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::G4VisCommandSceneAddTrajectories ( )

Definition at line 2759 of file G4VisCommandsSceneAdd.cc.

2759 {
2760 G4bool omitable;
2761 fpCommand = new G4UIcmdWithAString
2762 ("/vis/scene/add/trajectories", this);
2763 fpCommand -> SetGuidance
2764 ("Adds trajectories to current scene.");
2765 fpCommand -> SetGuidance
2766 ("Causes trajectories, if any, to be drawn at the end of processing an"
2767 "\nevent. Switches on trajectory storing and sets the"
2768 "\ndefault trajectory type.");
2769 fpCommand -> SetGuidance
2770 ("The command line parameter list determines the default trajectory type."
2771 "\nIf it contains the string \"smooth\", auxiliary inter-step points will"
2772 "\nbe inserted to improve the smoothness of the drawing of a curved"
2773 "\ntrajectory."
2774 "\nIf it contains the string \"rich\", significant extra information will"
2775 "\nbe stored in the trajectory (G4RichTrajectory) amenable to modeling"
2776 "\nand filtering with \"/vis/modeling/trajectories/create/drawByAttribute\""
2777 "\nand \"/vis/filtering/trajectories/create/attributeFilter\" commands."
2778 "\nIt may contain both strings in any order.");
2779 fpCommand -> SetGuidance
2780 ("\nTo switch off trajectory storing: \"/tracking/storeTrajectory 0\"."
2781 "\nSee also \"/vis/scene/endOfEventAction\".");
2782 fpCommand -> SetGuidance
2783 ("Note: This only sets the default. Independently of the result of this"
2784 "\ncommand, a user may instantiate a trajectory that overrides this default"
2785 "\nin PreUserTrackingAction.");
2786 fpCommand -> SetParameterName ("default-trajectory-type", omitable = true);
2787 fpCommand -> SetDefaultValue ("");
2788}
bool G4bool
Definition: G4Types.hh:86

◆ ~G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::~G4VisCommandSceneAddTrajectories ( )
virtual

Definition at line 2790 of file G4VisCommandsSceneAdd.cc.

2790 {
2791 delete fpCommand;
2792}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneAddTrajectories::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2794 of file G4VisCommandsSceneAdd.cc.

2794 {
2795 return "";
2796}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 2798 of file G4VisCommandsSceneAdd.cc.

2799 {
2800
2802 G4bool warn = verbosity >= G4VisManager::warnings;
2803
2805 if (!pScene) {
2806 if (verbosity >= G4VisManager::errors) {
2807 G4warn << "ERROR: No current scene. Please create one." << G4endl;
2808 }
2809 return;
2810 }
2811 const G4String& currentSceneName = pScene -> GetName ();
2812
2813 G4bool smooth = false;
2814 G4bool rich = false;
2815 if (newValue.find("smooth") != std::string::npos) smooth = true;
2816 if (newValue.find("rich") != std::string::npos) rich = true;
2817 if (newValue.size() && !(rich || smooth)) {
2818 if (verbosity >= G4VisManager::errors) {
2819 G4warn << "ERROR: Unrecognised parameter \"" << newValue << "\""
2820 "\n No action taken."
2821 << G4endl;
2822 }
2823 return;
2824 }
2825
2827 G4String defaultTrajectoryType;
2828 if (smooth && rich) {
2829 UImanager->ApplyCommand("/tracking/storeTrajectory 4");
2830 defaultTrajectoryType = "G4RichTrajectory configured for smooth steps";
2831 } else if (smooth) {
2832 UImanager->ApplyCommand("/tracking/storeTrajectory 2");
2833 defaultTrajectoryType = "G4SmoothTrajectory";
2834 } else if (rich) {
2835 UImanager->ApplyCommand("/tracking/storeTrajectory 3");
2836 defaultTrajectoryType = "G4RichTrajectory";
2837 } else {
2838 UImanager->ApplyCommand("/tracking/storeTrajectory 1");
2839 defaultTrajectoryType = "G4Trajectory";
2840 }
2841
2842 if (verbosity >= G4VisManager::errors) {
2843 G4warn <<
2844 "Attributes available for modeling and filtering with"
2845 "\n \"/vis/modeling/trajectories/create/drawByAttribute\" and"
2846 "\n \"/vis/filtering/trajectories/create/attributeFilter\" commands:"
2847 << G4endl;
2849 if (rich) {
2852 } else if (smooth) {
2855 } else {
2858 }
2859 }
2860
2861 const auto& eoeList = pScene->GetEndOfEventModelList();
2862 auto eoeModel = eoeList.begin();
2863 for (; eoeModel != eoeList.end(); ++eoeModel) {
2864 const auto* actualModel = eoeModel->fpModel;
2865 if (dynamic_cast<const G4TrajectoriesModel*>(actualModel)) break;
2866 }
2867 if (eoeModel == eoeList.end()) {
2868 // No trajectories model exists in the scene so create a new one...
2869 G4VModel* model = new G4TrajectoriesModel();
2870 pScene -> AddEndOfEventModel (model, warn);
2871 } // ...else it already exists and there is no need to add a new one
2872 // because G4TrajectoriesModel simply describes trajectories in the
2873 // trajectories store whatever the type.
2874
2875 if (verbosity >= G4VisManager::confirmations) {
2876 G4cout << "Default trajectory type " << defaultTrajectoryType
2877 << "\n will be used to store trajectories for scene \""
2878 << currentSceneName << "\"."
2879 << G4endl;
2880 }
2881
2882 if (verbosity >= G4VisManager::warnings) {
2883 G4warn <<
2884 "WARNING: Trajectory storing has been requested. This action may be"
2885 "\n reversed with \"/tracking/storeTrajectory 0\"."
2886 << G4endl;
2887 }
2888
2890}
#define G4warn
Definition: G4Scene.cc:41
#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:495
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
void CheckSceneAndNotifyHandlers(G4Scene *=nullptr)
static G4VisManager * fpVisManager
G4Scene * GetCurrentScene() const
static Verbosity GetVerbosity()

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