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

Adaptive mesh type (considering triangular faces) More...

#include <adaptivemesht.hh>

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

List of all members.

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_policyget_adaptive_policy (void)
 Get Adaptive Policy of this mesh.
const adaptive_policyget_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)

Detailed Description

template<class Traits = DefaultAdaptiveTraits>
class a48::AdaptiveMeshT< Traits >

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}
}   
Note:
All stellar operators can be used in an adaptive mesh. Although the flip operation is not used in the simplify/refine adaptation scheme (only split and weld operations are), it can be used to make a given triangulated mesh in a tri-quad mesh (a triangle mesh with a quadrilateral structure).
Template Parameters:
Traitstemplate argument to define mesh traits
Examples:
example_adaptivemesht.cc, example_adaptivepolicy.cc, example_adaptivetraits.h, example_gl.cc, and example_meshalgorithms.cc.

Definition at line 159 of file adaptivemesht.hh.


Member Typedef Documentation

template<class Traits = DefaultAdaptiveTraits>
typedef BaseItemsPolicy< Traits > a48::AdaptiveMeshT< Traits >::items_policy

items policy definition

Reimplemented from a48::StellarMeshT< Traits >.

Definition at line 163 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
typedef BaseStellarPolicy< Traits > a48::AdaptiveMeshT< Traits >::stellar_policy

stellar policy definition

Reimplemented from a48::StellarMeshT< Traits >.

Definition at line 164 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
typedef BaseAdaptivePolicy< Traits > a48::AdaptiveMeshT< Traits >::adaptive_policy

adaptive policy definition

Definition at line 165 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
typedef Traits::vertex_type a48::AdaptiveMeshT< Traits >::vertex_type

vertex definition

Reimplemented from a48::StellarMeshT< Traits >.

Definition at line 167 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
typedef Traits::halfedge_type a48::AdaptiveMeshT< Traits >::halfedge_type

halfedge definition

Reimplemented from a48::StellarMeshT< Traits >.

Definition at line 168 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
typedef Traits::face_type a48::AdaptiveMeshT< Traits >::face_type

face definition

Reimplemented from a48::StellarMeshT< Traits >.

Definition at line 169 of file adaptivemesht.hh.


Constructor & Destructor Documentation

template<class Traits = DefaultAdaptiveTraits>
a48::AdaptiveMeshT< Traits >::AdaptiveMeshT ( ) [inline]

Default Constructor.

Definition at line 172 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
a48::AdaptiveMeshT< Traits >::AdaptiveMeshT ( adaptive_policy _ap) [inline]

Constructor

Parameters:
[in]_apAdaptive Policy to be used by this mesh
See also:
BaseAdaptivePolicy

Definition at line 178 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
a48::AdaptiveMeshT< Traits >::AdaptiveMeshT ( items_policy _ip,
stellar_policy _sp = 0,
adaptive_policy _ap = 0 
) [inline]

Constructor

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

Definition at line 188 of file adaptivemesht.hh.

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

Copy Constructor

Parameters:
[in]_mCopy mesh

Definition at line 196 of file adaptivemesht.hh.


Member Function Documentation

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

Assign operator.

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

Definition at line 202 of file adaptivemesht.hh.

References a48::AdaptiveMeshT< Traits >::get_adaptive_policy().

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

Returns:
True if this mesh is a tri-quad mesh

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().

template<class Traits = DefaultAdaptiveTraits>
void a48::AdaptiveMeshT< Traits >::set_adaptive_policy ( adaptive_policy _ap) [inline]

Set Adaptive Policy for this mesh.

Parameters:
[in]_apAdaptive Policy to be used by this mesh
See also:
BaseAdaptivePolicy

Definition at line 242 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
adaptive_policy* a48::AdaptiveMeshT< Traits >::get_adaptive_policy ( void  ) [inline]

Get Adaptive Policy of this mesh.

Returns:
Adaptive Policy used by this mesh
See also:
BaseAdaptivePolicy

Definition at line 253 of file adaptivemesht.hh.

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

Returns:
Adaptive Policy (constant) used by this mesh

Definition at line 258 of file adaptivemesht.hh.

template<class Traits = DefaultAdaptiveTraits>
void a48::AdaptiveMeshT< Traits >::simplify ( vertex_type v) [inline]

Simplify current mesh.

Parameters:
[in,out]vVertex to be simplified/welded (removed)
See also:
StellarMeshT::weld

Definition at line 269 of file adaptivemesht.hh.

References a48::BaseAdaptivePolicy< Traits >::update_simplification(), and a48::StellarMeshT< Traits >::weld().

template<class Traits = DefaultAdaptiveTraits>
void a48::AdaptiveMeshT< Traits >::refine ( halfedge_type h) [inline]

Refine current mesh.

Parameters:
[in,out]hHalfedge to be refined/splitted
See also:
StellarMeshT::split

Definition at line 303 of file adaptivemesht.hh.

References a48::StellarMeshT< Traits >::split(), and a48::BaseAdaptivePolicy< Traits >::update_refinement().

template<class Traits = DefaultAdaptiveTraits>
void a48::AdaptiveMeshT< Traits >::adapt_simplify ( void  ) [inline]
template<class Traits = DefaultAdaptiveTraits>
void a48::AdaptiveMeshT< Traits >::adapt_refine ( void  ) [inline]

Friends And Related Function Documentation

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

Parameters:
[in]_mThe mesh to be written
[in,out]_outThe output stream to write the mesh to
[in]_wqWrite quad flag enables to write quad faces to the output
[in]_frattFunction to retrieve attributes of each vertex
[in]_fridFunction to retrieve the index of each vertex
Returns:
True if it succeed in writing the mesh
Template Parameters:
MeshBase mesh class must be derived from
See also:
MeshT

Definition at line 185 of file mesh.hh.

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

Parameters:
[in]_mThe mesh to be written
[in]_fnFile name (C string) to be written
[in]_wqWrite quad flag enables to write quad faces to the output
[in]_frattFunction to retrieve attributes of each vertex
[in]_fridFunction to retrieve the index of each vertex
Returns:
True if it succeed in writing the mesh
Template Parameters:
MeshBase mesh class must be derived from
See also:
MeshT

Definition at line 287 of file mesh.hh.

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

Parameters:
[out]_mThe mesh to be returned
[in,out]_inThe input stream to read the mesh from
[in]_fsattFunction to set the attributes of each vertex
[in]_fsidFunction to set the index of each vertex
Returns:
True if it succeed in reading the mesh
Template Parameters:
MeshBase mesh class must be derived from
See also:
MeshT

Definition at line 323 of file mesh.hh.

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

Parameters:
[out]_mThe mesh to be returned
[in]_fnFile name (C string) to be read
[in]_fsattFunction to set the attributes of each vertex
[in]_fsidFunction to set the index of each vertex
Returns:
True if it succeed in reading the mesh
Template Parameters:
MeshBase mesh class must be derived from
See also:
MeshT

Definition at line 413 of file mesh.hh.


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