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

#include <G4OpenGLImmediateXmViewer.hh>

Inheritance diagram for G4OpenGLImmediateXmViewer:

Public Member Functions

 G4OpenGLImmediateXmViewer (G4OpenGLImmediateSceneHandler &scene, const G4String &name="")
virtual ~G4OpenGLImmediateXmViewer ()
void Initialise ()
void DrawView ()
void FinishView ()
Public Member Functions inherited from G4OpenGLXmViewer
 G4OpenGLXmViewer (G4OpenGLSceneHandler &scene)
virtual ~G4OpenGLXmViewer ()
Public Member Functions inherited from G4OpenGLXViewer
 G4OpenGLXViewer (G4OpenGLSceneHandler &scene)
virtual ~G4OpenGLXViewer ()
void SetView ()
void ShowView ()
void SwitchToVisSubThread ()
void SwitchToMasterThread ()
void DrawText (const G4Text &)
Public Member Functions inherited from G4OpenGLViewer
virtual void ClearView ()
void ClearViewWithoutFlush ()
virtual bool exportImage (std::string name="", int width=-1, int height=-1)
bool setExportImageFormat (std::string format, bool quiet=false)
Public Member Functions inherited from G4VViewer
 G4VViewer (G4VSceneHandler &, G4int id, const G4String &name="")
virtual ~G4VViewer ()
void RefreshView ()
virtual G4bool ReadyToDraw ()
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
virtual void DoneWithMasterThread ()
virtual void MovingToVisSubThread ()
virtual void DoneWithVisSubThread ()
virtual void MovingToMasterThread ()
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)
virtual G4bool GetWindowSize (unsigned int &a_w, unsigned int &a_h)
Public Member Functions inherited from G4OpenGLImmediateViewer
 G4OpenGLImmediateViewer (G4OpenGLImmediateSceneHandler &scene)
void ProcessView ()

Additional Inherited Members

Static Public Member Functions inherited from G4OpenGLXmViewer
static void expose_callback (Widget w, XtPointer clientData, XtPointer callData)
static void resize_callback (Widget w, XtPointer clientData, XtPointer callData)
static void actions_callback (Widget w, XtPointer clientData, XtPointer callData)
static void misc_callback (Widget w, XtPointer clientData, XtPointer callData)
static void Add_set_field (char *widget, char *widget_text, Widget *row_col_box, Widget *wid, G4double *val, G4OpenGLXmViewer *pView)
static void zoom_callback (Widget w, XtPointer clientData, XtPointer callData)
static void dolly_callback (Widget w, XtPointer clientData, XtPointer callData)
static void pan_left_right_callback (Widget w, XtPointer clientData, XtPointer callData)
static void left_right_pan_callback (XtPointer clientData, XtIntervalId *timer_id)
static void theta_rotation_callback (Widget w, XtPointer clientData, XtPointer callData)
static void phi_rotation_callback (Widget w, XtPointer clientData, XtPointer callData)
static void pan_up_down_callback (Widget w, XtPointer clientData, XtPointer callData)
static void up_down_pan_callback (XtPointer clientData, XtIntervalId *timer_id)
static void drawing_style_callback (Widget w, XtPointer clientData, XtPointer callData)
static void background_color_callback (Widget w, XtPointer clientData, XtPointer callData)
static void set_rot_subject_callback (Widget w, XtPointer clientData, XtPointer callData)
static void set_rot_sens_callback (Widget w, XtPointer clientData, XtPointer callData)
static void set_pan_sens_callback (Widget w, XtPointer clientData, XtPointer callData)
static void set_wob_sens_callback (Widget w, XtPointer clientData, XtPointer callData)
static void projection_callback (Widget w, XtPointer clientData, XtPointer callData)
static void wobble_callback (Widget w, XtPointer clientData, XtPointer callData)
static void reset_callback (Widget w, XtPointer clientData, XtPointer callData)
static void update_panels_callback (Widget w, XtPointer clientData, XtPointer callData)
static void wobble_timer_callback (XtPointer clientData, XtIntervalId *timerid)
static void Add_radio_box (char *label_string, Widget *parent_frame_widget, XtCallbackRec *radio_box_cb, G4int num_buttons, G4int default_button, char *radio_box_name, char **button_names, G4OpenGLXmViewer *pView)
static void Add_four_arrow_buttons (G4OpenGLXmViewer *pView, XtCallbackRec **arrow_callbacks, Widget *parent_widget)
static void Add_slider_box (char *label_string, G4int num_sliders, char **slider_name, G4OpenGLXmViewer *pView, G4double *min_array, G4double *max_array, G4double *value_array, G4bool *show, short *decimals, unsigned char *orientation, unsigned char *direction, XtCallbackRec **slider_box_cb, Widget *parent_frame_widget)
static void rotate_in_theta (XtPointer clientData, XtIntervalId *timer_id)
static void rotate_in_phi (XtPointer clientData, XtIntervalId *timer_id)
static void get_double_value_callback (Widget w, XtPointer clientData, XtPointer callData)
static void get_text_callback (Widget w, XtPointer clientData, XtPointer callData)
static void transparency_callback (Widget w, XtPointer clientData, XtPointer callData)
static void antialias_callback (Widget w, XtPointer clientData, XtPointer callData)
static void haloing_callback (Widget w, XtPointer clientData, XtPointer callData)
static void aux_edge_callback (Widget w, XtPointer clientData, XtPointer callData)
static void set_print_colour_callback (Widget w, XtPointer clientData, XtPointer callData)
static void set_print_style_callback (Widget w, XtPointer clientData, XtPointer callData)
static void print_callback (Widget w, XtPointer clientData, XtPointer callData)
static G4bool get_boolean_userData (Widget w)
static G4int get_int_userData (Widget w)
Public Attributes inherited from G4VViewer
const G4int fMaxAllTouchables = 10000
G4bool fCurtailDescent = false
Protected Member Functions inherited from G4OpenGLXmViewer
virtual void ShowView ()
void ResetView ()
void GetXmConnection ()
virtual void CreateMainWindow ()
Protected Member Functions inherited from G4OpenGLXViewer
void GetXConnection ()
void CreateGLXContext (XVisualInfo *vi)
virtual void CreateFontLists ()
Protected Member Functions inherited from G4OpenGLViewer
 G4OpenGLViewer (G4OpenGLSceneHandler &scene)
virtual ~G4OpenGLViewer ()
void ChangePointSize (G4double size)
void ChangeLineWidth (G4double width)
void HaloingFirstPass ()
void HaloingSecondPass ()
void HLRFirstPass ()
void HLRSecondPass ()
void HLRThirdPass ()
void InitializeGLView ()
void ResizeGLView ()
void ResizeWindow (unsigned int, unsigned int)
virtual G4String Pick (GLdouble x, GLdouble y)
const std::vector< G4OpenGLViewerPickMap * > & GetPickDetails (GLdouble x, GLdouble y)
void rotateScene (G4double dx, G4double dy)
void rotateSceneToggle (G4double dx, G4double dy)
void setExportSize (G4int, G4int)
bool setExportFilename (G4String name, G4bool inc=true)
std::string getRealPrintFilename ()
unsigned int getWinWidth () const
unsigned int getWinHeight () const
G4bool sizeHasChanged ()
G4double GetSceneNearWidth ()
GLdouble getSceneFarWidth ()
GLdouble getSceneDepth ()
void addExportImageFormat (std::string format)
G4bool isGl2psWriting ()
G4bool isFramebufferReady ()
void g4GluPickMatrix (GLdouble x, GLdouble y, GLdouble width, GLdouble height, GLint viewport[4])
void g4GluLookAt (GLdouble eyex, GLdouble eyey, GLdouble eyez, GLdouble centerx, GLdouble centery, GLdouble centerz, GLdouble upx, GLdouble upy, GLdouble upz)
void g4GlOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
void g4GlFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near, GLdouble far)
bool IsGettingPickInfos () const
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 inherited from G4OpenGLXmViewer
XtAppContext app
XtWorkProcId workId
Widget toplevel
Widget shell
Widget main_win
Widget menubar
Widget style_cascade
Widget actions_cascade
Widget misc_cascade
Widget spec_cascade
Widget drawing_style_pullright
Widget background_color_pullright
Widget transparency_pullright
Widget antialias_pullright
Widget haloing_pullright
Widget aux_edge_pullright
Widget frame
Widget glxarea
XmString style_str
XmString actions_str
XmString misc_str
XmString spec_str
XmString draw_str
XmString polyhedron_str
XmString wireframe_str
XmString hlr_str
XmString hsr_str
XmString hlhsr_str
XmString set_str
XmString rot_str
XmString pan_str
XmString exit_str
XmString quit_str
XmString print_str
XmString white_str
XmString black_str
XmString anti_str
XmString trans_str
XmString halo_str
XmString aux_edge_str
XmString bgnd_str
XmString off_str
XmString on_str
G4double zoom_high
G4double zoom_low
G4double pan_low
G4double pan_high
G4double dolly_low
G4double dolly_high
G4double fov
G4double rot_sens_limit
G4double pan_sens_limit
G4double wob_high
G4double wob_low
G4double wob_sens
Pixel bgnd
Pixel borcol
G4bool pan_right
G4bool rotate_right
G4bool pan_up
G4bool rotate_up
XtIntervalId rotation_timer
XtIntervalId pan_timer
XtIntervalId wobble_timer
G4Vector3D original_vp
G4int frameNo
G4String menu_str [37]
G4OpenGLXmTopLevelShellfprotation_top
G4OpenGLXmBoxfprotation_button_box
G4OpenGLXmRadioButtonfprotation_button1
G4OpenGLXmRadioButtonfprotation_button2
G4OpenGLXmBoxfprotation_slider_box
G4OpenGLXmSliderBarfprotation_slider
G4OpenGLXmBoxfprotation_arrow_box
G4OpenGLXmFourArrowButtonsfprotation_arrow
G4OpenGLXmTopLevelShellfppanning_top
G4OpenGLXmFramedBoxfppanning_box
G4OpenGLXmFourArrowButtonsfppanning_arrows
G4OpenGLXmSliderBarfppanning_slider
G4OpenGLXmFramedBoxfpzoom_box
G4OpenGLXmSliderBarfpzoom_slider
G4OpenGLXmFramedBoxfpdolly_box
G4OpenGLXmSliderBarfpdolly_slider
G4OpenGLXmTopLevelShellfpsetting_top
G4OpenGLXmFramedBoxfpsetting_box
G4OpenGLXmTextFieldfppan_set
G4OpenGLXmTextFieldfprot_set
G4OpenGLXmTextFieldfpzoom_upper
G4OpenGLXmTextFieldfpzoom_lower
G4OpenGLXmTextFieldfpdolly_upper
G4OpenGLXmTextFieldfpdolly_lower
G4OpenGLXmPushButtonfpok_button
G4OpenGLXmTopLevelShellfpmiscellany_top
G4OpenGLXmFramedBoxfpwobble_box
G4OpenGLXmPushButtonfpwobble_button
G4OpenGLXmSliderBarfpwobble_slider
G4OpenGLXmFramedBoxfpreset_box
G4OpenGLXmPushButtonfpreset_button
G4OpenGLXmFramedBoxfpproj_style_box
G4OpenGLXmRadioButtonfporthogonal_button
G4OpenGLXmRadioButtonfpperspective_button
G4OpenGLXmTextFieldfpfov_text
G4OpenGLXmTopLevelShellfpprint_top
G4OpenGLXmFramedBoxfpprint_box
G4OpenGLXmFramedBoxfpprint_col_box
G4OpenGLXmFramedBoxfpprint_style_box
G4OpenGLXmTextFieldfpprint_text
G4OpenGLXmPushButtonfpprint_button
G4OpenGLXmSeparatorfpprint_line
G4OpenGLXmRadioButtonfpprint_col_radio1
G4OpenGLXmRadioButtonfpprint_col_radio2
G4OpenGLXmRadioButtonfpprint_style_radio1
G4OpenGLXmRadioButtonfpprint_style_radio2
Protected Attributes inherited from G4OpenGLXViewer
XWindowAttributes xwa
Display * dpy
XVisualInfo * vi_immediate
XVisualInfo * vi_stored
XVisualInfo * vi
Colormap cmap
XSetWindowAttributes swa
GLXDrawable win
GLXContext cxMaster
GLXContext cxVisSubThread
XEvent event
G4intattributeList
G4int errorBase
G4int eventBase
G4int major
G4int minor
XSizeHints * norm_hints
XWMHints * wm_hints
XClassHint * class_hints
Pixmap icon_pixmap
XSizeHints * size_hints
Atom Xatom
XTextProperty windowName
XTextProperty iconName
char charViewName [100]
Protected Attributes inherited from G4OpenGLViewer
G4bool fPrintColour
G4bool fVectoredPs
G4OpenGLSceneHandlerfOpenGLSceneHandler
G4Colour background
G4bool transparency_enabled
G4bool antialiasing_enabled
G4bool haloing_enabled
G4gl2psfGL2PSAction
G4double fRot_sens
G4double fPan_sens
unsigned int fWinSize_x
unsigned int fWinSize_y
std::vector< std::string > fExportImageFormatVector
std::string fDefaultExportImageFormat
std::string fExportImageFormat
int fExportFilenameIndex
G4int fPrintSizeX
G4int fPrintSizeY
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
Static Protected Attributes inherited from G4OpenGLXmViewer
static const G4String e_str = ""
Static Protected Attributes inherited from G4OpenGLXViewer
static int snglBuf_RGBA [12]
static int dblBuf_RGBA [13]
static XVisualInfo * vi_single_buffer = 0
static XVisualInfo * vi_double_buffer = 0

Detailed Description

Definition at line 43 of file G4OpenGLImmediateXmViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenGLImmediateXmViewer()

G4OpenGLImmediateXmViewer::G4OpenGLImmediateXmViewer ( G4OpenGLImmediateSceneHandler & scene,
const G4String & name = "" )

Definition at line 39 of file G4OpenGLImmediateXmViewer.cc.

42 : G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
43 G4OpenGLViewer (sceneHandler),
44 G4OpenGLXmViewer (sceneHandler),
45 G4OpenGLImmediateViewer (sceneHandler)
46{
47 if (fViewId < 0) return; // In case error in base class instantiation.
48
49// ensure a suitable window was found
50 if (!vi_immediate) {
51 G4cerr << "G4OpenGLImmediateXmViewer::G4OpenGLImmediateXmViewer -"
52 " G4OpenGLXmViewer couldn't get a visual." << G4endl;
53 fViewId = -1; // This flags an error.
54 return;
55 }
56}
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition G4ios.hh:67
G4OpenGLImmediateViewer(G4OpenGLImmediateSceneHandler &scene)
G4OpenGLViewer(G4OpenGLSceneHandler &scene)
friend class G4OpenGLXmViewer
XVisualInfo * vi_immediate
G4int fViewId
Definition G4VViewer.hh:269
G4VViewer(G4VSceneHandler &, G4int id, const G4String &name="")
Definition G4VViewer.cc:49

◆ ~G4OpenGLImmediateXmViewer()

G4OpenGLImmediateXmViewer::~G4OpenGLImmediateXmViewer ( )
virtual

Definition at line 58 of file G4OpenGLImmediateXmViewer.cc.

58{}

Member Function Documentation

◆ DrawView()

void G4OpenGLImmediateXmViewer::DrawView ( )
virtual

Implements G4VViewer.

Definition at line 73 of file G4OpenGLImmediateXmViewer.cc.

73 {
74
76
77#ifdef G4DEBUG_VIS_OGL
78 printf("G4OpenGLImmediateXmViewer::DrawView : \n");
79#endif
80
81 if(style!=G4ViewParameters::hlr &&
83
86#ifdef G4DEBUG_VIS_OGL
87 printf("G4OpenGLImmediateXmViewer::DrawView : change param\n");
88#endif
89 ProcessView ();
90 glFlush ();
91
93
94 }
95
96#ifdef G4DEBUG_VIS_OGL
97 printf("G4OpenGLImmediateXmViewer::DrawView : need Kernel/Process/Finish\n");
98#endif
99 NeedKernelVisit (); // Always need to visit G4 kernel.
100 ProcessView ();
101 FinishView ();
102
103}
const G4ViewParameters & GetViewParameters() const
void NeedKernelVisit()
Definition G4VViewer.cc:85
DrawingStyle GetDrawingStyle() const

◆ FinishView()

void G4OpenGLImmediateXmViewer::FinishView ( void )
virtual

Reimplemented from G4VViewer.

Definition at line 105 of file G4OpenGLImmediateXmViewer.cc.

105 {
106#ifdef G4DEBUG_VIS_OGL
107 printf("G4OpenGLImmediateXmViewer::FinishView : \n");
108#endif
109// glXWaitGL (); //Wait for effects of all previous OpenGL commands to
110 //be propagated before progressing.
111// JA: Commented out July 2021 - slows rendering down in some cases and I
112// don't see any adverse effects.
113 glFlush ();
114}

Referenced by DrawView().

◆ Initialise()

void G4OpenGLImmediateXmViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 60 of file G4OpenGLImmediateXmViewer.cc.

60 {
61
65
67
68 // If a double buffer context has been forced upon us, ignore the
69 // back buffer for this OpenGLImmediate view.
70 glDrawBuffer (GL_FRONT);
71}
virtual void CreateFontLists()
void CreateGLXContext(XVisualInfo *vi)
virtual void CreateMainWindow()

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