Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandDrawView Class Reference

#include <G4VisCommandsCompound.hh>

+ Inheritance 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)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
- 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)
 
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
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentLineWidth = 1.
 
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
 

Detailed Description

Definition at line 47 of file G4VisCommandsCompound.hh.

Constructor & Destructor Documentation

◆ G4VisCommandDrawView()

G4VisCommandDrawView::G4VisCommandDrawView ( )

Definition at line 97 of file G4VisCommandsCompound.cc.

97 {
98 G4bool omitable;
99 fpCommand = new G4UIcommand("/vis/drawView", this);
100 fpCommand->SetGuidance
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:67
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156

◆ ~G4VisCommandDrawView()

G4VisCommandDrawView::~G4VisCommandDrawView ( )
virtual

Definition at line 129 of file G4VisCommandsCompound.cc.

129 {
130 delete fpCommand;
131}

Member Function Documentation

◆ 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
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}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:369
G4int GetVerboseLevel() const
Definition: G4UImanager.hh:218
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:51
void SetVerboseLevel(G4int val)
Definition: G4UImanager.hh:216
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(const G4ViewParameters &vp)
Definition: G4VViewer.cc:130
static G4VisManager * fpVisManager
void SetAutoRefresh(G4bool)
G4bool IsAutoRefresh() const
G4VViewer * GetCurrentViewer() const
static Verbosity GetVerbosity()

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