Skip to content

Commit

Permalink
Merge pull request #1108 from kerautret/FixAxisTransp
Browse files Browse the repository at this point in the history
Fix axis display in transparent elements
  • Loading branch information
dcoeurjo committed Jan 11, 2016
2 parents f408482 + 80887e1 commit 7109988
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
- *IO Package*
- Fix viewer tests including qt4 headers even with configuring WITH_QT5=ON.
(Pablo Hernandez-Cerdan, [#1100](https://github.com/DGtal-team/DGtal/pull/1100))
- Fix Viewer3D axis display when they are included in a transparent element.
(issue #873)
(Bertrand Kerautret [##1108](https://github.com/DGtal-team/DGtal/pull/1108)))


# DGtal 0.9

Expand Down
8 changes: 8 additions & 0 deletions src/DGtal/io/viewers/Viewer3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,14 @@ namespace DGtal
virtual unsigned int getCurrentGLImageNumber();


/**
* @brief Overload of the QGLViewer method in order to change the
* order of display (to fix the QGLViewer axis display trough
* transparency).
**/
virtual void paintGL();


/**
* Add a TextureImage in the list of image to be displayed.
* @param image a TextureImage including image data buffer and position, orientation.
Expand Down
36 changes: 35 additions & 1 deletion src/DGtal/io/viewers/Viewer3D.ih
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "DGtal/io/viewers/CDrawableWithViewer3D.h"
#include "DGtal/io/viewers/Viewer3DFactory.h"
#include "QGLViewer/manipulatedFrame.h"
#include "QGLViewer/manipulatedCameraFrame.h"
//////////////////////////////////////////////////////////////////////////////

using namespace std;
Expand Down Expand Up @@ -1776,5 +1777,38 @@ DGtal::Viewer3D<Space, KSpace>::closeEvent ( QCloseEvent * e ){




template<typename Space, typename KSpace>
inline
void
DGtal::Viewer3D<Space, KSpace>::paintGL(){
if (displaysInStereo())
{
for (int view=1; view>=0; --view)
{
// Clears screen, set model view matrix with shifted matrix for ith buffer
preDrawStereo(view);
postDraw();
// Used defined method. Default is empty
if (camera()->frame()->isManipulated())
fastDraw();
else
draw();

}
}
else
{
// Clears screen, set model view matrix...
preDraw();
postDraw();
// Used defined method. Default calls draw()
if (camera()->frame()->isManipulated())
fastDraw();
else
draw();
// Add visual hints: axis, camera, grid...

}
Q_EMIT drawFinished(true);
}

0 comments on commit 7109988

Please sign in to comment.