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

#include <G4ToolsSGQtZBViewer.hh>

+ Inheritance diagram for G4ToolsSGQtZBViewer:

Public Member Functions

 G4ToolsSGQtZBViewer (toolx::Qt::session &a_session, G4ToolsSGSceneHandler &a_scene_handler, const G4String &a_name)
 
virtual ~G4ToolsSGQtZBViewer ()
 
virtual void Initialise ()
 
virtual void SetView ()
 
virtual void UpdateGUISceneTree ()
 
- Public Member Functions inherited from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::zb_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

 G4ToolsSGQtZBViewer (const G4ToolsSGQtZBViewer &a_from)
 
G4ToolsSGQtZBVieweroperator= (const G4ToolsSGQtZBViewer &)
 
- Protected Member Functions inherited from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::zb_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
 
G4ToolsSGQtZBDestroyCallbackfDestroyCallback
 
- Protected Attributes inherited from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::zb_viewer >
toolx::Qt::session & fSGSession
 
G4ToolsSGSceneHandlerfSGSceneHandler
 
toolx::Qt::zb_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 57 of file G4ToolsSGQtZBViewer.hh.

Constructor & Destructor Documentation

◆ G4ToolsSGQtZBViewer() [1/2]

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

Definition at line 60 of file G4ToolsSGQtZBViewer.hh.

61 :parent(a_session,a_scene_handler,a_name)
62 ,fSGQWidget(nullptr)
64 {
66 }
G4ToolsSGQtZBDestroyCallback * fDestroyCallback

◆ ~G4ToolsSGQtZBViewer()

virtual G4ToolsSGQtZBViewer::~G4ToolsSGQtZBViewer ( )
inlinevirtual

Definition at line 67 of file G4ToolsSGQtZBViewer.hh.

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

◆ G4ToolsSGQtZBViewer() [2/2]

G4ToolsSGQtZBViewer::G4ToolsSGQtZBViewer ( const G4ToolsSGQtZBViewer & a_from)
inlineprotected

Definition at line 71 of file G4ToolsSGQtZBViewer.hh.

71:parent(a_from){}

Member Function Documentation

◆ Initialise()

virtual void G4ToolsSGQtZBViewer::Initialise ( )
inlinevirtual

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

Definition at line 74 of file G4ToolsSGQtZBViewer.hh.

74 {
75 if(fSGQWidget) return; //done.
77 if(!fSGViewer) {
78 G4cerr << "G4ToolsSGQtZBViewer::Initialise: ERROR: G4ToolsSGQtZBViewer has no toolx::Qt::zb_viewer." << G4endl;
79 return;
80 }
81 fSGQWidget = fSGViewer->shell();
82 if (!fSGQWidget) {
83 G4cerr << "G4ToolsSGQtZBViewer::Initialise: ERROR: toolx::Qt::zb_viewer has no QWidget shell." << G4endl;
84 return;
85 }
86
89 fUIQt = session? dynamic_cast<G4UIQt*>(session) :nullptr;
90 if(fUIQt) {
91 G4Qt* interactorManager = G4Qt::getInstance ();
92 if (!interactorManager->IsExternalApp()) {
93 fSGViewer->set_own_shell(false);
95 QObject::connect(fSGQWidget,SIGNAL(destroyed()),fDestroyCallback,SLOT(execute()));
96
97 QMainWindow* main_window = fUIQt->GetMainWindow();
98 if(main_window) {
99 main_window->show();
100 interactorManager->FlushAndWaitExecution();
101 }
102 }
103 }}
104
105 fSGViewer->enable_keyboard_focus();
106 }
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=()

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

Definition at line 72 of file G4ToolsSGQtZBViewer.hh.

72{return *this;}

◆ SetView()

virtual void G4ToolsSGQtZBViewer::SetView ( )
inlinevirtual

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

Definition at line 108 of file G4ToolsSGQtZBViewer.hh.

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

◆ UpdateGUISceneTree()

virtual void G4ToolsSGQtZBViewer::UpdateGUISceneTree ( )
inlinevirtual

Definition at line 125 of file G4ToolsSGQtZBViewer.hh.

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

Member Data Documentation

◆ fDestroyCallback

G4ToolsSGQtZBDestroyCallback* G4ToolsSGQtZBViewer::fDestroyCallback
protected

Definition at line 132 of file G4ToolsSGQtZBViewer.hh.

Referenced by G4ToolsSGQtZBViewer(), Initialise(), and ~G4ToolsSGQtZBViewer().

◆ fSGQWidget

QWidget* G4ToolsSGQtZBViewer::fSGQWidget
protected

Definition at line 131 of file G4ToolsSGQtZBViewer.hh.

Referenced by Initialise(), and SetView().

◆ fUIQt

G4UIQt* G4ToolsSGQtZBViewer::fUIQt = nullptr
protected

Definition at line 130 of file G4ToolsSGQtZBViewer.hh.

Referenced by Initialise(), and UpdateGUISceneTree().


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