Geant4 11.4.0
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 ()
Public Member Functions inherited from G4ToolsSGViewer< toolx::Qt::session, toolx::Qt::zb_viewer >
virtual void key_press (const tools::sg::key_down_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 SetView ()
virtual void ClearView ()
virtual void DrawView ()
virtual void ShowView ()
virtual void FinishView ()
G4bool GetWindowSize (unsigned int &a_w, unsigned int &a_h)
G4bool GetRenderAreaSize (unsigned int &a_w, unsigned int &a_h)
virtual void EmitWindowRender ()
Public Member Functions inherited from G4VViewer
 G4VViewer (G4VSceneHandler &, G4int id, const G4String &name="")
virtual ~G4VViewer ()
virtual void ResetView ()
void RefreshView ()
virtual G4bool ReadyToDraw ()
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
virtual void DoneWithMasterThread ()
virtual void MovingToVisSubThread ()
virtual void SwitchToVisSubThread ()
virtual void DoneWithVisSubThread ()
virtual void MovingToMasterThread ()
virtual void SwitchToMasterThread ()
void InsertModelInSceneTree (G4VModel *)
const G4SceneTreeItemGetSceneTree ()
G4SceneTreeItemAccessSceneTree ()
void UpdateGUISceneTree ()
void UpdateGUIControlWidgets ()
void UpdateGUIDrawingStyle ()
void UpdateGUIProjectionStyle ()
void UpdateGUITransparencySlider ()
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 ()
void ProcessTransients ()
void ZoomFromMouseWheel (G4double delta, G4bool shift=false, G4double xPos=0, G4double yPos=0)
Public Member Functions inherited from G4ToolsSG_viewer
 G4ToolsSG_viewer ()
virtual ~G4ToolsSG_viewer ()

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)
G4bool CompareForTransientsRedraw (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)
G4double GetSceneNearWidth ()
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 Member Functions inherited from G4ToolsSG_viewer
 G4ToolsSG_viewer (const G4ToolsSG_viewer &)
G4ToolsSG_vieweroperator= (const G4ToolsSG_viewer &)

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 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.
G4SceneTreeItem fSceneTree
G4bool fNeedKernelVisit
G4bool fTransientsNeedRedrawing

Additional Inherited Members

Public Attributes inherited from G4VViewer
const G4int fMaxAllTouchables = 10000
G4bool fCurtailDescent = false

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 {
65 fDestroyCallback = new G4ToolsSGQtZBDestroyCallback(this);
66 }
G4ToolsSGQtZBDestroyCallback * fDestroyCallback

Referenced by G4ToolsSGQtZBViewer(), and operator=().

◆ ~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
87 {G4UImanager* ui = G4UImanager::GetUIpointer();
88 G4UIsession* session = ui->GetG4UIWindow();
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);
94 fUIQt->AddTabWidget(fSGQWidget,QString(GetName()));
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
static G4Qt * getInstance()
Definition G4Qt.cc:61
bool IsExternalApp()
Definition G4Qt.cc:210
void FlushAndWaitExecution() override
Definition G4Qt.cc:201
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;}

Member Data Documentation

◆ fDestroyCallback

G4ToolsSGQtZBDestroyCallback* G4ToolsSGQtZBViewer::fDestroyCallback
protected

Definition at line 111 of file G4ToolsSGQtZBViewer.hh.

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

◆ fSGQWidget

QWidget* G4ToolsSGQtZBViewer::fSGQWidget
protected

Definition at line 110 of file G4ToolsSGQtZBViewer.hh.

Referenced by G4ToolsSGQtZBViewer(), and Initialise().

◆ fUIQt

G4UIQt* G4ToolsSGQtZBViewer::fUIQt = nullptr
protected

Definition at line 109 of file G4ToolsSGQtZBViewer.hh.

Referenced by Initialise().


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