\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 4.8.1 - Linear Cell Complex
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc > Class Template Reference

#include <CGAL/Linear_cell_complex.h>

Inherits from

CGAL::Combinatorial_map< d, Items, Alloc >.

Definition

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.

Is Model Of:
CombinatorialMap
Template Parameters
dan integer for the dimension of the combinatorial map,
d2an integer for the dimension of the ambient space,
LCCTraitsmust be a model of the LinearCellComplexTraits concept, satisfying LCCTraits::ambient_dimension==d2,
Itemsmust be a model of the LinearCellComplexItems concept,
Allochas 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).

Advanced

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.

See Also
CombinatorialMap
CGAL::Combinatorial_map<d,Items,Alloc>
Dart
LinearCellComplexItems
CGAL::Linear_cell_complex_min_items<d>
LinearCellComplexTraits
CGAL::Linear_cell_complex_traits<d,K>
Deprecated:
Since CGAL 4.4, vertex_attribute and point methods are no more static. You can define the CGAL_CMAP_DEPRECATED macro to keep the old behavior.
Examples:
Linear_cell_complex/linear_cell_complex_3.cpp, Linear_cell_complex/linear_cell_complex_3_attributes_management.cpp, Linear_cell_complex/linear_cell_complex_3_with_colored_vertices.cpp, and Linear_cell_complex/linear_cell_complex_4.cpp.

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_rangevertex_attributes ()
 Returns a range of all the 0-attributes in this linear cell complex (a shortcut for attributes<0>()).
 
Vertex_attribute_const_rangevertex_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.
 
Pointpoint_of_vertex_attribute (Vertex_attribute_handle vh)
 Returns the point in the 0-attribute vh.
 
const Pointpoint_of_vertex_attribute (Vertex_attribute_const_handle vh) const
 Returns the point in the 0-attribute vh, when vh is const.
 
Pointpoint (Dart_handle dh)
 Returns the point in the 0-attribute associated with dh.
 
const Pointpoint (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
 

Member Typedef Documentation

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

Member Function Documentation

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
template<unsigned int i>
Point CGAL::Linear_cell_complex< d, d2, LCCTraits, Items, Alloc >::barycenter ( Dart_const_handle  dh) const

Returns the barycenter of the i-cell containing dh.

Precondition
1 \( \leq\)i \( \leq\)dimension and *dh \( \in\)darts().
template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

Precondition
*vh \( \in\)vertex_attributes().
template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
template<typename T1 >
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.

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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)).

Precondition
*vh \( \in\)vertex_attributes().
template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
template<unsigned int i>
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.

Precondition
i \( \leq\)dimension \( \leq\) 2 and *dh \( \in\)darts().

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.

Advanced

If are_attributes_automatically_managed()==false, non void attributes are not updated; thus the combinatorial map can be no more valid after this operation.

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

Precondition
2 \( \leq\)dimension and *dh \( \in\)darts().
Advanced

If are_attributes_automatically_managed()==false, non void attributes are not updated; thus the combinatorial map can be no more valid after this operation.

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
template<unsigned int i>
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.

Precondition
i \( \leq\)dimension \( \leq\) 2 and *dh \( \in\)darts().

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.

Advanced

If are_attributes_automatically_managed()==false, non void attributes are not updated; thus the combinatorial map can be no more valid after this operation.

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

Precondition
dimension \( \geq \) 2.
make_hexahedron.png
Example of r=lcc.make_hexahedron(p0,p1,p2,p3,p4,p5,p6,p7).
Examples:
Linear_cell_complex/linear_cell_complex_3_with_colored_vertices.cpp.
template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

Precondition
dimension \( \geq\) 1.
make_quadrilateral.png
Example of r=lcc.make_quadrangle(p0,p1,p2,p3).
template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

Precondition
dimension \( \geq\) 2.
make_segment.png
Example of r=lcc.make_segment(p0,p1).
template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

Precondition
dimension \( \geq\) 2.
make_tetrahedron.png
Example of r=lcc.make_tetrahedron(p0,p1,p2,p3).
template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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.

Precondition
dimension \( \geq\) 1.
make_triangle.png
Example of r=lcc.make_triangle(p0,p1,p2).
template<typename d , typename d2 , typename LCCTraits , typename Items , typename Alloc >
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)).

Precondition
*dh \( \in\)darts() and *vh \( \in\)vertex_attributes().