Geant4-11
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
G4VisCommandSceneAddVolume Class Reference

#include <G4VisCommandsSceneAdd.hh>

Inheritance diagram for G4VisCommandSceneAddVolume:
G4VVisCommandScene G4VVisCommand G4UImessenger

Public Member Functions

G4bool CommandsShouldBeInMaster () const
 
 G4VisCommandSceneAddVolume ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool operator== (const G4UImessenger &messenger) const
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
virtual ~G4VisCommandSceneAddVolume ()
 

Static Public Member Functions

static const G4ColourGetCurrentTextColour ()
 
static G4VisManagerGetVisManager ()
 
static void SetVisManager (G4VisManager *pVisManager)
 

Protected Member Functions

void AddUIcommand (G4UIcommand *newCommand)
 
G4String BtoS (G4bool b)
 
void CheckSceneAndNotifyHandlers (G4Scene *=nullptr)
 
G4bool CheckView ()
 
void ConvertToColour (G4Colour &colour, const G4String &redOrString, G4double green, G4double blue, G4double opacity)
 
const G4StringConvertToColourGuidance ()
 
void CopyCameraParameters (G4ViewParameters &target, const G4ViewParameters &from)
 
void CopyGuidanceFrom (const G4UIcommand *fromCmd, G4UIcommand *toCmd, G4int startLine=0)
 
void CopyMostViewParameters (G4ViewParameters &target, const G4ViewParameters &from)
 
void CopyParametersFrom (const G4UIcommand *fromCmd, G4UIcommand *toCmd)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
G4String CurrentSceneName ()
 
void DrawExtent (const G4VisExtent &)
 
G4String DtoS (G4double a)
 
void G4VisCommandsSceneAddUnsuccessful (G4VisManager::Verbosity verbosity)
 
void InterpolateToNewView (G4VViewer *currentViewer, const G4ViewParameters &oldVP, const G4ViewParameters &newVP, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
 
void InterpolateViews (G4VViewer *currentViewer, std::vector< G4ViewParameters > viewVector, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")
 
G4String ItoS (G4int i)
 
G4bool ProvideValueOfUnit (const G4String &where, const G4String &unit, const G4String &category, G4double &value)
 
void RefreshIfRequired (G4VViewer *viewer)
 
void SetViewParameters (G4VViewer *viewer, const G4ViewParameters &viewParams)
 
G4bool StoB (G4String s)
 
G4double StoD (G4String s)
 
G4int StoI (G4String s)
 
G4long StoL (G4String s)
 

Static Protected Member Functions

static G4bool ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
static G4String ConvertToString (G4double x, G4double y, const char *unitName)
 

Protected Attributes

G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Static Protected Attributes

static G4int fCurrentArrow3DLineSegmentsPerCircle = 6
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4VisExtent fCurrentExtentForField
 
static G4double fCurrentLineWidth = 1.
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentTextSize = 12.
 
static G4PhysicalVolumeModel::TouchableProperties fCurrentTouchableProperties
 
static std::vector< G4PhysicalVolumesSearchScene::FindingsfCurrrentPVFindingsForField
 
static G4VisManagerfpVisManager = nullptr
 
static G4bool fThereWasAViewer = false
 
static G4ViewParameters fVPExistingViewer
 

Private Member Functions

 G4VisCommandSceneAddVolume (const G4VisCommandSceneAddVolume &)
 
G4VisCommandSceneAddVolumeoperator= (const G4VisCommandSceneAddVolume &)
 

Private Attributes

G4UIcommandfpCommand
 

Detailed Description

Definition at line 479 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddVolume() [1/2]

G4VisCommandSceneAddVolume::G4VisCommandSceneAddVolume ( )

Definition at line 3033 of file G4VisCommandsSceneAdd.cc.

3033 {
3034 G4bool omitable;
3035 fpCommand = new G4UIcommand ("/vis/scene/add/volume", this);
3036 fpCommand -> SetGuidance
3037 ("Adds a physical volume to current scene, with optional clipping volume.");
3038 fpCommand -> SetGuidance
3039 ("If physical-volume-name is \"world\" (the default), the top of the"
3040 "\nmain geometry tree (material world) is added. If \"worlds\", the"
3041 "\ntops of all worlds - material world and parallel worlds, if any - are"
3042 "\nadded. Otherwise a search of all worlds is made.");
3043 fpCommand -> SetGuidance
3044 ("In the last case the names of all volumes in all worlds are matched"
3045 "\nagainst physical-volume-name. If this is of the form \"/regexp/\","
3046 "\nwhere regexp is a regular expression (see C++ regex), the match uses"
3047 "\nthe usual rules of regular expression matching. Otherwise an exact"
3048 "\nmatch is required."
3049 "\nFor example, \"/Shap/\" adds \"Shape1\" and \"Shape2\".");
3050 fpCommand -> SetGuidance
3051 ("It may help to see a textual representation of the geometry hierarchy of"
3052 "\nthe worlds. Try \"/vis/drawTree [worlds]\" or one of the driver/browser"
3053 "\ncombinations that have the required functionality, e.g., HepRepFile.");
3054 fpCommand -> SetGuidance
3055 ("If clip-volume-type is specified, the subsequent parameters are used to"
3056 "\nto define a clipping volume. For example,"
3057 "\n\"/vis/scene/add/volume ! ! ! -box km 0 1 0 1 0 1\" will draw the world"
3058 "\nwith the positive octant cut away. (If the Boolean Processor issues"
3059 "\nwarnings try replacing 0 by 0.000000001 or something.)");
3060 fpCommand -> SetGuidance
3061 ("If clip-volume-type is prepended with '-', the clip-volume is subtracted"
3062 "\n(cutaway). (This is the default if there is no prepended character.)"
3063 "\nIf '*' is prepended, the intersection of the physical-volume and the"
3064 "\nclip-volume is made. (You can make a section through the detector with"
3065 "\na thin box, for example).");
3066 fpCommand -> SetGuidance
3067 ("For \"box\", the parameters are xmin,xmax,ymin,ymax,zmin,zmax."
3068 "\nOnly \"box\" is programmed at present.");
3069 G4UIparameter* parameter;
3070 parameter = new G4UIparameter ("physical-volume-name", 's', omitable = true);
3071 parameter -> SetDefaultValue ("world");
3072 fpCommand -> SetParameter (parameter);
3073 parameter = new G4UIparameter ("copy-no", 'i', omitable = true);
3074 parameter -> SetGuidance ("If negative, matches any copy no.");
3075 parameter -> SetDefaultValue (-1);
3076 fpCommand -> SetParameter (parameter);
3077 parameter = new G4UIparameter ("depth-of-descent", 'i', omitable = true);
3078 parameter -> SetGuidance
3079 ("Depth of descent of geometry hierarchy. Default = unlimited depth.");
3080 parameter -> SetDefaultValue (G4Scene::UNLIMITED);
3081 fpCommand -> SetParameter (parameter);
3082 parameter = new G4UIparameter ("clip-volume-type", 's', omitable = true);
3083 parameter -> SetParameterCandidates("none box -box *box");
3084 parameter -> SetDefaultValue ("none");
3085 parameter -> SetGuidance("[-|*]type. See general guidance.");
3086 fpCommand -> SetParameter (parameter);
3087 parameter = new G4UIparameter ("parameter-unit", 's', omitable = true);
3088 parameter -> SetDefaultValue ("m");
3089 fpCommand -> SetParameter (parameter);
3090 parameter = new G4UIparameter ("parameter-1", 'd', omitable = true);
3091 parameter -> SetDefaultValue (0.);
3092 fpCommand -> SetParameter (parameter);
3093 parameter = new G4UIparameter ("parameter-2", 'd', omitable = true);
3094 parameter -> SetDefaultValue (0.);
3095 fpCommand -> SetParameter (parameter);
3096 parameter = new G4UIparameter ("parameter-3", 'd', omitable = true);
3097 parameter -> SetDefaultValue (0.);
3098 fpCommand -> SetParameter (parameter);
3099 parameter = new G4UIparameter ("parameter-4", 'd', omitable = true);
3100 parameter -> SetDefaultValue (0.);
3101 fpCommand -> SetParameter (parameter);
3102 parameter = new G4UIparameter ("parameter-5", 'd', omitable = true);
3103 parameter -> SetDefaultValue (0.);
3104 fpCommand -> SetParameter (parameter);
3105 parameter = new G4UIparameter ("parameter-6", 'd', omitable = true);
3106 parameter -> SetDefaultValue (0.);
3107 fpCommand -> SetParameter (parameter);
3108}
bool G4bool
Definition: G4Types.hh:86
@ UNLIMITED
Definition: G4Scene.hh:54

References G4VisCommandSceneAddText2D::fpCommand, and G4Scene::UNLIMITED.

◆ ~G4VisCommandSceneAddVolume()

G4VisCommandSceneAddVolume::~G4VisCommandSceneAddVolume ( )
virtual

Definition at line 3110 of file G4VisCommandsSceneAdd.cc.

3110 {
3111 delete fpCommand;
3112}

References G4VisCommandSceneAddText2D::fpCommand.

◆ G4VisCommandSceneAddVolume() [2/2]

G4VisCommandSceneAddVolume::G4VisCommandSceneAddVolume ( const G4VisCommandSceneAddVolume )
private

Member Function Documentation

◆ AddUIcommand()

void G4UImessenger::AddUIcommand ( G4UIcommand newCommand)
protectedinherited

Definition at line 149 of file G4UImessenger.cc.

150{
151 G4cerr << "Warning : Old style definition of G4UIcommand <"
152 << newCommand->GetCommandPath() << ">." << G4endl;
153}
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:136

References G4cerr, G4endl, and G4UIcommand::GetCommandPath().

◆ BtoS()

G4String G4UImessenger::BtoS ( G4bool  b)
protectedinherited

Definition at line 98 of file G4UImessenger.cc.

99{
100 G4String vl = "0";
101 if(b)
102 vl = "true";
103 return vl;
104}

◆ CheckSceneAndNotifyHandlers()

void G4VVisCommand::CheckSceneAndNotifyHandlers ( G4Scene pScene = nullptr)
protectedinherited

Definition at line 207 of file G4VVisCommand.cc.

208{
210
211 if (!pScene) {
212 if (verbosity >= G4VisManager::warnings) {
213 G4cout << "WARNING: Scene pointer is null."
214 << G4endl;
215 }
216 return;
217 }
218
219 G4VSceneHandler* pSceneHandler = fpVisManager -> GetCurrentSceneHandler();
220 if (!pSceneHandler) {
221 if (verbosity >= G4VisManager::warnings) {
222 G4cout << "WARNING: Scene handler not found." << G4endl;
223 }
224 return;
225 }
226
227 // Scene has changed. If it is the scene of the currrent scene handler
228 // refresh viewers of all scene handlers using this scene. If not, it may be
229 // a scene that the user is building up before attaching to a scene handler,
230 // so do nothing.
231 if (pScene == pSceneHandler->GetScene()) {
232 G4UImanager::GetUIpointer () -> ApplyCommand ("/vis/scene/notifyHandlers");
233 }
234
235}
G4GLOB_DLL std::ostream G4cout
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
G4Scene * GetScene() const
static G4VisManager * fpVisManager
static Verbosity GetVerbosity()

References G4VVisCommand::fpVisManager, G4cout, G4endl, G4VSceneHandler::GetScene(), G4UImanager::GetUIpointer(), G4VisManager::GetVerbosity(), and G4VisManager::warnings.

Referenced by G4VisCommandSceneActivateModel::SetNewValue(), G4VisCommandSceneRemoveModel::SetNewValue(), G4VisCommandSceneSelect::SetNewValue(), G4VisCommandSceneAddArrow::SetNewValue(), G4VisCommandSceneAddArrow2D::SetNewValue(), G4VisCommandSceneAddAxes::SetNewValue(), G4VisCommandSceneAddDate::SetNewValue(), G4VisCommandSceneAddDigis::SetNewValue(), G4VisCommandSceneAddEventID::SetNewValue(), G4VisCommandSceneAddExtent::SetNewValue(), G4VisCommandSceneAddElectricField::SetNewValue(), G4VisCommandSceneAddFrame::SetNewValue(), G4VisCommandSceneAddGPS::SetNewValue(), G4VisCommandSceneAddHits::SetNewValue(), G4VisCommandSceneAddLine::SetNewValue(), G4VisCommandSceneAddLine2D::SetNewValue(), G4VisCommandSceneAddLocalAxes::SetNewValue(), G4VisCommandSceneAddLogicalVolume::SetNewValue(), G4VisCommandSceneAddLogo::SetNewValue(), G4VisCommandSceneAddLogo2D::SetNewValue(), G4VisCommandSceneAddMagneticField::SetNewValue(), G4VisCommandSceneAddPSHits::SetNewValue(), G4VisCommandSceneAddScale::SetNewValue(), G4VisCommandSceneAddText::SetNewValue(), G4VisCommandSceneAddText2D::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSceneAddUserAction::SetNewValue(), SetNewValue(), G4VisCommandSceneAddPlotter::SetNewValue(), and G4VisCommandViewerRefresh::SetNewValue().

◆ CheckView()

G4bool G4VVisCommand::CheckView ( )
protectedinherited

Definition at line 237 of file G4VVisCommand.cc.

238{
240 G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
241
242 if (!viewer) {
243 if (verbosity >= G4VisManager::errors) {
244 G4cerr <<
245 "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities."
246 << G4endl;
247 }
248 return false;
249 }
250
251 return true;
252}

References G4VisManager::errors, G4VVisCommand::fpVisManager, G4cerr, G4endl, and G4VisManager::GetVerbosity().

◆ CommandsShouldBeInMaster()

G4bool G4UImessenger::CommandsShouldBeInMaster ( ) const
inlineinherited

Definition at line 77 of file G4UImessenger.hh.

78 {
80 }
G4bool commandsShouldBeInMaster

References G4UImessenger::commandsShouldBeInMaster.

Referenced by G4UIcommand::G4UIcommandCommonConstructorCode().

◆ ConvertToColour()

void G4VVisCommand::ConvertToColour ( G4Colour colour,
const G4String redOrString,
G4double  green,
G4double  blue,
G4double  opacity 
)
protectedinherited

Definition at line 119 of file G4VVisCommand.cc.

122{
123 // Note: colour is supplied by the caller and some or all of its components
124 // may act as default.
125 //
126 // Note: redOrString is either a number or string. If a string it must be
127 // one of the recognised colours.
128 //
129 // Thus the arguments can be, for example:
130 // (colour,"red",...,...,0.5): will give the colour red with opacity 0.5 (the
131 // third and fourth arguments are ignored), or
132 // (1.,0.,0.,0.5): this also will be red with opacity 0.5.
133
135
136 const size_t iPos0 = 0;
137 if (std::isalpha(redOrString[iPos0])) {
138
139 // redOrString is probably alphabetic characters defining the colour
140 if (!G4Colour::GetColour(redOrString, colour)) {
141 // Not a recognised string
142 if (verbosity >= G4VisManager::warnings) {
143 G4cout << "WARNING: Colour \"" << redOrString
144 << "\" not found. Defaulting to " << colour
145 << G4endl;
146 }
147 return;
148 } else {
149 // It was a recognised string. Now add opacity.
150 colour.SetAlpha(opacity);
151 return;
152 }
153
154 } else {
155
156 // redOrString is probably numeric defining the red component
157 std::istringstream iss(redOrString);
158 G4double red;
159 iss >> red;
160 if (iss.fail()) {
161 if (verbosity >= G4VisManager::warnings) {
162 G4cout << "WARNING: String \"" << redOrString
163 << "\" cannot be parsed. Defaulting to " << colour
164 << G4endl;
165 }
166 return;
167 } else {
168 colour = G4Colour(red,green,blue,opacity);
169 return;
170 }
171
172 }
173}
double G4double
Definition: G4Types.hh:83
static G4bool GetColour(const G4String &key, G4Colour &result)
Definition: G4Colour.cc:161
void SetAlpha(G4double)
Definition: G4Colour.cc:70

References G4VVisCommand::fpVisManager, G4cout, G4endl, G4Colour::GetColour(), G4VisManager::GetVerbosity(), G4Colour::SetAlpha(), and G4VisManager::warnings.

Referenced by G4VisCommandGeometrySetColour::SetNewValue(), G4VisCommandSceneAddGPS::SetNewValue(), G4VisCommandSetColour::SetNewValue(), G4VisCommandSetTextColour::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), and G4VisCommandsViewerSet::SetNewValue().

◆ ConvertToColourGuidance()

const G4String & G4VVisCommand::ConvertToColourGuidance ( )
protectedinherited

Definition at line 109 of file G4VVisCommand.cc.

110{
111 static G4String guidance
112 ("Accepts (a) RGB triplet. e.g., \".3 .4 .5\", or"
113 "\n (b) string such as \"white\", \"black\", \"grey\", \"red\"...or"
114 "\n (c) an additional number for opacity, e.g., \".3 .4 .5 .6\""
115 "\n or \"grey ! ! .6\" (note \"!\"'s for unused parameters).");
116 return guidance;
117}

Referenced by G4VisCommandSceneAddGPS::G4VisCommandSceneAddGPS(), G4VisCommandSetColour::G4VisCommandSetColour(), G4VisCommandSetTextColour::G4VisCommandSetTextColour(), G4VisCommandsTouchableSet::G4VisCommandsTouchableSet(), and G4VisCommandsViewerSet::G4VisCommandsViewerSet().

◆ ConvertToDoublePair()

G4bool G4VVisCommand::ConvertToDoublePair ( const G4String paramString,
G4double xval,
G4double yval 
)
staticprotectedinherited

Definition at line 85 of file G4VVisCommand.cc.

88{
89 G4double x, y;
90 G4String unit;
91
92 std::istringstream is(paramString);
93 is >> x >> y >> unit;
94
96 xval = x*G4UIcommand::ValueOf(unit);
97 yval = y*G4UIcommand::ValueOf(unit);
98 } else {
100 if (verbosity >= G4VisManager::errors) {
101 G4cout << "ERROR: Unrecognised unit" << G4endl;
102 }
103 return false;
104 }
105
106 return true;
107}
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:363
static G4bool IsUnitDefined(const G4String &)

References G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4VisManager::GetVerbosity(), G4UnitDefinition::IsUnitDefined(), and G4UIcommand::ValueOf().

Referenced by G4VisCommandViewerPan::SetNewValue(), and G4VisCommandsViewerSet::SetNewValue().

◆ ConvertToString()

G4String G4VVisCommand::ConvertToString ( G4double  x,
G4double  y,
const char *  unitName 
)
staticprotectedinherited

Definition at line 75 of file G4VVisCommand.cc.

77{
78 G4double uv = G4UIcommand::ValueOf(unitName);
79
80 std::ostringstream oss;
81 oss << x/uv << " " << y/uv << " " << unitName;
82 return oss.str();
83}

References G4UIcommand::ValueOf().

Referenced by G4VisCommandViewerPan::GetCurrentValue().

◆ CopyCameraParameters()

void G4VVisCommand::CopyCameraParameters ( G4ViewParameters target,
const G4ViewParameters from 
)
protectedinherited

Definition at line 385 of file G4VVisCommand.cc.

387{
388 // Copy view parameters pertaining only to camera
392 target.SetUpVector (from.GetUpVector());
393 target.SetFieldHalfAngle (from.GetFieldHalfAngle());
394 target.SetZoomFactor (from.GetZoomFactor());
395 target.SetScaleFactor (from.GetScaleFactor());
397 target.SetDolly (from.GetDolly());
398}
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
void SetScaleFactor(const G4Vector3D &scaleFactor)
const G4Vector3D & GetScaleFactor() const
void SetCurrentTargetPoint(const G4Point3D &currentTargetPoint)
const G4Vector3D & GetLightpointDirection() const
void SetFieldHalfAngle(G4double fieldHalfAngle)
const G4Vector3D & GetViewpointDirection() const
const G4Point3D & GetCurrentTargetPoint() const
G4double GetFieldHalfAngle() const
G4double GetZoomFactor() const
void SetDolly(G4double dolly)
const G4Vector3D & GetUpVector() const
void SetZoomFactor(G4double zoomFactor)
void SetUpVector(const G4Vector3D &upVector)
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
void SetLightsMoveWithCamera(G4bool moves)
G4bool GetLightsMoveWithCamera() const
G4double GetDolly() const

References G4ViewParameters::GetCurrentTargetPoint(), G4ViewParameters::GetDolly(), G4ViewParameters::GetFieldHalfAngle(), G4ViewParameters::GetLightpointDirection(), G4ViewParameters::GetLightsMoveWithCamera(), G4ViewParameters::GetScaleFactor(), G4ViewParameters::GetUpVector(), G4ViewParameters::GetViewpointDirection(), G4ViewParameters::GetZoomFactor(), G4ViewParameters::SetCurrentTargetPoint(), G4ViewParameters::SetDolly(), G4ViewParameters::SetFieldHalfAngle(), G4ViewParameters::SetLightpointDirection(), G4ViewParameters::SetLightsMoveWithCamera(), G4ViewParameters::SetScaleFactor(), G4ViewParameters::SetUpVector(), G4ViewParameters::SetViewpointDirection(), and G4ViewParameters::SetZoomFactor().

Referenced by G4VisCommandViewerCopyViewFrom::SetNewValue().

◆ CopyGuidanceFrom()

void G4VVisCommand::CopyGuidanceFrom ( const G4UIcommand fromCmd,
G4UIcommand toCmd,
G4int  startLine = 0 
)
protectedinherited

Definition at line 335 of file G4VVisCommand.cc.

337{
338 if (fromCmd && toCmd) {
339 const G4int nGuideEntries = fromCmd->GetGuidanceEntries();
340 for (G4int i = startLine; i < nGuideEntries; ++i) {
341 const G4String& guidance = fromCmd->GetGuidanceLine(i);
342 toCmd->SetGuidance(guidance);
343 }
344 }
345}
int G4int
Definition: G4Types.hh:85
const G4String & GetGuidanceLine(G4int i) const
Definition: G4UIcommand.hh:132
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
std::size_t GetGuidanceEntries() const
Definition: G4UIcommand.hh:128

References G4UIcommand::GetGuidanceEntries(), G4UIcommand::GetGuidanceLine(), and G4UIcommand::SetGuidance().

Referenced by G4VisCommandDrawLogicalVolume::G4VisCommandDrawLogicalVolume(), G4VisCommandDrawVolume::G4VisCommandDrawVolume(), G4VisCommandSceneAddMagneticField::G4VisCommandSceneAddMagneticField(), G4VisCommandsTouchable::G4VisCommandsTouchable(), and G4VisCommandViewerCentreOn::G4VisCommandViewerCentreOn().

◆ CopyMostViewParameters()

void G4VVisCommand::CopyMostViewParameters ( G4ViewParameters target,
const G4ViewParameters from 
)
protectedinherited

Definition at line 374 of file G4VVisCommand.cc.

376{
377 // Copy view parameters except for autoRefresh and background...
378 auto targetAutoRefresh = target.IsAutoRefresh();
379 auto targetBackground = target.GetBackgroundColour();
380 target = from;
381 target.SetAutoRefresh(targetAutoRefresh);
382 target.SetBackgroundColour(targetBackground);
383}
void SetAutoRefresh(G4bool)
void SetBackgroundColour(const G4Colour &)
const G4Colour & GetBackgroundColour() const
G4bool IsAutoRefresh() const

References G4ViewParameters::GetBackgroundColour(), G4ViewParameters::IsAutoRefresh(), G4ViewParameters::SetAutoRefresh(), and G4ViewParameters::SetBackgroundColour().

Referenced by G4VisCommandViewerCreate::SetNewValue(), and G4VisCommandsViewerSet::SetNewValue().

◆ CopyParametersFrom()

void G4VVisCommand::CopyParametersFrom ( const G4UIcommand fromCmd,
G4UIcommand toCmd 
)
protectedinherited

Definition at line 347 of file G4VVisCommand.cc.

349{
350 if (fromCmd && toCmd) {
351 const G4int nParEntries = fromCmd->GetParameterEntries();
352 for (G4int i = 0; i < nParEntries; ++i) {
353 G4UIparameter* parameter = new G4UIparameter(*(fromCmd->GetParameter(i)));
354 toCmd->SetParameter(parameter);
355 }
356 }
357}
std::size_t GetParameterEntries() const
Definition: G4UIcommand.hh:138
G4UIparameter * GetParameter(G4int i) const
Definition: G4UIcommand.hh:139
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:146

References G4UIcommand::GetParameter(), G4UIcommand::GetParameterEntries(), and G4UIcommand::SetParameter().

Referenced by G4VisCommandDrawLogicalVolume::G4VisCommandDrawLogicalVolume(), G4VisCommandDrawVolume::G4VisCommandDrawVolume(), G4VisCommandSceneAddMagneticField::G4VisCommandSceneAddMagneticField(), and G4VisCommandViewerCentreOn::G4VisCommandViewerCentreOn().

◆ CreateCommand()

template<typename T >
T * G4UImessenger::CreateCommand ( const G4String cname,
const G4String dsc 
)
protectedinherited

Definition at line 110 of file G4UImessenger.hh.

111{
112 G4String path;
113 if(cname[0] != '/')
114 {
115 path = baseDirName + cname;
116 if(path[0] != '/')
117 path = "/" + path;
118 }
119
120 T* command = new T(path.c_str(), this);
121 command->SetGuidance(dsc.c_str());
122
123 return command;
124}
G4String baseDirName

References G4UImessenger::baseDirName.

◆ CreateDirectory()

void G4UImessenger::CreateDirectory ( const G4String path,
const G4String dsc,
G4bool  commandsToBeBroadcasted = true 
)
protectedinherited

Definition at line 156 of file G4UImessenger.cc.

158{
160
161 G4String fullpath = path;
162 if(fullpath.back() != '/')
163 fullpath.append("/");
164
165 G4UIcommandTree* tree = ui->GetTree()->FindCommandTree(fullpath.c_str());
166 if(tree != nullptr)
167 {
168 baseDirName = tree->GetPathName();
169 }
170 else
171 {
172 baseDir = new G4UIdirectory(fullpath.c_str(), commandsToBeBroadcasted);
173 baseDirName = fullpath;
174 baseDir->SetGuidance(dsc.c_str());
175 }
176}
const G4String & GetPathName() const
G4UIcommandTree * FindCommandTree(const char *commandPath)
G4UIcommandTree * GetTree() const
Definition: G4UImanager.hh:186
G4UIdirectory * baseDir

References G4UImessenger::baseDir, G4UImessenger::baseDirName, G4UIcommandTree::FindCommandTree(), G4UIcommandTree::GetPathName(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), and G4UIcommand::SetGuidance().

Referenced by G4MoleculeShootMessenger::G4MoleculeShootMessenger(), and G4UImessenger::G4UImessenger().

◆ CurrentSceneName()

G4String G4VVisCommandScene::CurrentSceneName ( )
protectedinherited

Definition at line 50 of file G4VisCommandsScene.cc.

50 {
51 const G4Scene* pScene = fpVisManager -> GetCurrentScene ();
52 G4String currentSceneName = "none";
53 if (pScene) currentSceneName = pScene -> GetName ();
54 return currentSceneName;
55}

References G4VVisCommand::fpVisManager.

Referenced by G4VisCommandSceneNotifyHandlers::GetCurrentValue().

◆ DrawExtent()

void G4VVisCommand::DrawExtent ( const G4VisExtent extent)
protectedinherited

Definition at line 359 of file G4VVisCommand.cc.

360{
361 if (fpVisManager) {
362 const G4double halfX = (extent.GetXmax() - extent.GetXmin()) / 2.;
363 const G4double halfY = (extent.GetYmax() - extent.GetYmin()) / 2.;
364 const G4double halfZ = (extent.GetZmax() - extent.GetZmin()) / 2.;
365 if (halfX > 0. && halfY > 0. && halfZ > 0.) {
366 const G4Box box("vis_extent",halfX,halfY,halfZ);
367 const G4VisAttributes visAtts(G4Color::Red());
368 const G4Point3D& centre = extent.GetExtentCenter();
369 fpVisManager->Draw(box,visAtts,G4Translate3D(centre));
370 }
371 }
372}
HepGeom::Translate3D G4Translate3D
Definition: G4Box.hh:56
static G4Colour Red()
Definition: G4Colour.hh:161
G4double GetYmin() const
Definition: G4VisExtent.hh:101
G4double GetXmax() const
Definition: G4VisExtent.hh:100
const G4Point3D & GetExtentCenter() const
Definition: G4VisExtent.hh:106
G4double GetYmax() const
Definition: G4VisExtent.hh:102
G4double GetZmax() const
Definition: G4VisExtent.hh:104
G4double GetZmin() const
Definition: G4VisExtent.hh:103
G4double GetXmin() const
Definition: G4VisExtent.hh:99
void Draw(const G4Circle &, const G4Transform3D &objectTransformation=G4Transform3D())

References G4VisManager::Draw(), G4VVisCommand::fpVisManager, G4VisExtent::GetExtentCenter(), G4VisExtent::GetXmax(), G4VisExtent::GetXmin(), G4VisExtent::GetYmax(), G4VisExtent::GetYmin(), G4VisExtent::GetZmax(), G4VisExtent::GetZmin(), and G4Colour::Red().

Referenced by G4VisCommandSceneShowExtents::SetNewValue(), G4VisCommandSetVolumeForField::SetNewValue(), and G4VisCommandsTouchable::SetNewValue().

◆ DtoS()

G4String G4UImessenger::DtoS ( G4double  a)
protectedinherited

Definition at line 90 of file G4UImessenger.cc.

91{
92 std::ostringstream os;
93 os << a;
94 return G4String(os.str());
95}

Referenced by G4ScoreQuantityMessenger::FilterCommands(), and G4UIcontrolMessenger::SetNewValue().

◆ G4VisCommandsSceneAddUnsuccessful()

void G4VVisCommand::G4VisCommandsSceneAddUnsuccessful ( G4VisManager::Verbosity  verbosity)
protectedinherited

◆ GetCurrentTextColour()

const G4Colour & G4VVisCommand::GetCurrentTextColour ( )
staticinherited

Definition at line 70 of file G4VVisCommand.cc.

71{
72 return fCurrentTextColour;
73}
static G4Colour fCurrentTextColour

References G4VVisCommand::fCurrentTextColour.

◆ GetCurrentValue()

G4String G4VisCommandSceneAddVolume::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 3114 of file G4VisCommandsSceneAdd.cc.

3114 {
3115 return "world 0 -1";
3116}

◆ GetVisManager()

G4VisManager * G4VVisCommand::GetVisManager ( )
staticinherited

Definition at line 60 of file G4VVisCommand.cc.

61{
62 return fpVisManager;
63}

References G4VVisCommand::fpVisManager.

◆ InterpolateToNewView()

void G4VVisCommand::InterpolateToNewView ( G4VViewer currentViewer,
const G4ViewParameters oldVP,
const G4ViewParameters newVP,
const G4int  nInterpolationPoints = 50,
const G4int  waitTimePerPointmilliseconds = 20,
const G4String  exportString = "" 
)
protectedinherited

Definition at line 313 of file G4VVisCommand.cc.

320{
321 std::vector<G4ViewParameters> viewVector;
322 viewVector.push_back(oldVP);
323 viewVector.push_back(oldVP);
324 viewVector.push_back(newVP);
325 viewVector.push_back(newVP);
326
328 (currentViewer,
329 viewVector,
330 nInterpolationPoints,
331 waitTimePerPointmilliseconds,
332 exportString);
333}
void InterpolateViews(G4VViewer *currentViewer, std::vector< G4ViewParameters > viewVector, const G4int nInterpolationPoints=50, const G4int waitTimePerPointmilliseconds=20, const G4String exportString="")

References G4VVisCommand::InterpolateViews().

Referenced by G4VisCommandsTouchable::SetNewValue(), and G4VisCommandViewerCentreOn::SetNewValue().

◆ InterpolateViews()

void G4VVisCommand::InterpolateViews ( G4VViewer currentViewer,
std::vector< G4ViewParameters viewVector,
const G4int  nInterpolationPoints = 50,
const G4int  waitTimePerPointmilliseconds = 20,
const G4String  exportString = "" 
)
protectedinherited

Definition at line 288 of file G4VVisCommand.cc.

294{
295 const G4int safety = viewVector.size()*nInterpolationPoints;
296 G4int safetyCount = 0;
297 do {
298 G4ViewParameters* vp =
299 G4ViewParameters::CatmullRomCubicSplineInterpolation(viewVector,nInterpolationPoints);
300 if (!vp) break; // Finished.
301 currentViewer->SetViewParameters(*vp);
302 currentViewer->RefreshView();
303 if (exportString == "export" &&
304 G4StrUtil::contains(currentViewer->GetName(), "OpenGL")) {
305 G4UImanager::GetUIpointer()->ApplyCommand("/vis/ogl/export");
306 }
307 currentViewer->ShowView();
308 if (waitTimePerPointmilliseconds > 0)
309 std::this_thread::sleep_for(std::chrono::milliseconds(waitTimePerPointmilliseconds));
310 } while (safetyCount++ < safety); // Loop checking, 16.02.2016, J.Allison
311}
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485
const G4String & GetName() const
void SetViewParameters(const G4ViewParameters &vp)
Definition: G4VViewer.cc:120
void RefreshView()
virtual void ShowView()
Definition: G4VViewer.cc:103
static G4ViewParameters * CatmullRomCubicSplineInterpolation(const std::vector< G4ViewParameters > &views, G4int nInterpolationPoints=50)
G4bool contains(const G4String &str, std::string_view ss)
Check if a string contains a given substring.

References G4UImanager::ApplyCommand(), G4ViewParameters::CatmullRomCubicSplineInterpolation(), G4StrUtil::contains(), G4VViewer::GetName(), G4UImanager::GetUIpointer(), G4VViewer::RefreshView(), G4VViewer::SetViewParameters(), and G4VViewer::ShowView().

Referenced by G4VVisCommand::InterpolateToNewView(), and G4VisCommandViewerInterpolate::SetNewValue().

◆ ItoS()

G4String G4UImessenger::ItoS ( G4int  i)
protectedinherited

Definition at line 82 of file G4UImessenger.cc.

83{
84 std::ostringstream os;
85 os << i;
86 return G4String(os.str());
87}

Referenced by G4GenericMessenger::DeclareMethod(), and G4ParticleGunMessenger::GetCurrentValue().

◆ operator!=()

G4bool G4UImessenger::operator!= ( const G4UImessenger messenger) const
inherited

Definition at line 76 of file G4UImessenger.cc.

77{
78 return this != &messenger;
79}

◆ operator=()

G4VisCommandSceneAddVolume & G4VisCommandSceneAddVolume::operator= ( const G4VisCommandSceneAddVolume )
private

◆ operator==()

G4bool G4UImessenger::operator== ( const G4UImessenger messenger) const
inherited

Definition at line 70 of file G4UImessenger.cc.

71{
72 return this == &messenger;
73}

◆ ProvideValueOfUnit()

G4bool G4VVisCommand::ProvideValueOfUnit ( const G4String where,
const G4String unit,
const G4String category,
G4double value 
)
protectedinherited

Definition at line 175 of file G4VVisCommand.cc.

180{
181 // Return false if there's a problem
182
184
185 G4bool success = true;
187 if (verbosity >= G4VisManager::warnings) {
188 G4cerr << where
189 << "\n Unit \"" << unit << "\" not defined"
190 << G4endl;
191 }
192 success = false;
193 } else if (G4UnitDefinition::GetCategory(unit) != category) {
194 if (verbosity >= G4VisManager::warnings) {
195 G4cerr << where
196 << "\n Unit \"" << unit << "\" not a unit of " << category;
197 if (category == "Volumic Mass") G4cerr << " (density)";
198 G4cerr << G4endl;
199 }
200 success = false;
201 } else {
202 value = G4UnitDefinition::GetValueOf(unit);
203 }
204 return success;
205}
static G4double GetValueOf(const G4String &)
static G4String GetCategory(const G4String &)

References G4VVisCommand::fpVisManager, G4cerr, G4endl, G4UnitDefinition::GetCategory(), G4UnitDefinition::GetValueOf(), G4VisManager::GetVerbosity(), G4UnitDefinition::IsUnitDefined(), and G4VisManager::warnings.

Referenced by G4VisCommandViewerColourByDensity::SetNewValue(), and G4VisCommandsViewerSet::SetNewValue().

◆ RefreshIfRequired()

void G4VVisCommand::RefreshIfRequired ( G4VViewer viewer)
protectedinherited

Definition at line 271 of file G4VVisCommand.cc.

271 {
273 G4VSceneHandler* sceneHandler = viewer->GetSceneHandler();
274 const G4ViewParameters& viewParams = viewer->GetViewParameters();
275 if (sceneHandler && sceneHandler->GetScene()) {
276 if (viewParams.IsAutoRefresh()) {
277 G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/refresh");
278 }
279 else {
280 if (verbosity >= G4VisManager::warnings) {
281 G4cout << "Issue /vis/viewer/refresh or flush to see effect."
282 << G4endl;
283 }
284 }
285 }
286}
const G4ViewParameters & GetViewParameters() const
G4VSceneHandler * GetSceneHandler() const

References G4UImanager::ApplyCommand(), G4VVisCommand::fpVisManager, G4cout, G4endl, G4VSceneHandler::GetScene(), G4VViewer::GetSceneHandler(), G4UImanager::GetUIpointer(), G4VisManager::GetVerbosity(), G4VViewer::GetViewParameters(), G4ViewParameters::IsAutoRefresh(), and G4VisManager::warnings.

Referenced by G4VisCommandViewerReset::SetNewValue(), G4VisCommandViewerRebuild::SetNewValue(), G4VisCommandViewerSelect::SetNewValue(), and G4VVisCommand::SetViewParameters().

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 3118 of file G4VisCommandsSceneAdd.cc.

3119 {
3120
3122 G4bool warn = verbosity >= G4VisManager::warnings;
3123
3125 if (!pScene) {
3126 if (verbosity >= G4VisManager::errors) {
3127 G4cerr << "ERROR: No current scene. Please create one." << G4endl;
3128 }
3129 return;
3130 }
3131
3132 G4String name, clipVolumeType, parameterUnit;
3133 G4int copyNo, requestedDepthOfDescent;
3134 G4double param1, param2, param3, param4, param5, param6;
3135 std::istringstream is (newValue);
3136 is >> name >> copyNo >> requestedDepthOfDescent
3137 >> clipVolumeType >> parameterUnit
3138 >> param1 >> param2 >> param3 >> param4 >> param5 >> param6;
3140 G4PhysicalVolumeModel::subtraction; // Default subtraction mode.
3141 if (clipVolumeType[size_t(0)] == '-') {
3142 clipVolumeType = clipVolumeType.substr(1); // Remove first character.
3143 } else if (clipVolumeType[size_t(0)] == '*') {
3145 clipVolumeType = clipVolumeType.substr(1);
3146 }
3147 G4double unit = G4UIcommand::ValueOf(parameterUnit);
3148 param1 *= unit; param2 *= unit; param3 *= unit;
3149 param4 *= unit; param5 *= unit; param6 *= unit;
3150
3151 G4VSolid* clippingSolid = nullptr;
3152 if (clipVolumeType == "box") {
3153 const G4double dX = (param2 - param1) / 2.;
3154 const G4double dY = (param4 - param3) / 2.;
3155 const G4double dZ = (param6 - param5) / 2.;
3156 const G4double x0 = (param2 + param1) / 2.;
3157 const G4double y0 = (param4 + param3) / 2.;
3158 const G4double z0 = (param6 + param5) / 2.;
3159 clippingSolid = new G4DisplacedSolid
3160 ("_displaced_clipping_box",
3161 new G4Box("_clipping_box",dX,dY,dZ),
3162 G4Translate3D(x0,y0,z0));
3163 }
3164
3165 G4TransportationManager* transportationManager =
3167
3168 size_t nWorlds = transportationManager->GetNoWorlds();
3169 if (nWorlds > 1) { // Parallel worlds in operation...
3170 if (verbosity >= G4VisManager::warnings) {
3171 static G4bool warned = false;
3172 if (!warned && name != "worlds") {
3173 G4cout <<
3174 "WARNING: Parallel worlds in operation. To visualise, specify"
3175 "\n \"worlds\" or the parallel world volume or sub-volume name"
3176 "\n and control visibility with /vis/geometry."
3177 << G4endl;
3178 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3179 transportationManager->GetWorldsIterator();
3180 for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3181 G4cout << " World " << i << ": " << (*iterWorld)->GetName()
3182 << G4endl;
3183 warned = true;
3184 }
3185 }
3186 }
3187 }
3188
3189 // Get the world (the initial value of the iterator points to the mass world).
3190 G4VPhysicalVolume* world = *(transportationManager->GetWorldsIterator());
3191
3192 if (!world) {
3193 if (verbosity >= G4VisManager::errors) {
3194 G4cerr <<
3195 "ERROR: G4VisCommandSceneAddVolume::SetNewValue:"
3196 "\n No world. Maybe the geometry has not yet been defined."
3197 "\n Try \"/run/initialize\""
3198 << G4endl;
3199 }
3200 return;
3201 }
3202
3203 std::vector<G4PhysicalVolumesSearchScene::Findings> findingsVector;
3204
3205 // When it comes to determining the extent of a physical volume we normally
3206 // assume the user wishes to ignore "invisible" volumes. For example, most
3207 // users make the world volume invisible. So we ask the physical volume
3208 // model to traverse the geometry hierarchy, starting at the named physical
3209 // volume, until it finds non-invisible ones, whose extents are accumulated
3210 // to determine the overall extent. (Once a non-invisible volume is found,
3211 // the search is curtailed - daughters are always contained within the mother
3212 // so they have no subsequent influence on the extent of the mother - but the
3213 // search continues at the same level until all highest level non-invisible
3214 // volumes are found an their extents accumulated.) So the default is
3215 G4bool useFullExtent = false;
3216 // However, the above procedure can be time consuming in some situations, such
3217 // as a nested parameterisation whose ultimate volumes are the first non-
3218 // visible ones, which are typical of a medical "phantom". So we assume here
3219 // below that if a user specifies a name other than "world" or "worlds" he/she
3220 // wished the extent to be determined by the volume, whether it is visible
3221 // or not. So we set useFullExtent true at that point below.
3222
3223 if (name == "world") {
3224
3225 findingsVector.push_back
3227
3228 } else if (name == "worlds") {
3229
3230 if (nWorlds <= 1) {
3231 if (verbosity >= G4VisManager::warnings) {
3232 G4cout <<
3233 "WARNING: G4VisCommandSceneAddVolume::SetNewValue:"
3234 "\n Parallel worlds requested but none exist."
3235 "\n Just adding material world."
3236 << G4endl;
3237 }
3238 }
3239 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3240 transportationManager->GetWorldsIterator();
3241 for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3242 findingsVector.push_back
3244 (*iterWorld,*iterWorld));
3245 }
3246
3247 } else { // Search all worlds...
3248
3249 // Use the model's full extent. This assumes the user wants these
3250 // volumes in the findings vector (there could be more than one) to
3251 // determine the scene's extent. Otherwise G4PhysicalVolumeModel would
3252 // re-calculate each volume's extent based on visibility, etc., which
3253 // could be time consuming.
3254 useFullExtent = true;
3255
3256 std::vector<G4VPhysicalVolume*>::iterator iterWorld =
3257 transportationManager->GetWorldsIterator();
3258 for (size_t i = 0; i < nWorlds; ++i, ++iterWorld) {
3259 G4ModelingParameters mp; // Default - no culling.
3260 G4PhysicalVolumeModel searchModel
3261 (*iterWorld,
3263 G4Transform3D(),
3264 &mp,
3265 useFullExtent);
3267 (&searchModel, name, copyNo, requestedDepthOfDescent);
3268 searchModel.DescribeYourselfTo (searchScene); // Initiate search.
3269 for (const auto& findings: searchScene.GetFindings()) {
3270 findingsVector.push_back(findings);
3271 }
3272 }
3273 }
3274
3275 for (const auto& findings: findingsVector) {
3276 // Set copy number from search findings for replicas and parameterisations.
3277 findings.fpFoundPV->SetCopyNo(findings.fFoundPVCopyNo);
3279 (findings.fpFoundPV,
3280 requestedDepthOfDescent,
3281 findings.fFoundObjectTransformation,
3282 0, // No modelling parameters (these are set later by the scene handler).
3283 useFullExtent,
3284 findings.fFoundBasePVPath);
3285 if (clippingSolid) {
3286 foundPVModel->SetClippingSolid(clippingSolid);
3287 foundPVModel->SetClippingMode(clippingMode);
3288 }
3289 if (!foundPVModel->Validate(warn)) return;
3290 // ...so add it to the scene.
3291 G4bool successful = pScene->AddRunDurationModel(foundPVModel,warn);
3292 if (successful) {
3293 if (verbosity >= G4VisManager::confirmations) {
3294 G4cout << "\"" << findings.fpFoundPV->GetName()
3295 << "\", copy no. " << findings.fFoundPVCopyNo
3296 << ",\n found in searched volume \""
3297 << findings.fpSearchPV->GetName()
3298 << "\" at depth " << findings.fFoundDepth
3299 << ",\n base path: \"" << findings.fFoundBasePVPath
3300 << "\",\n with a requested depth of further descent of ";
3301 if (requestedDepthOfDescent < 0) {
3302 G4cout << "<0 (unlimited)";
3303 }
3304 else {
3305 G4cout << requestedDepthOfDescent;
3306 }
3307 G4cout << ",\n has been added to scene \"" << pScene->GetName() << "\"."
3308 << G4endl;
3309 }
3310 } else {
3312 }
3313 }
3314
3315 if (findingsVector.empty()) {
3316 if (verbosity >= G4VisManager::errors) {
3317 G4cerr << "ERROR: Volume \"" << name << "\"";
3318 if (copyNo >= 0) {
3319 G4cerr << ", copy no. " << copyNo << ",";
3320 }
3321 G4cerr << " not found." << G4endl;
3322 }
3324 return;
3325 }
3326
3328}
HepGeom::Transform3D G4Transform3D
void SetClippingSolid(G4VSolid *pClippingSolid)
G4bool Validate(G4bool warn)
void SetClippingMode(ClippingMode mode)
G4bool AddRunDurationModel(G4VModel *, G4bool warn=false)
Definition: G4Scene.cc:158
const G4String & GetName() const
static G4TransportationManager * GetTransportationManager()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
size_t GetNoWorlds() const
void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
void CheckSceneAndNotifyHandlers(G4Scene *=nullptr)
G4Scene * GetCurrentScene() const
const char * name(G4int ptype)

References G4Scene::AddRunDurationModel(), G4VVisCommand::CheckSceneAndNotifyHandlers(), G4VisManager::confirmations, G4PhysicalVolumeModel::DescribeYourselfTo(), G4VisManager::errors, G4VVisCommand::fpVisManager, G4cerr, G4cout, G4endl, G4VVisCommand::G4VisCommandsSceneAddUnsuccessful(), G4VisManager::GetCurrentScene(), G4PhysicalVolumesSearchScene::GetFindings(), G4Scene::GetName(), G4TransportationManager::GetNoWorlds(), G4TransportationManager::GetTransportationManager(), G4VisManager::GetVerbosity(), G4TransportationManager::GetWorldsIterator(), G4PhysicalVolumeModel::intersection, G4InuclParticleNames::name(), G4PhysicalVolumeModel::SetClippingMode(), G4PhysicalVolumeModel::SetClippingSolid(), G4PhysicalVolumeModel::subtraction, G4PhysicalVolumeModel::UNLIMITED, G4PhysicalVolumeModel::Validate(), G4UIcommand::ValueOf(), G4VisManager::warnings, and G4InuclParticleNames::z0.

◆ SetViewParameters()

void G4VVisCommand::SetViewParameters ( G4VViewer viewer,
const G4ViewParameters viewParams 
)
protectedinherited

◆ SetVisManager()

void G4VVisCommand::SetVisManager ( G4VisManager pVisManager)
staticinherited

Definition at line 65 of file G4VVisCommand.cc.

66{
67 fpVisManager = pVisManager;
68}

References G4VVisCommand::fpVisManager.

Referenced by G4VisManager::G4VisManager().

◆ StoB()

G4bool G4UImessenger::StoB ( G4String  s)
protectedinherited

Definition at line 137 of file G4UImessenger.cc.

138{
140 G4bool vl = false;
141 if(v == "Y" || v == "YES" || v == "1" || v == "T" || v == "TRUE")
142 {
143 vl = true;
144 }
145 return vl;
146}
G4String to_upper_copy(G4String str)
Return uppercase copy of string.

References G4StrUtil::to_upper_copy().

Referenced by G4LocalThreadCoutMessenger::SetNewValue(), G4CascadeParamMessenger::SetNewValue(), G4ScoreQuantityMessenger::SetNewValue(), and G4ScoringMessenger::SetNewValue().

◆ StoD()

G4double G4UImessenger::StoD ( G4String  s)
protectedinherited

◆ StoI()

G4int G4UImessenger::StoI ( G4String  s)
protectedinherited

◆ StoL()

G4long G4UImessenger::StoL ( G4String  s)
protectedinherited

Definition at line 117 of file G4UImessenger.cc.

118{
119 G4long vl;
120 const char* t = str;
121 std::istringstream is(t);
122 is >> vl;
123 return vl;
124}
long G4long
Definition: G4Types.hh:87

Referenced by G4RunMessenger::SetNewValue().

Field Documentation

◆ baseDir

G4UIdirectory* G4UImessenger::baseDir = nullptr
protectedinherited

◆ baseDirName

G4String G4UImessenger::baseDirName = ""
protectedinherited

◆ commandsShouldBeInMaster

G4bool G4UImessenger::commandsShouldBeInMaster = false
protectedinherited

◆ fCurrentArrow3DLineSegmentsPerCircle

G4int G4VVisCommand::fCurrentArrow3DLineSegmentsPerCircle = 6
staticprotectedinherited

◆ fCurrentColour

G4Colour G4VVisCommand::fCurrentColour = G4Colour::White()
staticprotectedinherited

◆ fCurrentExtentForField

G4VisExtent G4VVisCommand::fCurrentExtentForField
staticprotectedinherited

◆ fCurrentLineWidth

G4double G4VVisCommand::fCurrentLineWidth = 1.
staticprotectedinherited

◆ fCurrentTextColour

G4Colour G4VVisCommand::fCurrentTextColour = G4Colour::Blue()
staticprotectedinherited

◆ fCurrentTextLayout

G4Text::Layout G4VVisCommand::fCurrentTextLayout = G4Text::left
staticprotectedinherited

◆ fCurrentTextSize

G4double G4VVisCommand::fCurrentTextSize = 12.
staticprotectedinherited

◆ fCurrentTouchableProperties

G4PhysicalVolumeModel::TouchableProperties G4VVisCommand::fCurrentTouchableProperties
staticprotectedinherited

◆ fCurrrentPVFindingsForField

std::vector< G4PhysicalVolumesSearchScene::Findings > G4VVisCommand::fCurrrentPVFindingsForField
staticprotectedinherited

◆ fpCommand

G4UIcommand* G4VisCommandSceneAddVolume::fpCommand
private

Definition at line 488 of file G4VisCommandsSceneAdd.hh.

◆ fpVisManager

G4VisManager * G4VVisCommand::fpVisManager = nullptr
staticprotectedinherited

Definition at line 143 of file G4VVisCommand.hh.

Referenced by G4VisCommandSceneAddUserAction::AddVisAction(), G4VVisCommand::CheckSceneAndNotifyHandlers(), G4VVisCommand::CheckView(), G4VVisCommand::ConvertToColour(), G4VVisCommand::ConvertToDoublePair(), G4VVisCommandScene::CurrentSceneName(), G4VVisCommand::DrawExtent(), G4VisCommandSceneHandlerCreate::G4VisCommandSceneHandlerCreate(), G4VisCommandSceneHandlerAttach::GetCurrentValue(), G4VisCommandSceneHandlerCreate::GetCurrentValue(), G4VisCommandViewerClear::GetCurrentValue(), G4VisCommandViewerClearTransients::GetCurrentValue(), G4VisCommandViewerClone::GetCurrentValue(), G4VisCommandViewerCreate::GetCurrentValue(), G4VisCommandViewerFlush::GetCurrentValue(), G4VisCommandViewerReset::GetCurrentValue(), G4VisCommandViewerRefresh::GetCurrentValue(), G4VisCommandViewerRebuild::GetCurrentValue(), G4VisCommandViewerUpdate::GetCurrentValue(), G4VVisCommand::GetVisManager(), G4VisCommandViewerCreate::NextName(), G4VisCommandSceneAddEventID::EventID::operator()(), G4VVisCommand::ProvideValueOfUnit(), G4VVisCommand::RefreshIfRequired(), G4VVisCommandGeometrySet::Set(), G4VVisCommandGeometrySet::SetLVVisAtts(), G4ToolsSGSceneHandler::Messenger::SetNewValue(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::Messenger::SetNewValue(), G4VisCommandAbortReviewKeptEvents::SetNewValue(), G4VisCommandDrawOnlyToBeKeptEvents::SetNewValue(), G4VisCommandEnable::SetNewValue(), G4VisCommandInitialize::SetNewValue(), G4VisCommandList::SetNewValue(), G4VisCommandReviewKeptEvents::SetNewValue(), G4VisCommandVerbose::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawLogicalVolume::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandGeometryList::SetNewValue(), G4VisCommandGeometryRestore::SetNewValue(), G4VisCommandGeometrySetDaughtersInvisible::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValue(), G4VisCommandSceneActivateModel::SetNewValue(), G4VisCommandSceneCreate::SetNewValue(), G4VisCommandSceneEndOfEventAction::SetNewValue(), G4VisCommandSceneEndOfRunAction::SetNewValue(), G4VisCommandSceneList::SetNewValue(), G4VisCommandSceneNotifyHandlers::SetNewValue(), G4VisCommandSceneRemoveModel::SetNewValue(), G4VisCommandSceneSelect::SetNewValue(), G4VisCommandSceneShowExtents::SetNewValue(), G4VisCommandSceneAddArrow::SetNewValue(), G4VisCommandSceneAddArrow2D::SetNewValue(), G4VisCommandSceneAddAxes::SetNewValue(), G4VisCommandSceneAddDate::SetNewValue(), G4VisCommandSceneAddDigis::SetNewValue(), G4VisCommandSceneAddEventID::SetNewValue(), G4VisCommandSceneAddExtent::SetNewValue(), G4VisCommandSceneAddElectricField::SetNewValue(), G4VisCommandSceneAddFrame::SetNewValue(), G4VisCommandSceneAddGPS::SetNewValue(), G4VisCommandSceneAddHits::SetNewValue(), G4VisCommandSceneAddLine::SetNewValue(), G4VisCommandSceneAddLine2D::SetNewValue(), G4VisCommandSceneAddLocalAxes::SetNewValue(), G4VisCommandSceneAddLogicalVolume::SetNewValue(), G4VisCommandSceneAddLogo::SetNewValue(), G4VisCommandSceneAddLogo2D::SetNewValue(), G4VisCommandSceneAddMagneticField::SetNewValue(), G4VisCommandSceneAddPSHits::SetNewValue(), G4VisCommandSceneAddScale::SetNewValue(), G4VisCommandSceneAddText::SetNewValue(), G4VisCommandSceneAddText2D::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSceneAddUserAction::SetNewValue(), SetNewValue(), G4VisCommandSceneAddPlotter::SetNewValue(), G4VisCommandSceneHandlerAttach::SetNewValue(), G4VisCommandSceneHandlerCreate::SetNewValue(), G4VisCommandSceneHandlerList::SetNewValue(), G4VisCommandSceneHandlerSelect::SetNewValue(), G4VisCommandSetArrow3DLineSegmentsPerCircle::SetNewValue(), G4VisCommandSetColour::SetNewValue(), G4VisCommandSetExtentForField::SetNewValue(), G4VisCommandSetLineWidth::SetNewValue(), G4VisCommandSetTextColour::SetNewValue(), G4VisCommandSetTextLayout::SetNewValue(), G4VisCommandSetTextSize::SetNewValue(), G4VisCommandSetTouchable::SetNewValue(), G4VisCommandSetVolumeForField::SetNewValue(), G4VisCommandsTouchable::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandViewerAddCutawayPlane::SetNewValue(), G4VisCommandViewerCentreOn::SetNewValue(), G4VisCommandViewerChangeCutawayPlane::SetNewValue(), G4VisCommandViewerClear::SetNewValue(), G4VisCommandViewerClearCutawayPlanes::SetNewValue(), G4VisCommandViewerClearTransients::SetNewValue(), G4VisCommandViewerClearVisAttributesModifiers::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandViewerColourByDensity::SetNewValue(), G4VisCommandViewerCopyViewFrom::SetNewValue(), G4VisCommandViewerCreate::SetNewValue(), G4VisCommandViewerDolly::SetNewValue(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerInterpolate::SetNewValue(), G4VisCommandViewerList::SetNewValue(), G4VisCommandViewerPan::SetNewValue(), G4VisCommandViewerReset::SetNewValue(), G4VisCommandViewerRefresh::SetNewValue(), G4VisCommandViewerRebuild::SetNewValue(), G4VisCommandViewerSave::SetNewValue(), G4VisCommandViewerScale::SetNewValue(), G4VisCommandViewerSelect::SetNewValue(), G4VisCommandViewerUpdate::SetNewValue(), G4VisCommandViewerZoom::SetNewValue(), G4VisCommandViewerDefaultHiddenEdge::SetNewValue(), G4VisCommandViewerDefaultStyle::SetNewValue(), G4VisCommandsViewerSet::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValueOnLV(), and G4VVisCommand::SetVisManager().

◆ fThereWasAViewer

G4bool G4VVisCommand::fThereWasAViewer = false
staticprotectedinherited

◆ fVPExistingViewer

G4ViewParameters G4VVisCommand::fVPExistingViewer
staticprotectedinherited

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