Geant4 11.1.1
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 ()
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
 
virtual void updateQWidget ()=0
 
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 ()
 
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 ()
 

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 (QGLWidget *, 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 ()
 
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)
 

Additional Inherited Members

- Public Slots inherited from G4OpenGLQtViewer
void startPauseVideo ()
 
- Protected Slots inherited from G4OpenGLQtViewer
void updateToolbarAndMouseContextMenu ()
 
- Protected Attributes inherited from G4OpenGLQtViewer
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.
 
G4bool fNeedKernelVisit
 
- Protected Attributes inherited from G4OpenGLStoredViewer
G4OpenGLStoredSceneHandlerfG4OpenGLStoredSceneHandler
 
G4ViewParameters fLastVP
 
G4bool fDepthTestEnable
 
G4Colour fOldDisplayListColor
 

Detailed Description

Definition at line 45 of file G4OpenGLStoredQtViewer.hh.

Constructor & Destructor Documentation

◆ G4OpenGLStoredQtViewer()

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

Definition at line 43 of file G4OpenGLStoredQtViewer.cc.

45 :
46 G4VViewer (sceneHandler, sceneHandler.IncrementViewCount (), name),
47 G4OpenGLViewer (sceneHandler),
48 G4OpenGLQtViewer (sceneHandler),
49 G4OpenGLStoredViewer (sceneHandler), // FIXME : gerer le pb du parent !
50 QGLWidget()
51{
52 if (fViewId < 0) return; // In case error in base class instantiation.
53
55
56 // 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.
57 QGLWidget::setAttribute (Qt::WA_NoSystemBackground);
58
59 setFocusPolicy(Qt::StrongFocus); // enable keybord events
60 fHasToRepaint = false;
61 fPaintEventLock = false;
62 fUpdateGLLock = false;
63}
G4int fViewId
Definition: G4VViewer.hh:217

◆ ~G4OpenGLStoredQtViewer()

G4OpenGLStoredQtViewer::~G4OpenGLStoredQtViewer ( )

Definition at line 65 of file G4OpenGLStoredQtViewer.cc.

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

Member Function Documentation

◆ CompareForKernelVisit()

G4bool G4OpenGLStoredQtViewer::CompareForKernelVisit ( G4ViewParameters lastVP)
protectedvirtual

Reimplemented from G4OpenGLStoredViewer.

Definition at line 108 of file G4OpenGLStoredQtViewer.cc.

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

408{
410}
void G4manageContextMenuEvent(QContextMenuEvent *e)

◆ DisplayTimePOColourModification()

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

Reimplemented from G4OpenGLStoredViewer.

Definition at line 453 of file G4OpenGLStoredQtViewer.cc.

455 {
456 c = getColorForPoIndex((int)poIndex);
457}
G4Colour getColorForPoIndex(int poIndex)

◆ DrawView()

void G4OpenGLStoredQtViewer::DrawView ( )
virtual

Implements G4VViewer.

Definition at line 209 of file G4OpenGLStoredQtViewer.cc.

209 {
211}

◆ Initialise()

void G4OpenGLStoredQtViewer::Initialise ( )
virtual

Reimplemented from G4VViewer.

Definition at line 72 of file G4OpenGLStoredQtViewer.cc.

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

◆ initializeGL()

void G4OpenGLStoredQtViewer::initializeGL ( )

Definition at line 91 of file G4OpenGLStoredQtViewer.cc.

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

◆ keyPressEvent()

void G4OpenGLStoredQtViewer::keyPressEvent ( QKeyEvent *  event)
protected

Definition at line 365 of file G4OpenGLStoredQtViewer.cc.

366{
367 G4keyPressEvent(event);
368}
void G4keyPressEvent(QKeyEvent *event)

◆ keyReleaseEvent()

void G4OpenGLStoredQtViewer::keyReleaseEvent ( QKeyEvent *  event)
protected

Definition at line 370 of file G4OpenGLStoredQtViewer.cc.

371{
372 G4keyReleaseEvent(event);
373}
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 391 of file G4OpenGLStoredQtViewer.cc.

392{
394}

◆ mouseMoveEvent()

void G4OpenGLStoredQtViewer::mouseMoveEvent ( QMouseEvent *  event)
protected

Definition at line 401 of file G4OpenGLStoredQtViewer.cc.

402{
403 G4MouseMoveEvent(event);
404}
void G4MouseMoveEvent(QMouseEvent *event)

◆ mousePressEvent()

void G4OpenGLStoredQtViewer::mousePressEvent ( QMouseEvent *  event)
protected

Definition at line 360 of file G4OpenGLStoredQtViewer.cc.

361{
362 G4MousePressEvent(event);
363}
void G4MousePressEvent(QMouseEvent *event)

◆ mouseReleaseEvent()

void G4OpenGLStoredQtViewer::mouseReleaseEvent ( QMouseEvent *  event)
protected

Definition at line 396 of file G4OpenGLStoredQtViewer.cc.

397{
398 G4MouseReleaseEvent(event);
399}
void G4MouseReleaseEvent(QMouseEvent *evnt)

◆ paintEvent()

void G4OpenGLStoredQtViewer::paintEvent ( QPaintEvent *  event)
protected

Definition at line 345 of file G4OpenGLStoredQtViewer.cc.

345 {
347 return;
348 }
349 // Force a repaint next time if the FRAMEBUFFER is not READY
351 if ( fHasToRepaint) {
352 // Will really update the widget by calling CGLFlushDrawable
353 // The widget's rendering context will become the current context and initializeGL()
354 // will be called if it hasn't already been called.
355 // Copies the back buffer of a double-buffered context to the front buffer.
356 updateGL();
357 }
358}
G4bool isFramebufferReady()

◆ paintGL()

void G4OpenGLStoredQtViewer::paintGL ( )

Definition at line 297 of file G4OpenGLStoredQtViewer.cc.

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

◆ POSelected()

G4bool G4OpenGLStoredQtViewer::POSelected ( size_t  POListIndex)
protectedvirtual

Reimplemented from G4OpenGLStoredViewer.

Definition at line 199 of file G4OpenGLStoredQtViewer.cc.

200{
201 return isTouchableVisible((int)POListIndex);
202}
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 280 of file G4OpenGLStoredQtViewer.cc.

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

◆ showEvent()

void G4OpenGLStoredQtViewer::showEvent ( QShowEvent *  event)
protected

Definition at line 380 of file G4OpenGLStoredQtViewer.cc.

381{
383 fHasToRepaint = true;
384 }
385}

◆ ShowView()

void G4OpenGLStoredQtViewer::ShowView ( void  )
virtual

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

Reimplemented from G4VViewer.

Definition at line 434 of file G4OpenGLStoredQtViewer.cc.

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

◆ TOSelected()

G4bool G4OpenGLStoredQtViewer::TOSelected ( size_t  TOListIndex)
protectedvirtual

Reimplemented from G4OpenGLStoredViewer.

Definition at line 204 of file G4OpenGLStoredQtViewer.cc.

205{
206 return true;
207}

◆ updateQWidget()

void G4OpenGLStoredQtViewer::updateQWidget ( )
virtual

Implements G4OpenGLQtViewer.

Definition at line 412 of file G4OpenGLStoredQtViewer.cc.

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

Referenced by DrawView().

◆ wheelEvent()

void G4OpenGLStoredQtViewer::wheelEvent ( QWheelEvent *  event)
protected

Definition at line 375 of file G4OpenGLStoredQtViewer.cc.

376{
377 G4wheelEvent(event);
378}
void G4wheelEvent(QWheelEvent *event)

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