a48
2.0.2
|
Stellar-operations enabled mesh type (considering triangular faces) More...
#include <stellarmesht.hh>
Public Types | |
typedef BaseItemsPolicy< Traits > | items_policy |
items policy definition | |
typedef BaseStellarPolicy< Traits > | stellar_policy |
stellar policy definition | |
typedef Traits::vertex_type | vertex_type |
vertex definition | |
typedef Traits::halfedge_type | halfedge_type |
halfedge definition | |
typedef Traits::face_type | face_type |
face definition | |
Public Member Functions | |
StellarMeshT () | |
Default Constructor. | |
StellarMeshT (stellar_policy *_sp) | |
StellarMeshT (items_policy *_ip, stellar_policy *_sp=0) | |
StellarMeshT (const StellarMeshT< Traits > &_m) | |
StellarMeshT< Traits > & | operator= (const StellarMeshT< Traits > &_m) |
Assign operator. | |
bool | is_tri (void) const |
Verifies if this mesh is a triangulated mesh. | |
void | set_stellar_policy (stellar_policy *_sp) |
Set Stellar Policy for this mesh. | |
stellar_policy * | get_stellar_policy (void) |
Get Stellar Policy of this mesh. | |
const stellar_policy * | get_stellar_policy (void) const |
void | edge_weld (halfedge_type *h1, halfedge_type *h2) |
Weld an edge removing the middle vertex. | |
void | face_weld (halfedge_type *h1, halfedge_type *h2, halfedge_type *h3) |
Weld a face removing the middle vertex. | |
void | edge_split (halfedge_type *h) |
Split an edge inserting a vertex in the middle. | |
void | face_split (face_type *f) |
Split a face. | |
void | flip (halfedge_type *h) |
Flip a halfedge. | |
void | unflip (halfedge_type *h) |
Un-Flip a halfedge. | |
void | weld (vertex_type *v) |
Weld a vertex. | |
void | split (halfedge_type *h) |
Split a halfedge. | |
void | split (face_type *f0) |
Split a face. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class Mesh > | |
bool | make_triquad (Mesh &_m, float(*_fr)(typename Mesh::halfedge_type *)=0, unsigned int ualg=0) |
Converts mesh from triangles to tri-quads. | |
template<class Mesh > | |
bool | make_triquad_48clustering (Mesh &_m, float(*_fr)(typename Mesh::halfedge_type *)=0) |
Converts mesh from triangles to tri-quads. | |
template<class Mesh > | |
bool | make_triquad_crawler (Mesh &_m, float(*_fr)(typename Mesh::halfedge_type *)=0) |
Converts mesh from triangles to tri-quads. |
Stellar-operations enabled mesh type (considering triangular faces)
This class is based mainly on the following paper:
@ARTICLE{Velho:2003, author = {Velho, Luiz}, title = {Stellar Subdivision Grammars}, booktitle = {Proceedings of the 2003 Eurographics/ACM SIGGRAPH Symposium on Geometry processing}, year = {2003}, isbn = {1-58113-687-0}, pages = {188--199}, url = {http://portal.acm.org/citation.cfm?id=882370.882396} }
Traits | template argument to define mesh traits |
Definition at line 103 of file stellarmesht.hh.
typedef BaseItemsPolicy< Traits > a48::StellarMeshT< Traits >::items_policy |
items policy definition
Reimplemented from a48::MeshT< Traits >.
Reimplemented in a48::AdaptiveMeshT< Traits >.
Definition at line 107 of file stellarmesht.hh.
typedef BaseStellarPolicy< Traits > a48::StellarMeshT< Traits >::stellar_policy |
stellar policy definition
Reimplemented in a48::AdaptiveMeshT< Traits >.
Definition at line 108 of file stellarmesht.hh.
typedef Traits::vertex_type a48::StellarMeshT< Traits >::vertex_type |
vertex definition
Reimplemented from a48::MeshT< Traits >.
Reimplemented in a48::AdaptiveMeshT< Traits >.
Definition at line 110 of file stellarmesht.hh.
typedef Traits::halfedge_type a48::StellarMeshT< Traits >::halfedge_type |
halfedge definition
Reimplemented from a48::MeshT< Traits >.
Reimplemented in a48::AdaptiveMeshT< Traits >.
Definition at line 111 of file stellarmesht.hh.
typedef Traits::face_type a48::StellarMeshT< Traits >::face_type |
face definition
Reimplemented from a48::MeshT< Traits >.
Reimplemented in a48::AdaptiveMeshT< Traits >.
Definition at line 112 of file stellarmesht.hh.
a48::StellarMeshT< Traits >::StellarMeshT | ( | ) | [inline] |
Default Constructor.
Definition at line 115 of file stellarmesht.hh.
a48::StellarMeshT< Traits >::StellarMeshT | ( | stellar_policy * | _sp | ) | [inline] |
Constructor
[in] | _sp | Stellar Policy to be used by this mesh |
Definition at line 121 of file stellarmesht.hh.
a48::StellarMeshT< Traits >::StellarMeshT | ( | items_policy * | _ip, |
stellar_policy * | _sp = 0 |
||
) | [inline] |
Constructor
[in] | _ip | Items Policy to be used by this mesh |
[in] | _sp | Stellar Policy to be used by this mesh |
Definition at line 130 of file stellarmesht.hh.
a48::StellarMeshT< Traits >::StellarMeshT | ( | const StellarMeshT< Traits > & | _m | ) | [inline] |
StellarMeshT< Traits >& a48::StellarMeshT< Traits >::operator= | ( | const StellarMeshT< Traits > & | _m | ) | [inline] |
Assign operator.
[in] | _m | Copy mesh |
Definition at line 143 of file stellarmesht.hh.
References a48::StellarMeshT< Traits >::get_stellar_policy().
bool a48::StellarMeshT< Traits >::is_tri | ( | void | ) | const [inline] |
Verifies if this mesh is a triangulated mesh.
Definition at line 155 of file stellarmesht.hh.
References a48::MeshT< Traits >::faces_begin(), and a48::MeshT< Traits >::faces_end().
void a48::StellarMeshT< Traits >::set_stellar_policy | ( | stellar_policy * | _sp | ) | [inline] |
Set Stellar Policy for this mesh.
[in] | _sp | Stellar Policy to be used by this mesh |
Definition at line 170 of file stellarmesht.hh.
stellar_policy* a48::StellarMeshT< Traits >::get_stellar_policy | ( | void | ) | [inline] |
Get Stellar Policy of this mesh.
Definition at line 181 of file stellarmesht.hh.
const stellar_policy * a48::StellarMeshT< Traits >::get_stellar_policy | ( | void | ) | const [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 186 of file stellarmesht.hh.
void a48::StellarMeshT< Traits >::edge_weld | ( | halfedge_type * | h1, |
halfedge_type * | h2 | ||
) | [inline] |
Weld an edge removing the middle vertex.
* * /|\ /|\ / | \ / | \ / | \ /h1|h2\ *-->*-->* or *-->*-->* h1 h2 \ | / \ | / \|/ *
[in,out] | h1 | Halfedge pointing to the vertex to be removed |
[in,out] | h2 | Halfedge leaving the vertex to be removed |
Definition at line 208 of file stellarmesht.hh.
References a48::MeshT< Traits >::delete_vertex(), a48::BaseStellarPolicy< Traits >::remove_vertex(), and a48::StellarMeshT< Traits >::weld().
void a48::StellarMeshT< Traits >::face_weld | ( | halfedge_type * | h1, |
halfedge_type * | h2, | ||
halfedge_type * | h3 | ||
) | [inline] |
Weld a face removing the middle vertex.
* * /|h3 /|\ / * \ / \ / / \ \ -> / \ /.h1 h2.\ /_ \ *-------->* *-------->*
[in,out] | h1 | Halfedge h1 pointing to the vertex to be removed |
[in,out] | h2 | Halfedge h2 pointing to the vertex to be removed |
[in,out] | h3 | Halfedge h3 pointing to the vertex to be removed |
Definition at line 230 of file stellarmesht.hh.
References a48::StellarMeshT< Traits >::weld().
void a48::StellarMeshT< Traits >::edge_split | ( | halfedge_type * | h | ) | [inline] |
Split an edge inserting a vertex in the middle.
* * /|\ /|\ / | \ / | \ / | \ / h| \ *------>* or *------>* h \ | / \ | / \|/ *
[in,out] | h | Halfedge to be splitted |
Definition at line 249 of file stellarmesht.hh.
References a48::StellarMeshT< Traits >::split().
void a48::StellarMeshT< Traits >::face_split | ( | face_type * | f | ) | [inline] |
Split a face.
* * /|\ /|\ / \ / * \ / f \ -> / / \ \ /_ \ /. f .\ *-------->* *-------->*
[in,out] | f | Face to be splitted |
Definition at line 262 of file stellarmesht.hh.
References a48::StellarMeshT< Traits >::split().
void a48::StellarMeshT< Traits >::flip | ( | halfedge_type * | h | ) | [inline] |
Flip a halfedge.
* * / \ /|\ ph / \ nh //| \ / h \ / | \ *------>* -> * h| * \ / \ | / \ / \ | / \ / \|/ * *
[in,out] | h | Halfedge to be flipped |
Definition at line 277 of file stellarmesht.hh.
References a48::BaseStellarPolicy< Traits >::flip_halfedge().
void a48::StellarMeshT< Traits >::unflip | ( | halfedge_type * | h | ) | [inline] |
Un-Flip a halfedge.
* * / \ /|\ ph / \ nh / | \ / h \ / | \ *------>* -> * |h * \ / \ | / \ / \ |// \ / \|/ * *
[in,out] | h | Halfedge to do a reverse flip (undoing a previous flip) |
Definition at line 318 of file stellarmesht.hh.
References a48::BaseStellarPolicy< Traits >::flip_halfedge().
void a48::StellarMeshT< Traits >::weld | ( | vertex_type * | v | ) | [inline] |
Weld a vertex.
It is guaranteed that the vertex passed has the halfedge pointing to it as the halfedge survived after the vertex removal, therefore this halfedge can be queried by v->halfedge() _before_ the weld operation.
[in,out] | v | Vertex pointer to be collapsed |
Definition at line 355 of file stellarmesht.hh.
References a48::MeshT< Traits >::delete_face(), a48::MeshT< Traits >::delete_halfedge(), a48::MeshT< Traits >::delete_vertex(), and a48::BaseStellarPolicy< Traits >::remove_vertex().
void a48::StellarMeshT< Traits >::split | ( | halfedge_type * | h | ) | [inline] |
Split a halfedge.
It is guaranteed that the halfedge passed is the halfedge pointing to the new vertex created in the middle, therefore the vertex created can be queried by simply h->vertex() _after_ the split operation.
[in,out] | h | Halfedge to be splitted |
Definition at line 401 of file stellarmesht.hh.
References a48::MeshT< Traits >::add_vertex(), and a48::BaseStellarPolicy< Traits >::sample_vertex().
void a48::StellarMeshT< Traits >::split | ( | face_type * | f0 | ) | [inline] |
Split a face.
* * /|\ /|\ h20 / \ h10 / *v\ / f0 \ -> / / \ \ /_ \ /. f0 .\ *-------->* *-------->* h00 h00
[in,out] | f0 | Face to be splitted |
Definition at line 428 of file stellarmesht.hh.
References a48::MeshT< Traits >::add_face(), a48::MeshT< Traits >::add_halfedge(), a48::MeshT< Traits >::add_vertex(), and a48::BaseStellarPolicy< Traits >::sample_vertex().
bool make_triquad | ( | Mesh & | _m, |
float(*)(typename Mesh::halfedge_type *) | _fr = 0 , |
||
unsigned int | ualg = 0 |
||
) | [related] |
Converts mesh from triangles to tri-quads.
A tri-quad mesh is a triangle mesh with a quadrilateral structure suitable for the adaptive 4-8 mesh data structure. This function only works with triangulated and valid meshes. The Mesh class must be (or inherit from) an AdaptiveMesh class. The algorithms used in this function use a different rank value heuristic for an edge (given by a function _fr), please see each make_triquad_* algorithm for further details.
[in,out] | _m | The mesh to be converted |
[in] | _fr | Function to rank an edge defined by a non-boundary halfedge |
[in] | ualg | Use algorithm (default 0: original 4-8 clustering; 1: crawler) |
bool make_triquad_48clustering | ( | Mesh & | _m, |
float(*)(typename Mesh::halfedge_type *) | _fr = 0 |
||
) | [related] |
Converts mesh from triangles to tri-quads.
The Mesh class to be converted must be (or inherit from) an AdaptiveMesh class. The algorithm of this function uses a rank value defined for each edge (given by a function _fr), where higher values mean better halfedge to be splitted in four quads (using it as base block of the 4-8 subdivision process and considering the first subdivision level). For more information about the algorithm please read the following paper:
@INPROCEEDINGS{Velho:2000, title = {Quadrilateral Meshing using 4-8 Clustering}, author = {Luiz Velho}, year = {2000}, booktitle = {Proceedings of CILANCE 2000 - Symposium on Mesh Generation and Self-adaptivity}, pages = {61-64}, month = {December} }
The algorithm of this function considers the given mesh to be closed, if not it returns false.
[in,out] | _m | The mesh to be converted |
[in] | _fr | Function to rank an edge defined by a halfedge (i.e. the length of the edge) |
bool make_triquad_crawler | ( | Mesh & | _m, |
float(*)(typename Mesh::halfedge_type *) | _fr = 0 |
||
) | [related] |
Converts mesh from triangles to tri-quads.
The Mesh class to be converted must be (or inherit from) a StellarMesh class. The algorithm of this function uses a rank value defined for each edge (given by a function _fr), where lower values mean better halfedge to make a quad (using it as the diagonal edge of the quad) and if this value is negative it means that the quad resulting from the halfedge is invalid. For the rank function _fr, only the information at the vertices can be used (the halfedges and faces are created to test each quad configuration in the matching process). For more information about the algorithm please read the following paper:
@ARTICLE{Tarini:2010, author = {Tarini, Marco and Pietroni, Nico and Cignoni, Paolo and Panozzo, Daniele and Puppo, Enrico}, title = {Practical quad mesh simplification}, journal = {Computer Graphics Forum (Special Issue of Eurographics 2010 Conference)}, volume = {29}, number = {2}, pages = {407--418}, year = {2010}, url = {http://vcg.isti.cnr.it/Publications/2010/TPCPP10} }
[in,out] | _m | The mesh to be converted |
[in] | _fr | Function to rank an edge defined by a non-boundary halfedge (i.e. the squareness of the quad formed by the edge) |