CGAL 5.1.3 - Linear Cell Complex
LinearCellComplex Concept Reference

## Definition

The concept LinearCellComplex represents a linear cell complex in dimension d, in an ambient space of dimension d2. This is a model of the concept of GenericMap adding a requirement to ensure that each vertex of the map is associated with a model of CellAttributeWithPoint.

Refines:
GenericMap
Has Models:

CGAL::Linear_cell_complex_for_generalized_map<d,d2,LCCTraits,Items,Alloc>

LinearCellComplexItems
LinearCellComplexTraits

## Creation

LinearCellComplex ()
Default constructor creating an empty linear cell complex.

## Constants

static unsigned int ambient_dimension
Ambient dimension, must be > 1.

## Types

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) const
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...

## ◆ 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.

## ◆ 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.

## ◆ barycenter()

template<unsigned int i>
 Point LinearCellComplex::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().

## ◆ correct_invalid_attributes()

 void LinearCellComplex::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 generic 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.

## ◆ create_dart()

 Dart_handle LinearCellComplex::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().

## ◆ create_vertex_attribute()

template<typename T1 >
 Vertex_attribute_handle LinearCellComplex::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.

## ◆ erase_vertex_attribute()

 void LinearCellComplex::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().

## ◆ insert_barycenter_in_cell()

template<unsigned int i>
 Dart_handle LinearCellComplex::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.

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

## ◆ insert_dangling_cell_1_in_cell_2()

 Dart_handle LinearCellComplex::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().

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

## ◆ insert_point_in_cell()

template<unsigned int i>
 Dart_handle LinearCellComplex::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.

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

## ◆ is_valid()

 bool LinearCellComplex::is_valid ( ) const

Returns true iff this linear cell complex is valid.

A linear cell complex lcc is valid if it is a valid generic map (cf. GenericMap::is_valid()), and if for each dart handle dh such that *dh $$\in$$ darts(): dh->attribute<0>()!=NULL.

## ◆ make_hexahedron()

 Dart_handle LinearCellComplex::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, with edge [p0,p5] and belonging to the 2-cell having p0, p5, p6, p1 as points.

Precondition
dimension $$\geq$$ 2.
Example of r=lcc.make_hexahedron(p0,p1,p2,p3,p4,p5,p6,p7), left for combinatorial map as combinatorial data-structure, right for generalized maps.

 Dart_handle LinearCellComplex::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 and with edge [p0,p1].

Precondition
dimension $$\geq$$ 1.
Example of r=lcc.make_quadrangle(p0,p1,p2,p3), left for combinatorial map as combinatorial data-structure, right for generalized maps.

## ◆ make_segment()

 Dart_handle LinearCellComplex::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.
Example of r=lcc.make_segment(p0,p1), left for combinatorial map as combinatorial data-structure, right for generalized maps.

## ◆ make_tetrahedron()

 Dart_handle LinearCellComplex::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, with edge [p0,p1] and belonging to the 2-cell having p0, p1, p2 as points.

Precondition
dimension $$\geq$$ 2.
Example of r=lcc.make_tetrahedron(p0,p1,p2,p3), left for combinatorial map as combinatorial data-structure, right for generalized maps.

## ◆ make_triangle()

 Dart_handle LinearCellComplex::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 and with edge [p0,p1].

Precondition
dimension $$\geq$$ 1.
Example of r=lcc.make_triangle(p0,p1,p2), left for combinatorial map as combinatorial data-structure, right for generalized maps.

## ◆ set_vertex_attribute()

 void LinearCellComplex::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().