ug4
ug::DelaunayInfo< TAAPos > Class Template Reference

#include <delaunay_info.h>

+ Inheritance diagram for ug::DelaunayInfo< TAAPos >:

Classes

struct  CompareFaceInfo
 
struct  FaceInfo
 

Public Types

enum  Mark {
  NONE , INNER , NEW_INNER , SEGMENT ,
  NEW_SEGMENT , DART , SHELL
}
 

Public Member Functions

 DelaunayInfo (Grid &g, TAAPos &aaPos, Grid::edge_traits::callback cbConstrainedEdge)
 
virtual void edge_created (Grid *grid, Edge *e, GridObject *pParent, bool replacesParent)
 Notified whenever a new element of the given type is created in the given grid. More...
 
virtual void edge_to_be_erased (Grid *grid, Edge *e, Edge *replacedBy)
 Notified whenever an element of the given type is erased from the given grid. More...
 
virtual void face_created (Grid *grid, Face *f, GridObject *pParent, bool replacesParent)
 Notified whenever a new element of the given type is created in the given grid. More...
 
virtual void face_to_be_erased (Grid *grid, Face *f, Face *replacedBy)
 Notified whenever an element of the given type is erased from the given grid. More...
 
Gridgrid ()
 
template<class TIter >
void init_marks (TIter trisBegin, TIter trisEnd, bool pushFlipCandidates)
 
bool is_classifiable (Face *f)
 returns true if the face can be classified More...
 
bool is_dart_segment (Edge *e)
 returns true if the specified edge is a segment and is connected to a DART vertex More...
 
bool is_dart_shell_segment (Edge *e)
 returns true if the specified edge is a segment and connects a DART and a SHELL vertex More...
 
template<class TElem >
bool is_inner (TElem *e)
 returns true if the specified element is either marked as INNER or as NEW_INNER More...
 
bool is_new_dart_segment (Edge *e)
 returns true if the specified edge is a new segment and is connected to a DART vertex More...
 
template<class TElem >
bool is_segment (TElem *e)
 returns true if the specified element is either marked as SEGMENT, NEW_SEGMENT, DART or SHELL More...
 
Mark mark (Edge *e) const
 
Mark mark (Face *f) const
 
Mark mark (Vertex *v) const
 
AAPosposition_accessor ()
 
void set_mark (Edge *e, Mark m)
 
void set_mark (Face *f, Mark m)
 
template<class TAAPos >
void set_mark (Face *f, typename DelaunayInfo< TAAPos >::Mark mark)
 
template<class TIter >
void set_mark (TIter begin, TIter end, Mark m)
 
void set_mark (Vertex *v, Mark m)
 
void start_candidate_recording ()
 newly created edges will be recorded as possible new candidates More...
 
void stop_candidate_recording ()
 stops candidate recording and pushes all valid recorded edges to the list of real candidates More...
 
virtual void vertex_created (Grid *grid, Vertex *vrt, GridObject *pParent, bool replacesParent)
 Notified whenever a new element of the given type is created in the given grid. More...
 
 ~DelaunayInfo ()
 
bool is_candidate (Edge *e)
 
void push_candidate (Edge *e)
 
Edgepop_candidate ()
 
bool candidates_left ()
 
bool classified_faces_left ()
 
Facepop_classified_face ()
 
bool face_classification_enabled ()
 
void enable_face_classification (number minAngle)
 
number min_angle () const
 
number max_dot () const
 
- Public Member Functions inherited from ug::GridObserver
virtual void elements_to_be_cleared (Grid *grid)
 
virtual void grid_to_be_destroyed (Grid *grid)
 
virtual ~GridObserver ()
 
virtual void volume_created (Grid *grid, Volume *vol, GridObject *pParent=NULL, bool replacesParent=false)
 Notified whenever a new element of the given type is created in the given grid. More...
 
virtual void vertex_to_be_erased (Grid *grid, Vertex *vrt, Vertex *replacedBy=NULL)
 Notified whenever an element of the given type is erased from the given grid. More...
 
virtual void volume_to_be_erased (Grid *grid, Volume *vol, Volume *replacedBy=NULL)
 Notified whenever an element of the given type is erased from the given grid. More...
 
virtual void vertices_to_be_merged (Grid *grid, Vertex *target, Vertex *elem1, Vertex *elem2)
 Notified when two elements of the same type are going to be merged. More...
 
virtual void edges_to_be_merged (Grid *grid, Edge *target, Edge *elem1, Edge *elem2)
 Notified when two elements of the same type are going to be merged. More...
 
virtual void faces_to_be_merged (Grid *grid, Face *target, Face *elem1, Face *elem2)
 Notified when two elements of the same type are going to be merged. More...
 
virtual void volumes_to_be_merged (Grid *grid, Volume *target, Volume *elem1, Volume *elem2)
 Notified when two elements of the same type are going to be merged. More...
 

Private Types

typedef TAAPos AAPos
 
typedef Attachment< FaceInfo * > AFaceInfo
 
typedef std::priority_queue< FaceInfo *, std::vector< FaceInfo * >, CompareFaceInfoFacePriorityQueue
 
typedef TAAPos::ValueType vector_t
 

Private Member Functions

bool classify_face (Face *f)
 
bool is_classified (Face *f)
 

Private Attributes

Grid::AttachmentAccessor< Edge, ABoolm_aaCandidateEDGE
 
Grid::AttachmentAccessor< Face, AFaceInfom_aaFaceInfo
 
MultiElementAttachmentAccessor< ABytem_aaMark
 
AAPos m_aaPos
 
ABool m_aCandidate
 
AFaceInfo m_aFaceInfo
 
AByte m_aMark
 
bool m_candidateRecordingEnabled
 
Grid::edge_traits::callback m_cbConstrainedEdge
 
FacePriorityQueue m_faceQueue
 
Gridm_grid
 
number m_maxDot
 
number m_minAngle
 
std::queue< Edge * > m_qEdgeCandidates
 
std::vector< Edge * > m_recordedCandidates
 

Detailed Description

template<class TAAPos>
class ug::DelaunayInfo< TAAPos >

This class intended for internal use in delaunay related algorithms.

Member Typedef Documentation

◆ AAPos

template<class TAAPos >
typedef TAAPos ug::DelaunayInfo< TAAPos >::AAPos
private

◆ AFaceInfo

template<class TAAPos >
typedef Attachment<FaceInfo*> ug::DelaunayInfo< TAAPos >::AFaceInfo
private

◆ FacePriorityQueue

template<class TAAPos >
typedef std::priority_queue<FaceInfo*, std::vector<FaceInfo*>, CompareFaceInfo> ug::DelaunayInfo< TAAPos >::FacePriorityQueue
private

◆ vector_t

template<class TAAPos >
typedef TAAPos::ValueType ug::DelaunayInfo< TAAPos >::vector_t
private

Member Enumeration Documentation

◆ Mark

template<class TAAPos >
enum ug::DelaunayInfo::Mark
Enumerator
NONE 
INNER 
NEW_INNER 
SEGMENT 
NEW_SEGMENT 
DART 
SHELL 

Constructor & Destructor Documentation

◆ DelaunayInfo()

◆ ~DelaunayInfo()

template<class TAAPos >
ug::DelaunayInfo< TAAPos >::~DelaunayInfo

Member Function Documentation

◆ candidates_left()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::candidates_left ( )
inline

candidates are used during MakeDelaunay to define the set of edges which may have to be swapped to obtain a delaunay triangulation.

Referenced by ug::MakeDelaunay().

◆ classified_faces_left()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::classified_faces_left

Face classification is used to define and order the set of faces which whose circumcenter may have to be inserted in order to obtain a delaunay- triangulation with prescribed minimal angle during QualityGridGeneration. Face classification is not required for MakeDelaunay.

References ug::DelaunayInfo< TAAPos >::FaceInfo::f.

Referenced by ug::QualityGridGeneration().

◆ classify_face()

◆ edge_created()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::edge_created ( Grid grid,
Edge e,
GridObject pParent,
bool  replacesParent 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

Reimplemented from ug::GridObserver.

References ug::GridObject::base_object_id(), and ug::EDGE.

◆ edge_to_be_erased()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::edge_to_be_erased ( Grid grid,
Edge e,
Edge replacedBy 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

Reimplemented from ug::GridObserver.

◆ enable_face_classification()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::enable_face_classification ( number  minAngle)

Face classification is used to define and order the set of faces which whose circumcenter may have to be inserted in order to obtain a delaunay- triangulation with prescribed minimal angle during QualityGridGeneration. Face classification is not required for MakeDelaunay.

References ug::deg_to_rad(), and ug::DelaunayInfo< TAAPos >::FaceInfo::f.

Referenced by ug::QualityGridGeneration().

◆ face_classification_enabled()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::face_classification_enabled ( )
inline

Face classification is used to define and order the set of faces which whose circumcenter may have to be inserted in order to obtain a delaunay- triangulation with prescribed minimal angle during QualityGridGeneration. Face classification is not required for MakeDelaunay.

◆ face_created()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::face_created ( Grid grid,
Face f,
GridObject pParent,
bool  replacesParent 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

Reimplemented from ug::GridObserver.

References ug::GridObject::base_object_id(), and ug::FACE.

◆ face_to_be_erased()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::face_to_be_erased ( Grid grid,
Face f,
Face replacedBy 
)
virtual

Notified whenever an element of the given type is erased from the given grid.

Erase callbacks are called in reverse order in which the GridObservers were registered at the given grid.

if replacedBy != NULL the erased object is only replaced by another grid object of the same base type. This usually happens when constraining objects are replaced by regular objects in refinements. (E.g. a constraining edge by become a regular Edge; note that both objects are of type Edge*).

Reimplemented from ug::GridObserver.

References ug::NONE.

◆ grid()

template<class TAAPos >
Grid& ug::DelaunayInfo< TAAPos >::grid ( )
inline

Referenced by ug::MakeDelaunay().

◆ init_marks()

template<class TAAPos >
template<class TIter >
void ug::DelaunayInfo< TAAPos >::init_marks ( TIter  trisBegin,
TIter  trisEnd,
bool  pushFlipCandidates 
)
Warning
init_marks may currently only be called once! Undefined behaviour if called multiple times or after marks have already been set.
Todo:
think about adding a cleanup at the beginning of init_marks (costly)

References ug::GetAssociatedFaces(), ug::GetConnectedVertex(), ug::NONE, ug::FaceVertices::num_vertices(), ug::PI, ug::PointerConstArray< TPtr >::size(), ug::SMALL, ug::VecAngle(), ug::VecSubtract(), ug::EdgeVertices::vertex(), ug::FaceVertices::vertex(), and ug::FaceVertices::vertices().

Referenced by ug::QualityGridGeneration().

◆ is_candidate()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::is_candidate ( Edge e)
inline

candidates are used during MakeDelaunay to define the set of edges which may have to be swapped to obtain a delaunay triangulation.

Referenced by ug::MakeDelaunay(), and ug::QualityGridGeneration().

◆ is_classifiable()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::is_classifiable ( Face f)

returns true if the face can be classified

Faces which contain two shell vertices whose subtended angle is small are not classifiable.

References ug::PI, ug::SMALL, ug::VecAngle(), ug::VecDistanceSq(), ug::VecSubtract(), and ug::FaceVertices::vertex().

◆ is_classified()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::is_classified ( Face f)
private

◆ is_dart_segment()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::is_dart_segment ( Edge e)

returns true if the specified edge is a segment and is connected to a DART vertex

References ug::EdgeVertices::vertices().

◆ is_dart_shell_segment()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::is_dart_shell_segment ( Edge e)

returns true if the specified edge is a segment and connects a DART and a SHELL vertex

References ug::EdgeVertices::vertices().

◆ is_inner()

template<class TAAPos >
template<class TElem >
bool ug::DelaunayInfo< TAAPos >::is_inner ( TElem *  e)

returns true if the specified element is either marked as INNER or as NEW_INNER

Referenced by ug::QualityGridGeneration().

◆ is_new_dart_segment()

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::is_new_dart_segment ( Edge e)

returns true if the specified edge is a new segment and is connected to a DART vertex

References ug::EdgeVertices::vertices().

◆ is_segment()

template<class TAAPos >
template<class TElem >
bool ug::DelaunayInfo< TAAPos >::is_segment ( TElem *  e)

returns true if the specified element is either marked as SEGMENT, NEW_SEGMENT, DART or SHELL

Referenced by ug::MakeDelaunay(), and ug::QualityGridGeneration().

◆ mark() [1/3]

template<class TAAPos >
Mark ug::DelaunayInfo< TAAPos >::mark ( Edge e) const
inline

◆ mark() [2/3]

template<class TAAPos >
Mark ug::DelaunayInfo< TAAPos >::mark ( Face f) const
inline

◆ mark() [3/3]

template<class TAAPos >
Mark ug::DelaunayInfo< TAAPos >::mark ( Vertex v) const
inline

◆ max_dot()

template<class TAAPos >
number ug::DelaunayInfo< TAAPos >::max_dot ( ) const
inline

Face classification is used to define and order the set of faces which whose circumcenter may have to be inserted in order to obtain a delaunay- triangulation with prescribed minimal angle during QualityGridGeneration. Face classification is not required for MakeDelaunay.

◆ min_angle()

template<class TAAPos >
number ug::DelaunayInfo< TAAPos >::min_angle ( ) const
inline

Face classification is used to define and order the set of faces which whose circumcenter may have to be inserted in order to obtain a delaunay- triangulation with prescribed minimal angle during QualityGridGeneration. Face classification is not required for MakeDelaunay.

◆ pop_candidate()

template<class TAAPos >
Edge * ug::DelaunayInfo< TAAPos >::pop_candidate

candidates are used during MakeDelaunay to define the set of edges which may have to be swapped to obtain a delaunay triangulation.

Referenced by ug::MakeDelaunay().

◆ pop_classified_face()

template<class TAAPos >
Face * ug::DelaunayInfo< TAAPos >::pop_classified_face

Face classification is used to define and order the set of faces which whose circumcenter may have to be inserted in order to obtain a delaunay- triangulation with prescribed minimal angle during QualityGridGeneration. Face classification is not required for MakeDelaunay.

References ug::DelaunayInfo< TAAPos >::FaceInfo::classified, and ug::DelaunayInfo< TAAPos >::FaceInfo::f.

Referenced by ug::QualityGridGeneration().

◆ position_accessor()

template<class TAAPos >
AAPos& ug::DelaunayInfo< TAAPos >::position_accessor ( )
inline

◆ push_candidate()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::push_candidate ( Edge e)

candidates are used during MakeDelaunay to define the set of edges which may have to be swapped to obtain a delaunay triangulation.

Referenced by ug::MakeDelaunay(), and ug::QualityGridGeneration().

◆ set_mark() [1/5]

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::set_mark ( Edge e,
Mark  m 
)
inline

◆ set_mark() [2/5]

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::set_mark ( Face f,
Mark  m 
)

◆ set_mark() [3/5]

template<class TAAPos >
template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::set_mark ( Face f,
typename DelaunayInfo< TAAPos >::Mark  mark 
)

◆ set_mark() [4/5]

template<class TAAPos >
template<class TIter >
void ug::DelaunayInfo< TAAPos >::set_mark ( TIter  begin,
TIter  end,
Mark  m 
)
inline

◆ set_mark() [5/5]

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::set_mark ( Vertex v,
Mark  m 
)
inline

◆ start_candidate_recording()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::start_candidate_recording

newly created edges will be recorded as possible new candidates

All newly created edges will be added to a list of possible candidates, however, they are not added to the list of candidates until stop_candidate_recording() has been called. This is important since recorded possible candidates may be erased again from the grid (opposed to real candidates, which may not be erased).

References UG_COND_THROW.

Referenced by ug::QualityGridGeneration().

◆ stop_candidate_recording()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::stop_candidate_recording

stops candidate recording and pushes all valid recorded edges to the list of real candidates

Referenced by ug::QualityGridGeneration().

◆ vertex_created()

template<class TAAPos >
void ug::DelaunayInfo< TAAPos >::vertex_created ( Grid grid,
Vertex vrt,
GridObject pParent,
bool  replacesParent 
)
virtual

Notified whenever a new element of the given type is created in the given grid.

Creation callbacks are called in the order in which the GridObservers were registered at the given grid.

If replacesParent is true, then pParent is of the same base type as the created object (e.g. in case of edge_created, the parent is an Edge*). This case usually appears, when a contraining object is replaced by a regular grid object if the same base type during refinement. The method is called with replacesParent == true by Grid::create_and_replace methods.

Please note: If replacesParent == true, then a call to OBJECT_to_be_erased(grid, pParent, obj) will follow (OBJECT and obj are pseudonyms for the concrete type).

Reimplemented from ug::GridObserver.

References ug::GridObject::base_object_id(), and ug::EDGE.

Member Data Documentation

◆ m_aaCandidateEDGE

template<class TAAPos >
Grid::AttachmentAccessor<Edge, ABool> ug::DelaunayInfo< TAAPos >::m_aaCandidateEDGE
private

◆ m_aaFaceInfo

template<class TAAPos >
Grid::AttachmentAccessor<Face, AFaceInfo> ug::DelaunayInfo< TAAPos >::m_aaFaceInfo
private

◆ m_aaMark

template<class TAAPos >
MultiElementAttachmentAccessor<AByte> ug::DelaunayInfo< TAAPos >::m_aaMark
private

◆ m_aaPos

template<class TAAPos >
AAPos ug::DelaunayInfo< TAAPos >::m_aaPos
private

◆ m_aCandidate

template<class TAAPos >
ABool ug::DelaunayInfo< TAAPos >::m_aCandidate
private

◆ m_aFaceInfo

template<class TAAPos >
AFaceInfo ug::DelaunayInfo< TAAPos >::m_aFaceInfo
private

◆ m_aMark

template<class TAAPos >
AByte ug::DelaunayInfo< TAAPos >::m_aMark
private

◆ m_candidateRecordingEnabled

template<class TAAPos >
bool ug::DelaunayInfo< TAAPos >::m_candidateRecordingEnabled
private

◆ m_cbConstrainedEdge

template<class TAAPos >
Grid::edge_traits::callback ug::DelaunayInfo< TAAPos >::m_cbConstrainedEdge
private

◆ m_faceQueue

template<class TAAPos >
FacePriorityQueue ug::DelaunayInfo< TAAPos >::m_faceQueue
private

◆ m_grid

template<class TAAPos >
Grid& ug::DelaunayInfo< TAAPos >::m_grid
private

◆ m_maxDot

template<class TAAPos >
number ug::DelaunayInfo< TAAPos >::m_maxDot
private

◆ m_minAngle

template<class TAAPos >
number ug::DelaunayInfo< TAAPos >::m_minAngle
private

◆ m_qEdgeCandidates

template<class TAAPos >
std::queue<Edge*> ug::DelaunayInfo< TAAPos >::m_qEdgeCandidates
private

◆ m_recordedCandidates

template<class TAAPos >
std::vector<Edge*> ug::DelaunayInfo< TAAPos >::m_recordedCandidates
private

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