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

#include <G4ToolsSGQtGLESViewer.hh>

+ Inheritance diagram for G4ToolsSGQtGLESViewer:

Public Member Functions

 G4ToolsSGQtGLESViewer (toolx::Qt::session &a_session, G4ToolsSGSceneHandler &a_scene_handler, const G4String &a_name)
 
virtual ~G4ToolsSGQtGLESViewer ()
 
virtual void Initialise ()
 
virtual void SetView ()
 
virtual void UpdateGUISceneTree ()
 
- Public Member Functions inherited from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::sg_viewer >
virtual void key_press (const tools::sg::key_down_event &a_event)
 
virtual void key_release (const tools::sg::key_up_event &)
 
virtual void mouse_press (const tools::sg::mouse_down_event &a_event)
 
virtual void mouse_release (const tools::sg::mouse_up_event &)
 
virtual void mouse_move (const tools::sg::mouse_move_event &a_event)
 
virtual void wheel_rotate (const tools::sg::wheel_rotate_event &a_event)
 
 G4ToolsSGViewer (toolx::Qt::session &a_session, G4ToolsSGSceneHandler &a_scene_handler, const G4String &a_name)
 
virtual ~G4ToolsSGViewer ()
 
virtual void ClearView ()
 
virtual void DrawView ()
 
virtual void ShowView ()
 
virtual void FinishView ()
 
- Public Member Functions inherited from G4VViewer
 G4VViewer (G4VSceneHandler &, G4int id, const G4String &name="")
 
virtual ~G4VViewer ()
 
virtual void ResetView ()
 
void RefreshView ()
 
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
 
SceneTreeSceneAccessSceneTreeScene ()
 
G4SceneTreeItemAccessSceneTree ()
 
void UpdateGUISceneTree ()
 
const G4StringGetName () const
 
const G4StringGetShortName () const
 
void SetName (const G4String &)
 
G4int GetViewId () const
 
G4VSceneHandlerGetSceneHandler () const
 
const G4ViewParametersGetViewParameters () const
 
const G4ViewParametersGetDefaultViewParameters () const
 
G4double GetKernelVisitElapsedTimeSeconds () const
 
virtual const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers () const
 
void SetViewParameters (const G4ViewParameters &vp)
 
void SetDefaultViewParameters (const G4ViewParameters &vp)
 
const G4VisAttributesGetApplicableVisAttributes (const G4VisAttributes *) const
 
void SetNeedKernelVisit (G4bool need)
 
void NeedKernelVisit ()
 
void ProcessView ()
 

Protected Member Functions

 G4ToolsSGQtGLESViewer (const G4ToolsSGQtGLESViewer &a_from)
 
G4ToolsSGQtGLESVieweroperator= (const G4ToolsSGQtGLESViewer &)
 
- Protected Member Functions inherited from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::sg_viewer >
 G4ToolsSGViewer (const G4ToolsSGViewer &a_from)
 
G4ToolsSGVieweroperator= (const G4ToolsSGViewer &)
 
void KernelVisitDecision ()
 
G4bool CompareForKernelVisit (G4ViewParameters &vp)
 
void CreateSG (tools::sg::base_camera *a_camera, const G4Vector3D &a_light_dir)
 
void Export (const G4String &a_format, const G4String &a_file, G4bool a_do_transparency)
 
- Protected Member Functions inherited from G4VViewer
void SetTouchable (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath)
 
void TouchableSetVisibility (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, G4bool visibility)
 
void TouchableSetColour (const std::vector< G4PhysicalVolumeModel::G4PhysicalVolumeNodeID > &fullPath, const G4Colour &)
 

Protected Attributes

G4UIQtfUIQt = nullptr
 
QWidget * fSGQWidget
 
G4ToolsSGQtDestroyCallbackfDestroyCallback
 
- Protected Attributes inherited from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::sg_viewer >
toolx::Qt::session & fSGSession
 
G4ToolsSGSceneHandlerfSGSceneHandler
 
toolx::Qt::sg_viewer * fSGViewer
 
G4ViewParameters fLastVP
 
G4bool fKeyPressed
 
G4bool fKeyShift
 
G4bool fMousePressed
 
G4double fMousePressedX
 
G4double fMousePressedY
 
tools::sg::zb_manager f_zb_mgr
 
tools::sg::gl2ps_manager f_gl2ps_mgr
 
- Protected Attributes inherited from G4VViewer
G4VSceneHandlerfSceneHandler
 
G4int fViewId
 
G4String fName
 
G4String fShortName
 
G4ViewParameters fVP
 
G4ViewParameters fDefaultVP
 
G4double fKernelVisitElapsedTimeSeconds = 999.
 
SceneTreeScene fSceneTreeScene
 
G4SceneTreeItem fSceneTree
 
G4bool fNeedKernelVisit
 

Detailed Description

Definition at line 58 of file G4ToolsSGQtGLESViewer.hh.

Constructor & Destructor Documentation

◆ G4ToolsSGQtGLESViewer() [1/2]

G4ToolsSGQtGLESViewer::G4ToolsSGQtGLESViewer ( toolx::Qt::session & a_session,
G4ToolsSGSceneHandler & a_scene_handler,
const G4String & a_name )
inline

Definition at line 61 of file G4ToolsSGQtGLESViewer.hh.

62 :parent(a_session,a_scene_handler,a_name)
63 ,fSGQWidget(nullptr)
65 {
67 }
G4ToolsSGQtDestroyCallback * fDestroyCallback

◆ ~G4ToolsSGQtGLESViewer()

virtual G4ToolsSGQtGLESViewer::~G4ToolsSGQtGLESViewer ( )
inlinevirtual

Definition at line 68 of file G4ToolsSGQtGLESViewer.hh.

68 {
69 delete fDestroyCallback; //it will remove the below signal/slot connection.
70 }

◆ G4ToolsSGQtGLESViewer() [2/2]

G4ToolsSGQtGLESViewer::G4ToolsSGQtGLESViewer ( const G4ToolsSGQtGLESViewer & a_from)
inlineprotected

Definition at line 72 of file G4ToolsSGQtGLESViewer.hh.

72:parent(a_from){}

Member Function Documentation

◆ Initialise()

virtual void G4ToolsSGQtGLESViewer::Initialise ( )
inlinevirtual

Reimplemented from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::sg_viewer >.

Definition at line 75 of file G4ToolsSGQtGLESViewer.hh.

75 {
76 if(fSGQWidget) return; //done.
78 if(!fSGViewer) {
79 G4cerr << "G4ToolsSGQtGLESViewer::Initialise: ERROR: G4ToolsSGQtGLESViewer has no toolx::Qt::sg_viewer." << G4endl;
80 return;
81 }
82 fSGQWidget = fSGViewer->shell();
83 if (!fSGQWidget) {
84 G4cerr << "G4ToolsSGQtGLESViewer::Initialise: ERROR: toolx::Qt::sg_viewer has no QWidget shell." << G4endl;
85 return;
86 }
87
90 fUIQt = session? dynamic_cast<G4UIQt*>(session) :nullptr;
91 if(fUIQt) {
92 G4Qt* interactorManager = G4Qt::getInstance ();
93 if (!interactorManager->IsExternalApp()) {
94 fSGViewer->set_own_shell(false);
96 QObject::connect(fSGQWidget,SIGNAL(destroyed()),fDestroyCallback,SLOT(execute()));
97
98 QMainWindow* main_window = fUIQt->GetMainWindow();
99 if(main_window) {
100 main_window->show();
101 interactorManager->FlushAndWaitExecution();
102 }
103 }
104 }}
105
106 fSGViewer->enable_keyboard_focus();
107 }
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition G4ios.hh:67
Definition G4Qt.hh:50
static G4Qt * getInstance()
Definition G4Qt.cc:51
bool IsExternalApp()
Definition G4Qt.cc:183
void FlushAndWaitExecution() override
Definition G4Qt.cc:174
QMainWindow * GetMainWindow()
Definition G4UIQt.hh:203
G4bool AddTabWidget(QWidget *, QString)
Definition G4UIQt.cc:2283
G4UIsession * GetG4UIWindow() const
static G4UImanager * GetUIpointer()
const G4String & GetName() const

◆ operator=()

G4ToolsSGQtGLESViewer & G4ToolsSGQtGLESViewer::operator= ( const G4ToolsSGQtGLESViewer & )
inlineprotected

Definition at line 73 of file G4ToolsSGQtGLESViewer.hh.

73{return *this;}

◆ SetView()

virtual void G4ToolsSGQtGLESViewer::SetView ( )
inlinevirtual

Reimplemented from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::sg_viewer >.

Definition at line 109 of file G4ToolsSGQtGLESViewer.hh.

109 {
110#ifdef __APPLE__
111 if(fSGQWidget && fSGViewer) {
112 if( (2*fSGQWidget->width() == int(fSGViewer->width())) &&
113 (2*fSGQWidget->height() == int(fSGViewer->height())) ){
114 // With Qt/Cocoa, the received size in
115 // tools::sg::glarea::resizeGL is twice the QWidget::[width(),height()]!
116 // In general it does not pose problem, except when rendering 2D texts.
117 // In order to have similar sizes than other platforms, we have to double
118 // their pixel heights.
120 }
121 }
122#endif
124 }
G4ViewParameters fVP
Definition G4VViewer.hh:257
void SetGlobalMarkerScale(G4double globalMarkerScale)

◆ UpdateGUISceneTree()

virtual void G4ToolsSGQtGLESViewer::UpdateGUISceneTree ( )
inlinevirtual

Definition at line 126 of file G4ToolsSGQtGLESViewer.hh.

126 {
128 }
void UpdateSceneTree(const G4SceneTreeItem &) override
Definition G4UIQt.cc:1510
G4SceneTreeItem fSceneTree
Definition G4VViewer.hh:262

Member Data Documentation

◆ fDestroyCallback

G4ToolsSGQtDestroyCallback* G4ToolsSGQtGLESViewer::fDestroyCallback
protected

◆ fSGQWidget

QWidget* G4ToolsSGQtGLESViewer::fSGQWidget
protected

Definition at line 132 of file G4ToolsSGQtGLESViewer.hh.

Referenced by Initialise(), and SetView().

◆ fUIQt

G4UIQt* G4ToolsSGQtGLESViewer::fUIQt = nullptr
protected

Definition at line 131 of file G4ToolsSGQtGLESViewer.hh.

Referenced by Initialise(), and UpdateGUISceneTree().


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