 CGAL 5.4 - Combinatorial Maps
CombinatorialMap Concept Reference

## Definition

The concept CombinatorialMap defines a d-dimensional combinatorial map.

Refines:
GenericMap
Has Models:
CGAL::Combinatorial_map<d,Items,Alloc>

For a combinatorial map, the function next is equal to $$\beta_1$$, previous is equal to $$\beta_0$$ and the function opposite<i> is equal to $$\beta_i$$.

## Public Attributes

Dart_handle null_dart_handle
The null dart handle constant. More...

## Access Member Functions

Dart_handle beta (Dart_handle dh, int i, int j)
Returns $$\beta_j$$( $$\beta_i$$(*dh)). More...

Dart_const_handle beta (Dart_const_handle dh, int i, int j) const
Returns $$\beta_j$$( $$\beta_i$$(*dh)). More...

template<int i, int j>
Dart_handle beta (Dart_handle dh)
Returns $$\beta_j$$( $$\beta_i$$(*dh)). More...

template<int i, int j>
Dart_const_handle beta (Dart_const_handle dh) const
Returns $$\beta_j$$( $$\beta_i$$(*dh)). More...

Dart_handle opposite (Dart_handle dh)
Returns a handle to a dart belonging to the same edge than dart *dh, and not to the same vertex. More...

Dart_const_handle opposite (Dart_const_handle dh) const
Returns a const handle to a dart belonging to the same edge than dart *dh, and not to the same vertex, when the dart is const. More...

bool is_valid () const
Returns true iff the combinatorial map is valid. More...

## Modifiers

template<unsigned int i>
void link_beta (Dart_handle dh1, Dart_handle dh2)
Links *dh1 and *dh2 by $$\beta_i$$. More...

template<unsigned int i>
Unlinks *dh and $$\beta_i$$(*dh) by $$\beta_i$$. More...

## Operations

template<unsigned int i>
bool is_sewable (Dart_const_handle dh1, Dart_const_handle dh2) const
Returns true iff *dh1 can be i-sewn with *dh2 by keeping the generic map valid. More...

template<unsigned int i>
void sew (Dart_handle dh1, Dart_handle dh2)
i-sew darts *dh1 and *dh2, by keeping the generic map valid. More...

template<unsigned int i>
void unsew (Dart_handle dh)
i-unsew darts *dh and *opposite<i>(*dh), by keeping the generic map valid. More...

void reverse_orientation ()
Reverse the orientation (swap $$\beta_0$$ and $$\beta_1$$ links) of the entire map.

Reverse the orientation (swap $$\beta_0$$ and $$\beta_1$$ links) of the connected component containing the given dart.

## ◆ beta() [1/4]

 Dart_handle CombinatorialMap::beta ( Dart_handle dh, int i, int j )

Returns $$\beta_j$$( $$\beta_i$$(*dh)).

Overloads of this member function are defined that take from one to nine integer as arguments. For each function, betas are applied in the same order as their indices are given as parameters.

For example beta(dh,1)= $$\beta_1$$(*dh), and beta(dh,1,2,3,0)= $$\beta_0$$( $$\beta_3$$( $$\beta_2$$( $$\beta_1$$(*dh)))).

Precondition
0 $$\leq$$ i $$\leq$$ dimension, 0 $$\leq$$ j $$\leq$$ dimension and *dh $$\in$$ darts().

## ◆ beta() [2/4]

 Dart_const_handle CombinatorialMap::beta ( Dart_const_handle dh, int i, int j ) const

Returns $$\beta_j$$( $$\beta_i$$(*dh)).

Overloads of this member function are defined that take from one to nine integer as arguments.

Precondition
0 $$\leq$$ i $$\leq$$ dimension, 0 $$\leq$$ j $$\leq$$ dimension and *dh $$\in$$ darts().

## ◆ beta() [3/4]

template<int i, int j>
 Dart_handle CombinatorialMap::beta ( Dart_handle dh )

Returns $$\beta_j$$( $$\beta_i$$(*dh)).

Overloads of this member function are defined that take from one to nine integer as template arguments. For each function, betas are applied in the same order as their indices are given as template arguments.

For example beta<1>(dh)= $$\beta_1$$(*dh), and beta<1,2,3,0>(dh)= $$\beta_0$$( $$\beta_3$$( $$\beta_2$$( $$\beta_1$$(*dh)))).

Precondition
0 $$\leq$$ i $$\leq$$ dimension, 0 $$\leq$$ j $$\leq$$ dimension and *dh $$\in$$ darts().

## ◆ beta() [4/4]

template<int i, int j>
 Dart_const_handle CombinatorialMap::beta ( Dart_const_handle dh ) const

Returns $$\beta_j$$( $$\beta_i$$(*dh)).

Overloads of this member function are defined that take from one to nine integer as template arguments.

Precondition
0 $$\leq$$ i $$\leq$$ dimension, 0 $$\leq$$ j $$\leq$$ dimension and *dh $$\in$$ darts().

## ◆ is_sewable()

template<unsigned int i>
 bool CombinatorialMap::is_sewable ( Dart_const_handle dh1, Dart_const_handle dh2 ) const

Returns true iff *dh1 can be i-sewn with *dh2 by keeping the generic map valid.

This is true if there is a bijection f between all the darts of the orbit D1= $$\langle{}$$ $$\beta_1$$, $$\ldots$$, $$\beta_{i-2}$$, $$\beta_{i+2}$$, $$\ldots$$, $$\beta_d$$ $$\rangle{}$$(*dh1) and D2= $$\langle{}$$ $$\beta_1$$, $$\ldots$$, $$\beta_{i-2}$$, $$\beta_{i+2}$$, $$\ldots$$, $$\beta_d$$ $$\rangle{}$$(*dh2) satisfying:

• f(*dh1)=*dh2,
• $$\forall$$ e $$\in$$ D1, $$\forall$$ j $$\in$$ {1, $$\ldots$$,i-2,i+2, $$\ldots$$,d}, f( $$\beta_j$$(e))= $$\beta_j^{-1}$$(f(e)).
Precondition
0 $$\leq$$ i $$\leq$$ dimension, *dh1 $$\in$$ darts(), and *dh2 $$\in$$ darts().

## ◆ is_valid()

 bool CombinatorialMap::is_valid ( ) const

Returns true iff the combinatorial map is valid.

A combinatorial map is valid (see Sections Mathematical Definitions and Combinatorial Map Properties) if for all its darts d $$\in$$ darts():

• d is 0-free, or $$\beta_1(\beta_0(d))=d$$;
• d is 1-free, or $$\beta_0(\beta_1(d))=d$$;
• $$\forall$$i, 2 $$\leq$$ i $$\leq$$ dimension: d is i-free, or $$\beta_i(\beta_i(d))=d$$;
• $$\forall$$i, $$\forall$$ j, such that 0 $$\leq$$ i $$\leq$$ dimension-2 and i+2 $$\leq$$ j $$\leq$$ dimension: $$\beta_j(\beta_i(d))=\varnothing$$ or ; $$\beta_j(\beta_i(\beta_j(\beta_i(d))))=d$$;
• $$\forall$$i, 0 $$\leq$$ i $$\leq$$ dimension such that i-attributes are non void:
• $$\forall$$d2 in the same i-cell than d: d and d2 have the same i-attribute;
• $$\forall$$d2 in a different i-cell than d: d and d2 have different i-attributes.

template<unsigned int i>
 void CombinatorialMap::link_beta ( Dart_handle dh1, Dart_handle dh2 )

Links *dh1 and *dh2 by $$\beta_i$$.

The combinatorial map can be no longer valid after this operation. If are_attributes_automatically_managed()==true, non void attributes of *dh1 and *dh2 are updated: if one dart has an attribute and the second dart not, the non null attribute is associated to the dart having a null attribute. If both darts have an attribute, the attribute of *dh1 is associated to *dh2.

Precondition
0 $$\leq$$ i $$\leq$$ dimension, *dh1 $$\in$$ darts(), *dh2 $$\in$$ darts() and (i $$<$$ 2 or dh1 $$\neq$$dh2).

## ◆ opposite() [1/2]

 Dart_handle CombinatorialMap::opposite ( Dart_handle dh )

Returns a handle to a dart belonging to the same edge than dart *dh, and not to the same vertex.

nullptr if such a dart does not exist.

## ◆ opposite() [2/2]

 Dart_const_handle CombinatorialMap::opposite ( Dart_const_handle dh ) const

Returns a const handle to a dart belonging to the same edge than dart *dh, and not to the same vertex, when the dart is const.

nullptr if such a dart does not exist.

## ◆ sew()

template<unsigned int i>
 void CombinatorialMap::sew ( Dart_handle dh1, Dart_handle dh2 )

i-sew darts *dh1 and *dh2, by keeping the generic map valid.

Links by $$\beta_i$$ two by two all the darts of the orbit D1= $$\langle{}$$ $$\beta_1$$, $$\ldots$$, $$\beta_{i-2}$$, $$\beta_{i+2}$$, $$\ldots$$, $$\beta_d$$ $$\rangle{}$$(*dh1) and D2= $$\langle{}$$ $$\beta_0$$, $$\beta_2$$, $$\ldots$$, $$\beta_{i-2}$$, $$\beta_{i+2}$$, $$\ldots$$, $$\beta_d$$ $$\rangle{}$$(*dh2) such that d2=f(d1), where f is the bijection between D1 and D2 satisfying: f(*dh1)=*dh2, and for all e $$\in$$ D1, for all j $$\in$$ {1, $$\ldots$$,i-2,i+2, $$\ldots$$,d}, f( $$\beta_j$$(e))= $$\beta_j^{-1}$$(f(e)).

If are_attributes_automatically_managed()==true, when necessary, non void attributes are updated to ensure the validity of the generic map: for each j-cells c1 and c2 which are merged into one j-cell during the sew, the two associated attributes attr1 and attr2 are considered. If one attribute is nullptr and the other not, the non nullptr attribute is associated to all the darts of the resulting cell. When the two attributes are non nullptr, functor Attribute_type<i>::type::On_merge is called on the two attributes attr1 and attr2. If set, the dynamic onmerge function of i-attributes is also called on attr1 and attr2. Then, the attribute attr1 is associated to all darts of the resulting j-cell. Finally, attribute attr2 is removed from the generic map.

Precondition
is_sewable<i>(dh1,dh2).

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

template<unsigned int i>
 void CombinatorialMap::unlink_beta ( Dart_handle dh )

Unlinks *dh and $$\beta_i$$(*dh) by $$\beta_i$$.

The combinatorial map can be no longer valid after this operation. Attributes of *dh and $$\beta_i$$(*dh) are not modified.

Precondition
0 $$\leq$$ i $$\leq$$ dimension, *dh $$\in$$ darts(), and *dh is not i-free.

## ◆ unsew()

template<unsigned int i>
 void CombinatorialMap::unsew ( Dart_handle dh )

i-unsew darts *dh and *opposite<i>(*dh), by keeping the generic map valid.

Unlinks by $$\beta_i$$ all the darts in the orbit $$\langle{}$$ $$\beta_1$$, $$\ldots$$, $$\beta_{i-2}$$, $$\beta_{i+2}$$, $$\ldots$$, $$\beta_d$$ $$\rangle{}$$(*dh).

If are_attributes_automatically_managed()==true, when necessary, non void attributes are updated to ensure the validity of the generic map: for each j-cell c split in two j-cells c1 and c2 by the operation, if c is associated to a j-attribute attr1, then this attribute is duplicated into attr2, and all the darts belonging to c2 are associated with this new attribute. Finally, the functor Attribute_type<i>::type::On_split is called on the two attributes attr1 and attr2. If set, the dynamic onsplit function of i-attributes is also called on attr1 and attr2.

Precondition
0 $$\leq$$ i $$\leq$$ dimension, *dh $$\in$$ darts() and *dh is not i-free.

If are_attributes_automatically_managed()==false, non void attributes are not updated thus the generic map can be no more valid after this operation.
A dart d is i-free if beta(d, i)==null_dart_handle. Note that *null_dart_handle $$\notin$$darts().