Geant4-11
Data Structures | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
G4VisCommandSceneAddScale Class Reference

#include <G4VisCommandsSceneAdd.hh>

Inheritance diagram for G4VisCommandSceneAddScale:
G4VVisCommandScene G4VVisCommand G4UImessenger

Data Structures

struct  Scale
 

Public Member Functions

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

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

 G4VisCommandSceneAddScale (const G4VisCommandSceneAddScale &)
 
G4VisCommandSceneAddScaleoperator= (const G4VisCommandSceneAddScale &)
 

Private Attributes

G4UIcommandfpCommand
 

Detailed Description

Definition at line 380 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddScale() [1/2]

G4VisCommandSceneAddScale::G4VisCommandSceneAddScale ( )

Definition at line 2147 of file G4VisCommandsSceneAdd.cc.

2147 {
2148 G4bool omitable;
2149 fpCommand = new G4UIcommand ("/vis/scene/add/scale", this);
2150 fpCommand -> SetGuidance
2151 ("Adds an annotated scale line to the current scene.");
2152 fpCommand -> SetGuidance
2153 ("If \"unit\" is \"auto\", length is roughly one tenth of the scene extent.");
2154 fpCommand -> SetGuidance
2155 ("If \"direction\" is \"auto\", scale is roughly in the plane of the current view.");
2156 fpCommand -> SetGuidance
2157 ("If \"placement\" is \"auto\", scale is placed at bottom left of current view."
2158 "\n Otherwise placed at (xmid,ymid,zmid).");
2159 fpCommand -> SetGuidance
2160 ("An annotated line in the specified direction with tick marks at the"
2161 "\nend. If autoPlacing is true it is required to be centred at the"
2162 "\nfront, right, bottom corner of the world space, comfortably outside"
2163 "\nthe existing bounding box/sphere so that existing objects do not"
2164 "\nobscure it. Otherwise it is required to be drawn with mid-point at"
2165 "\n(xmid, ymid, zmid)."
2166 "\n"
2167 "\nThe auto placing algorithm is (approx):"
2168 "\n x = xmin + (1 + comfort) * (xmax - xmin);"
2169 "\n y = ymin - comfort * (ymax - ymin);"
2170 "\n z = zmin + (1 + comfort) * (zmax - zmin);"
2171 "\n if direction == x then (x - length,y,z) to (x,y,z);"
2172 "\n if direction == y then (x,y,z) to (x,y + length,z);"
2173 "\n if direction == z then (x,y,z - length) to (x,y,z);"
2174 );
2175 G4UIparameter* parameter;
2176 parameter = new G4UIparameter ("length", 'd', omitable = true);
2177 parameter->SetDefaultValue (1.);
2178 fpCommand->SetParameter (parameter);
2179 parameter = new G4UIparameter ("unit", 's', omitable = true);
2180 parameter->SetDefaultValue ("auto");
2181 fpCommand->SetParameter (parameter);
2182 parameter = new G4UIparameter ("direction", 's', omitable = true);
2183 parameter->SetGuidance ("auto|x|y|z");
2184 parameter->SetDefaultValue ("auto");
2185 fpCommand->SetParameter (parameter);
2186 parameter = new G4UIparameter ("red", 'd', omitable = true);
2187 parameter->SetDefaultValue (1.);
2188 fpCommand->SetParameter (parameter);
2189 parameter = new G4UIparameter ("green", 'd', omitable = true);
2190 parameter->SetDefaultValue (0.);
2191 fpCommand->SetParameter (parameter);
2192 parameter = new G4UIparameter ("blue", 'd', omitable = true);
2193 parameter->SetDefaultValue (0.);
2194 fpCommand->SetParameter (parameter);
2195 parameter = new G4UIparameter ("placement", 's', omitable = true);
2196 parameter -> SetParameterCandidates("auto manual");
2197 parameter->SetDefaultValue ("auto");
2198 fpCommand->SetParameter (parameter);
2199 parameter = new G4UIparameter ("xmid", 'd', omitable = true);
2200 parameter->SetDefaultValue (0.);
2201 fpCommand->SetParameter (parameter);
2202 parameter = new G4UIparameter ("ymid", 'd', omitable = true);
2203 parameter->SetDefaultValue (0.);
2204 fpCommand->SetParameter (parameter);
2205 parameter = new G4UIparameter ("zmid", 'd', omitable = true);
2206 parameter->SetDefaultValue (0.);
2207 fpCommand->SetParameter (parameter);
2208 parameter = new G4UIparameter ("unit", 's', omitable = true);
2209 parameter->SetDefaultValue ("m");
2210 fpCommand->SetParameter (parameter);
2211}
bool G4bool
Definition: G4Types.hh:86
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:146
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)

References G4VisCommandSceneAddLine2D::fpCommand, G4UIparameter::SetDefaultValue(), G4UIparameter::SetGuidance(), and G4UIcommand::SetParameter().

◆ ~G4VisCommandSceneAddScale()

G4VisCommandSceneAddScale::~G4VisCommandSceneAddScale ( )
virtual

Definition at line 2213 of file G4VisCommandsSceneAdd.cc.

2213 {
2214 delete fpCommand;
2215}

References G4VisCommandSceneAddLine2D::fpCommand.

◆ G4VisCommandSceneAddScale() [2/2]

G4VisCommandSceneAddScale::G4VisCommandSceneAddScale ( const G4VisCommandSceneAddScale )
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(), SetNewValue(), G4VisCommandSceneAddText::SetNewValue(), G4VisCommandSceneAddText2D::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSceneAddUserAction::SetNewValue(), G4VisCommandSceneAddVolume::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

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 G4VisCommandSceneAddScale::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2217 of file G4VisCommandsSceneAdd.cc.

2217 {
2218 return "";
2219}

◆ 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=()

G4VisCommandSceneAddScale & G4VisCommandSceneAddScale::operator= ( const G4VisCommandSceneAddScale )
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 G4VisCommandSceneAddScale::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 2221 of file G4VisCommandsSceneAdd.cc.

2221 {
2222
2224 G4bool warn = verbosity >= G4VisManager::warnings;
2225
2227 if (!pScene) {
2228 if (verbosity >= G4VisManager::errors) {
2229 G4cerr << "ERROR: No current scene. Please create one." << G4endl;
2230 }
2231 return;
2232 } else {
2233 if (pScene->GetExtent().GetExtentRadius() <= 0.) {
2234 if (verbosity >= G4VisManager::errors) {
2235 G4cerr
2236 << "ERROR: Scene has no extent. Add volumes or use \"/vis/scene/add/extent\"."
2237 << G4endl;
2238 }
2239 return;
2240 }
2241 }
2242
2243 G4double userLength, red, green, blue, xmid, ymid, zmid;
2244 G4String userLengthUnit, direction, placement, positionUnit;
2245 std::istringstream is (newValue);
2246 is >> userLength >> userLengthUnit >> direction
2247 >> red >> green >> blue
2248 >> placement
2249 >> xmid >> ymid >> zmid >> positionUnit;
2250
2251 G4double length = userLength;
2252 const G4VisExtent& sceneExtent = pScene->GetExtent(); // Existing extent.
2253 if (userLengthUnit == "auto") {
2254 const G4double lengthMax = 0.5 * sceneExtent.GetExtentRadius();
2255 const G4double intLog10Length = std::floor(std::log10(lengthMax));
2256 length = std::pow(10,intLog10Length);
2257 if (5.*length < lengthMax) length *= 5.;
2258 else if (2.*length < lengthMax) length *= 2.;
2259 } else {
2260 length *= G4UIcommand::ValueOf(userLengthUnit);
2261 }
2262 G4String annotation = G4BestUnit(length,"Length");
2263
2264 G4double unit = G4UIcommand::ValueOf(positionUnit);
2265 xmid *= unit; ymid *= unit; zmid *= unit;
2266
2267 Scale::Direction scaleDirection (Scale::x);
2268 if (direction[0] == 'y') scaleDirection = Scale::y;
2269 if (direction[0] == 'z') scaleDirection = Scale::z;
2270
2272 if (!pViewer) {
2273 if (verbosity >= G4VisManager::errors) {
2274 G4cerr <<
2275 "ERROR: G4VisCommandSceneAddScale::SetNewValue: no viewer."
2276 "\n Auto direction needs a viewer."
2277 << G4endl;
2278 }
2279 return;
2280 }
2281
2282 const G4Vector3D& vp =
2284 const G4Vector3D& up =
2285 pViewer->GetViewParameters().GetUpVector();
2286
2287 if (direction == "auto") { // Takes cue from viewer.
2288 if (std::abs(vp.x()) > std::abs(vp.y()) &&
2289 std::abs(vp.x()) > std::abs(vp.z())) { // x viewpoint
2290 if (std::abs(up.y()) > std::abs(up.z())) scaleDirection = Scale::z;
2291 else scaleDirection = Scale::y;
2292 }
2293 else if (std::abs(vp.y()) > std::abs(vp.x()) &&
2294 std::abs(vp.y()) > std::abs(vp.z())) { // y viewpoint
2295 if (std::abs(up.x()) > std::abs(up.z())) scaleDirection = Scale::z;
2296 else scaleDirection = Scale::x;
2297 }
2298 else if (std::abs(vp.z()) > std::abs(vp.x()) &&
2299 std::abs(vp.z()) > std::abs(vp.y())) { // z viewpoint
2300 if (std::abs(up.y()) > std::abs(up.x())) scaleDirection = Scale::x;
2301 else scaleDirection = Scale::y;
2302 }
2303 }
2304
2305 G4bool autoPlacing = false; if (placement == "auto") autoPlacing = true;
2306 // Parameters read and interpreted.
2307
2308 // Useful constants, etc...
2309 const G4double halfLength(length / 2.);
2310 const G4double comfort(0.01); // 0.15 seems too big. 0.05 might be better.
2311 const G4double freeLengthFraction (1. + 2. * comfort);
2312
2313 const G4double xmin = sceneExtent.GetXmin();
2314 const G4double xmax = sceneExtent.GetXmax();
2315 const G4double ymin = sceneExtent.GetYmin();
2316 const G4double ymax = sceneExtent.GetYmax();
2317 const G4double zmin = sceneExtent.GetZmin();
2318 const G4double zmax = sceneExtent.GetZmax();
2319
2320 // Test existing extent and issue warnings...
2321 G4bool worried = false;
2322 if (sceneExtent.GetExtentRadius() == 0) {
2323 worried = true;
2324 if (verbosity >= G4VisManager::warnings) {
2325 G4cout <<
2326 "WARNING: Existing scene does not yet have any extent."
2327 "\n Maybe you have not yet added any geometrical object."
2328 << G4endl;
2329 }
2330 }
2331
2332 // Test existing scene for room...
2333 G4bool room = true;
2334 switch (scaleDirection) {
2335 case Scale::x:
2336 if (freeLengthFraction * (xmax - xmin) < length) room = false;
2337 break;
2338 case Scale::y:
2339 if (freeLengthFraction * (ymax - ymin) < length) room = false;
2340 break;
2341 case Scale::z:
2342 if (freeLengthFraction * (zmax - zmin) < length) room = false;
2343 break;
2344 }
2345 if (!room) {
2346 worried = true;
2347 if (verbosity >= G4VisManager::warnings) {
2348 G4cout <<
2349 "WARNING: Not enough room in existing scene. Maybe scale is too long."
2350 << G4endl;
2351 }
2352 }
2353 if (worried) {
2354 if (verbosity >= G4VisManager::warnings) {
2355 G4cout <<
2356 "WARNING: The scale you have asked for is bigger than the existing"
2357 "\n scene. Maybe you have added it too soon. It is recommended that"
2358 "\n you add the scale last so that it can be correctly auto-positioned"
2359 "\n so as not to be obscured by any existing object and so that the"
2360 "\n view parameters can be correctly recalculated."
2361 << G4endl;
2362 }
2363 }
2364
2365 // Now figure out the extent...
2366 //
2367 // This creates a representation of annotated line in the specified
2368 // direction with tick marks at the end. If autoPlacing is true it
2369 // is required to be centred at the front, right, bottom corner of
2370 // the world space, comfortably outside the existing bounding
2371 // box/sphere so that existing objects do not obscure it. Otherwise
2372 // it is required to be drawn with mid-point at (xmid, ymid, zmid).
2373 //
2374 // The auto placing algorithm might be:
2375 // x = xmin + (1 + comfort) * (xmax - xmin)
2376 // y = ymin - comfort * (ymax - ymin)
2377 // z = zmin + (1 + comfort) * (zmax - zmin)
2378 // if direction == x then (x - length,y,z) to (x,y,z)
2379 // if direction == y then (x,y,z) to (x,y + length,z)
2380 // if direction == z then (x,y,z - length) to (x,y,z)
2381 //
2382 // Implement this in two parts. Here, use the scale's extent to
2383 // "expand" the scene's extent. Then rendering - in
2384 // G4VSceneHandler::AddPrimitive(const G4Scale&) - simply has to
2385 // ensure it's within the new extent.
2386 //
2387
2388 G4double sxmid(xmid), symid(ymid), szmid(zmid);
2389 if (autoPlacing) {
2390 // Aim to place at bottom right of screen in current view.
2391 // Give some comfort zone.
2392 const G4double xComfort = comfort * (xmax - xmin);
2393 const G4double yComfort = comfort * (ymax - ymin);
2394 const G4double zComfort = comfort * (zmax - zmin);
2395 switch (scaleDirection) {
2396 case Scale::x:
2397 if (vp.z() > 0.) {
2398 sxmid = xmax + xComfort;
2399 symid = ymin - yComfort;
2400 szmid = zmin - zComfort;
2401 } else {
2402 sxmid = xmin - xComfort;
2403 symid = ymin - yComfort;
2404 szmid = zmax + zComfort;
2405 }
2406 break;
2407 case Scale::y:
2408 if (vp.x() > 0.) {
2409 sxmid = xmin - xComfort;
2410 symid = ymax + yComfort;
2411 szmid = zmin - zComfort;
2412 } else {
2413 sxmid = xmax + xComfort;
2414 symid = ymin - yComfort;
2415 szmid = zmin - zComfort;
2416 }
2417 break;
2418 case Scale::z:
2419 if (vp.x() > 0.) {
2420 sxmid = xmax + xComfort;
2421 symid = ymin - yComfort;
2422 szmid = zmax + zComfort;
2423 } else {
2424 sxmid = xmin - xComfort;
2425 symid = ymin - yComfort;
2426 szmid = zmax + zComfort;
2427 }
2428 break;
2429 }
2430 }
2431
2433 const G4double h = halfLength;
2434 const G4double t = h/5.;
2435 G4VisExtent scaleExtent(-h,h,-t,t,-t,t);
2436 switch (scaleDirection) {
2437 case Scale::x:
2438 break;
2439 case Scale::y:
2441 break;
2442 case Scale::z:
2444 break;
2445 }
2446 transform = G4Translate3D(sxmid,symid,szmid) * transform;
2447 scaleExtent = scaleExtent.Transform(transform);
2448
2449 G4Colour colour(red, green, blue);
2450 if (direction == "auto") {
2451 switch (scaleDirection) {
2452 case Scale::x:
2453 colour = G4Colour::Red();
2454 break;
2455 case Scale::y:
2456 colour = G4Colour::Green();
2457 break;
2458 case Scale::z:
2459 colour = G4Colour::Blue();
2460 break;
2461 }
2462 }
2463 G4VisAttributes visAttr(colour);
2464
2465 Scale* scale = new Scale
2466 (visAttr, length, transform,
2467 annotation, fCurrentTextSize, colour);
2468 G4VModel* model = new G4CallbackModel<Scale>(scale);
2469 model->SetType("Scale");
2470 model->SetGlobalTag("Scale");
2471 model->SetGlobalDescription("Scale: " + newValue);
2472 model->SetExtent(scaleExtent);
2473
2474 const G4String& currentSceneName = pScene -> GetName ();
2475 G4bool successful = pScene -> AddRunDurationModel (model, warn);
2476 if (successful) {
2477 if (verbosity >= G4VisManager::confirmations) {
2478 G4cout << "Scale of " << annotation
2479 << " added to scene \"" << currentSceneName << "\".";
2480 if (verbosity >= G4VisManager::parameters) {
2481 G4cout << "\n with extent " << scaleExtent
2482 << "\n at " << transform.getRotation()
2483 << " " << transform.getTranslation();
2484 }
2485 G4cout << G4endl;
2486 }
2487 }
2488 else G4VisCommandsSceneAddUnsuccessful(verbosity);
2489
2491}
static constexpr double halfpi
Definition: G4SIunits.hh:57
#define G4BestUnit(a, b)
HepGeom::RotateZ3D G4RotateZ3D
HepGeom::RotateY3D G4RotateY3D
static G4Colour Green()
Definition: G4Colour.hh:162
static G4Colour Blue()
Definition: G4Colour.hh:163
const G4VisExtent & GetExtent() const
void SetType(const G4String &)
void SetGlobalDescription(const G4String &)
void SetGlobalTag(const G4String &)
void SetExtent(const G4VisExtent &)
static G4double fCurrentTextSize
void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
void CheckSceneAndNotifyHandlers(G4Scene *=nullptr)
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:75
G4Scene * GetCurrentScene() const
G4VViewer * GetCurrentViewer() const
G4bool transform(G4String &input, const G4String &type)

References G4Colour::Blue(), G4VVisCommand::CheckSceneAndNotifyHandlers(), G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fCurrentTextSize, G4VVisCommand::fpVisManager, G4BestUnit, G4cerr, G4cout, G4endl, G4VVisCommand::G4VisCommandsSceneAddUnsuccessful(), G4VisManager::GetCurrentScene(), G4VisManager::GetCurrentViewer(), G4Scene::GetExtent(), G4VisExtent::GetExtentRadius(), G4ViewParameters::GetUpVector(), G4VisManager::GetVerbosity(), G4VViewer::GetViewParameters(), G4ViewParameters::GetViewpointDirection(), G4VisExtent::GetXmax(), G4VisExtent::GetXmin(), G4VisExtent::GetYmax(), G4VisExtent::GetYmin(), G4VisExtent::GetZmax(), G4VisExtent::GetZmin(), G4Colour::Green(), halfpi, G4VisManager::parameters, G4Colour::Red(), G4VModel::SetExtent(), G4VModel::SetGlobalDescription(), G4VModel::SetGlobalTag(), G4VModel::SetType(), G4VisExtent::Transform(), G4coutFormatters::anonymous_namespace{G4coutFormatters.cc}::transform(), G4UIcommand::ValueOf(), G4VisManager::warnings, HepGeom::BasicVector3D< T >::x(), HepGeom::BasicVector3D< T >::y(), and HepGeom::BasicVector3D< T >::z().

◆ 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* G4VisCommandSceneAddScale::fpCommand
private

◆ 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(), SetNewValue(), G4VisCommandSceneAddText::SetNewValue(), G4VisCommandSceneAddText2D::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSceneAddUserAction::SetNewValue(), G4VisCommandSceneAddVolume::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: