ug4
ug::SubdivisionProjector Class Reference

Applies piecewise smooth loop subdivision rules. More...

#include <subdivision_projector.h>

+ Inheritance diagram for ug::SubdivisionProjector:

Public Member Functions

virtual number new_vertex (Vertex *vrt, Edge *parent)
 called when a new vertex was created from an old edge. More...
 
virtual void refinement_begins (const ISubGrid *sg)
 called before refinement begins More...
 
virtual bool refinement_begins_requires_subgrid () const
 
virtual void refinement_ends ()
 called when refinement is done More...
 
virtual void set_concerned_elements (SPElementCallback cb)
 
virtual void set_crease_callback (Grid::edge_traits::callback cbIsCrease)
 
virtual void set_geometry (SPIGeometry3d geometry)
 
 SubdivisionProjector ()
 
 SubdivisionProjector (Grid::edge_traits::callback cbIsCrease)
 
 SubdivisionProjector (SPIGeometry3d geometry)
 
 SubdivisionProjector (SPIGeometry3d geometry, Grid::edge_traits::callback cbIsCrease)
 
- Public Member Functions inherited from ug::RefinementProjector
virtual SPIGeometry3d geometry () const
 
virtual number new_vertex (Vertex *vrt, Face *parent)
 called when a new vertex was created from an old face. More...
 
virtual number new_vertex (Vertex *vrt, Vertex *parent)
 called when a new vertex was created from an old vertex. More...
 
virtual number new_vertex (Vertex *vrt, Volume *parent)
 called when a new vertex was created from an old volume. More...
 
 RefinementProjector ()
 
 RefinementProjector (SPElementCallback cb)
 
 RefinementProjector (SPIGeometry3d geometry)
 
 RefinementProjector (SPIGeometry3d geometry, SPElementCallback concernedElems)
 
virtual ~RefinementProjector ()
 

Protected Member Functions

size_t concerned_nbr_faces (Edge *edge, Grid::face_traits::secure_container *assFaces=NULL, Face *facesOut[2]=NULL)
 
size_t nbr_crease_edges (Vertex *vrt, Grid::edge_traits::secure_container *assEdges=NULL, Edge *creaseEdgesOut[2]=NULL)
 
- Protected Member Functions inherited from ug::RefinementProjector
IGeometry3dgeom ()
 
const IGeometry3dgeom () const
 
template<class TElem >
bool is_concerned (TElem *e)
 
vector3 pos (Vertex *v) const
 
void set_pos (Vertex *v, const vector3 &p)
 

Private Types

typedef std::vector< std::pair< Vertex *, vector3 > > new_pos_vec_t
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

Grid::edge_traits::callback m_cbIsCrease
 
bool m_customConcernedElementsCallbackUsed
 
new_pos_vec_t m_newPositions
 

Friends

class boost::serialization::access
 

Detailed Description

Applies piecewise smooth loop subdivision rules.

Warning
The implementation assumes that vertices which are passed to 'refinement_begins' still exist in the underlying grid when 'refinement_ends' is called.

Member Typedef Documentation

◆ new_pos_vec_t

typedef std::vector<std::pair<Vertex*, vector3> > ug::SubdivisionProjector::new_pos_vec_t
private

Constructor & Destructor Documentation

◆ SubdivisionProjector() [1/4]

ug::SubdivisionProjector::SubdivisionProjector ( )
inline

◆ SubdivisionProjector() [2/4]

ug::SubdivisionProjector::SubdivisionProjector ( Grid::edge_traits::callback  cbIsCrease)
inline

◆ SubdivisionProjector() [3/4]

ug::SubdivisionProjector::SubdivisionProjector ( SPIGeometry3d  geometry)
inline

◆ SubdivisionProjector() [4/4]

ug::SubdivisionProjector::SubdivisionProjector ( SPIGeometry3d  geometry,
Grid::edge_traits::callback  cbIsCrease 
)
inline

Member Function Documentation

◆ concerned_nbr_faces()

size_t ug::SubdivisionProjector::concerned_nbr_faces ( Edge edge,
Grid::face_traits::secure_container assFaces = NULL,
Face facesOut[2] = NULL 
)
protected

◆ nbr_crease_edges()

size_t ug::SubdivisionProjector::nbr_crease_edges ( Vertex vrt,
Grid::edge_traits::secure_container assEdges = NULL,
Edge creaseEdgesOut[2] = NULL 
)
protected

◆ new_vertex()

◆ refinement_begins()

void ug::SubdivisionProjector::refinement_begins ( const ISubGrid sg)
virtual

called before refinement begins

if not NULL, the specified sub-grid will contains all elements that will be refined and are affected by the given projector.

If the specialized implementation of refinement_begins requires this subgrid, the method 'refinement_begins_requires_subgrid' should be specialized and should return 'true'. In this case the subgrid should always be provided by the caller. If you call 'RefinementProjector::refinement_begins(sg);' at the beginning of your specialization, an error will be thrown if this is not the case.

Reimplemented from ug::RefinementProjector.

References ug::Grid::associated_elements(), ug::GetConnectedVertex(), ug::ISubGrid::goc(), lg_end_for, lg_for_each_const, p, ug::SubdivRules_PLoop::ref_even_crease_weights(), ug::SubdivRules_PLoop::ref_even_inner_center_weight(), ug::SubdivRules_PLoop::ref_even_inner_nbr_weight(), ug::PointerConstArray< TPtr >::size(), ug::VecAdd(), ug::VecScaleAdd(), and ug::VecSet().

◆ refinement_begins_requires_subgrid()

virtual bool ug::SubdivisionProjector::refinement_begins_requires_subgrid ( ) const
inlinevirtual

returns 'true' if a specialized projector requires the subgrid during its 'refinement_begins' method.

Note
Implementers of derived classes should overload this method and return 'true' if their 'refinement_begins' method requires a subgrid. Please have a look at the documentation of 'RefinementProjector::refinement_begins' for more information.

Reimplemented from ug::RefinementProjector.

◆ refinement_ends()

void ug::SubdivisionProjector::refinement_ends ( )
virtual

called when refinement is done

Reimplemented from ug::RefinementProjector.

References ug::MultiGrid::get_child_vertex().

◆ serialize()

template<class Archive >
void ug::SubdivisionProjector::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprivate

◆ set_concerned_elements()

virtual void ug::SubdivisionProjector::set_concerned_elements ( SPElementCallback  cb)
inlinevirtual

◆ set_crease_callback()

virtual void ug::SubdivisionProjector::set_crease_callback ( Grid::edge_traits::callback  cbIsCrease)
inlinevirtual

References m_cbIsCrease.

◆ set_geometry()

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ m_cbIsCrease

Grid::edge_traits::callback ug::SubdivisionProjector::m_cbIsCrease
private

Referenced by set_crease_callback().

◆ m_customConcernedElementsCallbackUsed

bool ug::SubdivisionProjector::m_customConcernedElementsCallbackUsed
private

◆ m_newPositions

new_pos_vec_t ug::SubdivisionProjector::m_newPositions
private

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