DGtal
0.6.devel
|
#include <MeshFromPoints.h>
Public Types | |
typedef std::vector< unsigned int > | MeshFace |
Public Member Functions | |
MeshFromPoints (bool saveFaceColor=false) | |
MeshFromPoints (const DGtal::Color &aColor) | |
MeshFromPoints (const std::vector< TPoint > &vertexSet) | |
~MeshFromPoints () | |
std::string | className () const |
void | addVertex (const TPoint &vertex) |
void | addTriangularFace (unsigned int indexVertex1, unsigned int indexVertex2, unsigned int indexVertex3, const DGtal::Color &aColor=DGtal::Color::White) |
void | addQuadFace (unsigned int indexVertex1, unsigned int indexVertex2, unsigned int indexVertex3, unsigned int indexVertex4, const DGtal::Color &aColor=DGtal::Color::White) |
void | addFace (const MeshFace &aFace, const DGtal::Color &aColor=DGtal::Color::White) |
const TPoint & | getVertex (unsigned int i) const |
const MeshFace & | getFace (unsigned int i) const |
const Color & | getFaceColor (unsigned int i) const |
unsigned int | nbFaces () const |
unsigned int | nbVertex () const |
void | invertVertexFaceOrder () |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Member Functions | |
MeshFromPoints (const MeshFromPoints &other) | |
MeshFromPoints & | operator= (const MeshFromPoints &other) |
Private Attributes | |
std::vector< MeshFace > | myFaceList |
std::vector< TPoint > | myVertexList |
std::vector< DGtal::Color > | myFaceColorList |
bool | mySaveFaceColor |
DGtal::Color | myDefaultColor |
Aim: This class is defined to represent a surface mesh through a set a vertex and a set of faces represented by its vertex index. By default it does not memorize the color Face and all faces will have the white color.
Description of template class 'MeshFromPoints'
This class was defined to import and display a mesh from different formats like OFF file format. Since it realized the concept of CDrawableWithDisplay3D we can display an MeshFromPoints with a Display3D object:
First we have to include the following header files:
Prepare display using QGLviewer: Viewer3D
Construct a MeshFromPoints with various faces:
Displaying the result:
Definition at line 86 of file MeshFromPoints.h.
typedef std::vector<unsigned int> DGtal::MeshFromPoints< TPoint >::MeshFace |
Structure for representing the faces from the vertex index.
Definition at line 98 of file MeshFromPoints.h.
|
inline |
Constructor. By default the constructed mesh does not contain nor store color information about the mesh. If you want to include color in the MeshFromPoint object you have to set the constructor parameter saveFaceColor to true.
saveFaceColor,: | used to memorize the color of a face (default= false) |
Constructor.
Definition at line 47 of file MeshFromPoints.ih.
References DGtal::Color::White.
|
inline |
Constructor. The constructed mesh will store an unique default color information about the mesh.
saveFaceColor,: | used to memorize the color of a face (default= false) |
Constructor.
Definition at line 58 of file MeshFromPoints.ih.
DGtal::MeshFromPoints< TPoint >::MeshFromPoints | ( | const std::vector< TPoint > & | vertexSet | ) |
Constructor by usung a vertex set as init. The color are not stored in this case.
vertexSet,: | the set of vertex. |
|
inline |
|
private |
Copy constructor.
other | the object to clone. Forbidden by default. |
|
inline |
Add a quad face given from index position.
listIndex,: | the index of all the face vertex. |
Definition at line 177 of file MeshFromPoints.ih.
|
inline |
Add a quad face given from index position.
indexVertex1,: | the index of the first vertex face. |
indexVertex2,: | the index of the second vertex face. |
indexVertex2,: | the index of the second vertex face. |
Definition at line 157 of file MeshFromPoints.ih.
Referenced by DGtal::Display3D::exportToMesh().
|
inline |
Add a triangle face given from index position.
indexVertex1,: | the index of the first vertex face. |
indexVertex2,: | the index of the second vertex face. |
indexVertex2,: | the index of the second vertex face. |
Definition at line 138 of file MeshFromPoints.ih.
Referenced by DGtal::Display3D::exportToMesh().
|
inline |
Adding new vertex.
Definition at line 128 of file MeshFromPoints.ih.
Referenced by DGtal::Display3D::exportToMesh().
|
inline |
Definition at line 256 of file MeshFromPoints.ih.
Referenced by DGtal::Display3DFactory::draw().
|
inline |
Return a reference to a face of index i.
i,: | the index of the face. |
Definition at line 200 of file MeshFromPoints.ih.
Referenced by DGtal::Display3DFactory::drawAsFaces().
|
inline |
Return a reference to a face Color of index i.
i,: | the index of the face. |
Definition at line 225 of file MeshFromPoints.ih.
Referenced by DGtal::Display3DFactory::drawAsFaces().
|
inline |
Return a reference to the vertex of index i.
i,: | the index of the vertex. |
Definition at line 190 of file MeshFromPoints.ih.
Referenced by DGtal::Display3DFactory::drawAsFaces().
|
inline |
Invert the face order (useful when normal is deducted from vertex order).
Definition at line 239 of file MeshFromPoints.ih.
|
inline |
Checks the validity/consistency of the object.
Definition at line 95 of file MeshFromPoints.ih.
|
inline |
Return the number of faces contained on the mesh object.
Definition at line 209 of file MeshFromPoints.ih.
Referenced by DGtal::Display3DFactory::drawAsFaces().
|
inline |
Return the number of faces contained on the mesh object.
Definition at line 217 of file MeshFromPoints.ih.
|
private |
Assignment.
other | the object to copy. |
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 83 of file MeshFromPoints.ih.
|
private |
Definition at line 271 of file MeshFromPoints.h.
|
private |
Definition at line 269 of file MeshFromPoints.h.
|
private |
Definition at line 267 of file MeshFromPoints.h.
|
private |
Definition at line 270 of file MeshFromPoints.h.
|
private |
Definition at line 268 of file MeshFromPoints.h.