DGtal
0.6.devel
|
#include <Viewer3D.h>
Data Structures | |
struct | compFarthestPolygonFromCamera |
struct | compFarthestSurfelFromCamera |
struct | compFarthestTriangleFromCamera |
struct | compFarthestVoxelFromCamera |
Public Member Functions | |
Viewer3D () | |
Viewer3D & | operator<< (const DGtal::Color &aColor) |
Viewer3D & | operator<< (const Display3D::StreamKey &key) |
void | sortSurfelFromCamera () |
void | sortTriangleFromCamera () |
void | sortQuadFromCamera () |
void | sortPolygonFromCamera () |
template<typename TDrawableWithDisplay3D > | |
Viewer3D & | operator<< (const TDrawableWithDisplay3D &object) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
![]() | |
virtual | ~Display3D () |
Display3D () | |
virtual void | setFillColor (DGtal::Color aColor) |
virtual void | setLineColor (DGtal::Color aColor) |
virtual DGtal::Color | getFillColor () |
virtual DGtal::Color | getLineColor () |
virtual void | addClippingPlane (double a, double b, double c, double d, bool drawPlane) |
virtual void | setCameraUpVector (double, double, double) |
virtual void | setCameraPosition (double, double, double) |
virtual void | setNearFar (double, double) |
virtual void | setCameraDirection (double, double, double) |
virtual std::string | getMode (const std::string &objectName) const |
virtual void | createNewLineList () |
virtual void | createNewPointList () |
virtual void | createNewVoxelList (bool depthTest=true) |
virtual void | addQuad (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, double x4, double y4, double z4, DGtal::Color aColor) |
virtual void | addTriangle (double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3, DGtal::Color aColor) |
virtual void | addPolygon (std::vector< pointD3D > vectPointsPolygon, DGtal::Color aColor) |
virtual void | addLine (double x1, double y1, double z1, double x2, double y2, double z2, const DGtal::Color &color=DGtal::Color(20, 20, 20, 200), double width=1.5) |
virtual void | addVoxel (DGtal::int64_t x, DGtal::int64_t y, DGtal::int64_t z, DGtal::Color color=DGtal::Color(220, 220, 220), double width=0.5, bool withWire=false) |
virtual void | addPoint (double x, double y, double z, const DGtal::Color &color=DGtal::Color(200, 20, 20), double size=40) |
virtual void | addKSSurfel (double x, double y, double z, bool xSurfel, bool ySurfel, bool zSurfel, double sizeShiftFactor, double positionShift=0.0, double sizeFactor=1.0, bool isSigned=false, bool aSign=true, bool basicMode=false) |
virtual void | addKSVoxel (int x, int y, int z, double sizeFactor=0.94) |
virtual void | addKSPointel (double x, double y, double z, double size=0.1, bool isSigned=false, bool aSign=true) |
virtual void | addKSLinel (double x1, double y1, double z1, double x2, double y2, double z2, double width=0.02, bool isSigned=false, bool aSign=true) |
void | updateBoundingBox (double x, double y, double z) |
void | exportToMesh (MeshFromPoints< Display3D::pointD3D > &aMesh) const |
void | setScale (float sx, float sy, float sz) |
Data Fields | |
DGtal::Color | myDefaultBackgroundColor |
DGtal::Color | myDefaultColor |
bool | myIsBackgroundDefault |
bool | myViewWire |
![]() | |
ModeMapping | myModes |
StyleMapping | myStyles |
bool | myBoundingPtEmptyTag |
double | myBoundingPtUp [3] |
double | myBoundingPtLow [3] |
Protected Member Functions | |
void | updateList (bool needToUpdateBoundingBox=true) |
void | glDrawGLLinel (lineD3D aLinel) |
void | glDrawGLPointel (pointD3D pointel) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | drawWithNames () |
virtual void | draw () |
virtual void | init () |
virtual QString | helpString () const |
virtual void | postSelection (const QPoint &point) |
Private Attributes | |
GLuint | myListToAff |
unsigned int | myNbListe |
qglviewer::Vec | myOrig |
qglviewer::Vec | myDir |
qglviewer::Vec | myDirSelector |
qglviewer::Vec | mySelectedPoint |
QPoint | myPosSelector |
Additional Inherited Members | |
![]() | |
enum | StreamKey { addNewList, updateDisplay, shiftSurfelVisu } |
typedef std::map< std::string, std::string > | ModeMapping |
typedef std::map< std::string, CountedPtr < DrawableWithDisplay3D > > | StyleMapping |
![]() | |
float | myScaleX |
float | myScaleY |
float | myScaleZ |
DGtal::Color | myCurrentFillColor |
DGtal::Color | myCurrentLineColor |
double | myCurrentfShiftVisuKSSurfels |
std::vector< std::vector < voxelD3D > > | myVoxelSetList |
std::vector< std::vector < lineD3D > > | myLineSetList |
std::vector< std::vector < pointD3D > > | myPointSetList |
std::vector< clippingPlaneD3D > | myClippingPlaneList |
std::vector< quadD3D > | myKSSurfelList |
std::vector< pointD3D > | myKSPointelList |
std::vector< lineD3D > | myKSLinelList |
std::vector< quadD3D > | myQuadList |
std::vector< triangleD3D > | myTriangleList |
std::vector< polygonD3D > | myPolygonList |
std::vector< bool > | myListVoxelDepthTest |
float | myMeshDefaultLineWidth |
Aim: Display 3D primitive (like PointVector, DigitalSetBySTLSet, Object ...). This class uses the libQGLViewer library (http://www.libqglviewer.com ). It inherits of the class Display3D and permits to display object using a simple stream mechanism of "<<".
Description of class 'Viewer3D'
For instance you can display objects as follows:
Definition at line 112 of file Viewer3D.h.
|
inline |
|
protectedvirtual |
Definition at line 105 of file Viewer3D.cpp.
References DGtal::Display3D::clippingPlaneD3D::a, DGtal::Display3D::clippingPlaneD3D::b, DGtal::Display3D::clippingPlaneD3D::c, and DGtal::Display3D::clippingPlaneD3D::d.
|
protectedvirtual |
Definition at line 86 of file Viewer3D.cpp.
|
protected |
Draw a linel by using the [gluCylinder] primitive.
Definition at line 703 of file Viewer3D.cpp.
References DGtal::Display3D::lineD3D::B, DGtal::Display3D::lineD3D::G, DGtal::Display3D::lineD3D::isSigned, DGtal::Display3D::lineD3D::R, DGtal::Display3D::lineD3D::signPos, DGtal::Display3D::lineD3D::T, DGtal::Display3D::lineD3D::width, DGtal::Display3D::lineD3D::x1, DGtal::Display3D::lineD3D::x2, DGtal::Display3D::lineD3D::y1, DGtal::Display3D::lineD3D::y2, DGtal::Display3D::lineD3D::z1, and DGtal::Display3D::lineD3D::z2.
|
protected |
Draw a linel by using the [gluCSphere] primitive.
Definition at line 723 of file Viewer3D.cpp.
References DGtal::Display3D::pointD3D::B, DGtal::Display3D::pointD3D::G, DGtal::Display3D::pointD3D::isSigned, DGtal::Display3D::pointD3D::R, DGtal::Display3D::pointD3D::signPos, DGtal::Display3D::pointD3D::size, DGtal::Display3D::pointD3D::T, DGtal::Display3D::pointD3D::x, DGtal::Display3D::pointD3D::y, and DGtal::Display3D::pointD3D::z.
|
protectedvirtual |
Definition at line 905 of file Viewer3D.cpp.
|
protectedvirtual |
Definition at line 248 of file Viewer3D.cpp.
bool DGtal::Viewer3D::isValid | ( | ) | const |
Checks the validity/consistency of the object.
Reimplemented from DGtal::Display3D.
Definition at line 75 of file Viewer3D.cpp.
|
protectedvirtual |
Used to manage new key event (wich are added from the default QGLviewer keys).
Note that when a new key event is taken into account it could be added in the QGLviewer init() method to update automatically the key description in the help QGLviewer window. For instance when a new key is processed in this method you simply should add the following code in the init() method:
e,: | the QKeyEvent |
Definition at line 779 of file Viewer3D.cpp.
References DGtal::Trace::info(), and DGtal::trace.
|
inline |
Set the default color for future drawing.
aColor,: | a DGtal::Color (allow to set a trasnparency value). |
Definition at line 48 of file Viewer3D.ih.
References myDefaultColor.
|
inline |
Set the default color for future drawing.
aColor,: | a DGtal::Color (allow to set a trasnparency value). |
Set the default color for future drawing.
aColor,: | a DGtal::Color (allow to set a transparency value). |
Definition at line 65 of file Viewer3D.ih.
References DGtal::Display3D::addNewList, DGtal::Display3D::shiftSurfelVisu, and DGtal::Display3D::updateDisplay.
|
inline |
Draws the drawable [object] in this board. It should satisfy the concept CDrawableWithViewer3D, which requires for instance a method setStyle( Viewer3D & ).
object | any drawable object. |
Reimplemented from DGtal::Display3D.
Definition at line 88 of file Viewer3D.ih.
References DGtal::Display3DFactory::draw().
|
protectedvirtual |
Definition at line 357 of file Viewer3D.cpp.
References DGtal::abs(), DGtal::Trace::info(), and DGtal::trace.
void DGtal::Viewer3D::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Reimplemented from DGtal::Display3D.
Definition at line 65 of file Viewer3D.cpp.
void DGtal::Viewer3D::sortPolygonFromCamera | ( | ) |
Sort all polygons from the camera.
Definition at line 342 of file Viewer3D.cpp.
References DGtal::Trace::info(), DGtal::Viewer3D::compFarthestPolygonFromCamera::posCam, and DGtal::trace.
void DGtal::Viewer3D::sortQuadFromCamera | ( | ) |
Sort all triangle from the camera.
Definition at line 329 of file Viewer3D.cpp.
References DGtal::Trace::info(), DGtal::Viewer3D::compFarthestSurfelFromCamera::posCam, and DGtal::trace.
void DGtal::Viewer3D::sortSurfelFromCamera | ( | ) |
Sort all surfels from the camera.
Definition at line 299 of file Viewer3D.cpp.
References DGtal::Trace::info(), DGtal::Viewer3D::compFarthestVoxelFromCamera::posCam, and DGtal::trace.
void DGtal::Viewer3D::sortTriangleFromCamera | ( | ) |
Sort all triangle from the camera.
Definition at line 315 of file Viewer3D.cpp.
References DGtal::Trace::info(), DGtal::Viewer3D::compFarthestTriangleFromCamera::posCam, and DGtal::trace.
|
protected |
Permit to update the OpenGL list to be displayed. Need to called after a number of addVoxel or after a sortSurfelFromCamera().
Creation of new lists to display 3D mesh First list: quad faces. Second list: Wired version of quad face. Third list: Triangle faces. Fourth list: Wired version of triangle face. Fifth list: Polygonal faces. Sixth list: Wired version of polygonal face.
Definition at line 395 of file Viewer3D.cpp.
DGtal::Color DGtal::Viewer3D::myDefaultBackgroundColor |
Definition at line 124 of file Viewer3D.h.
DGtal::Color DGtal::Viewer3D::myDefaultColor |
Definition at line 130 of file Viewer3D.h.
Referenced by operator<<().
|
private |
Definition at line 237 of file Viewer3D.h.
|
private |
Definition at line 237 of file Viewer3D.h.
bool DGtal::Viewer3D::myIsBackgroundDefault |
Definition at line 131 of file Viewer3D.h.
|
private |
Definition at line 235 of file Viewer3D.h.
|
private |
Definition at line 236 of file Viewer3D.h.
|
private |
Definition at line 237 of file Viewer3D.h.
|
private |
Definition at line 238 of file Viewer3D.h.
|
private |
Definition at line 237 of file Viewer3D.h.
bool DGtal::Viewer3D::myViewWire |
Definition at line 132 of file Viewer3D.h.