Developer Documentation
OpenMesh::Subdivider::Adaptive::CompositeT< M > Class Template Reference

#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Tools/Subdivider/Adaptive/Composite/CompositeT.hh>

Public Types

typedef RuleInterfaceT< M > Rule
 
typedef M Mesh
 
typedef std::vector< Rule * > RuleSequence
 
typedef M::VertexHandle VH
 
typedef M::FaceHandle FH
 
typedef M::EdgeHandle EH
 
typedef M::HalfedgeHandle HH
 

Public Member Functions

 CompositeT (Mesh &_mesh)
 Constructor. More...
 
void cleanup (void)
 
bool initialize (void)
 Initialize faces, edges, vertices, and rules. More...
 
void refine (typename M::FaceHandle &_fh)
 Refine one face. More...
 
void refine (typename M::VertexHandle &_vh)
 Raise one vertex to next final level. More...
 
int subdiv_type ()
 Return subdivision split type (3 for 1-to-3 split, 4 for 1-to-4 split). More...
 
const Rulesubdiv_rule () const
 

Managing composite rules

RuleSequence rule_sequence_
 
int subdiv_type_
 
Rulesubdiv_rule_
 
Mesh & mesh_
 
template<typename R >
RuleHandleT< R > add ()
 
template<typename R >
RuleHandleT< R > & add (RuleHandleT< R > &_rh)
 
template<typename R >
RuleHandleT< R >::Rule & rule (const RuleHandleT< R > &_rh)
 
RuleInterfaceT< M > & rule (size_t _idx)
 
size_t n_rules () const
 Number of rules in the rule sequence. More...
 
std::string rules_as_string (const std::string &_sep=" * ") const
 Return the sequence as string. More...
 
const RuleSequence & rules () const
 The rule sequence. More...
 
state_t generation (state_t _s) const
 
state_t generation (VH _vh) const
 
state_t generation (EH _eh) const
 
state_t generation (FH _fh) const
 
Rulet_rule () const
 
Rulef_rule ()
 
Rulel_rule ()
 
 CompositeT (const CompositeT &)
 
CompositeToperator= (const CompositeT)
 

Detailed Description

template<typename M>
class OpenMesh::Subdivider::Adaptive::CompositeT< M >

Adaptive Composite Subdivision framework.

The adaptive composite subdivision framework is based on the work done by P. Oswald and P. Schroeder. This framework elevates the uniform case of the composite scheme to the adaptive setting.

For details on the composite scheme refer to

For details on the transition from uniform to adaptive composite subdivision please refer to

In the composite scheme a subdivision operator is created by combining smaller "atomic" rules. Depending on the selection and ordering of the operator many known subdivision schemes can be created.

Every rule inherits from RuleInterfaceT and is represented out of the subdivider object by a RuleHandleT (as usual within OpenMesh). You can add rules using the CompositeT::add() functions. The correct order of adding the rules is very important, and furthermore not all rules get along with each other very well. (Please read the given literature, especially the paper by Oswald and Schr�der.)

To use a composite subdivider first define a rule sequence describing the order of execution of the rules. In the order the rules habe been added they will be executed. E.g. the rules given in operator notation have to added from right to left.

After the rule sequence has been defined the subdivider has to be intialized using CompositeT::initialize(). If everything went well, use CompositeT::refine() to subdivide locally a face or vertex.

Note
Not all (topological) operators have been implemented!
Only triangle meshes are supported.
The rule sequence must begin with a topological operator.
See also
RuleInterfaceT, RuleHandleT

Definition at line 133 of file CompositeT.hh.

Member Typedef Documentation

◆ EH

template<typename M >
typedef M::EdgeHandle OpenMesh::Subdivider::Adaptive::CompositeT< M >::EH

Definition at line 143 of file CompositeT.hh.

◆ FH

template<typename M >
typedef M::FaceHandle OpenMesh::Subdivider::Adaptive::CompositeT< M >::FH

Definition at line 142 of file CompositeT.hh.

◆ HH

template<typename M >
typedef M::HalfedgeHandle OpenMesh::Subdivider::Adaptive::CompositeT< M >::HH

Definition at line 144 of file CompositeT.hh.

◆ Mesh

template<typename M >
typedef M OpenMesh::Subdivider::Adaptive::CompositeT< M >::Mesh

Definition at line 138 of file CompositeT.hh.

◆ Rule

template<typename M >
typedef RuleInterfaceT<M> OpenMesh::Subdivider::Adaptive::CompositeT< M >::Rule

Definition at line 137 of file CompositeT.hh.

◆ RuleSequence

template<typename M >
typedef std::vector<Rule*> OpenMesh::Subdivider::Adaptive::CompositeT< M >::RuleSequence

Definition at line 139 of file CompositeT.hh.

◆ VH

template<typename M >
typedef M::VertexHandle OpenMesh::Subdivider::Adaptive::CompositeT< M >::VH

Definition at line 141 of file CompositeT.hh.

Constructor & Destructor Documentation

◆ CompositeT() [1/2]

template<typename M >
OpenMesh::Subdivider::Adaptive::CompositeT< M >::CompositeT ( Mesh &  _mesh)
inlineexplicit

Constructor.

Definition at line 149 of file CompositeT.hh.

◆ ~CompositeT()

template<typename M >
virtual OpenMesh::Subdivider::Adaptive::CompositeT< M >::~CompositeT ( )
inlinevirtual

Definition at line 155 of file CompositeT.hh.

◆ CompositeT() [2/2]

template<typename M >
OpenMesh::Subdivider::Adaptive::CompositeT< M >::CompositeT ( const CompositeT< M > &  )
private

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Member Function Documentation

◆ add() [1/2]

template<typename M >
template<typename R >
RuleHandleT< R > OpenMesh::Subdivider::Adaptive::CompositeT< M >::add ( )
inline

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 201 of file CompositeT.hh.

◆ add() [2/2]

template<typename M >
template<typename R >
RuleHandleT< R > & OpenMesh::Subdivider::Adaptive::CompositeT< M >::add ( RuleHandleT< R > &  _rh)
inline

Add new rule to rule sequence by passing an appropriate handle to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 213 of file CompositeT.hh.

◆ cleanup()

template<typename M >
void OpenMesh::Subdivider::Adaptive::CompositeT< M >::cleanup ( void  )
inline

Reset self to state after the default constructor except of the mesh.

Definition at line 161 of file CompositeT.hh.

◆ f_rule()

template<typename M >
Rule * OpenMesh::Subdivider::Adaptive::CompositeT< M >::f_rule ( )
inlineprivate

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 268 of file CompositeT.hh.

◆ generation() [1/4]

template<typename M >
state_t OpenMesh::Subdivider::Adaptive::CompositeT< M >::generation ( EH  _eh) const
inlineprotected

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 261 of file CompositeT.hh.

◆ generation() [2/4]

template<typename M >
state_t OpenMesh::Subdivider::Adaptive::CompositeT< M >::generation ( FH  _fh) const
inlineprotected

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 262 of file CompositeT.hh.

◆ generation() [3/4]

template<typename M >
state_t OpenMesh::Subdivider::Adaptive::CompositeT< M >::generation ( state_t  _s) const
inlineprotected

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 259 of file CompositeT.hh.

◆ generation() [4/4]

template<typename M >
state_t OpenMesh::Subdivider::Adaptive::CompositeT< M >::generation ( VH  _vh) const
inlineprotected

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 260 of file CompositeT.hh.

◆ initialize()

template<class M >
bool OpenMesh::Subdivider::Adaptive::CompositeT< M >::initialize ( void  )

Initialize faces, edges, vertices, and rules.

Definition at line 76 of file CompositeT_impl.hh.

◆ l_rule()

template<typename M >
Rule * OpenMesh::Subdivider::Adaptive::CompositeT< M >::l_rule ( )
inlineprivate

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 269 of file CompositeT.hh.

◆ n_rules()

template<typename M >
size_t OpenMesh::Subdivider::Adaptive::CompositeT< M >::n_rules ( ) const
inline

Number of rules in the rule sequence.

Definition at line 244 of file CompositeT.hh.

◆ operator=()

template<typename M >
CompositeT & OpenMesh::Subdivider::Adaptive::CompositeT< M >::operator= ( const  CompositeT)
private

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

◆ refine() [1/2]

template<class M >
void OpenMesh::Subdivider::Adaptive::CompositeT< M >::refine ( typename M::FaceHandle &  _fh)

Refine one face.

Definition at line 174 of file CompositeT_impl.hh.

◆ refine() [2/2]

template<class M >
void OpenMesh::Subdivider::Adaptive::CompositeT< M >::refine ( typename M::VertexHandle &  _vh)

Raise one vertex to next final level.

Definition at line 275 of file CompositeT_impl.hh.

◆ rule() [1/2]

template<typename M >
template<typename R >
RuleHandleT< R >::Rule & OpenMesh::Subdivider::Adaptive::CompositeT< M >::rule ( const RuleHandleT< R > &  _rh)
inline

Get rule in the rule sequence by a handle.

Returns
The wanted rule if the handle is valid. The return value is undefined if the handle is invalid!

Definition at line 224 of file CompositeT.hh.

◆ rule() [2/2]

template<typename M >
RuleInterfaceT< M > & OpenMesh::Subdivider::Adaptive::CompositeT< M >::rule ( size_t  _idx)
inline

Get rule (interface) by index

Returns
The wanted rule if the handle is valid. The return value is undefined if the handle is invalid!

Definition at line 237 of file CompositeT.hh.

◆ rules()

template<typename M >
const RuleSequence & OpenMesh::Subdivider::Adaptive::CompositeT< M >::rules ( ) const
inlineprotected

The rule sequence.

Definition at line 254 of file CompositeT.hh.

◆ rules_as_string()

template<class M >
std::string OpenMesh::Subdivider::Adaptive::CompositeT< M >::rules_as_string ( const std::string &  _sep = " * ") const

Return the sequence as string.

Definition at line 289 of file CompositeT_impl.hh.

◆ subdiv_rule()

template<typename M >
const Rule & OpenMesh::Subdivider::Adaptive::CompositeT< M >::subdiv_rule ( ) const
inline

Definition at line 189 of file CompositeT.hh.

◆ subdiv_type()

template<typename M >
int OpenMesh::Subdivider::Adaptive::CompositeT< M >::subdiv_type ( )
inline

Return subdivision split type (3 for 1-to-3 split, 4 for 1-to-4 split).

Definition at line 185 of file CompositeT.hh.

◆ t_rule()

template<typename M >
Rule * OpenMesh::Subdivider::Adaptive::CompositeT< M >::t_rule ( ) const
inlineprivate

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 267 of file CompositeT.hh.

Member Data Documentation

◆ mesh_

template<typename M >
Mesh& OpenMesh::Subdivider::Adaptive::CompositeT< M >::mesh_
private

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 284 of file CompositeT.hh.

◆ rule_sequence_

template<typename M >
RuleSequence OpenMesh::Subdivider::Adaptive::CompositeT< M >::rule_sequence_
private

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 274 of file CompositeT.hh.

◆ subdiv_rule_

template<typename M >
Rule* OpenMesh::Subdivider::Adaptive::CompositeT< M >::subdiv_rule_
private

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 279 of file CompositeT.hh.

◆ subdiv_type_

template<typename M >
int OpenMesh::Subdivider::Adaptive::CompositeT< M >::subdiv_type_
private

Add new rule to rule sequence by passing the type of the wanted rule as template argument to the method.

Returns
Valid handle on success. Else it is invalid.

Definition at line 277 of file CompositeT.hh.


The documentation for this class was generated from the following files: