a48
2.0.2
|
Mesh type for a halfedge-based (topological) mesh. More...
#include <mesht.hh>
Public Types | |
typedef BaseItemsPolicy< Traits > | items_policy |
items 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 | |
typedef halfedge_type::edge_type | edge_type |
edge definition | |
typedef std::set< vertex_type * > | vertex_container |
vertex container definition | |
typedef std::set< halfedge_type * > | halfedge_container |
halfedge container definition | |
typedef std::set< face_type * > | face_container |
face container definition | |
typedef vertex_container::iterator | vertex_iterator |
vertex iterator definition | |
typedef vertex_container::const_iterator | vertex_const_iterator |
vertex constant iterator definition | |
typedef halfedge_container::iterator | halfedge_iterator |
halfedge iterator definition | |
typedef halfedge_container::const_iterator | halfedge_const_iterator |
halfedge constant iterator definition | |
typedef face_container::iterator | face_iterator |
face iterator definition | |
typedef face_container::const_iterator | face_const_iterator |
face constant iterator definition | |
Public Member Functions | |
MeshT () | |
Default Constructor. | |
MeshT (items_policy *_ip) | |
MeshT (const MeshT< Traits > &_m) | |
~MeshT () | |
Destructor. | |
void | clear (void) |
Clear entire mesh, deleting all elements and erasing all containers. | |
MeshT< Traits > & | operator= (const MeshT< Traits > &_m) |
Assign operator. | |
void | fix_vertices_stars (void) |
Fix the star circulation of all mesh vertices. | |
vertex_type * | add_vertex (void) |
Add a new vertex to this mesh. | |
halfedge_type * | add_halfedge (void) |
Add a new halfedge to this mesh. | |
face_type * | add_face (void) |
Add a new face to this mesh. | |
void | delete_vertex (vertex_type *_v) |
Delete a vertex from this mesh. | |
void | delete_halfedge (halfedge_type *_h) |
Delete a halfedge from this mesh. | |
void | delete_face (face_type *_f) |
Delete a face from this mesh. | |
bool | is_closed (void) const |
Verifies if this mesh is closed (without boundaries) | |
bool | is_consistent (void) const |
Verifies mesh halfedge data structure consistency. | |
bool | is_manifold (void) const |
Verifies if this mesh is a manifold (topologically) | |
bool | is_valid (void) const |
Verifies if this mesh is valid (halfedge data structure is ok) | |
void | set_base (const unsigned int &nv, const unsigned int &nf, const unsigned int *conn, const unsigned int &nvf=3) |
Sets the base mesh. | |
void | set_base (vertex_type **verts, const unsigned int *conn, const unsigned int &nf, const unsigned int &nvf=3) |
void | set_items_policy (items_policy *_ip) |
Set Items Policy for this mesh. | |
unsigned int | size_of_vertices (void) const |
Gets the number of vertices of this mesh. | |
unsigned int | size_of_halfedges (void) const |
Gets the number of halfedges of this mesh. | |
unsigned int | size_of_faces (void) const |
Gets the number of faces of this mesh. | |
const vertex_container & | set_of_vertices (void) const |
Gets the set of vertices of this mesh. | |
const halfedge_container & | set_of_halfedges (void) const |
Gets the set of halfedges of this mesh. | |
const face_container & | set_of_faces (void) const |
Gets the set of faces of this mesh. | |
items_policy * | get_items_policy (void) |
Get Items Policy of this mesh. | |
const items_policy * | get_items_policy (void) const |
vertex_iterator | vertices_begin (void) |
vertex_const_iterator | vertices_begin (void) const |
vertex_iterator | vertices_end (void) |
vertex_const_iterator | vertices_end (void) const |
halfedge_iterator | halfedges_begin (void) |
halfedge_const_iterator | halfedges_begin (void) const |
halfedge_iterator | halfedges_end (void) |
halfedge_const_iterator | halfedges_end (void) const |
face_iterator | faces_begin (void) |
face_const_iterator | faces_begin (void) const |
face_iterator | faces_end (void) |
face_const_iterator | faces_end (void) const |
Related Functions | |
(Note that these are not member functions.) | |
template<class Mesh > | |
bool | make_consistent (Mesh &_m) |
Reset halfedge orientations to make the mesh consistent. |
Mesh type for a halfedge-based (topological) mesh.
This class is based mainly on the following book:
@BOOK{Mantyla:1988, title = {An introduction to solid modeling}, author = {M{\"a}ntyl{\"a}, M.}, isbn = {9780881751086}, lccn = {87027852}, note = {\url{http://books.google.com.br/books?id=CJVRAAAAMAAJ}}, year = {1988}, publisher = {Computer Science Press} }
Traits | template argument to define mesh traits |
typedef BaseItemsPolicy< Traits > a48::MeshT< Traits >::items_policy |
items policy definition
Reimplemented in a48::AdaptiveMeshT< Traits >, and a48::StellarMeshT< Traits >.
typedef Traits::vertex_type a48::MeshT< Traits >::vertex_type |
vertex definition
Reimplemented in a48::AdaptiveMeshT< Traits >, and a48::StellarMeshT< Traits >.
typedef Traits::halfedge_type a48::MeshT< Traits >::halfedge_type |
halfedge definition
Reimplemented in a48::AdaptiveMeshT< Traits >, and a48::StellarMeshT< Traits >.
typedef Traits::face_type a48::MeshT< Traits >::face_type |
face definition
Reimplemented in a48::AdaptiveMeshT< Traits >, and a48::StellarMeshT< Traits >.
typedef halfedge_type::edge_type a48::MeshT< Traits >::edge_type |
typedef std::set< vertex_type* > a48::MeshT< Traits >::vertex_container |
typedef std::set< halfedge_type* > a48::MeshT< Traits >::halfedge_container |
typedef std::set< face_type* > a48::MeshT< Traits >::face_container |
typedef vertex_container::iterator a48::MeshT< Traits >::vertex_iterator |
typedef vertex_container::const_iterator a48::MeshT< Traits >::vertex_const_iterator |
typedef halfedge_container::iterator a48::MeshT< Traits >::halfedge_iterator |
typedef halfedge_container::const_iterator a48::MeshT< Traits >::halfedge_const_iterator |
typedef face_container::iterator a48::MeshT< Traits >::face_iterator |
typedef face_container::const_iterator a48::MeshT< Traits >::face_const_iterator |
a48::MeshT< Traits >::MeshT | ( | ) | [inline] |
a48::MeshT< Traits >::MeshT | ( | items_policy * | _ip | ) | [inline] |
a48::MeshT< Traits >::MeshT | ( | const MeshT< Traits > & | _m | ) | [inline] |
a48::MeshT< Traits >::~MeshT | ( | ) | [inline] |
void a48::MeshT< Traits >::clear | ( | void | ) | [inline] |
MeshT< Traits >& a48::MeshT< Traits >::operator= | ( | const MeshT< Traits > & | _m | ) | [inline] |
Assign operator.
[in] | _m | Copy mesh |
Definition at line 205 of file mesht.hh.
References a48::MeshT< Traits >::add_face(), a48::MeshT< Traits >::add_halfedge(), a48::MeshT< Traits >::add_vertex(), a48::MeshT< Traits >::clear(), a48::MeshT< Traits >::faces_begin(), a48::MeshT< Traits >::faces_end(), a48::MeshT< Traits >::get_items_policy(), a48::MeshT< Traits >::halfedges_begin(), a48::MeshT< Traits >::halfedges_end(), a48::BaseItemsPolicy< Traits >::set_face_attributes(), a48::BaseItemsPolicy< Traits >::set_halfedge_attributes(), a48::BaseItemsPolicy< Traits >::set_vertex_attributes(), a48::MeshT< Traits >::vertices_begin(), and a48::MeshT< Traits >::vertices_end().
void a48::MeshT< Traits >::fix_vertices_stars | ( | void | ) | [inline] |
Fix the star circulation of all mesh vertices.
Make sure each boundary vertex starts its star circulation with the first halfedge in the boundary.
vertex_type* a48::MeshT< Traits >::add_vertex | ( | void | ) | [inline] |
halfedge_type* a48::MeshT< Traits >::add_halfedge | ( | void | ) | [inline] |
face_type* a48::MeshT< Traits >::add_face | ( | void | ) | [inline] |
void a48::MeshT< Traits >::delete_vertex | ( | vertex_type * | _v | ) | [inline] |
void a48::MeshT< Traits >::delete_halfedge | ( | halfedge_type * | _h | ) | [inline] |
void a48::MeshT< Traits >::delete_face | ( | face_type * | _f | ) | [inline] |
bool a48::MeshT< Traits >::is_closed | ( | void | ) | const [inline] |
bool a48::MeshT< Traits >::is_consistent | ( | void | ) | const [inline] |
bool a48::MeshT< Traits >::is_manifold | ( | void | ) | const [inline] |
bool a48::MeshT< Traits >::is_valid | ( | void | ) | const [inline] |
Verifies if this mesh is valid (halfedge data structure is ok)
A valid mesh is also a consistent mesh, so this function overlaps the is_consistent function.
void a48::MeshT< Traits >::set_base | ( | const unsigned int & | nv, |
const unsigned int & | nf, | ||
const unsigned int * | conn, | ||
const unsigned int & | nvf = 3 |
||
) | [inline] |
Sets the base mesh.
All the vertices of the mesh will be instantiated through the add_vertex() method and the items policy (if any) will be used to set vertex attributes. Note that the order of the vertices in the mesh container (accessed by the vertices_begin() method) is not guaranteed to complain with the input connectivity array, for that reason a temporary container is created to store vertex_type*'s in the correct order. The base-mesh connnectivity must be given in the same orientation to ensure that opposite halfedges go in opposite directions.
[in] | nv | Number of vertices in the base mesh |
[in] | nf | Number of faces in the base mesh |
[in] | conn | Connectivity describing base-mesh topology |
[in] | nvf | Number of vertices per face (default 3 = triangle mesh) |
Definition at line 437 of file mesht.hh.
References a48::MeshT< Traits >::add_vertex(), a48::MeshT< Traits >::clear(), and a48::BaseItemsPolicy< Traits >::set_vertex_attributes().
void a48::MeshT< Traits >::set_base | ( | vertex_type ** | verts, |
const unsigned int * | conn, | ||
const unsigned int & | nf, | ||
const unsigned int & | nvf = 3 |
||
) | [inline] |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
All the vertices of the mesh must have been defined previously through the add_vertex() method. The base-mesh connnectivity must be given in the same orientation.
[in,out] | verts | An array of vertex_type pointers previously defined |
[in] | conn | Connectivity describing base-mesh topology |
[in] | nf | Number of faces in the base mesh |
[in] | nvf | Number of vertices per face (default 3 = triangle mesh) |
Definition at line 465 of file mesht.hh.
References a48::MeshT< Traits >::add_face(), a48::MeshT< Traits >::add_halfedge(), a48::MeshT< Traits >::fix_vertices_stars(), a48::BaseItemsPolicy< Traits >::set_face_attributes(), and a48::BaseItemsPolicy< Traits >::set_halfedge_attributes().
void a48::MeshT< Traits >::set_items_policy | ( | items_policy * | _ip | ) | [inline] |
Set Items Policy for this mesh.
[in] | _ip | Items Policy to be used by this mesh |
unsigned int a48::MeshT< Traits >::size_of_vertices | ( | void | ) | const [inline] |
unsigned int a48::MeshT< Traits >::size_of_halfedges | ( | void | ) | const [inline] |
unsigned int a48::MeshT< Traits >::size_of_faces | ( | void | ) | const [inline] |
const vertex_container& a48::MeshT< Traits >::set_of_vertices | ( | void | ) | const [inline] |
const halfedge_container& a48::MeshT< Traits >::set_of_halfedges | ( | void | ) | const [inline] |
const face_container& a48::MeshT< Traits >::set_of_faces | ( | void | ) | const [inline] |
items_policy* a48::MeshT< Traits >::get_items_policy | ( | void | ) | [inline] |
const items_policy * a48::MeshT< Traits >::get_items_policy | ( | void | ) | const [inline] |
vertex_iterator a48::MeshT< Traits >::vertices_begin | ( | void | ) | [inline] |
vertex_const_iterator a48::MeshT< Traits >::vertices_begin | ( | void | ) | const [inline] |
vertex_iterator a48::MeshT< Traits >::vertices_end | ( | void | ) | [inline] |
vertex_const_iterator a48::MeshT< Traits >::vertices_end | ( | void | ) | const [inline] |
halfedge_iterator a48::MeshT< Traits >::halfedges_begin | ( | void | ) | [inline] |
halfedge_const_iterator a48::MeshT< Traits >::halfedges_begin | ( | void | ) | const [inline] |
halfedge_iterator a48::MeshT< Traits >::halfedges_end | ( | void | ) | [inline] |
halfedge_const_iterator a48::MeshT< Traits >::halfedges_end | ( | void | ) | const [inline] |
face_iterator a48::MeshT< Traits >::faces_begin | ( | void | ) | [inline] |
face_const_iterator a48::MeshT< Traits >::faces_begin | ( | void | ) | const [inline] |
face_iterator a48::MeshT< Traits >::faces_end | ( | void | ) | [inline] |
face_const_iterator a48::MeshT< Traits >::faces_end | ( | void | ) | const [inline] |
bool make_consistent | ( | Mesh & | _m | ) | [related] |
Reset halfedge orientations to make the mesh consistent.
If one mesh face is not given in the same orientation of the others then some opposed halfedges are going in the same direction and the mesh is not consistent.
[in,out] | _m | The input mesh to make consistent |
Mesh | Base mesh class must be derived from |