a48  2.0.2
a48::StellarMeshT< Traits > Class Template Reference

Stellar-operations enabled mesh type (considering triangular faces) More...

#include <stellarmesht.hh>

Inheritance diagram for a48::StellarMeshT< Traits >:
a48::MeshT< Traits > a48::AdaptiveMeshT< Traits >

List of all members.

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_policyget_stellar_policy (void)
 Get Stellar Policy of this mesh.
const stellar_policyget_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.

Detailed Description

template<class Traits = DefaultTraits>
class a48::StellarMeshT< Traits >

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}
}   
Template Parameters:
Traitstemplate argument to define mesh traits
Examples:
example_stellarmesht.cc, and example_stellarpolicy.cc.

Definition at line 103 of file stellarmesht.hh.


Member Typedef Documentation

template<class Traits = DefaultTraits>
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.

template<class Traits = DefaultTraits>
typedef BaseStellarPolicy< Traits > a48::StellarMeshT< Traits >::stellar_policy

stellar policy definition

Reimplemented in a48::AdaptiveMeshT< Traits >.

Definition at line 108 of file stellarmesht.hh.

template<class Traits = DefaultTraits>
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.

template<class Traits = DefaultTraits>
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.

template<class Traits = DefaultTraits>
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.


Constructor & Destructor Documentation

template<class Traits = DefaultTraits>
a48::StellarMeshT< Traits >::StellarMeshT ( ) [inline]

Default Constructor.

Definition at line 115 of file stellarmesht.hh.

template<class Traits = DefaultTraits>
a48::StellarMeshT< Traits >::StellarMeshT ( stellar_policy _sp) [inline]

Constructor

Parameters:
[in]_spStellar Policy to be used by this mesh
See also:
BaseStellarPolicy

Definition at line 121 of file stellarmesht.hh.

template<class Traits = DefaultTraits>
a48::StellarMeshT< Traits >::StellarMeshT ( items_policy _ip,
stellar_policy _sp = 0 
) [inline]

Constructor

Parameters:
[in]_ipItems Policy to be used by this mesh
[in]_spStellar Policy to be used by this mesh
See also:
BaseItemsPolicy
BaseStellarPolicy

Definition at line 130 of file stellarmesht.hh.

template<class Traits = DefaultTraits>
a48::StellarMeshT< Traits >::StellarMeshT ( const StellarMeshT< Traits > &  _m) [inline]

Copy Constructor

Parameters:
[in]_mCopy mesh

Definition at line 137 of file stellarmesht.hh.


Member Function Documentation

template<class Traits = DefaultTraits>
StellarMeshT< Traits >& a48::StellarMeshT< Traits >::operator= ( const StellarMeshT< Traits > &  _m) [inline]

Assign operator.

Parameters:
[in]_mCopy mesh
Returns:
This mesh as a clone of the copy mesh

Definition at line 143 of file stellarmesht.hh.

References a48::StellarMeshT< Traits >::get_stellar_policy().

template<class Traits = DefaultTraits>
bool a48::StellarMeshT< Traits >::is_tri ( void  ) const [inline]

Verifies if this mesh is a triangulated mesh.

Returns:
True 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().

template<class Traits = DefaultTraits>
void a48::StellarMeshT< Traits >::set_stellar_policy ( stellar_policy _sp) [inline]

Set Stellar Policy for this mesh.

Parameters:
[in]_spStellar Policy to be used by this mesh
See also:
BaseStellarPolicy

Definition at line 170 of file stellarmesht.hh.

template<class Traits = DefaultTraits>
stellar_policy* a48::StellarMeshT< Traits >::get_stellar_policy ( void  ) [inline]

Get Stellar Policy of this mesh.

Returns:
Stellar Policy used by this mesh
See also:
BaseStellarPolicy

Definition at line 181 of file stellarmesht.hh.

template<class Traits = DefaultTraits>
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.

Returns:
Stellar Policy (constant) used by this mesh

Definition at line 186 of file stellarmesht.hh.

template<class Traits = DefaultTraits>
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          \  |  /
                              \ | /
                               \|/
                                *    
Parameters:
[in,out]h1Halfedge pointing to the vertex to be removed
[in,out]h2Halfedge leaving the vertex to be removed
See also:
weld

Definition at line 208 of file stellarmesht.hh.

References a48::MeshT< Traits >::delete_vertex(), a48::BaseStellarPolicy< Traits >::remove_vertex(), and a48::StellarMeshT< Traits >::weld().

template<class Traits = DefaultTraits>
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.\        /_      \
             *-------->*      *-------->*    
Parameters:
[in,out]h1Halfedge h1 pointing to the vertex to be removed
[in,out]h2Halfedge h2 pointing to the vertex to be removed
[in,out]h3Halfedge h3 pointing to the vertex to be removed
See also:
weld

Definition at line 230 of file stellarmesht.hh.

References a48::StellarMeshT< Traits >::weld().

template<class Traits = DefaultTraits>
void a48::StellarMeshT< Traits >::edge_split ( halfedge_type h) [inline]

Split an edge inserting a vertex in the middle.

                *               *
               /|\             /|\
              / | \           / | \
             /  |  \         / h|  \
            *------>*  or   *------>*
              h              \  |  /
                              \ | /
                               \|/
                                *    
Parameters:
[in,out]hHalfedge to be splitted
See also:
split

Definition at line 249 of file stellarmesht.hh.

References a48::StellarMeshT< Traits >::split().

template<class Traits = DefaultTraits>
void a48::StellarMeshT< Traits >::face_split ( face_type f) [inline]

Split a face.

                  *              *
                 /|\            /|\
                /   \          / * \
               /  f  \   ->   / / \ \
              /_      \      /.  f  .\
             *-------->*    *-------->*    
Parameters:
[in,out]fFace to be splitted
See also:
split

Definition at line 262 of file stellarmesht.hh.

References a48::StellarMeshT< Traits >::split().

template<class Traits = DefaultTraits>
void a48::StellarMeshT< Traits >::flip ( halfedge_type h) [inline]

Flip a halfedge.

                 *              *
                / \            /|\
            ph /   \ nh       //| \
              /  h  \        /  |  \
             *------>*  ->  *  h|   *
              \     /        \  |  /
               \   /          \ | /
                \ /            \|/
                 *              *    
Parameters:
[in,out]hHalfedge to be flipped

Definition at line 277 of file stellarmesht.hh.

References a48::BaseStellarPolicy< Traits >::flip_halfedge().

template<class Traits = DefaultTraits>
void a48::StellarMeshT< Traits >::unflip ( halfedge_type h) [inline]

Un-Flip a halfedge.

                 *              *
                / \            /|\
            ph /   \ nh       / | \
              /  h  \        /  |  \
             *------>*  ->  *   |h  *
              \     /        \  |  /
               \   /          \ |//
                \ /            \|/
                 *              *    
Parameters:
[in,out]hHalfedge to do a reverse flip (undoing a previous flip)

Definition at line 318 of file stellarmesht.hh.

References a48::BaseStellarPolicy< Traits >::flip_halfedge().

template<class Traits = DefaultTraits>
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.

Parameters:
[in,out]vVertex 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().

template<class Traits = DefaultTraits>
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.

Parameters:
[in,out]hHalfedge to be splitted

Definition at line 401 of file stellarmesht.hh.

References a48::MeshT< Traits >::add_vertex(), and a48::BaseStellarPolicy< Traits >::sample_vertex().

template<class Traits = DefaultTraits>
void a48::StellarMeshT< Traits >::split ( face_type f0) [inline]

Split a face.

                  *             *
                 /|\           /|\
            h20 /   \ h10     / *v\
               / f0  \   ->  / / \ \
              /_      \     /. f0  .\
             *-------->*   *-------->*
                 h00           h00        
Parameters:
[in,out]f0Face 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().


Friends And Related Function Documentation

template<class Mesh >
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.

See also:
MeshT::is_valid
StellarMeshT::is_tri
AdaptiveMeshT::is_triquad
Parameters:
[in,out]_mThe mesh to be converted
[in]_frFunction to rank an edge defined by a non-boundary halfedge
[in]ualgUse algorithm (default 0: original 4-8 clustering; 1: crawler)
Returns:
True if the mesh is now a tri-quad mesh
Examples:
example_meshalgorithms.cc.

Definition at line 539 of file mesh.hh.

template<class Mesh >
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.

Parameters:
[in,out]_mThe mesh to be converted
[in]_frFunction to rank an edge defined by a halfedge (i.e. the length of the edge)
Returns:
True if the mesh is now a tri-quad mesh

Definition at line 581 of file mesh.hh.

template<class Mesh >
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}
}   
Parameters:
[in,out]_mThe mesh to be converted
[in]_frFunction to rank an edge defined by a non-boundary halfedge (i.e. the squareness of the quad formed by the edge)
Returns:
True if the mesh is now a tri-quad mesh

Definition at line 691 of file mesh.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Typedefs