a48
2.0.2
|
Adaptive mesh type (considering triangular faces) More...
#include <adaptivemesht.hh>
Public Types | |
typedef BaseItemsPolicy< Traits > | items_policy |
items policy definition | |
typedef BaseStellarPolicy< Traits > | stellar_policy |
stellar policy definition | |
typedef BaseAdaptivePolicy < Traits > | adaptive_policy |
adaptive 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 | |
AdaptiveMeshT () | |
Default Constructor. | |
AdaptiveMeshT (adaptive_policy *_ap) | |
AdaptiveMeshT (items_policy *_ip, stellar_policy *_sp=0, adaptive_policy *_ap=0) | |
AdaptiveMeshT (const AdaptiveMeshT< Traits > &_m) | |
AdaptiveMeshT< Traits > & | operator= (const AdaptiveMeshT< Traits > &_m) |
Assign operator. | |
bool | is_triquad (void) const |
Verifies if this mesh is a tri-quad mesh. | |
void | set_adaptive_policy (adaptive_policy *_ap) |
Set Adaptive Policy for this mesh. | |
adaptive_policy * | get_adaptive_policy (void) |
Get Adaptive Policy of this mesh. | |
const adaptive_policy * | get_adaptive_policy (void) const |
void | simplify (vertex_type *v) |
Simplify current mesh. | |
void | refine (halfedge_type *h) |
Refine current mesh. | |
void | adapt_simplify (void) |
Adaptive simplify current mesh. | |
void | adapt_refine (void) |
Adaptive refine current mesh. | |
Related Functions | |
(Note that these are not member functions.) | |
template<class Mesh > | |
bool | write_off_mesh (const Mesh &_m, std::ostream &_out, const bool &_wq=false, void(*_fratt)(std::string &, const typename Mesh::vertex_type *)=0, void(*_frid)(unsigned &, const typename Mesh::vertex_type *)=0) |
Writes a mesh into an output stream (as OFF) | |
template<class Mesh > | |
bool | write_off_mesh (const Mesh &_m, const char *_fn, const bool &_wq=false, void(*_fratt)(std::string &, const typename Mesh::vertex_type *)=0, void(*_frid)(unsigned &, const typename Mesh::vertex_type *)=0) |
template<class Mesh > | |
bool | read_off_mesh (Mesh &_m, std::istream &_in, void(*_fsatt)(typename Mesh::vertex_type *, const std::string &)=0, void(*_fsid)(typename Mesh::vertex_type *, const unsigned &)=0) |
Reads an OFF mesh from an input stream. | |
template<class Mesh > | |
bool | read_off_mesh (Mesh &_m, const char *_fn, void(*_fsatt)(typename Mesh::vertex_type *, const std::string &)=0, void(*_fsid)(typename Mesh::vertex_type *, const unsigned &)=0) |
Adaptive mesh type (considering triangular faces)
This class is based mainly on the following paper:
@ARTICLE{Velho:2001, author = {Luiz Velho and Denis Zorin}, title = {4-8 Subdivision}, journal = {Computer Aided Geometric Design}, volume = {18}, number = {5}, pages = {397--427}, year = {2001}, issn = {0167-8396}, doi = {http://dx.doi.org/10.1016/S0167-8396(01)00039-5} }
Traits | template argument to define mesh traits |
Definition at line 159 of file adaptivemesht.hh.
typedef BaseItemsPolicy< Traits > a48::AdaptiveMeshT< Traits >::items_policy |
items policy definition
Reimplemented from a48::StellarMeshT< Traits >.
Definition at line 163 of file adaptivemesht.hh.
typedef BaseStellarPolicy< Traits > a48::AdaptiveMeshT< Traits >::stellar_policy |
stellar policy definition
Reimplemented from a48::StellarMeshT< Traits >.
Definition at line 164 of file adaptivemesht.hh.
typedef BaseAdaptivePolicy< Traits > a48::AdaptiveMeshT< Traits >::adaptive_policy |
adaptive policy definition
Definition at line 165 of file adaptivemesht.hh.
typedef Traits::vertex_type a48::AdaptiveMeshT< Traits >::vertex_type |
vertex definition
Reimplemented from a48::StellarMeshT< Traits >.
Definition at line 167 of file adaptivemesht.hh.
typedef Traits::halfedge_type a48::AdaptiveMeshT< Traits >::halfedge_type |
halfedge definition
Reimplemented from a48::StellarMeshT< Traits >.
Definition at line 168 of file adaptivemesht.hh.
typedef Traits::face_type a48::AdaptiveMeshT< Traits >::face_type |
face definition
Reimplemented from a48::StellarMeshT< Traits >.
Definition at line 169 of file adaptivemesht.hh.
a48::AdaptiveMeshT< Traits >::AdaptiveMeshT | ( | ) | [inline] |
Default Constructor.
Definition at line 172 of file adaptivemesht.hh.
a48::AdaptiveMeshT< Traits >::AdaptiveMeshT | ( | adaptive_policy * | _ap | ) | [inline] |
Constructor
[in] | _ap | Adaptive Policy to be used by this mesh |
Definition at line 178 of file adaptivemesht.hh.
a48::AdaptiveMeshT< Traits >::AdaptiveMeshT | ( | items_policy * | _ip, |
stellar_policy * | _sp = 0 , |
||
adaptive_policy * | _ap = 0 |
||
) | [inline] |
Constructor
[in] | _ip | Items Policy to be used by this mesh |
[in] | _sp | Stellar Policy to be used by this mesh |
[in] | _ap | Adaptive Policy to be used by this mesh |
Definition at line 188 of file adaptivemesht.hh.
a48::AdaptiveMeshT< Traits >::AdaptiveMeshT | ( | const AdaptiveMeshT< Traits > & | _m | ) | [inline] |
AdaptiveMeshT< Traits >& a48::AdaptiveMeshT< Traits >::operator= | ( | const AdaptiveMeshT< Traits > & | _m | ) | [inline] |
Assign operator.
[in] | _m | Copy mesh |
Definition at line 202 of file adaptivemesht.hh.
References a48::AdaptiveMeshT< Traits >::get_adaptive_policy().
bool a48::AdaptiveMeshT< Traits >::is_triquad | ( | void | ) | const [inline] |
Verifies if this mesh is a tri-quad mesh.
A tri-quad mesh is a triangle mesh with pairs of triangles composing quads. The adaptive mesh type is defined over the adaptive face type which implicitly defines a quad as two triangular faces sharing the same split edge.
number of split halfedges
Definition at line 220 of file adaptivemesht.hh.
References a48::MeshT< Traits >::halfedges_begin(), a48::MeshT< Traits >::halfedges_end(), and a48::MeshT< Traits >::size_of_faces().
void a48::AdaptiveMeshT< Traits >::set_adaptive_policy | ( | adaptive_policy * | _ap | ) | [inline] |
Set Adaptive Policy for this mesh.
[in] | _ap | Adaptive Policy to be used by this mesh |
Definition at line 242 of file adaptivemesht.hh.
adaptive_policy* a48::AdaptiveMeshT< Traits >::get_adaptive_policy | ( | void | ) | [inline] |
Get Adaptive Policy of this mesh.
Definition at line 253 of file adaptivemesht.hh.
const adaptive_policy * a48::AdaptiveMeshT< Traits >::get_adaptive_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 258 of file adaptivemesht.hh.
void a48::AdaptiveMeshT< Traits >::simplify | ( | vertex_type * | v | ) | [inline] |
Simplify current mesh.
[in,out] | v | Vertex to be simplified/welded (removed) |
Definition at line 269 of file adaptivemesht.hh.
References a48::BaseAdaptivePolicy< Traits >::update_simplification(), and a48::StellarMeshT< Traits >::weld().
void a48::AdaptiveMeshT< Traits >::refine | ( | halfedge_type * | h | ) | [inline] |
Refine current mesh.
[in,out] | h | Halfedge to be refined/splitted |
Definition at line 303 of file adaptivemesht.hh.
References a48::StellarMeshT< Traits >::split(), and a48::BaseAdaptivePolicy< Traits >::update_refinement().
void a48::AdaptiveMeshT< Traits >::adapt_simplify | ( | void | ) | [inline] |
Adaptive simplify current mesh.
Definition at line 320 of file adaptivemesht.hh.
References a48::BaseAdaptivePolicy< Traits >::next_simplify_vertex(), a48::AdaptiveMeshT< Traits >::simplify(), and a48::BaseAdaptivePolicy< Traits >::update_simplification().
void a48::AdaptiveMeshT< Traits >::adapt_refine | ( | void | ) | [inline] |
Adaptive refine current mesh.
Definition at line 333 of file adaptivemesht.hh.
References a48::BaseAdaptivePolicy< Traits >::next_refine_halfedge(), a48::AdaptiveMeshT< Traits >::refine(), and a48::BaseAdaptivePolicy< Traits >::update_refinement().
bool write_off_mesh | ( | const Mesh & | _m, |
std::ostream & | _out, | ||
const bool & | _wq = false , |
||
void(*)(std::string &, const typename Mesh::vertex_type *) | _fratt = 0 , |
||
void(*)(unsigned &, const typename Mesh::vertex_type *) | _frid = 0 |
||
) | [related] |
Writes a mesh into an output stream (as OFF)
The mesh is written using the Object File Format (OFF) to the ouput stream as text. During writing two functions are called to retrieve: vertex attributes as a string; and index as an integer. Both functions retrieve from the Mesh::vertex_type class in the following way: _fratt(str, vertex_type*); _frid(id, vertex_type*). If the first function is missing, no attributes is written to the output stream (one empty line for each vertex). If the second function is missing, the order of the vertices in the mesh vertex container is used as index of each vertex.
[in] | _m | The mesh to be written |
[in,out] | _out | The output stream to write the mesh to |
[in] | _wq | Write quad flag enables to write quad faces to the output |
[in] | _fratt | Function to retrieve attributes of each vertex |
[in] | _frid | Function to retrieve the index of each vertex |
Mesh | Base mesh class must be derived from |
bool write_off_mesh | ( | const Mesh & | _m, |
const char * | _fn, | ||
const bool & | _wq = false , |
||
void(*)(std::string &, const typename Mesh::vertex_type *) | _fratt = 0 , |
||
void(*)(unsigned &, const typename Mesh::vertex_type *) | _frid = 0 |
||
) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[in] | _m | The mesh to be written |
[in] | _fn | File name (C string) to be written |
[in] | _wq | Write quad flag enables to write quad faces to the output |
[in] | _fratt | Function to retrieve attributes of each vertex |
[in] | _frid | Function to retrieve the index of each vertex |
Mesh | Base mesh class must be derived from |
bool read_off_mesh | ( | Mesh & | _m, |
std::istream & | _in, | ||
void(*)(typename Mesh::vertex_type *, const std::string &) | _fsatt = 0 , |
||
void(*)(typename Mesh::vertex_type *, const unsigned &) | _fsid = 0 |
||
) | [related] |
Reads an OFF mesh from an input stream.
The mesh is constructed using the Object File Format (OFF) read from the input stream as text. During reading two functions are called to set: vertex attributes as a string; and index as an integer. Both functions set from the Mesh::vertex_type class in the following way: _fsatt(vertex_type*, str); _fsid( vertex_type*, id). If the first function is missing, no attributes is read back from the input stream. If the second function is missing, vertex indices are disconsider.
[out] | _m | The mesh to be returned |
[in,out] | _in | The input stream to read the mesh from |
[in] | _fsatt | Function to set the attributes of each vertex |
[in] | _fsid | Function to set the index of each vertex |
Mesh | Base mesh class must be derived from |
bool read_off_mesh | ( | Mesh & | _m, |
const char * | _fn, | ||
void(*)(typename Mesh::vertex_type *, const std::string &) | _fsatt = 0 , |
||
void(*)(typename Mesh::vertex_type *, const unsigned &) | _fsid = 0 |
||
) | [related] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[out] | _m | The mesh to be returned |
[in] | _fn | File name (C string) to be read |
[in] | _fsatt | Function to set the attributes of each vertex |
[in] | _fsid | Function to set the index of each vertex |
Mesh | Base mesh class must be derived from |