DGtal 0.3.0
Data Structures | Public Types | Public Member Functions | Data Fields | Protected Member Functions | Private Attributes

DGtal::DGtalQGLViewer Class Reference

Aim: More...

#include <DGtalQGLViewer.h>

Collaboration diagram for DGtal::DGtalQGLViewer:
Collaboration graph
[legend]

Data Structures

struct  clippingPlaneGL
struct  compFarthestFromCamera
struct  lineGL
struct  pointGL
struct  quadGL
struct  voxelGL

Public Types

enum  StreamKey { addNewList, updateDisplay }
typedef std::map< std::string,
std::string > 
ModeMapping
typedef std::map< std::string,
CountedPtr
< DrawableWithDGtalQGLViewer > > 
StyleMapping

Public Member Functions

void createNewVoxelList (bool depthTest=true)
void createNewLineList ()
void createNewPointList ()
std::string getMode (const std::string &objectName) const
DGtalQGLVieweroperator<< (const QColor &aColor)
DGtalQGLVieweroperator<< (const DGtalQGLViewer::StreamKey &key)
void addVoxel (int x, int y, int z, QColor color=QColor(220, 220, 220), double width=0.5)
void addPoint (double x, double y, double z, const QColor &color=QColor(200, 20, 20), double size=40)
void addLine (double x1, double y1, double z1, double x2, double y2, double z2, const QColor &color=QColor(20, 20, 20, 200), double width=1.5)
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, QColor aColor)
void addClippingPlane (double a, double b, double c, double d, bool drawPlane)
void setLineColor (QColor aColor)
QColor getLineColor ()
void setFillColor (QColor aColor)
QColor getFillColor ()
void sortSurfelFromCamera ()
template<typename TDrawableWithDGtalQGLViewer >
DGtalQGLVieweroperator<< (const TDrawableWithDGtalQGLViewer &object)
void selfDisplay (std::ostream &out) const
bool isValid () const

Data Fields

QColor myDefaultBackgroundColor
QColor myDefaultColor
QColor myCurrentFillColor
QColor myCurrentLineColor
bool myIsBackgroundDefault
ModeMapping myModes
StyleMapping myStyles

Protected Member Functions

void updateList (bool updateBoundingBox=true)
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

std::vector< std::vector
< voxelGL > > 
myVoxelSetList
std::vector< std::vector
< lineGL > > 
myLineSetList
std::vector< std::vector
< pointGL > > 
myPointSetList
std::vector< clippingPlaneGLmyClippingPlaneList
std::vector< quadGLmyQuadList
std::vector< bool > myListVoxelDepthTest
qglviewer::Vec myBoundingPtUp
qglviewer::Vec myBoundingPtLow
GLuint myListToAff
uint myNbListe
qglviewer::Vec myOrig
qglviewer::Vec myDir
qglviewer::Vec myDirSelector
qglviewer::Vec mySelectedPoint
QPoint myPosSelector

Detailed Description

Aim:

Description of class 'DGtalQGLViewer'

Examples:

3dBorderExtraction.cpp, 3dBorderExtractionImg.cpp, dgtalQGLviewer-1-points.cpp, dgtalQGLviewer-2-sets.cpp, dgtalQGLviewer-3-objects.cpp, dgtalQGLviewer-4-modes.cpp, dgtalQGLviewer-5-custom.cpp, dgtalQGLviewer-6-clipping.cpp, digitalSetFromPointList.cpp, digitalSetFromVol.cpp, distancetransform3D.cpp, and homotopicThinning3D.cpp.

Definition at line 98 of file DGtalQGLViewer.h.


Member Typedef Documentation

typedef std::map< std::string, std::string > DGtal::DGtalQGLViewer::ModeMapping

The associated map type for storing possible modes used for displaying for digital objects.

Definition at line 109 of file DGtalQGLViewer.h.

typedef std::map< std::string,CountedPtr<DrawableWithDGtalQGLViewer> > DGtal::DGtalQGLViewer::StyleMapping

The associated map type for storing the default styles of digital objects.

Definition at line 117 of file DGtalQGLViewer.h.


Member Enumeration Documentation

Enumerator:
addNewList 
updateDisplay 

Definition at line 103 of file DGtalQGLViewer.h.


Member Function Documentation

void DGtal::DGtalQGLViewer::addClippingPlane ( double  a,
double  b,
double  c,
double  d,
bool  drawPlane 
)

Add a new 3D Clipping plane represented by ax+by+cz+d = 0 A maximal of five clipping plane can be added.

Parameters:
a,b,c,d: plane equation.

Referenced by DGtal::ClippingPlane::selfDrawQGL().

void DGtal::DGtalQGLViewer::addLine ( double  x1,
double  y1,
double  z1,
double  x2,
double  y2,
double  z2,
const QColor &  color = QColor(20, 20, 20, 200),
double  width = 1.5 
)
void DGtal::DGtalQGLViewer::addPoint ( double  x,
double  y,
double  z,
const QColor &  color = QColor(200, 20, 20),
double  size = 40 
)
void DGtal::DGtalQGLViewer::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,
QColor  aColor 
)
void DGtal::DGtalQGLViewer::addVoxel ( int  x,
int  y,
int  z,
QColor  color = QColor(220, 220, 220),
double  width = 0.5 
)

Add a point as a 3d voxel using default color in the current openGL list. A voxel can be added in a new list by calling: ().

Parameters:
aPoint,:the center of the voxel.
width,:the width of the voxel (default 0.5)
void DGtal::DGtalQGLViewer::createNewLineList ( )

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

void DGtal::DGtalQGLViewer::createNewPointList ( )

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

void DGtal::DGtalQGLViewer::createNewVoxelList ( bool  depthTest = true)

Used to create a new list containing new 3D objects (useful to use transparency between different objects).

void DGtal::DGtalQGLViewer::draw ( ) [protected, virtual]
void DGtal::DGtalQGLViewer::drawWithNames ( ) [protected, virtual]

Definition at line 82 of file DGtalQGLViewer.cpp.

QColor DGtal::DGtalQGLViewer::getFillColor ( )
QColor DGtal::DGtalQGLViewer::getLineColor ( )
std::string DGtal::DGtalQGLViewer::getMode ( const std::string &  objectName) const
Parameters:
objectNamethe name of the object (generally obtained with a 'object.styleName()').
Returns:
the current mode for the given object name or "" if no specific mode has been set.
QString DGtal::DGtalQGLViewer::helpString ( ) const [protected, virtual]

Definition at line 404 of file DGtalQGLViewer.cpp.

void DGtal::DGtalQGLViewer::init ( ) [protected, virtual]

Definition at line 166 of file DGtalQGLViewer.cpp.

bool DGtal::DGtalQGLViewer::isValid ( ) const

Checks the validity/consistency of the object.

Returns:
'true' if the object is valid, 'false' otherwise.

Definition at line 71 of file DGtalQGLViewer.cpp.

void DGtal::DGtalQGLViewer::keyPressEvent ( QKeyEvent *  e) [protected, virtual]

Definition at line 376 of file DGtalQGLViewer.cpp.

DGtalQGLViewer& DGtal::DGtalQGLViewer::operator<< ( const QColor &  aColor)

Set the default color for future drawing.

Parameters:
aColor,:a QColor (allow to set a trasnparency value).
template<typename TDrawableWithDGtalQGLViewer >
DGtalQGLViewer& DGtal::DGtalQGLViewer::operator<< ( const TDrawableWithDGtalQGLViewer &  object)

Draws the drawable [object] in this board. It should satisfy the concept CDrawableWithDGtalQGLViewer, which requires for instance a method selfDraw( DGtalQGLViewer & ).

Parameters:
objectany drawable object.
Returns:
a reference on 'this'.
DGtalQGLViewer& DGtal::DGtalQGLViewer::operator<< ( const DGtalQGLViewer::StreamKey key)

Set the default color for future drawing.

Parameters:
aColor,:a QColor (allow to set a trasnparency value).
void DGtal::DGtalQGLViewer::postSelection ( const QPoint &  point) [protected, virtual]

Definition at line 213 of file DGtalQGLViewer.cpp.

void DGtal::DGtalQGLViewer::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters:
outthe output stream where the object is written.

Definition at line 61 of file DGtalQGLViewer.cpp.

void DGtal::DGtalQGLViewer::setFillColor ( QColor  aColor)
void DGtal::DGtalQGLViewer::setLineColor ( QColor  aColor)
void DGtal::DGtalQGLViewer::sortSurfelFromCamera ( )

Sort all surfels from the camera.

Definition at line 202 of file DGtalQGLViewer.cpp.

References DGtal::DGtalQGLViewer::compFarthestFromCamera::posCam.

void DGtal::DGtalQGLViewer::updateList ( bool  updateBoundingBox = true) [protected]

Permit to update the OpenGL list to be displayed. Need to called after a number of addVoxel or after a sortSurfelFromCamera().

Definition at line 244 of file DGtalQGLViewer.cpp.


Field Documentation

qglviewer::Vec DGtal::DGtalQGLViewer::myBoundingPtLow [private]

Definition at line 362 of file DGtalQGLViewer.h.

qglviewer::Vec DGtal::DGtalQGLViewer::myBoundingPtUp [private]

Definition at line 361 of file DGtalQGLViewer.h.

Definition at line 352 of file DGtalQGLViewer.h.

Definition at line 121 of file DGtalQGLViewer.h.

Definition at line 122 of file DGtalQGLViewer.h.

Definition at line 119 of file DGtalQGLViewer.h.

Definition at line 120 of file DGtalQGLViewer.h.

qglviewer::Vec DGtal::DGtalQGLViewer::myDir [private]

Definition at line 366 of file DGtalQGLViewer.h.

qglviewer::Vec DGtal::DGtalQGLViewer::myDirSelector [private]

Definition at line 366 of file DGtalQGLViewer.h.

Definition at line 123 of file DGtalQGLViewer.h.

std::vector< std::vector<lineGL> > DGtal::DGtalQGLViewer::myLineSetList [private]

Definition at line 346 of file DGtalQGLViewer.h.

Definition at line 364 of file DGtalQGLViewer.h.

std::vector<bool> DGtal::DGtalQGLViewer::myListVoxelDepthTest [private]

Definition at line 359 of file DGtalQGLViewer.h.

Definition at line 294 of file DGtalQGLViewer.h.

Referenced by DGtal::SetMode3D::selfDrawQGL().

Definition at line 365 of file DGtalQGLViewer.h.

qglviewer::Vec DGtal::DGtalQGLViewer::myOrig [private]

Definition at line 366 of file DGtalQGLViewer.h.

std::vector< std::vector<pointGL> > DGtal::DGtalQGLViewer::myPointSetList [private]

Definition at line 349 of file DGtalQGLViewer.h.

Definition at line 367 of file DGtalQGLViewer.h.

std::vector< quadGL > DGtal::DGtalQGLViewer::myQuadList [private]

Definition at line 355 of file DGtalQGLViewer.h.

qglviewer::Vec DGtal::DGtalQGLViewer::mySelectedPoint [private]

Definition at line 366 of file DGtalQGLViewer.h.

For instance, may associate a new style object T1 to the class "HyperRectDomain": myStyles[ "HyperRectDomain" ] = T1.

One can also store a new style T2 for a specific mode used for drawing a class: myStyles[ "HyperRectDomain/Paving" ] = T2.

Modes may only be used in objects implementing the concept CDrawableWithDGtalBoard.

Definition at line 305 of file DGtalQGLViewer.h.

Referenced by DGtal::CustomStyle3D::selfDrawQGL().

std::vector< std::vector<voxelGL> > DGtal::DGtalQGLViewer::myVoxelSetList [private]

Definition at line 343 of file DGtalQGLViewer.h.


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines