Geant4 11.2.2
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 ()
 
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 LtoS (G4long l)
 
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
 
static G4SceneTreeItem fExistingSceneTree
 

Detailed Description

Definition at line 451 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::G4VisCommandSceneAddTrajectories ( )

Definition at line 2767 of file G4VisCommandsSceneAdd.cc.

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

◆ ~G4VisCommandSceneAddTrajectories()

G4VisCommandSceneAddTrajectories::~G4VisCommandSceneAddTrajectories ( )
virtual

Definition at line 2798 of file G4VisCommandsSceneAdd.cc.

2798 {
2799 delete fpCommand;
2800}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneAddTrajectories::GetCurrentValue ( G4UIcommand * command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2802 of file G4VisCommandsSceneAdd.cc.

2802 {
2803 return "";
2804}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 2806 of file G4VisCommandsSceneAdd.cc.

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

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