31#if defined(Viewer3D_RECURSES)
32#error Recursive header files inclusion detected in Viewer3D.h
35#define Viewer3D_RECURSES
37#if !defined Viewer3D_h
43#include "DGtal/base/Common.h"
54#define GL_SILENCE_DEPRECATION
56#include <OpenGL/glu.h>
62#include <QApplication>
64#include <QGLViewer/qglviewer.h>
68#include "DGtal/kernel/SpaceND.h"
69#include "DGtal/topology/KhalimskySpaceND.h"
70#include "DGtal/base/CountedPtr.h"
71#include "DGtal/io/Display3D.h"
72#include "DGtal/math/BasicMathFunctions.h"
74#include "DGtal/kernel/CSpace.h"
129 template <
typename TSpace = SpaceND<3>,
130 typename TKSpace = KhalimskySpaceND<3>>
179 boost::ignore_unused_variable_warning( viewer );
180 boost::ignore_unused_variable_warning( event );
191 boost::ignore_unused_variable_warning( viewer );
201 boost::ignore_unused_variable_warning( viewer );
210 boost::ignore_unused_variable_warning( viewer );
221 boost::ignore_unused_variable_warning( viewer );
236 boost::ignore_unused_variable_warning( viewer );
237 boost::ignore_unused_variable_warning( point );
251 boost::ignore_unused_variable_warning( viewer );
252 boost::ignore_unused_variable_warning( event );
266 boost::ignore_unused_variable_warning( viewer );
267 boost::ignore_unused_variable_warning( event );
282 boost::ignore_unused_variable_warning( viewer );
283 boost::ignore_unused_variable_warning( event );
386 glEnable(GL_NORMALIZE);
523 template<
typename TDomain>
525 double xBottomLeft=0.0,
double yBottomLeft=0.0,
double zBottomLeft=0.0, std::string mode=
"BoundingBox")
530 myDomainWidth = (aDomain.upperBound())[0]-(aDomain.lowerBound())[0]+1;
531 myDomainHeight = (aDomain.upperBound())[1]-(aDomain.lowerBound())[1]+1;
546 double xBottomLeft,
double yBottomLeft,
double zBottomLeft);
556 double yTranslation=0.0,
double zTranslation=0.0);
606 if(img.myImageHeight>0 && img.myImageWidth>0)
608 myTabImage = new unsigned int [img.myImageWidth*img.myImageHeight];
609 for(unsigned int i=0; i<img.myImageWidth*img.myImageHeight; i++)
611 myTabImage[i] = img.myTabImage[i];
640 template <
typename TImageType,
typename TFunctor>
644 double xBottomLeft=0.0,
double yBottomLeft=0.0,
double zBottomLeft=0.0,
650 myDirection=normalDir;
651 myImageWidth = (image.domain().upperBound())[0]-(image.domain().lowerBound())[0]+1;
652 myImageHeight = (image.domain().upperBound())[1]-(image.domain().lowerBound())[1]+1;
653 myTabImage =
new unsigned int [myImageWidth*myImageHeight];
654 updateImageOrientation(normalDir, xBottomLeft, yBottomLeft, zBottomLeft);
656 updateImageDataAndParam(image, aFunctor);
669 double xBottomLeft,
double yBottomLeft,
double zBottomLeft);
685 point1 = aPoint1; point2 = aPoint2; point3 = aPoint3; point4 = aPoint4;
705 template <
typename TImageType,
typename TFunctor>
707 double yTranslation=0.0,
double zTranslation=0.0)
711 assert ( (image.domain().upperBound())[0]-(image.domain().lowerBound())[0]+1==
static_cast<int>(myImageWidth) &&
712 (image.domain().upperBound())[1]-(image.domain().lowerBound())[1]+1==
static_cast<int>(myImageHeight));
714 point1[0] += xTranslation; point1[1] += yTranslation; point1[2] += zTranslation;
715 point2[0] += xTranslation; point2[1] +=yTranslation; point2[2] += zTranslation;
716 point3[0] += xTranslation; point3[1] += yTranslation; point3[2] += zTranslation;
717 point4[0] += xTranslation; point4[1] += yTranslation; point4[2] += zTranslation;
720 for(
typename TImageType::Domain::ConstIterator it = image.domain().begin(), itend=image.domain().end();
723 myTabImage[pos]= aFunctor(image(*it));
776 void sortPolygonFromCamera();
780 template <
typename TDrawableWithViewer3D>
852 template <
typename TImageType,
typename TFunctor>
854 void updateTextureImage(
unsigned int imageIndex,
const TImageType & image,
const TFunctor & aFunctor,
855 double xTranslation=0.0,
double yTranslation=0.0,
double zTranslation=0.0,
871 double xPosition,
double yPosition,
896 template<
typename TDomain>
910 double xPosition,
double yPosition,
921 double yTranslation,
double zTranslation);
929 std::vector<typename DGtal::Viewer3D< Space , KSpace >::LineD3D>
937 std::vector<typename DGtal::Viewer3D< Space , KSpace >::LineD3D>
949 template <
typename TContainer >
973 myLightPositionFixToCamera = fixedToCam;
974 updateLightCoordsFromCamera();
975 if(myLightPositionFixToCamera)
979 displayMessage(QString(
"Light source position fixed to camera."), 3000);
981 updateRelativeCameraFromLightPosition();
986 displayMessage(QString(
"Light source position fixed to main scene."), 3000);
1002 QGLViewer::drawLight( light );
1007 QGLViewer::drawLight( light, zoom );
1077 sqrt( ( posCam.x - s1.
center[ 0 ] ) * ( posCam.x - s1.
center[ 0 ] ) +
1078 ( posCam.y - s1.
center[ 1 ] ) * ( posCam.y - s1.
center[ 1 ] ) +
1079 ( posCam.z - s1.
center[ 2 ] ) * ( posCam.z - s1.
center[ 2 ] ) );
1081 sqrt( ( posCam.x - s2.
center[ 0 ] ) * ( posCam.x - s2.
center[ 0 ] ) +
1082 ( posCam.y - s2.
center[ 1 ] ) * ( posCam.y - s2.
center[ 1 ] ) +
1083 ( posCam.z - s2.
center[ 2 ] ) * ( posCam.z - s2.
center[ 2 ] ) );
1084 return dist1 > dist2;
1100 double dist1= sqrt ( ( posCam.x-center1.x ) * ( posCam.x-center1.x ) + ( posCam.y-center1.y ) * ( posCam.y-center1.y ) + ( posCam.z-center1.z ) * ( posCam.z-center1.z ) );
1101 double dist2= sqrt ( ( posCam.x-center2.x ) * ( posCam.x-center2.x ) + ( posCam.y-center2.y ) * ( posCam.y-center2.y ) + ( posCam.z-center2.z ) * ( posCam.z-center2.z ) );
1120 double dist1= sqrt ( ( posCam.x-center1.x ) * ( posCam.x-center1.x ) + ( posCam.y-center1.y ) * ( posCam.y-center1.y ) + ( posCam.z-center1.z ) * ( posCam.z-center1.z ) );
1121 double dist2= sqrt ( ( posCam.x-center2.x ) * ( posCam.x-center2.x ) + ( posCam.y-center2.y ) * ( posCam.y-center2.y ) + ( posCam.z-center2.z ) * ( posCam.z-center2.z ) );
1135 double c1x=0.0, c1y=0.0, c1z=0.0;
1136 double c2x=0.0, c2y=0.0, c2z=0.0;
1137 for(
unsigned int i=0; i< q1.
vertices.size(); i++){
1142 for(
unsigned int i=0; i< q2.
vertices.size(); i++){
1148 qglviewer::Vec center1 ( c1x/(
double)q1.
vertices.size(),c1y/(
double)q1.
vertices.size(), c1z/(
double)q1.
vertices.size() );
1149 qglviewer::Vec center2 ( c2x/(
double)q2.
vertices.size(),c2y/(
double)q2.
vertices.size(), c2z/(
double)q2.
vertices.size() );
1151 double dist1= sqrt ( ( posCam.x-center1.x ) * ( posCam.x-center1.x ) + ( posCam.y-center1.y ) * ( posCam.y-center1.y ) + ( posCam.z-center1.z ) * ( posCam.z-center1.z ) );
1152 double dist2= sqrt ( ( posCam.x-center2.x ) * ( posCam.x-center2.x ) + ( posCam.y-center2.y ) * ( posCam.y-center2.y ) + ( posCam.z-center2.z ) * ( posCam.z-center2.z ) );
1196 virtual QDomElement
domElement(
const QString& name, QDomDocument& document)
const;
1249 double vectNormal[3];
1262 if(myTextureImageBufferGS!=0)
1263 delete [] myTextureImageBufferGS;
1267 if(myTextureImageBufferRGB!=0)
1268 delete [] myTextureImageBufferRGB;
1275 myBufferHeight(aGLImg.myBufferHeight),
1276 myTextureName(aGLImg.myTextureName),
1277 myMode(aGLImg.myMode),
1278 myTextureFitX(aGLImg.myTextureFitX),
1279 myTextureFitY(aGLImg.myTextureFitY)
1294 myTextureImageBufferGS =
new unsigned char [myBufferHeight*myBufferWidth];
1295 for(
unsigned int i=0; i<myBufferHeight*myBufferWidth;i++)
1301 myTextureImageBufferRGB =
new unsigned char [3*myBufferHeight*myBufferWidth];
1302 for(
unsigned int i=0; i<3*myBufferHeight*myBufferWidth;i+=3)
1315 point1[0]=aGSImage.
point1[0]; point1[1]=aGSImage.
point1[1]; point1[2]=aGSImage.
point1[2];
1316 point2[0]=aGSImage.
point2[0]; point2[1]=aGSImage.
point2[1]; point2[2]=aGSImage.
point2[2];
1317 point3[0]=aGSImage.
point3[0]; point3[1]=aGSImage.
point3[1]; point3[2]=aGSImage.
point3[2];
1318 point4[0]=aGSImage.
point4[0]; point4[1]=aGSImage.
point4[1]; point4[2]=aGSImage.
point4[2];
1325 if(myDirection==undefDirection){
1328 vectNormal[0] = v1[1]*v2[2] - v1[2]*v2[1];
1329 vectNormal[1] = v1[2]*v2[0] - v1[0]*v2[2];
1330 vectNormal[2] = v1[0]*v2[1] - v1[1]*v2[0];
1331 double norm = sqrt(vectNormal[0]*vectNormal[0]+vectNormal[1]*vectNormal[1]+vectNormal[2]*vectNormal[2]);
1332 vectNormal[0] /=norm; vectNormal[1] /=norm; vectNormal[2] /=norm;
1335 myBufferWidth = functions::roundToUpperPowerOfTwo(myImageWidth);
1336 myBufferHeight = functions::roundToUpperPowerOfTwo(myImageHeight);
1340 myTextureImageBufferGS =
new unsigned char [myBufferHeight*myBufferWidth];
1342 for (
unsigned int i=0; i<myBufferHeight; i++)
1344 for (
unsigned int j=0; j<myBufferWidth; j++)
1346 if(i<myImageHeight && j< myImageWidth)
1348 myTextureImageBufferGS[pos]= aGSImage.
myTabImage[i*myImageWidth+j];
1350 myTextureImageBufferGS[pos]=0;
1357 myTextureImageBufferRGB =
new unsigned char [3*myBufferHeight*myBufferWidth];
1359 for (
unsigned int i=0; i<myBufferHeight; i++)
1361 for (
unsigned int j=0; j<myBufferWidth; j++)
1363 if(i<myImageHeight && j< myImageWidth)
1366 myTextureImageBufferRGB[pos]= aCol.
red();
1367 myTextureImageBufferRGB[pos+1]= aCol.
green();
1368 myTextureImageBufferRGB[pos+2]= aCol.
blue();
1370 myTextureImageBufferRGB[pos]=0;
1371 myTextureImageBufferRGB[pos+1]=0;
1372 myTextureImageBufferRGB[pos+2]=0;
1379 myTextureFitX = 1.0-((myBufferWidth-myImageWidth)/(double)myBufferWidth);
1380 myTextureFitY = 1.0-((myBufferHeight-myImageHeight)/(double)myBufferHeight);
1391 typedef typename std::vector<typename Viewer3D<Space, KSpace>::CubeD3D>
VectorCubes;
1392 typedef typename std::vector<typename Viewer3D<Space, KSpace>::QuadD3D>
VectorQuad;
1393 typedef typename std::vector<typename Viewer3D<Space, KSpace>::LineD3D>
VectorLine;
1394 typedef typename std::vector<typename Viewer3D<Space, KSpace>::BallD3D>
VectorBall;
1395 typedef typename std::vector<typename Viewer3D<Space, KSpace>::TriangleD3D>
VectorTriangle;
1396 typedef typename std::vector<typename Viewer3D<Space, KSpace>::PolygonD3D>
VectorPolygon;
1400 typedef typename VectorCubes::iterator
ItCube;
1560 template<
typename TImageORDomain>
1564 double xB = (anImageOrDom.point1[0]+anImageOrDom.point2[0]+anImageOrDom.point3[0]+anImageOrDom.point4[0])/4.0;
1565 double yB = (anImageOrDom.point1[1]+anImageOrDom.point2[1]+anImageOrDom.point3[1]+anImageOrDom.point4[1])/4.0;
1566 double zB = (anImageOrDom.point1[2]+anImageOrDom.point2[2]+anImageOrDom.point3[2]+anImageOrDom.point4[2])/4.0;
1567 rotatePoint( anImageOrDom.point1[0], anImageOrDom.point1[1], anImageOrDom.point1[2], xB, yB, zB, angle, rotationDir);
1568 rotatePoint( anImageOrDom.point2[0], anImageOrDom.point2[1], anImageOrDom.point2[2], xB, yB, zB, angle, rotationDir);
1569 rotatePoint( anImageOrDom.point3[0], anImageOrDom.point3[1], anImageOrDom.point3[2], xB, yB, zB, angle, rotationDir);
1570 rotatePoint( anImageOrDom.point4[0], anImageOrDom.point4[1], anImageOrDom.point4[2], xB, yB, zB, angle, rotationDir);
1587 template <
typename TValues>
1590 double cx,
double cy,
double cz,
1627 int mySelectedElementId = -1;
1628 unsigned char mySelectionColorShift = 150;
1631 qglviewer::Vec myOrig,
myDir, myDirSelector, mySelectedPoint;
1637 bool myIsDoubleFaceRendering =
true;
1639 double camera_position[3];
1640 double camera_direction[3];
1641 double camera_upVector[3];
1643 bool myLightPositionFixToCamera =
true;
1647 GLfloat myLightPosition [4] = {0.0f, 0.0f, 1.0f, 1.0f};
1648 GLfloat myLightPositionRefCameraDefault [3] = {-100.0f, 100.0f, 0.0f};
1649 GLfloat myLightPositionRefCamera [3] = {0.0f, 0.0f, 0.0f};
1650 GLfloat myMaterialShininessCoeff[1] = {50.0f} ;
1651 GLfloat myMaterialSpecularCoeffs[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
1652 GLfloat myLightSpecularCoeffs[4] = { 0.3f, 0.3f, 0.3f, 1.0f };
1653 GLfloat myLightAmbientCoeffs[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
1654 GLfloat myLightDiffuseCoeffs[4] = { 0.7f, 0.7f, 0.7f, 1.0f };
1656 const GLfloat myDefaultRenderSpec = 0.3f;
1657 const GLfloat myDefaultRenderDiff = 0.7f;
1658 const GLfloat myLambertRenderSpec = 0.0f;
1659 const GLfloat myLambertRenderDiff = 0.9f;
1660 const GLfloat myMetallicRenderSpec = 0.5f;
1661 const GLfloat myMetallicRenderDiff = 0.5f;
1662 const GLfloat myPlasticRenderSpec = 0.8f;
1663 const GLfloat myPlasticRenderDiff = 0.2f;
1665 bool myUseGLPointsForBalls =
false;
1674 float myGLScaleFactorX=1.0;
1675 float myGLScaleFactorY=1.0;
1676 float myGLScaleFactorZ=1.0;
1693 template <
typename TSpace,
typename TKSpace>
1707#include "DGtal/io/viewers/Viewer3D.ih"
1714#undef Viewer3D_RECURSES
Structure representing an RGB triple with alpha component.
void green(const unsigned char aGreenValue)
void red(const unsigned char aRedValue)
void blue(const unsigned char aBlueValue)
Aim: This semi abstract class defines the stream mechanism to display 3d primitive (like BallVector,...
int(*) SelectCallbackFct(void *viewer, DGtal::int32_t name, void *data)
Space::RealPoint RealPoint
std::map< DGtal::int32_t, std::vector< CubeD3D > > CubesMap
The type that maps identifier name -> vector of CubeD3D.
SelectCallbackFct getSelectCallback3D(DGtal::int32_t aName, void *&data) const
std::map< DGtal::int32_t, std::vector< QuadD3D > > QuadsMap
The type that maps identifier name -> vector of QuadD3D.
Aim: Implements basic operations that will be used in Point and Vector classes.
void glCreateListPolygonsWired(const std::vector< VectorPolygon > &aVectPolygon, unsigned int idList)
bool myIsBackgroundDefault
true if the background is default
unsigned int myNbLineSetList
bool myViewWire
objects have shadows which follow the camera if false
void drawSomeLight(GLenum light) const
To call the protected method drawLight.
GLuint myTriangleSetListId
lists of the list to draw
virtual QString helpString() const
void setCameraPosition(double ax, double ay, double az)
virtual void mouseMoveEvent(QMouseEvent *e)
virtual void mousePressEvent(QMouseEvent *e)
virtual void paintGL()
Overload of the QGLViewer method in order to change the order of display (to fix the QGLViewer axis d...
double camera_upVector[3]
camera up-vector
virtual void show()
Overload QWidget method in order to add a call to updateList() method (to ensure that the lists are w...
void sortQuadFromCamera()
void glCreateListQuadMapsWired(const typename Display3D< Space, KSpace >::QuadsMap &aQuadMap, unsigned int idList)
std::vector< typename Viewer3D< Space, KSpace >::BallD3D > VectorBall
void setExtension(Extension *ext)
static void rotatePoint(TValues &x, TValues &y, TValues &z, double cx, double cy, double cz, double rotationAngle, ImageDirection rotationDir)
DGtal::Color myDefaultColor
the default color of the viewer
void setCameraDirection(double ax, double ay, double az)
void setGLLightDiffuseCoefficients(const GLfloat lightDiffuseCoeffs[4])
bool myAutoSaveState
flag to save automatically or not the Viewer3d state when closing the viewer
std::vector< typename Viewer3D< Space, KSpace >::PolygonD3D > VectorPolygon
int myRefMouseXPos
the angle rotation increment used for interactive light move
void setNearFar(double _near, double _far)
virtual void closeEvent(QCloseEvent *e)
Overload the QWidget method to customize the viewer state auto saving. Now it save the viewer state i...
double myLigthRotationStep
std::vector< GLTextureImage > myVectTextureImage
list of the images textures in this viewer
float myMeshDefaultLineWidth
void translateAn2DDomain(unsigned int domainIndex, double xTranslation, double yTranslation, double zTranslation)
GLuint myPolygonSetListWiredId
static void rotateImageVertex(TImageORDomain &anImageOrDom, double angle, ImageDirection rotationDir)
virtual unsigned int getCurrentGLImageNumber()
void updateAn2DDomainOrientation(unsigned int imageIndex, double xPosition, double yPosition, double zPosition, ImageDirection newDirection)
TextureMode
the modes of representation of an image
void drawSomeLight(GLenum light, float zoom) const
To call the protected method drawLight.
void glCreateListPolygons(const std::vector< VectorPolygon > &aVectPolygon, unsigned int idList)
void selfDisplay(std::ostream &out) const
Viewer3D(const KSpace &KSEmb)
virtual void keyPressEvent(QKeyEvent *e)
void glUpdateBackground()
void glCreateListLines(const VectorLine &aVectLine, unsigned int idList)
std::vector< typename Viewer3D< Space, KSpace >::QuadD3D > VectorQuad
double myLightR
the light position (azimuth)
RenderingMode myRenderingMode
std::vector< typename Viewer3D< Space, KSpace >::CubeD3D > VectorCubes
std::vector< typename Viewer3D< Space, KSpace >::TextureImage > VectorTextureImage
void rotateDomain(Image2DDomainD3D &anDom, double angle, ImageDirection rotationDir)
void glCreateListQuadMaps(const typename Display3D< Space, KSpace >::QuadsMap &aQuadMap, unsigned int idList)
void glDrawGLBall(const typename Viewer3D< Space, KSpace >::BallD3D &aBall)
std::vector< Image2DDomainD3D > myImageDomainList
Used to store all the domains.
void updateRenderingCoefficients(const RenderingMode aRenderMode, bool displayState=true)
Display::RealPoint RealPoint
bool myIsMovingLight
the reference mouse y-position used to determince the light position change (inclination)
std::vector< typename DGtal::Viewer3D< Space, KSpace >::LineD3D > compute2DDomainLineRepresentation(Image2DDomainD3D &anImageDomain)
QPoint myPosSelector
a point selected with postSelection
void updateRelativeCameraFromLightPosition()
void setLightModeFixToCamera(bool fixedToCam, bool verbose=true)
unsigned int myNbBallSetList
Display::SelectCallbackFct SelectCallbackFct
virtual unsigned int getCurrentDomainNumber()
virtual void initFromDOMElement(const QDomElement &element)
Overload of the QGLViewer method which restores the viewer state from a QDomDocument element....
GLuint myPolygonSetListId
void updateEmbeddingTextureImage(unsigned int anImageIndex, typename Space::Point aPoint1, typename Space::Point aPoint2, typename Space::Point aPoint3, typename Space::Point aPoint4)
double myGLLineMinWidth
to improve the display of gl points
void glCreateListCubesMaps(const typename Display3D< Space, KSpace >::CubesMap &aCubeMap, unsigned int idList)
void setGLLightSpecularCoefficients(const GLfloat lightSpecularCoeffs[4])
int myRefMouseYPos
the reference mouse x-position used to determince the light position change (azimuth)
VectorCubes::iterator ItCube
GLuint myCubeSetListWiredId
std::vector< typename Viewer3D< Space, KSpace >::LineD3D > VectorLine
void setGLScale(float sx, float sy, float sz)
void glCreateListBalls(const VectorBall &aVectBall, unsigned int idList)
unsigned int myNbPrismSetList
void glCreateListTrianglesWired(const std::vector< VectorTriangle > &aVectTriangle, unsigned int idList)
Viewer3D< Space, KSpace > Self
void updateOrientationTextureImage(unsigned int imageIndex, double xPosition, double yPosition, double zPosition, ImageDirection newDirection)
virtual void postSelection(const QPoint &point)
postSelection
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
DGtal::Color myDefaultBackgroundColor
the default background color of the viewer
void sortTriangleFromCamera()
Display3D< Space, KSpace > Display
void updateList(bool needToUpdateBoundingBox=true)
void glUpdateLightRenderingMode() const
ImageDirection
the 3 possible axes for the image direction
unsigned int myNbListe
number of lists in myListToAff
GLuint myTriangleSetListWiredId
virtual void drawWithNames()
drawWithNames
void addTextureImage(const TextureImage &image)
void setUseGLPointForBalls(bool useOpenGLPt)
std::vector< typename DGtal::Viewer3D< Space, KSpace >::LineD3D > compute2DDomainLineRepresentation(Image2DDomainD3D &anImageDomain, double delta)
void addImage2DDomainD3D(const TDomain &anImageDomain, std::string mode, const DGtal::Color &aColor=DGtal::Color::Red)
double myLightPhi
the light position (inclination)
double camera_position[3]
camera position
void setGLMaterialShininessCoefficient(const GLfloat matShininessCoeff)
void setGLLightAmbientCoefficients(const GLfloat lightAmbientCoeffs[4])
virtual void mouseReleaseEvent(QMouseEvent *e)
void glCreateListTriangles(const std::vector< VectorTriangle > &aVectTriangle, unsigned int idList)
double ZNear
znear distance
void glCreateListQuadD3D(const VectorQuad &aVectQuad, unsigned int idList)
void updateTextureImage(unsigned int imageIndex, const TImageType &image, const TFunctor &aFunctor, double xTranslation=0.0, double yTranslation=0.0, double zTranslation=0.0, double rotationAngle=0.0, ImageDirection rotationDir=zDirection)
void sortSurfelFromCamera()
void rotateLineD3D(typename DGtal::Display3D< Space, KSpace >::LineD3D &aLine, DGtal::PointVector< 3, int, TContainer > pt, double angleRotation, ImageDirection dirRotation)
double camera_direction[3]
camera direction
std::vector< typename Viewer3D< Space, KSpace >::TriangleD3D > VectorTriangle
void setGLDoubleRenderingMode(bool doubleSidedRendering)
void setCameraUpVector(double ax, double ay, double az)
virtual QDomElement domElement(const QString &name, QDomDocument &document) const
Overload of the QGLViewer method which returns an XML QDomElement representing the QGLViewer state....
void updateLightCoordsFromCamera()
void glUpdateTextureImages(const VectorTextureImage &aVectImage)
std::vector< TextureImage > myGSImageList
flag to display the ligth source when it is moved by the user
Extension * myExtension
Stored a possible extension to the viewer (pointer owned).
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
RealPoint center
The center coordinate of the cube.
std::vector< RealPoint > vertices
bool operator()(typename Viewer3D< Space, KSpace >::CubeD3D s1, typename Viewer3D< Space, KSpace >::CubeD3D s2)
virtual bool mouseMoveEvent(const Viewer &viewer, QMouseEvent *event)
virtual ~Extension()=default
virtual QString helpString(const Viewer &viewer) const
Viewer3D< Space, KSpace > Viewer
The associated viewer.
virtual void draw(Viewer &viewer)
virtual bool mouseReleaseEvent(const Viewer &viewer, QMouseEvent *event)
virtual bool mousePressEvent(const Viewer &viewer, QMouseEvent *event)
virtual bool postSelection(const Viewer &viewer, const QPoint &point)
virtual void drawWithNames(Viewer &viewer)
virtual void init(Viewer &viewer)
virtual bool keyPressEvent(Viewer &viewer, QKeyEvent *event)
unsigned int myBufferHeight
unsigned char * myTextureImageBufferGS
GLTextureImage(const GLTextureImage &aGLImg)
unsigned int myImageWidth
GLTextureImage(const typename Viewer3D< Space, KSpace >::TextureImage &aGSImage)
unsigned int myBufferWidth
unsigned char * myTextureImageBufferRGB
Viewer3D< Space, KSpace >::ImageDirection myDirection
RealPoint point1
coordinates
Viewer3D< Space, KSpace >::TextureMode myMode
unsigned int myImageHeight
unsigned int myDomainWidth
the width of the image domain
Image2DDomainD3D(TDomain aDomain, ImageDirection normalDir=zDirection, double xBottomLeft=0.0, double yBottomLeft=0.0, double zBottomLeft=0.0, std::string mode="BoundingBox")
unsigned int myDomainHeight
the height of the image domain
ImageDirection myDirection
the direction of the domain (x, y or z axe)
DGtal::Color color
The image domain color.
std::size_t myLineSetIndex
the index of the line of the domain in the lineSetList of the viewer
void translateDomain(double xTranslation=0.0, double yTranslation=0.0, double zTranslation=0.0)
RealPoint point1
The image domain coordinates.
std::string myMode
the mode of representation of the image domain
void updateDomainOrientation(ImageDirection normalDir, double xBottomLeft, double yBottomLeft, double zBottomLeft)
unsigned int myImageHeight
the width of the image
void updateImageOrientation(ImageDirection normalDir, double xBottomLeft, double yBottomLeft, double zBottomLeft)
unsigned int * myTabImage
the height of the image
TextureImage(const TImageType &image, const TFunctor &aFunctor, ImageDirection normalDir=zDirection, double xBottomLeft=0.0, double yBottomLeft=0.0, double zBottomLeft=0.0, TextureMode aMode=GrayScaleMode)
bool myDrawDomain
for each pixel of the image, color or height ?
ImageDirection myDirection
~TextureImage()
the mode of representation of the image
TextureMode myMode
index of the image domain if exist
TextureImage(const TextureImage &img)
Copy constructor (needed due to myTabImage)
void updateImageDataAndParam(const TImageType &image, const TFunctor &aFunctor, double xTranslation=0.0, double yTranslation=0.0, double zTranslation=0.0)
unsigned int myImageWidth
direction of the image (x, y or z axe)
std::string className() const
unsigned int myIndexDomain
true if the draw have a domain
void updateImage3DEmbedding(RealPoint aPoint1, RealPoint aPoint2, RealPoint aPoint3, RealPoint aPoint4)
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Aim: Defines a unary functor, which associates arguments to results.