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

#include <G4OpenGLStoredQtViewer.hh>

+ Inheritance diagram for G4OpenGLStoredQtViewer:

Public Member Functions

 G4OpenGLStoredQtViewer (G4OpenGLStoredSceneHandler &scene, const G4String &name="")
 
 ~G4OpenGLStoredQtViewer ()
 
void Initialise ()
 
void initializeGL ()
 
void DrawView ()
 
void resizeGL (int width, int height)
 
void paintGL ()
 
void updateQWidget ()
 
void ShowView ()
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
 
void DisplayTimePOColourModification (G4Colour &, size_t)
 
- Public Member Functions inherited from G4OpenGLQtViewer
 G4OpenGLQtViewer (G4OpenGLSceneHandler &scene)
 
virtual ~G4OpenGLQtViewer ()
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
 
void updateSceneTreeWidget ()
 
void updateViewerPropertiesTableWidget ()
 
void updatePickInfosWidget (int, int)
 
QString setEncoderPath (QString path)
 
QString getEncoderPath ()
 
QString setTempFolderPath (QString path)
 
QString getTempFolderPath ()
 
QString setSaveFileName (QString path)
 
QString getSaveFileName ()
 
bool isRecording ()
 
bool isStopped ()
 
bool isPaused ()
 
bool isEncoding ()
 
bool isWaiting ()
 
bool isFailed ()
 
void setWaiting ()
 
bool isBadEncoder ()
 
bool isBadOutput ()
 
bool isBadTmp ()
 
bool isSuccess ()
 
void setBadTmp ()
 
void setBadOutput ()
 
void setBadEncoder ()
 
bool isReadyToEncode ()
 
void resetRecording ()
 
void encodeVideo ()
 
void stopVideo ()
 
void saveVideo ()
 
bool generateMpegEncoderParameters ()
 
void displayRecordingStatus ()
 
void DrawText (const G4Text &)
 
void ResetView ()
 
void addPVSceneTreeElement (const G4String &model, G4PhysicalVolumeModel *pPVModel, int currentPVPOIndex)
 
void addNonPVSceneTreeElement (const G4String &model, int currentPVPOIndex, const std::string &modelDescription, const G4Visible &visible)
 
bool isTouchableVisible (int POindex)
 
void clearTreeWidget ()
 
bool exportImage (std::string name="", int width=-1, int height=-1)
 
void G4MousePressEvent (QMouseEvent *event)
 
void G4wheelEvent (QWheelEvent *event)
 
void G4keyPressEvent (QKeyEvent *event)
 
void G4keyReleaseEvent (QKeyEvent *event)
 
void G4MouseDoubleClickEvent ()
 
void G4MouseReleaseEvent (QMouseEvent *evnt)
 
void G4MouseMoveEvent (QMouseEvent *event)
 
- Public Member Functions inherited from G4OpenGLViewer
void ClearView ()
 
void ClearViewWithoutFlush ()
 
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 ()
 
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
 
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 ()
 

Protected Member Functions

G4bool CompareForKernelVisit (G4ViewParameters &)
 
G4bool POSelected (size_t POListIndex)
 
G4bool TOSelected (size_t TOListIndex)
 
void showEvent (QShowEvent *event)
 
void wheelEvent (QWheelEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void mouseDoubleClickEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
void contextMenuEvent (QContextMenuEvent *e)
 
void keyPressEvent (QKeyEvent *event)
 
void keyReleaseEvent (QKeyEvent *event)
 
void paintEvent (QPaintEvent *event)
 
- Protected Member Functions inherited from G4OpenGLQtViewer
void CreateGLQtContext ()
 
virtual void CreateMainWindow (G4QGLWidgetType *, const QString &)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
 
void G4manageContextMenuEvent (QContextMenuEvent *e)
 
void rotateQtScene (float, float)
 
void rotateQtSceneToggle (float, float)
 
void moveScene (float, float, float, bool)
 
void FinishView ()
 
void updateKeyModifierState (const Qt::KeyboardModifiers &)
 
void displaySceneTreeComponent ()
 
G4Colour getColorForPoIndex (int poIndex)
 
const std::vector< G4ModelingParameters::VisAttributesModifier > * GetPrivateVisAttributesModifiers () const
 
bool isCurrentWidget ()
 
void savePPMToTemp ()
 
- Protected Member Functions inherited from G4OpenGLViewer
 G4OpenGLViewer (G4OpenGLSceneHandler &scene)
 
virtual ~G4OpenGLViewer ()
 
void SetView ()
 
void ResetView ()
 
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 ()
 
void DrawDisplayLists ()
 
void AddPrimitiveForASingleFrame (const G4Text &text)
 
void AddPrimitiveForASingleFrame (const G4Circle &circle)
 

Additional Inherited Members

- Public Slots inherited from G4OpenGLQtViewer
void startPauseVideo ()
 
- Protected Slots inherited from G4OpenGLQtViewer
void updateToolbarAndMouseContextMenu ()
 
- Protected Attributes inherited from G4OpenGLQtViewer
G4UIQtfUiQt
 
QWidget * fGLWidget
 
int fRecordFrameNumber
 
bool fHasToRepaint
 
bool fUpdateGLLock
 
bool fQGLWidgetInitialiseCompleted
 
bool fPaintEventLock
 
bool fMouseOnSceneTree
 
- 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.
 
SceneTreeScene fSceneTreeScene
 
G4SceneTreeItem fSceneTree
 
G4bool fNeedKernelVisit
 
- Protected Attributes inherited from G4OpenGLStoredViewer
G4OpenGLStoredSceneHandlerfG4OpenGLStoredSceneHandler
 
G4ViewParameters fLastVP
 
G4bool fDepthTestEnable
 
G4Colour fOldDisplayListColor
 

Detailed Description

Definition at line 44 of file G4OpenGLStoredQtViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenGLStoredQtViewer()

G4OpenGLStoredQtViewer::G4OpenGLStoredQtViewer ( G4OpenGLStoredSceneHandler & scene,
const G4String & name = "" )

Definition at line 44 of file G4OpenGLStoredQtViewer.cc.

46 :
47 G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
48 G4OpenGLViewer (sceneHandler),
49 G4OpenGLQtViewer (sceneHandler),
50 G4OpenGLStoredViewer (sceneHandler), // FIXME : gerer le pb du parent !
52{
53 if (fViewId < 0) return; // In case error in base class instantiation.
54
56
57 // Indicates that the widget has no background, i.e. when the widget receives paint events, the background is not automatically repainted. Note: Unlike WA_OpaquePaintEvent, newly exposed areas are never filled with the background (e.g., after showing a window for the first time the user can see "through" it until the application processes the paint events). This flag is set or cleared by the widget's author.
58 G4QGLWidgetType::setAttribute (Qt::WA_NoSystemBackground);
59
60 setFocusPolicy(Qt::StrongFocus); // enable keybord events
61 fHasToRepaint = false;
62 fPaintEventLock = false;
63 fUpdateGLLock = false;
64}
QOpenGLWidget G4QGLWidgetType
G4OpenGLQtViewer(G4OpenGLSceneHandler &scene)
G4OpenGLStoredViewer(G4OpenGLStoredSceneHandler &scene)
G4OpenGLViewer(G4OpenGLSceneHandler &scene)
G4int fViewId
Definition G4VViewer.hh:254
G4VViewer(G4VSceneHandler &, G4int id, const G4String &name="")
Definition G4VViewer.cc:49

◆ ~G4OpenGLStoredQtViewer()

G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer ( )

Definition at line 66 of file G4OpenGLStoredQtViewer.cc.

66 {
67 // makeCurrent(); // Not sure why this - commented out 12-Apr-2021 JA
68 // this is connect to the Dialog for deleting it properly
69 // when close event.
70 // ((QDialog*)window())->reject();
71}

Member Function Documentation

◆ CompareForKernelVisit()

G4bool G4OpenGLStoredQtViewer::CompareForKernelVisit ( G4ViewParameters & lastVP)
protectedvirtual

Reimplemented from G4OpenGLStoredViewer.

Definition at line 109 of file G4OpenGLStoredQtViewer.cc.

110{
111 // Identical to G4OpenGLStoredViewer::CompareForKernelVisit except
112 // for checking of VisAttributesModifiers, because
113 // G4OpenGLStoredQtViewer keeps track of its own touchable
114 // modifiers (fTreeItemModels, etc.).
115 if (
116 (lastVP.GetDrawingStyle () != fVP.GetDrawingStyle ()) ||
118 (lastVP.IsAuxEdgeVisible () != fVP.IsAuxEdgeVisible ()) ||
119 (lastVP.IsCulling () != fVP.IsCulling ()) ||
120 (lastVP.IsCullingInvisible () != fVP.IsCullingInvisible ()) ||
121 (lastVP.IsDensityCulling () != fVP.IsDensityCulling ()) ||
122 (lastVP.IsCullingCovered () != fVP.IsCullingCovered ()) ||
123 (lastVP.GetCBDAlgorithmNumber() !=
125 // Note: Section and Cutaway can reveal back-facing faces. If
126 // backface culling is implemented, the image can look strange because
127 // the back-facing faces are not there. For the moment, we have disabled
128 // (commented out) backface culling (it seems not to affect performance -
129 // in fact, performance seems to improve), so there is no problem.
130 (lastVP.IsSection () != fVP.IsSection ()) ||
131 // Section (DCUT) is NOT implemented locally so we need to visit the kernel.
132 // (lastVP.IsCutaway () != fVP.IsCutaway ()) ||
133 // Cutaways are implemented locally so we do not need to visit the kernel.
134 (lastVP.IsExplode () != fVP.IsExplode ()) ||
135 (lastVP.GetNoOfSides () != fVP.GetNoOfSides ()) ||
138 (lastVP.IsMarkerNotHidden () != fVP.IsMarkerNotHidden ()) ||
139 (lastVP.GetDefaultVisAttributes()->GetColour() !=
144 (lastVP.IsPicking () != fVP.IsPicking ()) ||
147 return true;
148
149 // Don't check VisAttributesModifiers if this comparison has been
150 // initiated by a mouse interaction on the scene tree.
151 if (fMouseOnSceneTree) {
152 // Reset the flag.
153 fMouseOnSceneTree = false;
154 } else {
155 // Not initiated by a mouse so compare for kernel visit.
157 return true;
158 }
159 }
160
161 if (lastVP.IsDensityCulling () &&
162 (lastVP.GetVisibleDensity () != fVP.GetVisibleDensity ()))
163 return true;
164
165// /**************************************************************
166// If section (DCUT) is implemented locally, comment this out.
167 if (lastVP.IsSection () &&
168 (lastVP.GetSectionPlane () != fVP.GetSectionPlane ()))
169 return true;
170// ***************************************************************/
171
172 /**************************************************************
173 If cutaways are implemented locally, comment this out.
174 if (lastVP.IsCutaway ()) {
175 if (vp.GetCutawayMode() != fVP.GetCutawayMode()) return true;
176 if (lastVP.GetCutawayPlanes ().size () !=
177 fVP.GetCutawayPlanes ().size ()) return true;
178 for (size_t i = 0; i < lastVP.GetCutawayPlanes().size(); ++i)
179 if (lastVP.GetCutawayPlanes()[i] != fVP.GetCutawayPlanes()[i])
180 return true;
181 }
182 ***************************************************************/
183
184 if (lastVP.GetCBDAlgorithmNumber() > 0) {
185 if (lastVP.GetCBDParameters().size() != fVP.GetCBDParameters().size()) return true;
186 else if (lastVP.GetCBDParameters() != fVP.GetCBDParameters()) return true;
187 }
188
189 if (lastVP.IsExplode () &&
190 (lastVP.GetExplodeFactor () != fVP.GetExplodeFactor ()))
191 return true;
192
193 if (lastVP.IsSpecialMeshRendering() &&
195 return true;
196
197 return false;
198}
G4ViewParameters fVP
Definition G4VViewer.hh:257
const std::vector< G4ModelingParameters::VisAttributesModifier > & GetVisAttributesModifiers() const
G4int GetNoOfSides() const
G4bool IsSpecialMeshRendering() const
G4double GetExplodeFactor() const
G4int GetNumberOfCloudPoints() const
G4bool IsMarkerNotHidden() const
G4double GetGlobalLineWidthScale() const
const G4Colour & GetBackgroundColour() const
G4bool IsSection() const
G4bool IsPicking() const
G4bool IsCulling() const
const G4VisAttributes * GetDefaultTextVisAttributes() const
G4bool IsExplode() const
const std::vector< G4double > & GetCBDParameters() const
G4int GetCBDAlgorithmNumber() const
const std::vector< G4ModelingParameters::PVNameCopyNo > & GetSpecialMeshVolumes() const
G4double GetGlobalMarkerScale() const
G4bool IsCullingInvisible() const
const G4VisAttributes * GetDefaultVisAttributes() const
G4bool IsDensityCulling() const
G4double GetVisibleDensity() const
SMROption GetSpecialMeshRenderingOption() const
G4bool IsCullingCovered() const
const G4Plane3D & GetSectionPlane() const
DrawingStyle GetDrawingStyle() const
G4bool IsAuxEdgeVisible() const
const G4Colour & GetColour() const

◆ contextMenuEvent()

void G4OpenGLStoredQtViewer::contextMenuEvent ( QContextMenuEvent * e)
protected

Definition at line 413 of file G4OpenGLStoredQtViewer.cc.

414{
416}
void G4manageContextMenuEvent(QContextMenuEvent *e)

◆ DisplayTimePOColourModification()

void G4OpenGLStoredQtViewer::DisplayTimePOColourModification ( G4Colour & c,
size_t poIndex )
virtual

Reimplemented from G4OpenGLStoredViewer.

Definition at line 459 of file G4OpenGLStoredQtViewer.cc.

461 {
462 c = getColorForPoIndex((int)poIndex);
463}
G4Colour getColorForPoIndex(int poIndex)

◆ DrawView()

void G4OpenGLStoredQtViewer::DrawView ( )
virtual

Implements G4VViewer.

Definition at line 210 of file G4OpenGLStoredQtViewer.cc.

◆ Initialise()

void G4OpenGLStoredQtViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 73 of file G4OpenGLStoredQtViewer.cc.

73 {
74 makeCurrent();
75
77 CreateMainWindow (this,QString(GetName()));
78
79 glDrawBuffer (GL_BACK);
80
81 // set the good tab active
82 if (G4QGLWidgetType::parentWidget()) {
83 auto *parentTab = dynamic_cast<QTabWidget*> (G4QGLWidgetType::parentWidget()->parent()) ;
84 if (parentTab) {
85 parentTab->setCurrentIndex(parentTab->count()-1);
86 }
87 }
88
90}
virtual void CreateMainWindow(G4QGLWidgetType *, const QString &)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
const G4String & GetName() const

◆ initializeGL()

void G4OpenGLStoredQtViewer::initializeGL ( )

Definition at line 92 of file G4OpenGLStoredQtViewer.cc.

92 {
93
95
96 if (fSceneHandler.GetScene() == 0) {
97 fHasToRepaint =false;
98 } else {
99 fHasToRepaint =true;
100 }
101
102 // Set the component visible
103 // setVisible(true) ;
104
105 // Set jpg as default export format for Qt viewer
107}
bool setExportImageFormat(std::string format, bool quiet=false)
G4Scene * GetScene() const
G4VSceneHandler & fSceneHandler
Definition G4VViewer.hh:253

◆ keyPressEvent()

void G4OpenGLStoredQtViewer::keyPressEvent ( QKeyEvent * event)
protected

Definition at line 371 of file G4OpenGLStoredQtViewer.cc.

372{
373 G4keyPressEvent(event);
374}
void G4keyPressEvent(QKeyEvent *event)

◆ keyReleaseEvent()

void G4OpenGLStoredQtViewer::keyReleaseEvent ( QKeyEvent * event)
protected

Definition at line 376 of file G4OpenGLStoredQtViewer.cc.

377{
378 G4keyReleaseEvent(event);
379}
void G4keyReleaseEvent(QKeyEvent *event)

◆ mouseDoubleClickEvent()

void G4OpenGLStoredQtViewer::mouseDoubleClickEvent ( QMouseEvent * event)
protected

This function was build in order to make a zoom on double clic event. It was think to build a rubberband on the zoom area, but never work fine

Definition at line 397 of file G4OpenGLStoredQtViewer.cc.

398{
400}

◆ mouseMoveEvent()

void G4OpenGLStoredQtViewer::mouseMoveEvent ( QMouseEvent * event)
protected

Definition at line 407 of file G4OpenGLStoredQtViewer.cc.

408{
409 G4MouseMoveEvent(event);
410}
void G4MouseMoveEvent(QMouseEvent *event)

◆ mousePressEvent()

void G4OpenGLStoredQtViewer::mousePressEvent ( QMouseEvent * event)
protected

Definition at line 366 of file G4OpenGLStoredQtViewer.cc.

367{
368 G4MousePressEvent(event);
369}
void G4MousePressEvent(QMouseEvent *event)

◆ mouseReleaseEvent()

void G4OpenGLStoredQtViewer::mouseReleaseEvent ( QMouseEvent * event)
protected

Definition at line 402 of file G4OpenGLStoredQtViewer.cc.

403{
404 G4MouseReleaseEvent(event);
405}
void G4MouseReleaseEvent(QMouseEvent *evnt)

◆ paintEvent()

void G4OpenGLStoredQtViewer::paintEvent ( QPaintEvent * event)
protected

Definition at line 346 of file G4OpenGLStoredQtViewer.cc.

346 {
348 return;
349 }
350 // Force a repaint next time if the FRAMEBUFFER is not READY
352 if ( fHasToRepaint) {
353 // Will really update the widget by calling CGLFlushDrawable
354 // The widget's rendering context will become the current context and initializeGL()
355 // will be called if it hasn't already been called.
356 // Copies the back buffer of a double-buffered context to the front buffer.
357#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
358 updateGL();
359#else
360 // Not sure this is correct....
361 paintGL();
362#endif
363 }
364}
G4bool isFramebufferReady()

◆ paintGL()

void G4OpenGLStoredQtViewer::paintGL ( )

Definition at line 298 of file G4OpenGLStoredQtViewer.cc.

299{
301
302 if (fPaintEventLock) {
303// return ;
304 }
305 fPaintEventLock = true;
306 if ((getWinWidth() == 0) && (getWinHeight() == 0)) {
307 return;
308 }
309
311 fPaintEventLock = false;
312 return;
313 }
314 // DO NOT RESIZE IF SIZE HAS NOT CHANGE :
315 // WHEN CLICK ON THE FRAME FOR EXAMPLE
316 // EXECEPT WHEN MOUSE MOVE EVENT
317 if ( !fHasToRepaint) {
318 // L. Garnier : Trap to get the size with mac OSX 10.6 and Qt 4.6(devel)
319 // Tested on Qt4.5 on mac, 4.4 on windows, 4.5 on unbuntu
320 int sw = 0;
321 int sh = 0;
322 if (!isMaximized() && !isFullScreen()) {
323 sw = normalGeometry().width();
324 sh = normalGeometry().height();
325 } else {
326 sw = frameGeometry().width();
327 sh = frameGeometry().height();
328 }
329 if ((getWinWidth() == (unsigned int)sw) &&(getWinHeight() == (unsigned int)sh)) {
330 return;
331 }
332 }
333 // Ensure that we really draw the BACK buffer
334 glDrawBuffer (GL_BACK);
335
336 SetView();
337
338 ClearView (); //ok, put the background correct
339 ComputeView();
340
341 fHasToRepaint = false;
342
343 fPaintEventLock = false;
344}
void updateToolbarAndMouseContextMenu()
unsigned int getWinHeight() const
unsigned int getWinWidth() const

Referenced by paintEvent().

◆ POSelected()

G4bool G4OpenGLStoredQtViewer::POSelected ( size_t POListIndex)
protectedvirtual

Reimplemented from G4OpenGLStoredViewer.

Definition at line 200 of file G4OpenGLStoredQtViewer.cc.

201{
202 return isTouchableVisible((int)POListIndex);
203}
bool isTouchableVisible(int POindex)

◆ resizeGL()

void G4OpenGLStoredQtViewer::resizeGL ( int aWidth,
int aHeight )
  • Lors du resize de la fenetre, on doit non pas redessiner le detecteur, mais aussi les evenements

Definition at line 281 of file G4OpenGLStoredQtViewer.cc.

284{
285 // Set new size, it will be update when next Repaint()->SetView() called
286 if ((aWidth > 0) && (aHeight > 0)) {
287 ResizeWindow(aWidth,aHeight);
289 }
290}
void ResizeWindow(unsigned int, unsigned int)
G4bool sizeHasChanged()

◆ showEvent()

void G4OpenGLStoredQtViewer::showEvent ( QShowEvent * event)
protected

Definition at line 386 of file G4OpenGLStoredQtViewer.cc.

387{
389 fHasToRepaint = true;
390 }
391}

◆ ShowView()

void G4OpenGLStoredQtViewer::ShowView ( void )
virtual

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//

Reimplemented from G4VViewer.

Definition at line 440 of file G4OpenGLStoredQtViewer.cc.

444{
445 // glFlush (); // Tentativley offered by JA 29/04/16.
446
447 // Some X servers fail to draw all trajectories, particularly Mac
448 // XQuartz. Revisit this at a future date. Meanwhile, issue an
449 // extra...
450 // ClearView(); // Necessary? JA 29/04/16
451 // DrawView(); // Necessary? JA 29/04/16
452 activateWindow();
453 // glFlush(); // NO NEED and as drawView will already cause a flush
454 // that could do a double flush
455
456}

◆ TOSelected()

G4bool G4OpenGLStoredQtViewer::TOSelected ( size_t TOListIndex)
protectedvirtual

Reimplemented from G4OpenGLStoredViewer.

Definition at line 205 of file G4OpenGLStoredQtViewer.cc.

206{
207 return true;
208}

◆ updateQWidget()

void G4OpenGLStoredQtViewer::updateQWidget ( )
virtual

Implements G4OpenGLQtViewer.

Definition at line 418 of file G4OpenGLStoredQtViewer.cc.

418 {
419 if (fUpdateGLLock) {
420 return;
421 }
422
423 if (! isCurrentWidget()){
424 return;
425 }
426
427 fUpdateGLLock = true;
428 fHasToRepaint= true;
429 // Will really update the widget by calling CGLFlushDrawable
430 // The widget's rendering context will become the current context and initializeGL()
431 // will be called if it hasn't already been called.
432 // Copies the back buffer of a double-buffered context to the front buffer.
433 repaint(); // will read scene tree state
434 // updateGL() // From J.Allison picking branch
437 fUpdateGLLock = false;
438}
void updateViewerPropertiesTableWidget()

Referenced by DrawView().

◆ wheelEvent()

void G4OpenGLStoredQtViewer::wheelEvent ( QWheelEvent * event)
protected

Definition at line 381 of file G4OpenGLStoredQtViewer.cc.

382{
383 G4wheelEvent(event);
384}
void G4wheelEvent(QWheelEvent *event)

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