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

#include <G4VisCommandsCompound.hh>

Inheritance diagram for G4VisCommandDrawView:
Collaboration diagram for G4VisCommandDrawView:

Public Member Functions

 G4VisCommandDrawView ()
 
virtual ~G4VisCommandDrawView ()
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- 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 ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
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 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 47 of file G4VisCommandsCompound.hh.

Constructor & Destructor Documentation

G4VisCommandDrawView::G4VisCommandDrawView ( )

Definition at line 113 of file G4VisCommandsCompound.cc.

113  {
114  G4bool omitable;
115  fpCommand = new G4UIcommand("/vis/drawView", this);
116  fpCommand->SetGuidance
117  ("Draw view from this angle, etc.");
118  G4UIparameter* parameter;
119  parameter = new G4UIparameter("theta-degrees", 'd', omitable = true);
120  parameter -> SetDefaultValue(0.);
121  fpCommand -> SetParameter (parameter);
122  parameter = new G4UIparameter("phi-degrees", 'd', omitable = true);
123  parameter -> SetDefaultValue(0.);
124  fpCommand -> SetParameter (parameter);
125  parameter = new G4UIparameter("pan-right", 'd', omitable = true);
126  parameter -> SetDefaultValue(0.);
127  fpCommand -> SetParameter (parameter);
128  parameter = new G4UIparameter("pan-up", 'd', omitable = true);
129  parameter -> SetDefaultValue(0.);
130  fpCommand -> SetParameter (parameter);
131  parameter = new G4UIparameter("pan-unit", 's', omitable = true);
132  parameter -> SetDefaultValue("cm");
133  fpCommand -> SetParameter (parameter);
134  parameter = new G4UIparameter("zoom-factor", 'd', omitable = true);
135  parameter -> SetDefaultValue(1.);
136  fpCommand -> SetParameter (parameter);
137  parameter = new G4UIparameter("dolly", 'd', omitable = true);
138  parameter -> SetDefaultValue(0.);
139  fpCommand -> SetParameter (parameter);
140  parameter = new G4UIparameter("dolly-unit", 's', omitable = true);
141  parameter -> SetDefaultValue("cm");
142  fpCommand -> SetParameter (parameter);
143 }
bool G4bool
Definition: G4Types.hh:79
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161

Here is the call graph for this function:

G4VisCommandDrawView::~G4VisCommandDrawView ( )
virtual

Definition at line 145 of file G4VisCommandsCompound.cc.

145  {
146  delete fpCommand;
147 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 149 of file G4VisCommandsCompound.cc.

149  {
150 
152 
153  G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
154  if (!currentViewer) {
155  if (verbosity >= G4VisManager::warnings) {
156  G4cout <<
157  "WARNING: G4VisCommandsDrawView::SetNewValue: no current viewer."
158  << G4endl;
159  }
160  return;
161  }
162 
163  G4String thetaDeg;
164  G4String phiDeg;
165  G4String panRight;
166  G4String panUp;
167  G4String panUnit;
168  G4String zoomFactor;
169  G4String dolly;
170  G4String dollyUnit;
171  std::istringstream is(newValue);
172  is >> thetaDeg >> phiDeg >> panRight >> panUp >> panUnit
173  >> zoomFactor >> dolly >> dollyUnit;
174 
175  G4UImanager* UImanager = G4UImanager::GetUIpointer();
176  G4int keepVerbose = UImanager->GetVerboseLevel();
177  G4int newVerbose(0);
178  if (keepVerbose >= 2 ||
180  newVerbose = 2;
181  UImanager->SetVerboseLevel(newVerbose);
182  G4ViewParameters vp = currentViewer->GetViewParameters();
183  G4bool keepAutoRefresh = vp.IsAutoRefresh();
184  vp.SetAutoRefresh(false);
185  currentViewer->SetViewParameters(vp);
186  UImanager->ApplyCommand(
187  G4String("/vis/viewer/set/viewpointThetaPhi " + thetaDeg + " " + phiDeg + " deg"));
188  UImanager->ApplyCommand(
189  G4String("/vis/viewer/panTo " + panRight + " " + panUp + " " + panUnit));
190  UImanager->ApplyCommand(
191  G4String("/vis/viewer/zoomTo " + zoomFactor));
192  vp = currentViewer->GetViewParameters();
193  vp.SetAutoRefresh(keepAutoRefresh);
194  currentViewer->SetViewParameters(vp);
195  UImanager->ApplyCommand(
196  G4String("/vis/viewer/dollyTo " + dolly + " " + dollyUnit));
197  UImanager->SetVerboseLevel(keepVerbose);
198 }
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(const G4ViewParameters &vp)
Definition: G4VViewer.cc:120
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:227
int G4int
Definition: G4Types.hh:78
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:225
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void SetAutoRefresh(G4bool)
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
G4VViewer * GetCurrentViewer() const
G4bool IsAutoRefresh() const
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
static G4VisManager * fpVisManager

Here is the call graph for this function:


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