Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ToolsSGViewer.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// John Allison 6th October 2019
27
28#ifndef G4TOOLSSGVIEWER_HH
29#define G4TOOLSSGVIEWER_HH
30
31#include "G4VViewer.hh"
32
34#include "G4Scene.hh"
35#include "G4VVisCommand.hh"
36
37#include <tools/fpng>
38#include <tools/toojpeg>
39
40#include <tools/sg/device_interactor>
41#include <tools/sg/separator>
42#include <tools/sg/ortho>
43#include <tools/sg/perspective>
44#include <tools/sg/torche>
45#include <tools/sg/blend>
46#include <tools/sg/noderef>
47#include <tools/sg/keys>
48
49#include <tools/tokenize>
50#include <tools/sg/write_paper>
51
52template <class SG_SESSION,class SG_VIEWER>
53class G4ToolsSGViewer : public G4VViewer, tools::sg::device_interactor {
54 typedef G4VViewer parent;
55 typedef tools::sg::device_interactor parent_interactor;
56public: //tools::sg::device_interactor interface.
57 virtual void key_press(const tools::sg::key_down_event& a_event) {
58 fKeyPressed = true;
59 fKeyShift = a_event.key() == tools::sg::key_shift()?true:false;
60 }
61 virtual void key_release(const tools::sg::key_up_event&) {fKeyPressed = false;}
62 virtual void mouse_press(const tools::sg::mouse_down_event& a_event) {
63 fMousePressed = true;
64 fMousePressedX = a_event.x();
65 fMousePressedY = a_event.y();
66 }
67 virtual void mouse_release(const tools::sg::mouse_up_event&) {fMousePressed = false;}
68 virtual void mouse_move(const tools::sg::mouse_move_event& a_event) {
69 G4double x = a_event.x();
70 G4double y = a_event.y();
75
76 if (fMousePressed) {
77
78 if (fKeyPressed && fKeyShift) { // Translation (pan)
79
81 const G4double scale = 300; // Roughly pixels per window, empirically chosen
82 const G4double dxScene = dx*sceneRadius/scale;
83 const G4double dyScene = dy*sceneRadius/scale;
84 fVP.IncrementPan(-dxScene,dyScene);
85
86 } else { // Rotation
87
88 // Simple ad-hoc algorithms
90 const G4Vector3D& y_prime = x_prime.cross(fVP.GetViewpointDirection());
91 const G4double scale = 200; // Roughly pixels per window, empirically chosen
92 G4Vector3D newViewpointDirection = fVP.GetViewpointDirection();
93 newViewpointDirection += dx*x_prime/scale;
94 newViewpointDirection += dy*y_prime/scale;
95 fVP.SetViewpointDirection(newViewpointDirection.unit());
96
98 G4Vector3D newUpVector = fVP.GetUpVector();
99 newUpVector += dx*x_prime/scale;
100 newUpVector += dy*y_prime/scale;
101 fVP.SetUpVector(newUpVector.unit());
102 }
103 }
104 }
105
106 SetView();
107 DrawView();
108 }
109 virtual void wheel_rotate(const tools::sg::wheel_rotate_event& a_event) {
110 const G4double angleY = a_event.angle();
111 if (fVP.GetFieldHalfAngle() == 0.) { // Orthographic projection
112 const G4double scale = 500; // Empirically chosen
113 fVP.MultiplyZoomFactor(1.+angleY/scale);
114 } else { // Perspective projection
115 const G4double delta = fSceneHandler.GetExtent().GetExtentRadius()/200.; // Empirical
116 fVP.SetDolly(fVP.GetDolly()+angleY*delta);
117 }
118 SetView();
119 DrawView();
120 }
121public:
122 G4ToolsSGViewer(SG_SESSION& a_session,G4ToolsSGSceneHandler& a_scene_handler, const G4String& a_name)
123 :parent(a_scene_handler,a_scene_handler.IncrementViewCount(),a_name)
124 ,fSGSession(a_session)
125 ,fSGSceneHandler(a_scene_handler)
126 ,fSGViewer(nullptr)
127 ,fKeyPressed(false)
128 ,fKeyShift(false)
129 ,fMousePressed(false)
132 {
133 //::printf("debug : G4ToolsSGViewer::G4ToolsSGViewer: %lu, %s\n",this,a_name.c_str());
135 }
136
138 //::printf("debug : G4ToolsSGViewer::~G4ToolsSGViewer: %lu\n",this);
139 //WARNING : nodes may refer f_gl2ps_mgr, f_zb_mgr (to handle gstos (for GPU) or textures), then
140 // we have to delete them first.
141 fSGViewer->sg().clear();
142 delete fSGViewer;
143 }
144protected:
146 :parent(a_from)
147 ,parent_interactor(a_from)
148 ,fSGSession(a_from.fSGSession)
150 ,fSGViewer(nullptr)
151 ,fKeyPressed(false)
152 ,fKeyShift(false)
153 ,fMousePressed(false)
156 {}
158public:
159 virtual void Initialise() {
160 if(fSGViewer) return; //done.
161 fVP.SetAutoRefresh(true);
163 //::printf("debug : G4ToolsSGViewer::Initialise\n");
164 //////////////////////////////////////////////////////////
165 /// create the viewer, set the scene graph ///////////////
166 //////////////////////////////////////////////////////////
167 fSGViewer = new SG_VIEWER(fSGSession
172 ,fName);
173 if(!fSGViewer->has_window()) {
174 fViewId = -1; // This flags an error.
175 G4cerr << "G4ToolsSGViewer::Initialise : SG_VIEWER::has_window() failed." << G4endl;
176 return;
177 }
178 fSGViewer->set_device_interactor(this);
179 }
180
181 virtual void SetView() {
182 //::printf("debug : G4ToolsSGViewer::SetView\n");
183 if(!fSceneHandler.GetScene()) {
184 fSGViewer->set_clear_color(0.3,0.3,0.3,1); //some grey color to signal the user that something is wrong.
185 G4cerr << "G4ToolsSGViewer::SetView : no G4Scene.." << G4endl;
186 return;
187 }
188
189 //////////////////////////////////////////////////////////
190 //////////////////////////////////////////////////////////
191 //////////////////////////////////////////////////////////
192 // Get radius of scene, etc.
193 // Note that this procedure properly takes into account zoom, dolly and pan.
194 const G4Point3D targetPoint
197 if(radius<=0.) radius = 1.;
198 const G4double cameraDistance = fVP.GetCameraDistance (radius);
199 const G4Point3D cameraPosition = targetPoint + cameraDistance * fVP.GetViewpointDirection().unit();
200 const G4Normal3D& up = fVP.GetUpVector ();
201 const G4double pnear = fVP.GetNearDistance (cameraDistance, radius);
202 const G4double pfar = fVP.GetFarDistance (cameraDistance, pnear, radius);
203 //const G4double right = fVP.GetFrontHalfHeight (pnear, radius);
204 //const G4double left = -right;
205 const G4double top = fVP.GetFrontHalfHeight (pnear, radius);
206 const G4double bottom = -top;
207 // sanity check :
208 tools::vec3f dir(float(targetPoint.x()-cameraPosition.x()),
209 float(targetPoint.y()-cameraPosition.y()),
210 float(targetPoint.z()-cameraPosition.z()));
211 if(!dir.length()) {
212 fSGViewer->set_clear_color(0.3,0.3,0.3,1);
213 G4cerr << "G4ToolsSGViewer::SetView : null size viewer area." << G4endl;
214 return;
215 }
216
217 //////////////////////////////////////////////////////////
218 //////////////////////////////////////////////////////////
219 //////////////////////////////////////////////////////////
220 /*
221 G4cout << "debug : 0002 : radius " << radius << std::endl;
222 G4cout << "debug : cameraDistance : " << cameraDistance << std::endl;
223 G4cout << "debug : fieldHalfAngle : " << fVP.GetFieldHalfAngle() << std::endl;
224 G4cout << "debug : zoomFactor : " << fVP.GetZoomFactor() << std::endl;
225 G4cout << "debug : up : " << up.x() << " " << up.y() << " " << up.z() << std::endl;
226 G4cout << "debug : targetPoint : " << targetPoint.x() << " " << targetPoint.y() << " " << targetPoint.z() << std::endl;
227 G4cout << "debug : cameraPosition : " << cameraPosition.x() << " " << cameraPosition.y() << " " << cameraPosition.z() << std::endl;
228 G4cout << "debug : camera : znear " << pnear << ", zfar " << pfar << std::endl;
229 */
230 //////////////////////////////////////////////////////////
231 /// create scene graph ///////////////////////////////////
232 //////////////////////////////////////////////////////////
233 // Set projection, then create the tools::sg camera node :
234 tools::sg::base_camera* _camera = nullptr;
235 if (fVP.GetFieldHalfAngle() <= 0.) {
236 //G4cout << "debug : camera : ortho : top " << top << " bottom " << bottom << " top-bottom " << top-bottom << std::endl;
237 if((top-bottom)<=0) {
238 fSGViewer->set_clear_color(0.3,0.3,0.3,1);
239 G4cerr << "G4ToolsSGViewer::SetView : for ortho camera, (top-bottom)<=0." << G4endl;
240 return;
241 }
242 tools::sg::ortho* ortho_camera = new tools::sg::ortho;
243 ortho_camera->height.value(float(top-bottom));
244 _camera = ortho_camera;
245 } else {
246 //G4cout << "debug : camera : perspec : heightAngle " << float(2*fVP.GetFieldHalfAngle()) << std::endl;
247 tools::sg::perspective* perspective_camera = new tools::sg::perspective;
248 perspective_camera->height_angle.value(float(2*fVP.GetFieldHalfAngle()));
249 _camera = perspective_camera;
250 }
251
252 _camera->position.value
253 (tools::vec3f(float(cameraPosition.x()),
254 float(cameraPosition.y()),
255 float(cameraPosition.z())));
256 _camera->znear.value(float(pnear));
257 _camera->zfar.value(float(pfar));
258
259 _camera->look_at(dir,tools::vec3f(up.x(),up.y(),up.z())); //same logic as in G4OpenInventorViewer.
260
261 /*
262 const G4Vector3D& lightDirection = fVP.GetLightpointDirection();
263 G4cout << "debug : lightDirection : " << lightDirection.x() << " " << lightDirection.y() << " " << lightDirection.z() << std::endl;
264 const G4Vector3D& actualLightDirection = fVP.GetActualLightpointDirection();
265 G4cout << "debug : actualLightDirection : " << actualLightDirection.x() << " " << actualLightDirection.y() << " " << actualLightDirection.z() << std::endl;
266 */
267
269
270 {G4Color background = fVP.GetBackgroundColour ();
271 fSGViewer->set_clear_color(float(background.GetRed()),float(background.GetGreen()),float(background.GetBlue()),1);}
272 }
273
274 virtual void ClearView() {}
275
276 virtual void DrawView() {
278 G4bool kernelVisitWasNeeded = fNeedKernelVisit; // Keep (ProcessView resets).
279 fLastVP = fVP;
280 ProcessView(); // Clears store and processes scene only if necessary.
281 if (kernelVisitWasNeeded) {
282 // We might need to do something if the kernel was visited.
283 } else {
284 }
285 FinishView (); // Flush streams and/or swap buffers.
286 }
287
288 virtual void ShowView() {FinishView();}
289
290 virtual void FinishView() {
291 if(fSGViewer) {
293 fSGViewer->show();
294 fSGViewer->win_render();
295 fSGSession.sync();
296 }
297 }
298
299#ifdef G4MULTITHREADED
300 virtual void SwitchToVisSubThread() {}
301
302 virtual void SwitchToMasterThread() {
304 // I have not figured out how to draw during a run.
305 //
306 // Setting fNeedKernelVisit=true causes scene deletion and a complete rebuild,
307 // including trajectories, hits, etc. from kept events.
308 //
309 // Clearly this is a limitation because even if you run 1000 events you only
310 // get those kept (default 100), and even worse, if end-if-event-action is
311 // "refresh", you only get one event (the last I think).
312 //
313 // Also, strictly, there is no need to rebuid run-duration models (detector),
314 // but a complete rebuild is the easiest way (already imeplemented).
315 //
316 // Only do this if there are end-of-event models (e.g., trajectories) that
317 // may require it.
319 fNeedKernelVisit = true;
320 DrawView(); // Draw trajectories, etc., from kept events
321 }
322 }
323 }
324#endif
325
326 //SG_VIEWER* sg_viewer() {return fSGViewer;}
327protected:
330 NeedKernelVisit (); // Sets fNeedKernelVisit.
331 }
332 }
333
335 // Typical comparison. Taken from OpenInventor.
336 if (
337 (vp.GetDrawingStyle () != fVP.GetDrawingStyle ()) ||
339 (vp.IsAuxEdgeVisible () != fVP.IsAuxEdgeVisible ()) ||
340 (vp.IsCulling () != fVP.IsCulling ()) ||
342 (vp.IsDensityCulling () != fVP.IsDensityCulling ()) ||
343 (vp.IsCullingCovered () != fVP.IsCullingCovered ()) ||
344 (vp.GetCBDAlgorithmNumber() !=
346 (vp.IsSection () != fVP.IsSection ()) ||
347 (vp.IsCutaway () != fVP.IsCutaway ()) ||
348 // This assumes use of generic clipping (sectioning, slicing,
349 // DCUT, cutaway). If a decision is made to implement locally,
350 // this will need changing. See G4OpenGLViewer::SetView,
351 // G4OpenGLStoredViewer.cc::CompareForKernelVisit and
352 // G4OpenGLStoredSceneHander::CreateSection/CutawayPolyhedron.
353 (vp.IsExplode () != fVP.IsExplode ()) ||
354 (vp.GetNoOfSides () != fVP.GetNoOfSides ()) ||
363 (vp.IsPicking () != fVP.IsPicking ()) ||
364 // Scaling for Open Inventor is done by the scene handler so it
365 // needs a kernel visit. (In this respect, it differs from the
366 // OpenGL drivers, where it's done in SetView.)
367 (vp.GetScaleFactor () != fVP.GetScaleFactor ()) ||
374 )
375 return true;
376
377 if (vp.IsDensityCulling () &&
379 return true;
380
381 if (vp.GetCBDAlgorithmNumber() > 0) {
382 if (vp.GetCBDParameters().size() != fVP.GetCBDParameters().size()) return true;
383 else if (vp.GetCBDParameters() != fVP.GetCBDParameters()) return true;
384 }
385
386 if (vp.IsSection () &&
387 (vp.GetSectionPlane () != fVP.GetSectionPlane ()))
388 return true;
389
390 if (vp.IsCutaway ()) {
391 if (vp.GetCutawayMode() != fVP.GetCutawayMode()) return true;
392 if (vp.GetCutawayPlanes ().size () !=
393 fVP.GetCutawayPlanes ().size ()) return true;
394 for (size_t i = 0; i < vp.GetCutawayPlanes().size(); ++i)
395 if (vp.GetCutawayPlanes()[i] != fVP.GetCutawayPlanes()[i])
396 return true;
397 }
398
399 if (vp.IsExplode () &&
401 return true;
402
403 if (vp.IsSpecialMeshRendering() &&
405 return true;
406
407 return false;
408 }
409// void keyPressEvent (KeyEvent*);
410// void keyReleaseEvent (KeyEvent*);
411// void mouseDoubleClickEvent(MouseEvent*);
412// void mouseMoveEvent (MouseEvent*);
413// void mousePressEvent (MouseEvent*);
414// void mouseReleaseEvent (MouseEvent*);
415// void wheelEvent (WheelEvent*);
416
417protected:
418 void CreateSG(tools::sg::base_camera* a_camera,const G4Vector3D& a_light_dir) {
419 tools::sg::group& _parent = fSGViewer->sg();
420 _parent.clear();
421
422 ///////////////////////////////////////////////////
423 /// 2D scene graph: ///////////////////////////////
424 ///////////////////////////////////////////////////
425 tools::sg::separator* scene_2D = new tools::sg::separator;
426 _parent.add(scene_2D);
427 scene_2D->add(new tools::sg::noderef(fSGSceneHandler.GetTransient2DObjects()));
428 scene_2D->add(new tools::sg::noderef(fSGSceneHandler.GetPersistent2DObjects()));
429
430 ///////////////////////////////////////////////////
431 /// 3D scene graph: ///////////////////////////////
432 ///////////////////////////////////////////////////
433 tools::sg::separator* scene_3D = new tools::sg::separator;
434 _parent.add(scene_3D);
435
436 scene_3D->add(a_camera);
437
438 {tools::sg::torche* light = new tools::sg::torche;
439 light->on = true;
440 light->direction = tools::vec3f(-a_light_dir.x(),-a_light_dir.y(),-a_light_dir.z());
441 light->ambient = tools::colorf(0.2f,0.2f,0.2f,1.0f); //same as in G4OpenGLViewer.cc glLight(GL_LIGHT0,GL_AMBIENT and GL_DIFFUSE).
442 light->color = tools::colorf(0.8f,0.8f,0.8f,1.0f); //idem.
443 scene_3D->add(light);}
444
445 {tools::sg::blend* blend = new tools::sg::blend;
446 blend->on = true; //to handle transparency.
447 scene_3D->add(blend);}
448
449 scene_3D->add(new tools::sg::noderef(fSGSceneHandler.GetTransient3DObjects()));
450 scene_3D->add(new tools::sg::noderef(fSGSceneHandler.GetPersistent3DObjects()));
451 }
452
453 void Export(const G4String& a_format,const G4String& a_file,G4bool a_do_transparency) {
454 if(!fSGViewer) return;
455 const G4Colour& back_color = fVP.GetBackgroundColour();
456 bool top_to_bottom = false; //if using tools::fpng, tools::toojpeg.
457 if(!tools::sg::write_paper(G4cout,f_gl2ps_mgr,f_zb_mgr,
458 tools::fpng::write,tools::toojpeg::write,
459 float(back_color.GetRed()),float(back_color.GetGreen()),float(back_color.GetBlue()),float(back_color.GetAlpha()),
460 fSGViewer->sg(),fSGViewer->width(),fSGViewer->height(),
461 a_file,a_format,a_do_transparency,top_to_bottom,std::string(),std::string())) {
462 G4cout << "G4ToolsSGViewer::Export: write_paper() failed." << G4endl;
463 return;
464 }
465 }
466
467protected:
468 class Messenger: public G4VVisCommand {
469 public:
470 static void Create() {static Messenger s_messenger;}
471 private:
472 Messenger() {
473 G4UIparameter* parameter;
474 //////////////////////////////////////////////////////////
475 //////////////////////////////////////////////////////////
476 write_scene = new G4UIcommand("/vis/tsg/export", this);
477 write_scene->SetGuidance("Write the content of the current viewer in a file at various formats.");
478 write_scene->SetGuidance("Default file is out.eps and default format is gl2ps_eps.");
479 write_scene->SetGuidance("Available formats are:");
480 write_scene->SetGuidance("- gl2ps_eps: gl2ps producing eps");
481 write_scene->SetGuidance("- gl2ps_ps: gl2ps producing ps");
482 write_scene->SetGuidance("- gl2ps_pdf: gl2ps producing pdf");
483 write_scene->SetGuidance("- gl2ps_svg: gl2ps producing svg");
484 write_scene->SetGuidance("- gl2ps_tex: gl2ps producing tex");
485 write_scene->SetGuidance("- gl2ps_pgf: gl2ps producing pgf");
486 write_scene->SetGuidance("- zb_ps: tools::sg offscreen zbuffer put in a PostScript file.");
487 write_scene->SetGuidance("- zb_png: tools::sg offscreen zbuffer put in a png file.");
488 write_scene->SetGuidance("- zb_jpeg: tools::sg offscreen zbuffer put in a jpeg file.");
489
490 parameter = new G4UIparameter("format",'s',true);
491 parameter->SetDefaultValue("gl2ps_eps");
492 write_scene->SetParameter (parameter);
493
494 parameter = new G4UIparameter("file",'s',true);
495 parameter->SetDefaultValue("out.eps");
496 write_scene->SetParameter (parameter);
497
498 parameter = new G4UIparameter ("do_transparency", 'b', true);
499 parameter->SetDefaultValue ("true");
500 write_scene->SetParameter (parameter);
501
502 }
503 virtual ~Messenger() {
504 delete write_scene;
505 }
506 public:
507 virtual void SetNewValue(G4UIcommand* a_cmd,G4String a_value) {
510 if (!viewer) {
511 if (verbosity >= G4VisManager::errors) G4cerr << "ERROR: No current viewer." << G4endl;
512 return;
513 }
514 G4ToolsSGViewer* tsg_viewer = dynamic_cast<G4ToolsSGViewer*>(viewer);
515 if(!tsg_viewer) {
516 G4cout << "G4ToolsSGViewer::SetNewValue:"
517 << " current viewer is not a G4ToolsSGViewer." << G4endl;
518 return;
519 }
520 std::vector<std::string> args;
521 tools::double_quotes_tokenize(a_value,args);
522 if(args.size()!=a_cmd->GetParameterEntries()) return;
523 if(a_cmd==write_scene) {
524 G4bool do_transparency = G4UIcommand::ConvertToBool(args[2].c_str());
525 tsg_viewer->Export(args[0],args[1],do_transparency);
526 }
527 }
528 private:
529 G4UIcommand* write_scene;
530 };
531
532protected:
533 SG_SESSION& fSGSession;
535 SG_VIEWER* fSGViewer;
536 G4ViewParameters fLastVP; // Memory for making kernel visit decisions.
537
542
543 tools::sg::zb_manager f_zb_mgr;
544 tools::sg::gl2ps_manager f_gl2ps_mgr;
545
546};
547
548#endif
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4double GetBlue() const
Definition G4Colour.hh:154
G4double GetAlpha() const
Definition G4Colour.hh:155
G4double GetRed() const
Definition G4Colour.hh:152
G4double GetGreen() const
Definition G4Colour.hh:153
const G4VisExtent & GetExtent() const
const G4Point3D & GetStandardTargetPoint() const
const std::vector< Model > & GetEndOfEventModelList() const
tools::sg::separator & GetTransient3DObjects()
tools::sg::separator & GetTransient2DObjects()
tools::sg::separator & GetPersistent3DObjects()
void TouchPlotters(tools::sg::node &)
tools::sg::separator & GetPersistent2DObjects()
virtual void SetNewValue(G4UIcommand *a_cmd, G4String a_value)
virtual void ClearView()
virtual void ShowView()
SG_SESSION & fSGSession
virtual void mouse_move(const tools::sg::mouse_move_event &a_event)
virtual void mouse_press(const tools::sg::mouse_down_event &a_event)
virtual void key_press(const tools::sg::key_down_event &a_event)
virtual void wheel_rotate(const tools::sg::wheel_rotate_event &a_event)
virtual void FinishView()
void Export(const G4String &a_format, const G4String &a_file, G4bool a_do_transparency)
void CreateSG(tools::sg::base_camera *a_camera, const G4Vector3D &a_light_dir)
virtual void mouse_release(const tools::sg::mouse_up_event &)
G4bool CompareForKernelVisit(G4ViewParameters &vp)
virtual void key_release(const tools::sg::key_up_event &)
G4ToolsSGViewer(const G4ToolsSGViewer &a_from)
G4ToolsSGViewer(SG_SESSION &a_session, G4ToolsSGSceneHandler &a_scene_handler, const G4String &a_name)
virtual void Initialise()
G4ToolsSGSceneHandler & fSGSceneHandler
virtual void SetView()
SG_VIEWER * fSGViewer
tools::sg::gl2ps_manager f_gl2ps_mgr
G4ViewParameters fLastVP
tools::sg::zb_manager f_zb_mgr
G4ToolsSGViewer & operator=(const G4ToolsSGViewer &)
virtual ~G4ToolsSGViewer()
virtual void DrawView()
std::size_t GetParameterEntries() const
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
static G4bool ConvertToBool(const char *st)
void SetDefaultValue(const char *theDefaultValue)
G4Scene * GetScene() const
virtual const G4VisExtent & GetExtent() const
G4bool fNeedKernelVisit
Definition G4VViewer.hh:266
void ProcessView()
Definition G4VViewer.cc:108
G4VSceneHandler & fSceneHandler
Definition G4VViewer.hh:253
G4String fName
Definition G4VViewer.hh:255
void NeedKernelVisit()
Definition G4VViewer.cc:81
G4ViewParameters fDefaultVP
Definition G4VViewer.hh:258
G4int fViewId
Definition G4VViewer.hh:254
G4ViewParameters fVP
Definition G4VViewer.hh:257
static G4VisManager * GetVisManager()
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
const std::vector< G4ModelingParameters::VisAttributesModifier > & GetVisAttributesModifiers() const
const G4Vector3D & GetScaleFactor() const
void SetAutoRefresh(G4bool)
G4int GetNoOfSides() const
G4bool IsSpecialMeshRendering() const
G4int GetWindowAbsoluteLocationHintY(G4int) const
CutawayMode GetCutawayMode() const
G4double GetCameraDistance(G4double radius) const
G4double GetExplodeFactor() const
G4int GetNumberOfCloudPoints() const
G4bool IsMarkerNotHidden() const
unsigned int GetWindowSizeHintX() const
G4double GetGlobalLineWidthScale() const
G4bool IsCutaway() const
G4Vector3D & GetActualLightpointDirection()
const G4Colour & GetBackgroundColour() const
const G4Vector3D & GetViewpointDirection() const
G4bool IsSection() const
const G4Point3D & GetCurrentTargetPoint() const
G4bool IsPicking() const
G4double GetFarDistance(G4double cameraDistance, G4double nearDistance, G4double radius) const
G4double GetFieldHalfAngle() const
G4bool IsCulling() const
G4double GetFrontHalfHeight(G4double nearDistance, G4double radius) const
const G4VisAttributes * GetDefaultTextVisAttributes() const
void SetDolly(G4double dolly)
G4int GetWindowAbsoluteLocationHintX(G4int) const
G4bool IsExplode() const
void IncrementPan(G4double right, G4double up)
const G4Vector3D & GetUpVector() const
const std::vector< G4double > & GetCBDParameters() const
G4int GetCBDAlgorithmNumber() const
const std::vector< G4ModelingParameters::PVNameCopyNo > & GetSpecialMeshVolumes() const
G4double GetGlobalMarkerScale() const
G4bool IsCullingInvisible() const
const G4VisAttributes * GetDefaultVisAttributes() const
void SetUpVector(const G4Vector3D &upVector)
const G4Planes & GetCutawayPlanes() const
RotationStyle GetRotationStyle() const
G4bool IsDensityCulling() const
void MultiplyZoomFactor(G4double zoomFactorMultiplier)
G4double GetVisibleDensity() const
SMROption GetSpecialMeshRenderingOption() const
unsigned int GetWindowSizeHintY() const
G4bool IsCullingCovered() const
const G4Plane3D & GetSectionPlane() const
G4double GetNearDistance(G4double cameraDistance, G4double radius) const
DrawingStyle GetDrawingStyle() const
G4bool IsAuxEdgeVisible() const
G4double GetDolly() const
const G4Colour & GetColour() const
G4double GetExtentRadius() const
G4VViewer * GetCurrentViewer() const
static Verbosity GetVerbosity()
BasicVector3D< T > cross(const BasicVector3D< T > &v) const
BasicVector3D< T > unit() const
G4bool IsMultithreadedApplication()