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

#include <G4OpenGLStoredXViewer.hh>

+ Inheritance diagram for G4OpenGLStoredXViewer:

Public Member Functions

 G4OpenGLStoredXViewer (G4OpenGLStoredSceneHandler &scene, const G4String &name="")
 
virtual ~G4OpenGLStoredXViewer ()
 
void Initialise ()
 
void DrawView ()
 
void FinishView ()
 
- 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

- 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 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 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 G4OpenGLStoredXViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenGLStoredXViewer()

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

Definition at line 39 of file G4OpenGLStoredXViewer.cc.

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

◆ ~G4OpenGLStoredXViewer()

G4OpenGLStoredXViewer::~G4OpenGLStoredXViewer ( )
virtual

Definition at line 57 of file G4OpenGLStoredXViewer.cc.

57{}

Member Function Documentation

◆ DrawView()

void G4OpenGLStoredXViewer::DrawView ( )
virtual

Implements G4VViewer.

Definition at line 73 of file G4OpenGLStoredXViewer.cc.

73 {
74
75#ifdef G4DEBUG_VIS_OGL
76 printf("G4OpenGLStoredXViewer::DrawView\n");
77#endif
78
80
81 // See if things have changed from last time and remake if necessary...
82 // The fNeedKernelVisit flag might have been set by the user in
83 // /vis/viewer/rebuild, but if not, make decision and set flag only
84 // if necessary...
86 fLastVP = fVP;
87 G4bool kernelVisitWasNeeded = fNeedKernelVisit; // Keep (ProcessView resets).
88 ProcessView ();
89
91
94#ifdef G4DEBUG_VIS_OGL
95 printf("G4OpenGLStoredXViewer::DrawView flush \n");
96#endif
97 glFlush ();
98
100
102
103 } else {
104
105 if (!kernelVisitWasNeeded) {
106#ifdef G4DEBUG_VIS_OGL
107 printf("G4OpenGLStoredXViewer::DrawView NO need kernel visit\n");
108#endif
110
111 } else {
112
113#ifdef G4DEBUG_VIS_OGL
114 printf("G4OpenGLStoredXViewer::DrawView NEED kernel visit\n");
115#endif
116 // However, union cutaways are implemented in DrawDisplayLists, so make
117 // an extra pass...
118 if (fVP.IsCutaway() &&
120 ClearView();
122 } else { // ADD TO AVOID KernelVisit=1 and nothing to display
124 }
125 }
126 }
127
128 FinishView ();
129
130}
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 G4OpenGLStoredXViewer::FinishView ( void  )
virtual

Reimplemented from G4VViewer.

Definition at line 132 of file G4OpenGLStoredXViewer.cc.

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

Referenced by DrawView().

◆ Initialise()

void G4OpenGLStoredXViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 59 of file G4OpenGLStoredXViewer.cc.

59 {
60
61#ifdef G4DEBUG_VIS_OGL
62 printf("G4OpenGLStoredXViewer::Initialise\n");
63#endif
67
69
70 glDrawBuffer (GL_BACK);
71}
void CreateGLXContext(XVisualInfo *vi)
virtual void CreateFontLists()
virtual void CreateMainWindow()

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