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

#include <G4OpenGLStoredXmViewer.hh>

+ Inheritance diagram for G4OpenGLStoredXmViewer:

Public Member Functions

 G4OpenGLStoredXmViewer (G4OpenGLStoredSceneHandler &scene, const G4String &name="")
 
virtual ~G4OpenGLStoredXmViewer ()
 
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 DrawText (const G4Text &)
 
- Public Member Functions inherited from G4OpenGLViewer
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 ()
 
virtual void Initialise ()
 
virtual void ResetView ()
 
virtual void SetView ()=0
 
virtual void ClearView ()=0
 
virtual void DrawView ()=0
 
void RefreshView ()
 
virtual void ShowView ()
 
virtual void FinishView ()
 
std::vector< G4ThreeVectorComputeFlyThrough (G4Vector3D *)
 
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 ()
 
- Public Member Functions inherited from G4OpenGLStoredViewer
 G4OpenGLStoredViewer (G4OpenGLStoredSceneHandler &scene)
 
virtual ~G4OpenGLStoredViewer ()
 

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)
 
- 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 CreateMainWindow ()
 
virtual void CreateFontLists ()
 
- Protected Member Functions inherited from G4OpenGLViewer
 G4OpenGLViewer (G4OpenGLSceneHandler &scene)
 
virtual ~G4OpenGLViewer ()
 
void SetView ()
 
void ResetView ()
 
virtual void DrawText (const G4Text &)
 
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)
 
virtual void CreateFontLists ()
 
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 ()
 
GLdouble 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)
 
- 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 G4OpenGLStoredViewer
void KernelVisitDecision ()
 
virtual G4bool CompareForKernelVisit (G4ViewParameters &)
 
void DrawDisplayLists ()
 
virtual void DisplayTimePOColourModification (G4Colour &, size_t)
 
void AddPrimitiveForASingleFrame (const G4Text &text)
 
void AddPrimitiveForASingleFrame (const G4Circle &circle)
 
virtual G4bool POSelected (size_t)
 
virtual G4bool TOSelected (size_t)
 
- 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
 
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.
 
G4bool fNeedKernelVisit
 
- Protected Attributes inherited from G4OpenGLStoredViewer
G4OpenGLStoredSceneHandlerfG4OpenGLStoredSceneHandler
 
G4ViewParameters fLastVP
 
G4bool fDepthTestEnable
 
G4Colour fOldDisplayListColor
 
- 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 41 of file G4OpenGLStoredXmViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenGLStoredXmViewer()

G4OpenGLStoredXmViewer::G4OpenGLStoredXmViewer ( G4OpenGLStoredSceneHandler scene,
const G4String name = "" 
)

Definition at line 39 of file G4OpenGLStoredXmViewer.cc.

42 : G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
43 G4OpenGLViewer (sceneHandler),
44 G4OpenGLXmViewer (sceneHandler),
45 G4OpenGLStoredViewer (sceneHandler)
46{
47
48 if (fViewId < 0) return; // In case error in base class instantiation.
49
50 if (!vi_stored) {
51 fViewId = -1; // This flags an error.
52 G4cerr << "G4OpenGLStoredXmViewer::G4OpenGLStoredXmViewer -"
53 " G4OpenGLXmViewer couldn't get a visual." << G4endl;
54 return;
55 }
56}
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
friend class G4OpenGLXmViewer
XVisualInfo * vi_stored
G4int fViewId
Definition: G4VViewer.hh:217

◆ ~G4OpenGLStoredXmViewer()

G4OpenGLStoredXmViewer::~G4OpenGLStoredXmViewer ( )
virtual

Definition at line 58 of file G4OpenGLStoredXmViewer.cc.

59{}

Member Function Documentation

◆ DrawView()

void G4OpenGLStoredXmViewer::DrawView ( )
virtual

Implements G4VViewer.

Definition at line 72 of file G4OpenGLStoredXmViewer.cc.

72 {
73#ifdef G4DEBUG_VIS_OGL
74 printf("G4OpenGLStoredXmViewer::DrawView \n");
75#endif
76
78
79 //See if things have changed from last time and remake if necessary...
80 // /vis/viewer/rebuild, but if not, make decision and set flag only
81 // if necessary...
83 fLastVP = fVP;
84 G4bool kernelVisitWasNeeded = fNeedKernelVisit; // Keep (ProcessView resets).
85 ProcessView ();
86
87 if(style!=G4ViewParameters::hlr &&
89
92#ifdef G4DEBUG_VIS_OGL
93 printf("G4OpenGLStoredXmViewer::DrawView () flush\n");
94#endif
95 glFlush ();
96
98
100 FinishView ();
101
102 } else {
103
104#ifdef G4DEBUG_VIS_OGL
105 printf("G4OpenGLStoredXmViewer::DrawView not hlr \n");
106#endif
107 // If kernel visit was needed, drawing and FinishView will already
108 // have been done, so...
109 if (!kernelVisitWasNeeded) {
110#ifdef G4DEBUG_VIS_OGL
111 printf("G4OpenGLStoredXmViewer::ComputeView Don't need kernel Visit \n");
112#endif
114 FinishView ();
115 } else {
116#ifdef G4DEBUG_VIS_OGL
117 printf("G4OpenGLStoredXmViewer::ComputeView Need kernel Visit \n");
118#endif
119 // However, union cutaways are implemented in DrawDisplayLists, so make
120 // an extra pass...
121 if (fVP.IsCutaway() &&
123 ClearView();
125 FinishView ();
126 } else { // ADD TO AVOID KernelVisit=1 and nothing to display
128 FinishView ();
129 }
130 }
131 }
132#ifdef G4DEBUG_VIS_OGL
133 printf("G4OpenGLStoredXmViewer::DrawView ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n");
134#endif
135}
bool G4bool
Definition: G4Types.hh:86
void HaloingSecondPass()
G4bool fNeedKernelVisit
Definition: G4VViewer.hh:227
const G4ViewParameters & GetViewParameters() const
void ProcessView()
Definition: G4VViewer.cc:107
G4ViewParameters fVP
Definition: G4VViewer.hh:220
CutawayMode GetCutawayMode() const
G4bool IsCutaway() const
DrawingStyle GetDrawingStyle() const

◆ FinishView()

void G4OpenGLStoredXmViewer::FinishView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 137 of file G4OpenGLStoredXmViewer.cc.

137 {
138// glXWaitGL (); //Wait for effects of all previous OpenGL commands to
139 //be propogated before progressing.
140// JA: Commented out July 2021 - slows rendering down in some cases and I
141// don't see any adverse effects.
142
143#ifdef G4DEBUG_VIS_OGL
144 printf("G4OpenGLStoredXmViewer::FinishView () flush \n");
145#endif
146 glFlush (); //FIXME
147
148 GLint renderMode;
149 glGetIntegerv(GL_RENDER_MODE, &renderMode);
150 if (renderMode == GL_RENDER) glXSwapBuffers (dpy, win);
151}

Referenced by DrawView().

◆ Initialise()

void G4OpenGLStoredXmViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 61 of file G4OpenGLStoredXmViewer.cc.

61 {
62
66
68
69 glDrawBuffer (GL_BACK);
70}
virtual void CreateFontLists()
void CreateGLXContext(XVisualInfo *vi)
virtual void CreateMainWindow()

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