CGAL 4.8.1 - Linear Cell Complex
|
#include <CGAL/Linear_cell_complex.h>
CGAL::Combinatorial_map< d, Items, Alloc >.
The class Linear_cell_complex
represents a linear cell complex in dimension d
, in an ambient space of dimension d2
.
This is a model of the concept of CombinatorialMap
adding a requirement to ensure that each vertex of the map is associated with a model of CellAttributeWithPoint
.
d | an integer for the dimension of the combinatorial map, |
d2 | an integer for the dimension of the ambient space, |
LCCTraits | must be a model of the LinearCellComplexTraits concept, satisfying LCCTraits::ambient_dimension==d2 , |
Items | must be a model of the LinearCellComplexItems concept, |
Alloc | has to match the standard allocator requirements. |
There are four default template arguments: d2
is equal to d
, LCCTraits
is equal to CGAL::Linear_cell_complex_traits<d2>
, Items
is equal to CGAL::Linear_cell_complex_min_items<d>
and Alloc
is CGAL_ALLOCATOR(int)
.
Note that there is an additional, and undocumented, template parameter CMap
for Linear_cell_complex<d,d2,LCCTraits,Items,Alloc,CMap>
allowing to inherit from any model of the CombinatorialMap
concept.
CombinatorialMap
CGAL::Combinatorial_map<d,Items,Alloc>
Dart
LinearCellComplexItems
CGAL::Linear_cell_complex_min_items<d>
LinearCellComplexTraits
CGAL::Linear_cell_complex_traits<d,K>
vertex_attribute
and point
methods are no more static. You can define the CGAL_CMAP_DEPRECATED
macro to keep the old behavior.Creation | |
LinearCellComplex () | |
Default constructor creating an empty linear cell complex. | |
Constants | |
static unsigned int | ambient_dimension = d2 |
Ambient dimension, must be > 1. | |
Types | |
typedef Linear_cell_complex< d, d2, LCCTraits, Items, Alloc > | Self |
typedef Items::Dart_wrapper < Self >::Dart | Dart |
The type of dart, must satisfy Dart::dimension==d . | |
typedef Items | Items |
typedef Alloc | Alloc |
typedef Traits::FT | FT |
typedef Traits::Point | Point |
typedef Traits::Vector | Vector |
typedef unspecified_type | Vertex_attribute |
Type of 0-attributes, a model of CellAttributeWithPoint concept (a shortcut for Attribute_type<0>::type ). | |
typedef unspecified_type | Vertex_attribute_handle |
Handle through 0-attributes (a shortcut for Attribute_handle<0>::type ). | |
typedef unspecified_type | Vertex_attribute_const_handle |
Const handle through 0-attributes (a shortcut for Attribute_const_handle<0>::type ). | |
typedef unspecified_type | Vertex_attribute_range |
Range of all the 0-attributes, a model of the Range concept (a shortcut for Attribute_range<0>::type ). More... | |
typedef unspecified_type | Vertex_attribute_const_range |
Const range of all the 0-attributes, a model of the ConstRange concept a shortcut for Attribute_const_range<0>::type ). More... | |
Range Access Member Functions | |
Vertex_attribute_range & | vertex_attributes () |
Returns a range of all the 0-attributes in this linear cell complex (a shortcut for attributes<0>()). | |
Vertex_attribute_const_range & | vertex_attributes () const |
Returns a const range of all the 0-attributes in this linear cell complex (a shortcut for attributes<0>() const). | |
Access Member Functions | |
bool | is_valid () const |
Returns true iff this linear cell complex is valid. More... | |
size_type | number_of_vertex_attributes () const |
Returns the number of 0-attributes in this linear cell complex (a shortcut for number_of_attributes<0>()). | |
Vertex_attribute_handle | vertex_attribute (Dart_handle dh) |
Returns the 0-attribute associated with dh . | |
Vertex_attribute_const_handle | vertex_attribute (Dart_const_handle dh) |
Returns the 0-attribute associated with dh , when dh is const. | |
Point & | point_of_vertex_attribute (Vertex_attribute_handle vh) |
Returns the point in the 0-attribute vh . | |
const Point & | point_of_vertex_attribute (Vertex_attribute_const_handle vh) const |
Returns the point in the 0-attribute vh , when vh is const. | |
Point & | point (Dart_handle dh) |
Returns the point in the 0-attribute associated with dh . | |
const Point & | point (Dart_const_handle dh) |
Returns the point in the 0-attribute associated with dh , when dh is const. | |
Modifiers | |
Dart_handle | create_dart (Vertex_attribute_handle vh) |
Creates a new dart in this linear cell complex, sets its associated 0-attribute to vh and returns the corresponding handle. More... | |
Dart_handle | create_dart (const Point &apoint) |
Creates a new dart in this linear cell complex, creates a new 0-attribute initialized with apoint , sets the associated 0-attribute of the new dart to this new 0-attribute, and returns the corresponding handle. | |
template<typename T1 > | |
Vertex_attribute_handle | create_vertex_attribute (T1 t1) |
Creates a new 0-attribute in this linear cell complex, and returns the corresponding handle (a shortcut for create_attribute<0>(t1)). More... | |
void | erase_vertex_attribute (Vertex_attribute_handle vh) |
Removes the 0-attribute pointed to by vh from this linear cell complex (a shortcut for erase_attribute<0>(vh)). More... | |
void | set_vertex_attribute (Dart_handle dh, Vertex_attribute_handle vh) |
Associates the 0-attribute of all the darts of the 0-cell containing dh to vh (a shortcut for set_attribute<0>(dh,vh)). More... | |
Attributes management | |
void | correct_invalid_attributes () |
Correct the invalid attributes of the linear cell complex. More... | |
Operations | |
template<unsigned int i> | |
Point | barycenter (Dart_const_handle dh) const |
Returns the barycenter of the i-cell containing dh . More... | |
template<unsigned int i> | |
Dart_handle | insert_point_in_cell (Dart_handle dh, Point p) |
Inserts a point, copy of p , in the i-cell containing dh . More... | |
template<unsigned int i> | |
Dart_handle | insert_barycenter_in_cell (Dart_handle dh) |
Inserts a point in the barycenter of the i-cell containing dh . More... | |
Dart_handle | insert_dangling_cell_1_in_cell_2 (Dart_handle dh, Point p) |
Inserts a 1-cell in the 2-cell containing dh , the 1-cell being attached only by one of its vertex to the 0-cell containing dh . More... | |
Constructions | |
Dart_handle | make_segment (const Point &p0, const Point &p1) |
Creates an isolated segment in this linear cell complex (two darts linked by \( \beta_2\)) having p0 , p1 as points. More... | |
Dart_handle | make_triangle (const Point &p0, const Point &p1, const Point &p2) |
Creates an isolated triangle in this linear cell complex having p0 , p1 , p2 as points. More... | |
Dart_handle | make_quadrangle (const Point &p0, const Point &p1, const Point &p2, const Point &p3) |
Creates an isolated quadrangle in this linear cell complex having p0 , p1 , p2 , p3 as points. More... | |
Dart_handle | make_tetrahedron (const Point &p0, const Point &p1, const Point &p2, const Point &p3) |
Creates an isolated tetrahedron in this linear cell complex having p0 , p1 ,p2 ,p3 as points. More... | |
Dart_handle | make_hexahedron (const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Point &p4, const Point &p5, const Point &p6, const Point &p7) |
Creates an isolated hexahedron in this linear cell complex having p0 , p1 , p2 , p3 , p4 , p5 , p6 , p7 as points. More... | |
Additional Inherited Members | |
Public Types inherited from CGAL::Combinatorial_map< d, Items, Alloc > | |
typedef Combinatorial_map< d, Items, Alloc > | Self |
typedef Items::Dart_wrapper < Self >::Dart | Dart |
typedef unspecified_type CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::Vertex_attribute_const_range |
Const range of all the 0-attributes, a model of the ConstRange
concept a shortcut for Attribute_const_range<0>::type
).
Iterator inner type is bidirectional iterator and value type is Vertex_attribute.
typedef unspecified_type CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::Vertex_attribute_range |
Range of all the 0-attributes, a model of the Range
concept (a shortcut for Attribute_range<0>::type
).
Iterator inner type is bidirectional iterator and value type is Vertex_attribute.
Point CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::barycenter | ( | Dart_const_handle | dh) | const |
void CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::correct_invalid_attributes | ( | ) |
Correct the invalid attributes of the linear cell complex.
We can have invalid attribute either if we have called set_automatic_attributes_management(false)
before to use some modification operations or if we have modified the combinatorial map by using low level operations.
The validation process of a linear cell complex validates its combinatorial map (cf. correct_invalid_attributes()
), and for each dart d
having no vertex attribute, a new vertex attribute is created, with its Point initialized to CGAL::Origin
, and all the darts of the 0-cell containing d
are linked with the new attribute.
Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::create_dart | ( | Vertex_attribute_handle | vh) |
Creates a new dart in this linear cell complex, sets its associated 0-attribute to vh
and returns the corresponding handle.
*vh
\( \in\)vertex_attributes()
. Vertex_attribute_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::create_vertex_attribute | ( | T1 | t1) |
Creates a new 0-attribute in this linear cell complex, and returns the corresponding handle (a shortcut for create_attribute<0>(t1)).
Calls the constructor of Vertex_attribute having T1
as parameter. Overloads of this member function are defined that take from zero to nine arguments. With zero argument, create_vertex_attribute()
creates a new 0-attribute by using the default constructor.
void CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::erase_vertex_attribute | ( | Vertex_attribute_handle | vh) |
Removes the 0-attribute pointed to by vh
from this linear cell complex (a shortcut for erase_attribute<0>(vh)).
*vh
\( \in\)vertex_attributes()
. Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::insert_barycenter_in_cell | ( | Dart_handle | dh) |
Inserts a point in the barycenter of the i-cell containing dh
.
Returns a handle on one dart of this cell.
If are_attributes_automatically_managed()
==true
, if i-attributes are non void, Attribute_type<i>::type::On_split(a,a') is called, with a the original i-attribute associated with dh and a' each new i-attribute created during the operation.
If are_attributes_automatically_managed()
==false
, non void attributes are not updated; thus the combinatorial map can be no more valid after this operation.
Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::insert_dangling_cell_1_in_cell_2 | ( | Dart_handle | dh, |
Point | p | ||
) |
Inserts a 1-cell in the 2-cell containing dh
, the 1-cell being attached only by one of its vertex to the 0-cell containing dh
.
The second vertex is associated with a new 0-attribute containing a copy of p
as point. Returns a handle on one dart belonging to the new 0-cell.
If are_attributes_automatically_managed()
==false
, non void attributes are not updated; thus the combinatorial map can be no more valid after this operation.
Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::insert_point_in_cell | ( | Dart_handle | dh, |
Point | p | ||
) |
Inserts a point, copy of p
, in the i-cell containing dh
.
Returns a handle on one dart of this cell.
If are_attributes_automatically_managed()
==true
, if i-attributes are non void, Attribute_type<i>::type::On_split(a,a') is called, with a the original i-attribute associated with dh and a' each new i-attribute created during the operation.
If are_attributes_automatically_managed()
==false
, non void attributes are not updated; thus the combinatorial map can be no more valid after this operation.
bool CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::is_valid | ( | ) | const |
Returns true iff this linear cell complex is valid.
A linear cell complex lcc
is valid if it is a valid combinatorial map (cf. CombinatorialMap::is_valid()
), and if for each dart handle dh such that *dh
\(\in\)darts(): dh->attribute<0>()!=NULL
.
Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::make_hexahedron | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2, | ||
const Point & | p3, | ||
const Point & | p4, | ||
const Point & | p5, | ||
const Point & | p6, | ||
const Point & | p7 | ||
) |
Creates an isolated hexahedron in this linear cell complex having p0
, p1
, p2
, p3
, p4
, p5
, p6
, p7
as points.
Returns a handle on the dart associated with p0
and belonging to the 2-cell having p0
, p5
, p6
, p1
as points.
Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::make_quadrangle | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2, | ||
const Point & | p3 | ||
) |
Creates an isolated quadrangle in this linear cell complex having p0
, p1
, p2
, p3
as points.
Returns a handle on the dart associated with p0
.
Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::make_segment | ( | const Point & | p0, |
const Point & | p1 | ||
) |
Creates an isolated segment in this linear cell complex (two darts linked by \( \beta_2\)) having p0
, p1
as points.
Returns a handle on the dart associated with p0
.
Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::make_tetrahedron | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2, | ||
const Point & | p3 | ||
) |
Creates an isolated tetrahedron in this linear cell complex having p0
, p1
,p2
,p3
as points.
Returns a handle on the dart associated with p0
and belonging to the 2-cell having p0
, p1
, p2
as points.
Dart_handle CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::make_triangle | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2 | ||
) |
Creates an isolated triangle in this linear cell complex having p0
, p1
, p2
as points.
Returns a handle on the dart associated with p0
.
void CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::set_vertex_attribute | ( | Dart_handle | dh, |
Vertex_attribute_handle | vh | ||
) |
Associates the 0-attribute of all the darts of the 0-cell containing dh
to vh
(a shortcut for set_attribute<0>(dh,vh)).
*dh
\( \in\)darts() and *vh
\( \in\)vertex_attributes()
.