Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VisCommandGeometrySetColour Class Reference

#include <G4VisCommandsGeometrySet.hh>

Inheritance diagram for G4VisCommandGeometrySetColour:
Collaboration diagram for G4VisCommandGeometrySetColour:

Public Member Functions

 G4VisCommandGeometrySetColour ()
 
virtual ~G4VisCommandGeometrySetColour ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandGeometry
virtual ~G4VVisCommandGeometry ()
 
- Public Member Functions inherited from G4VVisCommand
 G4VVisCommand ()
 
virtual ~G4VVisCommand ()
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
static const G4ColourGetCurrentColour ()
 
static G4double GetCurrentLineWidth ()
 
static const G4ColourGetCurrentTextColour ()
 
static G4Text::Layout GetCurrentTextLayout ()
 
static G4double GetCurrentTextSize ()
 
- Protected Types inherited from G4VVisCommandGeometry
typedef std::map
< G4LogicalVolume *, const
G4VisAttributes * >
::const_iterator 
VisAttsMapIterator
 
- Protected Member Functions inherited from G4VVisCommandGeometrySet
void Set (G4String logVolName, const G4VVisCommandGeometrySetFunction &, G4int requestedDepth)
 
void SetLVVisAtts (G4LogicalVolume *, const G4VVisCommandGeometrySetFunction &, G4int depth, G4int requestedDepth)
 
- Protected Member Functions inherited from G4VVisCommand
void UpdateVisManagerScene (const G4String &sceneName="")
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Static Protected Member Functions inherited from G4VVisCommand
static G4String ConvertToString (G4double x, G4double y, const char *unitName)
 
static void ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 
- Static Protected Attributes inherited from G4VVisCommandGeometry
static std::map
< G4LogicalVolume *, const
G4VisAttributes * > 
fVisAttsMap
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4int fErrorCode = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4double fCurrentLineWidth = 1.
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentTextSize = 12.
 
static
G4ModelingParameters::PVNameCopyNoPath 
fCurrentTouchablePath
 

Detailed Description

Definition at line 179 of file G4VisCommandsGeometrySet.hh.

Constructor & Destructor Documentation

G4VisCommandGeometrySetColour::G4VisCommandGeometrySetColour ( )

Definition at line 106 of file G4VisCommandsGeometrySet.cc.

107 {
108  G4bool omitable;
109  fpCommand = new G4UIcommand("/vis/geometry/set/colour", this);
110  fpCommand->SetGuidance("Sets colour of logical volume(s).");
111  fpCommand->SetGuidance("\"all\" sets all logical volumes.");
112  fpCommand->SetGuidance
113  ("Optionally propagates down hierarchy to given depth.");
114  G4UIparameter* parameter;
115  parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true);
116  parameter->SetDefaultValue("all");
117  fpCommand->SetParameter(parameter);
118  parameter = new G4UIparameter("depth", 'd', omitable = true);
119  parameter->SetDefaultValue(0);
120  parameter->SetGuidance
121  ("Depth of propagation (-1 means unlimited depth).");
122  fpCommand->SetParameter(parameter);
123  parameter = new G4UIparameter("red", 's', omitable = true);
124  parameter->SetDefaultValue("1.");
125  parameter->SetGuidance
126  ("Red component or a string, e.g., \"blue\", in which case succeeding colour components are ignored.");
127  fpCommand->SetParameter(parameter);
128  parameter = new G4UIparameter("green", 'd', omitable = true);
129  parameter->SetDefaultValue(1.);
130  fpCommand->SetParameter(parameter);
131  parameter = new G4UIparameter("blue", 'd', omitable = true);
132  parameter->SetDefaultValue(1.);
133  fpCommand->SetParameter(parameter);
134  parameter = new G4UIparameter("opacity", 'd', omitable = true);
135  parameter->SetDefaultValue(1.);
136  fpCommand->SetParameter(parameter);
137 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetDefaultValue(const char *theDefaultValue)
bool G4bool
Definition: G4Types.hh:79
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void SetGuidance(const char *theGuidance)

Here is the call graph for this function:

G4VisCommandGeometrySetColour::~G4VisCommandGeometrySetColour ( )
virtual

Definition at line 139 of file G4VisCommandsGeometrySet.cc.

140 {
141  delete fpCommand;
142 }

Member Function Documentation

G4String G4VisCommandGeometrySetColour::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 144 of file G4VisCommandsGeometrySet.cc.

145 {
146  return "";
147 }
void G4VisCommandGeometrySetColour::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 150 of file G4VisCommandsGeometrySet.cc.

151 {
152  G4String name, redOrString;
153  G4int requestedDepth;
154  G4double green, blue, opacity;
155  std::istringstream iss(newValue);
156  iss >> name >> requestedDepth >> redOrString >> green >> blue >> opacity;
157  G4Colour colour(1,1,1,1); // Default white and opaque.
158  const size_t iPos0 = 0;
159  if (std::isalpha(redOrString[iPos0])) {
160  if (!G4Colour::GetColour(redOrString, colour)) {
162  G4cout << "WARNING: Colour \"" << redOrString
163  << "\" not found. Defaulting to white and opaque."
164  << G4endl;
165  }
166  }
167  } else {
168  colour = G4Colour(G4UIcommand::ConvertToDouble(redOrString), green, blue);
169  }
170  colour = G4Colour
171  (colour.GetRed(), colour.GetGreen(), colour.GetBlue(), opacity);
172 
173  G4VisCommandGeometrySetColourFunction setColour(colour);
174  Set(name, setColour, requestedDepth);
175 }
const XML_Char * name
Definition: expat.h:151
void Set(G4String logVolName, const G4VVisCommandGeometrySetFunction &, G4int requestedDepth)
static G4bool GetColour(const G4String &key, G4Colour &result)
Definition: G4Colour.cc:126
Definition: test07.cc:36
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
static G4double ConvertToDouble(const char *st)
Definition: G4UIcommand.cc:455
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static G4VisManager * fpVisManager

Here is the call graph for this function:


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