50 (
"/vis/touchable/set/colour",
this);
51 fpCommandSetColour->
SetGuidance(
"Set colour of current touchable.");
53 (
"Use \"/vis/set/touchable\" to set current touchable.");
55 (
"If \"red\" is a string understood by the vis system it will be taken."
56 "\n Otherwise the values of \red\", \"green\", etc., are used.");
66 parameter =
new G4UIparameter(
"opacity",
'd', omitable =
true);
71 (
"/vis/touchable/set/daughtersInvisible",
this);
73 (
"Daughters of current touchable invisible: true/false.");
75 (
"Use \"/vis/set/touchable\" to set current touchable.");
76 fpCommandSetDaughtersInvisible->
SetParameterName(
"daughtersInvisible", omitable =
true);
80 (
"/vis/touchable/set/forceAuxEdgeVisible",
this);
82 (
"Force auxiliary (soft) edges of current touchable to be visible: true/false.");
84 (
"Use \"/vis/set/touchable\" to set current touchable.");
85 fpCommandSetForceAuxEdgeVisible->
SetParameterName(
"forceAuxEdgeVisible", omitable =
true);
89 (
"/vis/touchable/set/lineSegmentsPerCircle",
this);
91 (
"For current touchable, set number of line segments per circle, the"
92 "\nprecision with which a curved line or surface is represented by a"
93 "\npolygon or polyhedron, regardless of the view parameters."
94 "\nNegative to pick up G4Polyhedron default value.");
96 (
"Use \"/vis/set/touchable\" to set current touchable.");
97 fpCommandSetLineSegmentsPerCircle->
SetParameterName(
"lineSegmentsPerCircle", omitable =
true);
101 (
"/vis/touchable/set/forceSolid",
this);
103 (
"Force current touchable always to be drawn solid (surface drawing).");
105 (
"Use \"/vis/set/touchable\" to set current touchable.");
110 (
"/vis/touchable/set/forceWireframe",
this);
112 (
"Force current touchable always to be drawn as wireframe.");
114 (
"Use \"/vis/set/touchable\" to set current touchable.");
115 fpCommandSetForceWireframe->
SetParameterName(
"forceWireframe", omitable =
true);
119 (
"/vis/touchable/set/lineStyle",
this);
120 fpCommandSetLineStyle->
SetGuidance(
"Set line style of current touchable drawing.");
122 (
"Use \"/vis/set/touchable\" to set current touchable.");
124 fpCommandSetLineStyle->
SetCandidates(
"unbroken dashed dotted");
128 (
"/vis/touchable/set/lineWidth",
this);
129 fpCommandSetLineWidth->
SetGuidance(
"Set line width of current touchable.");
131 (
"Use \"/vis/set/touchable\" to set current touchable.");
136 (
"/vis/touchable/set/visibility",
this);
138 (
"Set visibility of current touchable: true/false.");
140 (
"Use \"/vis/set/touchable\" to set current touchable.");
146 delete fpCommandSetVisibility;
147 delete fpCommandSetLineWidth;
148 delete fpCommandSetLineStyle;
149 delete fpCommandSetForceWireframe;
150 delete fpCommandSetForceSolid;
151 delete fpCommandSetLineSegmentsPerCircle;
152 delete fpCommandSetForceAuxEdgeVisible;
153 delete fpCommandSetDaughtersInvisible;
154 delete fpCommandSetColour;
166 G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
167 if (!currentViewer) {
170 "ERROR: G4VisCommandsTouchableSet::SetNewValue: no current viewer."
179 if (command == fpCommandSetColour)
183 std::istringstream iss(newValue);
184 iss >> redOrString >> green >> blue >> opacity;
186 const size_t iPos0 = 0;
187 if (std::isalpha(redOrString[iPos0])) {
190 G4cout <<
"WARNING: Colour \"" << redOrString
191 <<
"\" not found. Defaulting to white and opaque."
206 fCurrentTouchablePath));
209 else if (command == fpCommandSetDaughtersInvisible) {
215 fCurrentTouchablePath));
218 else if (command == fpCommandSetForceAuxEdgeVisible) {
224 fCurrentTouchablePath));
227 else if (command == fpCommandSetLineSegmentsPerCircle) {
234 fCurrentTouchablePath));
237 else if (command == fpCommandSetForceSolid) {
243 fCurrentTouchablePath));
246 else if (command == fpCommandSetForceWireframe) {
252 fCurrentTouchablePath));
255 else if (command == fpCommandSetLineStyle) {
257 if (newValue ==
"dashed") {
259 }
else if (newValue ==
"dotted") {
268 fCurrentTouchablePath));
271 else if (command == fpCommandSetLineWidth) {
277 fCurrentTouchablePath));
280 else if (command == fpCommandSetVisibility) {
286 fCurrentTouchablePath));
292 "ERROR: G4VisCommandsTouchableSet::SetNewValue: unrecognised command."
298 SetViewParameters(currentViewer,workingVP);
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameter(G4UIparameter *const newParameter)
void SetColour(const G4Colour &)
void SetForceWireframe(G4bool)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4String GetCurrentValue(G4UIcommand *command)
void SetLineStyle(LineStyle)
void SetLineWidth(G4double)
void SetVisibility(G4bool)
const G4ViewParameters & GetViewParameters() const
static G4bool GetColour(const G4String &key, G4Colour &result)
void SetDefaultValue(const char *theDefaultValue)
void SetForceSolid(G4bool)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4GLOB_DLL std::ostream G4cout
virtual ~G4VisCommandsTouchableSet()
static G4bool ConvertToBool(const char *st)
G4double GetGreen() const
void SetGuidance(const char *aGuidance)
void SetNewValue(G4UIcommand *command, G4String newValue)
static G4double ConvertToDouble(const char *st)
void SetForceAuxEdgeVisible(G4bool)
static G4int ConvertToInt(const char *st)
void AddVisAttributesModifier(const G4ModelingParameters::VisAttributesModifier &)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4double defVal)
G4VisCommandsTouchableSet()
void SetCandidates(const char *candidateList)
void SetDefaultValue(G4int defVal)
void SetDaughtersInvisible(G4bool)
void SetForceLineSegmentsPerCircle(G4int nSegments)