Geant4  10.02.p03
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
 

Private Member Functions

 G4VisCommandDrawView (const G4VisCommandDrawView &)
 
G4VisCommandDrawViewoperator= (const G4VisCommandDrawView &)
 

Private Attributes

G4UIcommandfpCommand
 

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 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() [1/2]

G4VisCommandDrawView::G4VisCommandDrawView ( )

Definition at line 97 of file G4VisCommandsCompound.cc.

97  {
98  G4bool omitable;
99  fpCommand = new G4UIcommand("/vis/drawView", this);
101  ("Draw view from this angle, etc.");
102  G4UIparameter* parameter;
103  parameter = new G4UIparameter("theta-degrees", 'd', omitable = true);
104  parameter -> SetDefaultValue(0.);
105  fpCommand -> SetParameter (parameter);
106  parameter = new G4UIparameter("phi-degrees", 'd', omitable = true);
107  parameter -> SetDefaultValue(0.);
108  fpCommand -> SetParameter (parameter);
109  parameter = new G4UIparameter("pan-right", 'd', omitable = true);
110  parameter -> SetDefaultValue(0.);
111  fpCommand -> SetParameter (parameter);
112  parameter = new G4UIparameter("pan-up", 'd', omitable = true);
113  parameter -> SetDefaultValue(0.);
114  fpCommand -> SetParameter (parameter);
115  parameter = new G4UIparameter("pan-unit", 's', omitable = true);
116  parameter -> SetDefaultValue("cm");
117  fpCommand -> SetParameter (parameter);
118  parameter = new G4UIparameter("zoom-factor", 'd', omitable = true);
119  parameter -> SetDefaultValue(1.);
120  fpCommand -> SetParameter (parameter);
121  parameter = new G4UIparameter("dolly", 'd', omitable = true);
122  parameter -> SetDefaultValue(0.);
123  fpCommand -> SetParameter (parameter);
124  parameter = new G4UIparameter("dolly-unit", 's', omitable = true);
125  parameter -> SetDefaultValue("cm");
126  fpCommand -> SetParameter (parameter);
127 }
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::~G4VisCommandDrawView ( )
virtual

Definition at line 129 of file G4VisCommandsCompound.cc.

129  {
130  delete fpCommand;
131 }

◆ G4VisCommandDrawView() [2/2]

G4VisCommandDrawView::G4VisCommandDrawView ( const G4VisCommandDrawView )
private

Member Function Documentation

◆ operator=()

G4VisCommandDrawView& G4VisCommandDrawView::operator= ( const G4VisCommandDrawView )
private

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 133 of file G4VisCommandsCompound.cc.

133  {
134 
136 
137  G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
138  if (!currentViewer) {
139  if (verbosity >= G4VisManager::warnings) {
140  G4cout <<
141  "WARNING: G4VisCommandsDrawView::SetNewValue: no current viewer."
142  << G4endl;
143  }
144  return;
145  }
146 
147  G4String thetaDeg;
148  G4String phiDeg;
149  G4String panRight;
150  G4String panUp;
151  G4String panUnit;
152  G4String zoomFactor;
153  G4String dolly;
154  G4String dollyUnit;
155  std::istringstream is(newValue);
156  is >> thetaDeg >> phiDeg >> panRight >> panUp >> panUnit
157  >> zoomFactor >> dolly >> dollyUnit;
158 
159  G4UImanager* UImanager = G4UImanager::GetUIpointer();
160  G4int keepVerbose = UImanager->GetVerboseLevel();
161  G4int newVerbose(0);
162  if (keepVerbose >= 2 ||
164  newVerbose = 2;
165  UImanager->SetVerboseLevel(newVerbose);
166  G4ViewParameters vp = currentViewer->GetViewParameters();
167  G4bool keepAutoRefresh = vp.IsAutoRefresh();
168  vp.SetAutoRefresh(false);
169  currentViewer->SetViewParameters(vp);
170  UImanager->ApplyCommand(
171  G4String("/vis/viewer/set/viewpointThetaPhi " + thetaDeg + " " + phiDeg + " deg"));
172  UImanager->ApplyCommand(
173  G4String("/vis/viewer/panTo " + panRight + " " + panUp + " " + panUnit));
174  UImanager->ApplyCommand(
175  G4String("/vis/viewer/zoomTo " + zoomFactor));
176  vp = currentViewer->GetViewParameters();
177  vp.SetAutoRefresh(keepAutoRefresh);
178  currentViewer->SetViewParameters(vp);
179  UImanager->ApplyCommand(
180  G4String("/vis/viewer/dollyTo " + dolly + " " + dollyUnit));
181  UImanager->SetVerboseLevel(keepVerbose);
182 }
G4VViewer * GetCurrentViewer() const
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:227
void SetViewParameters(const G4ViewParameters &vp)
Definition: G4VViewer.cc:130
int G4int
Definition: G4Types.hh:78
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:225
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4bool IsAutoRefresh() const
void SetAutoRefresh(G4bool)
static Verbosity GetVerbosity()
const G4ViewParameters & GetViewParameters() const
#define G4endl
Definition: G4ios.hh:61
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
static G4VisManager * fpVisManager
Here is the call graph for this function:

Member Data Documentation

◆ fpCommand

G4UIcommand* G4VisCommandDrawView::fpCommand
private

Definition at line 55 of file G4VisCommandsCompound.hh.


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