Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VisCommandSceneAddArrow Class Reference

#include <G4VisCommandsSceneAdd.hh>

Inheritance diagram for G4VisCommandSceneAddArrow:
Collaboration diagram for G4VisCommandSceneAddArrow:

Public Member Functions

 G4VisCommandSceneAddArrow ()
 
virtual ~G4VisCommandSceneAddArrow ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandScene
 G4VVisCommandScene ()
 
virtual ~G4VVisCommandScene ()
 
- Public Member Functions inherited from G4VVisCommand
 G4VVisCommand ()
 
virtual ~G4VVisCommand ()
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 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 Member Functions inherited from G4VVisCommandScene
G4String CurrentSceneName ()
 
- 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 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 46 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

G4VisCommandSceneAddArrow::G4VisCommandSceneAddArrow ( )

Definition at line 96 of file G4VisCommandsSceneAdd.cc.

96  {
97  fpCommand = new G4UIcommand("/vis/scene/add/arrow", this);
98  fpCommand -> SetGuidance ("Adds arrow to current scene.");
99  G4bool omitable;
100  G4UIparameter* parameter;
101  parameter = new G4UIparameter ("x1", 'd', omitable = false);
102  fpCommand -> SetParameter (parameter);
103  parameter = new G4UIparameter ("y1", 'd', omitable = false);
104  fpCommand -> SetParameter (parameter);
105  parameter = new G4UIparameter ("z1", 'd', omitable = false);
106  fpCommand -> SetParameter (parameter);
107  parameter = new G4UIparameter ("x2", 'd', omitable = false);
108  fpCommand -> SetParameter (parameter);
109  parameter = new G4UIparameter ("y2", 'd', omitable = false);
110  fpCommand -> SetParameter (parameter);
111  parameter = new G4UIparameter ("z2", 'd', omitable = false);
112  fpCommand -> SetParameter (parameter);
113  parameter = new G4UIparameter ("unit", 's', omitable = true);
114  parameter->SetDefaultValue ("m");
115  fpCommand->SetParameter (parameter);
116 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetDefaultValue(const char *theDefaultValue)
bool G4bool
Definition: G4Types.hh:79

Here is the call graph for this function:

G4VisCommandSceneAddArrow::~G4VisCommandSceneAddArrow ( )
virtual

Definition at line 118 of file G4VisCommandsSceneAdd.cc.

118  {
119  delete fpCommand;
120 }

Member Function Documentation

G4String G4VisCommandSceneAddArrow::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 122 of file G4VisCommandsSceneAdd.cc.

122  {
123  return "";
124 }
void G4VisCommandSceneAddArrow::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 126 of file G4VisCommandsSceneAdd.cc.

127 {
129  G4bool warn(verbosity >= G4VisManager::warnings);
130 
131  G4Scene* pScene = fpVisManager->GetCurrentScene();
132  if (!pScene) {
133  if (verbosity >= G4VisManager::errors) {
134  G4cerr << "ERROR: No current scene. Please create one." << G4endl;
135  }
136  return;
137  }
138 
139  G4String unitString;
140  G4double x1, y1, z1, x2, y2, z2;
141  std::istringstream is(newValue);
142  is >> x1 >> y1 >> z1 >> x2 >> y2 >> z2 >> unitString;
143  G4double unit = G4UIcommand::ValueOf(unitString);
144  x1 *= unit; y1 *= unit; z1 *= unit;
145  x2 *= unit; y2 *= unit; z2 *= unit;
146 
147  // Consult scene for arrow width.
148  const G4VisExtent& sceneExtent = pScene->GetExtent();
149  G4double arrowWidth =
150  0.005 * fCurrentLineWidth * sceneExtent.GetExtentRadius();
151 
153  (x1, y1, z1, x2, y2, z2,
154  arrowWidth, fCurrentColour, newValue);
155 
156  const G4String& currentSceneName = pScene -> GetName ();
157  G4bool successful = pScene -> AddRunDurationModel (model, warn);
158  if (successful) {
159  if (verbosity >= G4VisManager::confirmations) {
160  G4cout << "Arrow has been added to scene \""
161  << currentSceneName << "\"."
162  << G4endl;
163  }
164  }
165  else G4VisCommandsSceneAddUnsuccessful(verbosity);
166  UpdateVisManagerScene (currentSceneName);
167 }
static G4Colour fCurrentColour
void UpdateVisManagerScene(const G4String &sceneName="")
static void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
G4double GetExtentRadius() const
Definition: G4VisExtent.cc:73
G4GLOB_DLL std::ostream G4cout
const G4VisExtent & GetExtent() const
bool G4bool
Definition: G4Types.hh:79
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:309
static G4double fCurrentLineWidth
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const XML_Char XML_Content * model
Definition: expat.h:151
G4Scene * GetCurrentScene() const
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager

Here is the call graph for this function:


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