CGAL 5.6.2 - Halfedge Data Structures
|
#include <CGAL/HalfedgeDS_const_decorator.h>
CGAL::HalfedgeDS_items_decorator< HDS >.
The class CGAL::HalfedgeDS_items_decorator<HDS>
provides additional functions for vertices, halfedges, and faces of a halfedge data structure without knowing the containing halfedge data structure.
The class CGAL::HalfedgeDS_decorator<HDS>
stores a reference to the halfedge data structure and provides functions that modify the halfedge data structure, for example Euler-operators. The class CGAL::HalfedgeDS_const_decorator<HDS>
stores a const reference to the halfedge data structure. It contains non-modifying functions, for example the test for validness of the data structure.
All these additional functions take care of the different capabilities a halfedge data structure may have or may not have. The functions evaluate the type tags of the halfedge data structure to decide on the actions. If a particular feature is not supported nothing is done. Note that for example the creation of new halfedges is mandatory for all halfedge data structures and will not appear here again.
HDS | must be a model of HalfedgeDS |
Example
The following program fragment illustrates the implementation of a is_valid()
member function for a simplified polyhedron class. We assume here that the level three check is the appropriate default for polyhedral surfaces.
CGAL::HalfedgeDS_items_decorator<HDS>
CGAL::HalfedgeDS_decorator<HDS>
Creation | |
HalfedgeDS_const_decorator (const HDS &hds) | |
keeps internally a const reference to hds . | |
Validness Checks | |
A halfedge data structure has no definition of validness of its own, but a useful set of tests is defined with the following levels:
| |
bool | is_valid (bool verbose=false, int level=0) const |
returns true if the halfedge data structure hds is valid with respect to the level value as defined above. More... | |
bool | normalized_border_is_valid (bool verbose=false) const |
returns true if the border halfedges are in normalized representation, which is when enumerating all halfedges with the halfedge iterator the following holds: The non-border edges precede the border edges. More... | |
Additional Inherited Members | |
Public Types inherited from CGAL::HalfedgeDS_items_decorator< HDS > | |
typedef unspecified_type | HalfedgeDS |
halfedge data structure. | |
typedef unspecified_type | Vertex |
vertex type of HalfedgeDS . | |
typedef unspecified_type | Halfedge |
halfedge type of HalfedgeDS . | |
typedef unspecified_type | Face |
face type of HalfedgeDS . | |
typedef unspecified_type | Vertex_handle |
typedef unspecified_type | Halfedge_handle |
typedef unspecified_type | Face_handle |
typedef unspecified_type | Vertex_iterator |
typedef unspecified_type | Halfedge_iterator |
typedef unspecified_type | Face_iterator |
typedef unspecified_type | size_type |
typedef unspecified_type | difference_type |
typedef unspecified_type | iterator_category |
typedef unspecified_type | Supports_vertex_halfedge |
typedef unspecified_type | Supports_halfedge_prev |
typedef unspecified_type | Supports_halfedge_vertex |
typedef unspecified_type | Supports_halfedge_face |
typedef unspecified_type | Supports_face_halfedge |
typedef unspecified_type | Supports_removal |
Public Member Functions inherited from CGAL::HalfedgeDS_items_decorator< HDS > | |
HalfedgeDS_items_decorator () | |
default constructor. | |
Halfedge_handle | get_vertex_halfedge (Vertex_handle v) |
returns the incident halfedge of v if supported, Halfedge_handle() otherwise. | |
Vertex_handle | get_vertex (Halfedge_handle h) |
returns the incident vertex of h if supported, Vertex_handle() otherwise. | |
Halfedge_handle | get_prev (Halfedge_handle h) |
returns the previous halfedge of h if supported, Halfedge_handle() otherwise. | |
Halfedge_handle | find_prev (Halfedge_handle h) |
returns the previous halfedge of h . More... | |
Halfedge_handle | find_prev_around_vertex (Halfedge_handle h) |
returns the previous halfedge of h . More... | |
Face_handle | get_face (Halfedge_handle h) |
returns the incident face of h if supported, Face_handle() otherwise. | |
Halfedge_handle | get_face_halfedge (Face_handle f) |
returns the incident halfedge of f if supported, Halfedge_handle() otherwise. | |
void | close_tip (Halfedge_handle h) const |
makes h->opposite() the successor of h . | |
void | close_tip (Halfedge_handle h, Vertex_handle v) const |
makes h->opposite() the successor of h and sets the incident vertex of h to v . | |
void | insert_tip (Halfedge_handle h, Halfedge_handle v) const |
inserts the tip of the edge h into the halfedges around the vertex pointed to by v . More... | |
void | remove_tip (Halfedge_handle h) const |
removes the edge h->next()->opposite() from the halfedge circle around the vertex referred to by h . More... | |
void | insert_halfedge (Halfedge_handle h, Halfedge_handle f) const |
inserts the halfedge h between f and f->next() . More... | |
void | remove_halfedge (Halfedge_handle h) const |
removes edge h->next() from the halfedge circle around the face referred to by h . More... | |
void | set_vertex_in_vertex_loop (Halfedge_handle h, Vertex_handle v) const |
loops around the vertex incident to h and sets all vertex pointers to v . More... | |
void | set_face_in_face_loop (Halfedge_handle h, Face_handle f) const |
loops around the face incident to h and sets all face pointers to f . More... | |
Halfedge_handle | flip_edge (Halfedge_handle h) const |
performs an edge flip. More... | |
void | set_vertex_halfedge (Vertex_handle v, Halfedge_handle g) const |
sets the incident halfedge of v to g . | |
void | set_vertex_halfedge (Halfedge_handle h) const |
sets the incident halfedge of the vertex v to h . | |
void | set_vertex (Halfedge_handle h, Vertex_handle v) const |
sets the incident vertex of h to v . | |
void | set_prev (Halfedge_handle h, Halfedge_handle g) const |
sets the previous link of h to g . | |
void | set_face (Halfedge_handle h, Face_handle f) const |
sets the incident face of h to f . | |
void | set_face_halfedge (Face_handle f, Halfedge_handle g) const |
sets the incident halfedge of f to g . | |
void | set_face_halfedge (Halfedge_handle h) const |
sets the incident halfedge of the face f to h . | |
bool CGAL::HalfedgeDS_const_decorator< HDS >::is_valid | ( | bool | verbose = false , |
int | level = 0 |
||
) | const |
returns true
if the halfedge data structure hds
is valid with respect to the level
value as defined above.
If verbose
is true
, statistics are written to cerr
.
bool CGAL::HalfedgeDS_const_decorator< HDS >::normalized_border_is_valid | ( | bool | verbose = false | ) | const |
returns true
if the border halfedges are in normalized representation, which is when enumerating all halfedges with the halfedge iterator the following holds: The non-border edges precede the border edges.
For border edges, the second halfedge is a border halfedge. (The first halfedge may or may not be a border halfedge.) The halfedge iterator HalfedgeDS::border_halfedges_begin()
denotes the first border edge. If verbose
is true
, statistics are written to cerr
.