|
|
|
|
@ -10,13 +10,7 @@ namespace CGAL {
|
|
|
|
|
|
|
|
|
|
\section Linear_cell_complexIntroduction Introduction
|
|
|
|
|
|
|
|
|
|
A <I>d</I>D linear cell complex allows to represent an orientable
|
|
|
|
|
subdivided <I>d</I>D object having linear geometry: each vertex of the
|
|
|
|
|
subdivision is associated with a point. The geometry of each edge is a
|
|
|
|
|
segment whose end points are associated with the two vertices of the
|
|
|
|
|
edge, the geometry of each 2-cell is obtained from all the segments
|
|
|
|
|
associated to the edges describing the boundary of the 2-cell and so
|
|
|
|
|
on.
|
|
|
|
|
A <I>d</I>D linear cell complex allows to represent an orientable subdivided <I>d</I>D object having linear geometry: each vertex of the subdivision is associated with a point. The geometry of each edge is a segment whose end points are associated with the two vertices of the edge, the geometry of each 2-cell is obtained from all the segments associated to the edges describing the boundary of the 2-cell and so on.
|
|
|
|
|
|
|
|
|
|
The combinatorial part of a linear cell complex is described \tred{either by a <I>d</I>D \ref CombinatorialMap "combinatorial map" or by a <I>d</I>D \ref GeneralizedMap "generalized map" (it is strongly recommended to first read the \ref ChapterCombinatorialMap "Combinatorial maps user manual" or \ref ChapterGeneralizedMap "Generalized maps user manual" for definitions)}. To add the linear geometrical embedding, a point (a model of \link Kernel::Point_2 `Point_2`\endlink or \link Kernel::Point_3 `Point_3`\endlink or \link Kernel_d::Point_d `Point_d`\endlink) is associated to each vertex of the \tred{combinatorial data-structure}.
|
|
|
|
|
|
|
|
|
|
@ -52,29 +46,12 @@ UML diagram of the main classes of the package. Gray elements come from the \ref
|
|
|
|
|
|
|
|
|
|
\section sseclinearcellcomplex Linear Cell Complex
|
|
|
|
|
|
|
|
|
|
The \link CGAL::Linear_cell_complex `Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>`\endlink class
|
|
|
|
|
is a model of the `CombinatorialMap` concept. It guarantees that
|
|
|
|
|
each vertex of the combinatorial map is associated with an attribute
|
|
|
|
|
containing a point. This class can be used in geometric algorithms (it
|
|
|
|
|
plays the same role as `Polyhedron_3` for \ref chapterHalfedgeDS "Halfedge Data Structures").
|
|
|
|
|
The \link CGAL::Linear_cell_complex `Linear_cell_complex<d,d2,LCCTraits,Items,Alloc>`\endlink class is a model of the `CombinatorialMap` \tred{or the `Generalized_map`} concept. It guarantees that each vertex is associated with an attribute containing a point. This class can be used in geometric algorithms (it plays the same role as `Polyhedron_3` for \ref chapterHalfedgeDS "Halfedge Data Structures").
|
|
|
|
|
|
|
|
|
|
This class has five template parameters standing for the dimension of
|
|
|
|
|
the combinatorial map, the dimension of the ambient space, a traits
|
|
|
|
|
class (a model of the `LinearCellComplexTraits` concept, see
|
|
|
|
|
Section \ref sseclcctraits "Linear Cell Complex Traits"), an items class (a model of the
|
|
|
|
|
`LinearCellComplexItems` concept, see
|
|
|
|
|
Section \ref sseclccitem "Linear Cell Complex Items"), and an allocator which must be a model
|
|
|
|
|
of the allocator concept of \stl. %Default classes are provided for
|
|
|
|
|
the traits, items, and for the allocator classes, and by default
|
|
|
|
|
`d2=d`.
|
|
|
|
|
This class has five template parameters standing for the dimension of the map, the dimension of the ambient space, a traits class (a model of the `LinearCellComplexTraits` concept, see Section \ref sseclcctraits "Linear Cell Complex Traits"), an items class (a model of the `LinearCellComplexItems` concept, see Section \ref sseclccitem "Linear Cell Complex Items"), and an allocator which must be a model of the allocator concept of \stl. %Default classes are provided for the traits, items, and for the allocator classes, and by default `d2=d`.
|
|
|
|
|
|
|
|
|
|
A linear cell complex is valid, if it is a valid combinatorial map
|
|
|
|
|
where each dart is associated with an attribute containing a point
|
|
|
|
|
(i.e.\ an instance of a model of the `CellAttributeWithPoint`
|
|
|
|
|
concept). Note that there are no validity constraints on the geometry
|
|
|
|
|
(test on self intersection, planarity of 2-cells...).
|
|
|
|
|
We can see two examples of `Linear_cell_complex` in
|
|
|
|
|
\cgalFigureRef{fig_lcc_instantiations}.
|
|
|
|
|
A linear cell complex is valid, if it is a valid combinatorial \tred{or generalized} map where each dart is associated with an attribute containing a point (i.e.\ an instance of a model of the `CellAttributeWithPoint`
|
|
|
|
|
concept). Note that there are no validity constraints on the geometry (test on self intersection, planarity of 2-cells...). We can see two examples of `Linear_cell_complex` in \cgalFigureRef{fig_lcc_instantiations}.
|
|
|
|
|
|
|
|
|
|
\cgalFigureBegin{fig_lcc_instantiations,lcc_instantiations.svg}
|
|
|
|
|
Examples of `Linear_cell_complex`. Gray disks show the attributes associated to vertices. Associations between darts and attributes are drawn by small lines between darts and disks. <B>Left:</B> Example of `Linear_cell_complex<2,2>`. <B>Right:</B> Example of `Linear_cell_complex<3,3>`.
|
|
|
|
|
@ -84,182 +61,92 @@ Examples of `Linear_cell_complex`. Gray disks show the attributes associated to
|
|
|
|
|
\subsection Linear_cell_complexCellAttributes Cell Attributes
|
|
|
|
|
\anchor ssecattributewp
|
|
|
|
|
|
|
|
|
|
The `Cell_attribute_with_point<LCC,Info_,Tag,OnMerge,OnSplit>`
|
|
|
|
|
class is a model of the `CellAttributeWithPoint` concept, which is
|
|
|
|
|
a refinement of the `CellAttribute` concept. It represents an
|
|
|
|
|
attribute associated with a cell, which can contain an information
|
|
|
|
|
(depending on whether `Info_==void` or not), but which always
|
|
|
|
|
contains a point, an instance of \link Linear_cell_complex::Point `LCC::Point`\endlink.
|
|
|
|
|
The `Cell_attribute_with_point<LCC,Info_,Tag,OnMerge,OnSplit>` class is a model of the `CellAttributeWithPoint` concept, which is a refinement of the `CellAttribute` concept. It represents an attribute associated with a cell, which can contain an information (depending on whether `Info_==void` or not), but which always contains a point, an instance of \link Linear_cell_complex::Point `LCC::Point`\endlink.
|
|
|
|
|
|
|
|
|
|
\subsection Linear_cell_complexLinearCellComplexTraits Linear Cell Complex Traits
|
|
|
|
|
\anchor sseclcctraits
|
|
|
|
|
|
|
|
|
|
The `LinearCellComplexTraits` geometric traits concept defines the
|
|
|
|
|
required types and functors used in the `Linear_cell_complex`
|
|
|
|
|
class. For example it defines \link LinearCellComplexTraits::Point `Point`\endlink, the type of points used,
|
|
|
|
|
and \link LinearCellComplexTraits::Vector `Vector`\endlink, the corresponding vector type. It also defines all
|
|
|
|
|
the required functors used for constructions and operations, as for
|
|
|
|
|
example \link LinearCellComplexTraits::Construct_translated_point `Construct_translated_point`\endlink or
|
|
|
|
|
\link LinearCellComplexTraits::Construct_sum_of_vectors `Construct_sum_of_vectors`\endlink.
|
|
|
|
|
The `LinearCellComplexTraits` geometric traits concept defines the required types and functors used in the `Linear_cell_complex` class. For example it defines \link LinearCellComplexTraits::Point `Point`\endlink, the type of points used, and \link LinearCellComplexTraits::Vector `Vector`\endlink, the corresponding vector type. It also defines all the required functors used for constructions and operations, as for example \link LinearCellComplexTraits::Construct_translated_point `Construct_translated_point`\endlink or \link LinearCellComplexTraits::Construct_sum_of_vectors `Construct_sum_of_vectors`\endlink.
|
|
|
|
|
|
|
|
|
|
The class `Linear_cell_complex_traits<d,K>` is a model of
|
|
|
|
|
`LinearCellComplexTraits`. It defines the different types which
|
|
|
|
|
are obtained from `K` that, depending on `d`, is a model of
|
|
|
|
|
the concept `Kernel` if `d==2` or `d==3`, and a model of
|
|
|
|
|
the concept `Kernel_d` otherwise.
|
|
|
|
|
The class `Linear_cell_complex_traits<d,K>` is a model of `LinearCellComplexTraits`. It defines the different types which are obtained from `K` that, depending on `d`, is a model of the concept `Kernel` if `d==2` or `d==3`, and a model of the concept `Kernel_d` otherwise.
|
|
|
|
|
|
|
|
|
|
\subsection Linear_cell_complexLinearCellComplexItems Linear Cell Complex Items
|
|
|
|
|
\anchor sseclccitem
|
|
|
|
|
|
|
|
|
|
The `LinearCellComplexItems` concept refines the
|
|
|
|
|
`CombinatorialMapItems` concept by adding the requirement that
|
|
|
|
|
0-attributes are enabled, and associated with a type of attribute
|
|
|
|
|
being a model of the `CellAttributeWithPoint` concept.
|
|
|
|
|
The `LinearCellComplexItems` concept refines the `CombinatorialMapItems` \tred{or the `Generalized_mapItems`} concept by adding the requirement that 0-attributes are enabled, and associated with a type of attribute being a model of the `CellAttributeWithPoint` concept.
|
|
|
|
|
|
|
|
|
|
The class `Linear_cell_complex_min_items<d>` is a model of `LinearCellComplexItems`. It uses `Dart<d>`, and instances of `Cell_attribute_with_point` (which contain no information) associated to each vertex. All other attributes are `void`.
|
|
|
|
|
|
|
|
|
|
\tred{Similarly, the class `GMap_linear_cell_complex_min_items<d>` is a model of `LinearCellComplexItems` using `GMap_dart<d>`, and instances of `Cell_attribute_with_point` (which contain no information) associated to each vertex. All other attributes are `void`.}
|
|
|
|
|
|
|
|
|
|
The class `Linear_cell_complex_min_items<d>` is a
|
|
|
|
|
model of `LinearCellComplexItems`. It uses `Dart<d>`,
|
|
|
|
|
and instances of `Cell_attribute_with_point`
|
|
|
|
|
(which contain no information) associated to each vertex. All other
|
|
|
|
|
attributes are `void`.
|
|
|
|
|
|
|
|
|
|
\section Linear_cell_complexOperations Operations
|
|
|
|
|
|
|
|
|
|
Several operations defined in the combinatorial maps package can be used on a linear cell complex. This is the case for all the iteration operations that do not modify the model (see example in Section \ref ssec3Dlcc "A 3D Linear Cell Complex"). This is also the case for all the operations that do not create new 0-cells: \link CombinatorialMap::sew `sew`\endlink, \link CombinatorialMap::unsew `unsew`\endlink, \link CombinatorialMap::remove_cell `remove_cell`\endlink, \link CombinatorialMap::insert_cell_1_in_cell_2 `insert_cell_1_in_cell_2`\endlink, \link CombinatorialMap::insert_cell_2_in_cell_3 `insert_cell_2_in_cell_3`\endlink. Indeed, all these operations update non `void` attributes, and thus update vertex attributes of a linear cell complex. Note that some existing 0-attributes can be duplicated by the \link CombinatorialMap::unsew `unsew`\endlink method, but these 0-attributes are not new but copies of existing old 0-attributes.
|
|
|
|
|
Several operations defined in the combinatorial maps \tred{or generalized maps} package can be used on a linear cell complex. This is the case for all the iteration operations that do not modify the model (see example in Section \ref ssec3Dlcc "A 3D Linear Cell Complex"). This is also the case for all the operations that do not create new 0-cells: `sew`, `unsew`, `remove_cell`, `insert_cell_1_in_cell_2` or `insert_cell_2_in_cell_3` \tred{(see the documentation of these functions in the `CombinatorialMap` or `GeneralizedMap` concept)}. Indeed, all these operations update non `void` attributes, and thus update vertex attributes of a linear cell complex. Note that some existing 0-attributes can be duplicated by the `unsew` method, but these 0-attributes are not new but copies of existing old 0-attributes.
|
|
|
|
|
|
|
|
|
|
However, operations that create a new 0-cell can not be directly used since the new 0-cell would not be associated with a vertex attribute. Indeed, it is not possible for these operations to automatically decide which point to create. These operations are: \link CombinatorialMap::insert_cell_0_in_cell_1 `insert_cell_0_in_cell_1`\endlink, \link CombinatorialMap::insert_cell_0_in_cell_2 `insert_cell_0_in_cell_2`\endlink, \link CombinatorialMap::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2`\endlink, plus all the creation operations. For these operations, new versions are proposed taking some points as additional parameters. Lastly, some new operations are defined, which use the geometry (see sections \ref ssecconstructionsop "Construction Operations" and \ref ssecmodifop "Modification Operations").
|
|
|
|
|
However, operations that create a new 0-cell can not be directly used since the new 0-cell would not be associated with a vertex attribute. Indeed, it is not possible for these operations to automatically decide which point to create. These operations are: `insert_cell_0_in_cell_1`, `insert_cell_0_in_cell_2`, `insert_dangling_cell_1_in_cell_2`, plus all the creation operations. For these operations, new versions are proposed taking some points as additional parameters. Lastly, some new operations are defined, which use the geometry (see sections \ref ssecconstructionsop "Construction Operations" and \ref ssecmodifop "Modification Operations").
|
|
|
|
|
|
|
|
|
|
All the operations given in this section guarantee that given a valid
|
|
|
|
|
linear cell complex and a possible operation, the result is a valid
|
|
|
|
|
linear cell complex. As for a combinatorial map, it is also possible
|
|
|
|
|
to use low level operations but additional operations may be needed to
|
|
|
|
|
restore the validity conditions.
|
|
|
|
|
All the operations given in this section guarantee that given a valid linear cell complex and a possible operation, the result is a valid linear cell complex. As for a combinatorial \tred{or generalized} map, it is also possible to use low level operations but additional operations may be needed to restore the validity conditions.
|
|
|
|
|
|
|
|
|
|
\subsection sseclcclinkdarts Sewing and Unsewing
|
|
|
|
|
|
|
|
|
|
As explained in the combinatorial map user manual,
|
|
|
|
|
Section \ref sseclinkdarts "Sewing Orbits and Linking Darts", it is possible to glue two <I>i</I>-cells
|
|
|
|
|
along an (<I>i</I>-1)-cell by using the \link CombinatorialMap::sew `sew<i>`\endlink method. Since
|
|
|
|
|
this method updates non void attributes, and since points are specific
|
|
|
|
|
attributes, they are automatically updated during the \link CombinatorialMap::sew `sew<i>`\endlink
|
|
|
|
|
method. Thus the sewing of two <I>i</I>-cells could deform the
|
|
|
|
|
geometry of the concerned objects.
|
|
|
|
|
As explained in the \link CombinatorialMap::sew `combinatorial map`\endlink and \tred{and \link GeneralizedMap::sew `generalized map`\endlink } user manuals, it is possible to glue two <I>i</I>-cells along an (<I>i</I>-1)-cell by using the \link CombinatorialMap::sew `sew<i>`\endlink method. Since this method updates non void attributes, and since points are specific attributes, they are automatically updated during the `sew<i>` method. Thus the sewing of two <I>i</I>-cells could deform the geometry of the concerned objects.
|
|
|
|
|
|
|
|
|
|
For example, in \cgalFigureRef{fig_lcc_example_3d_sew}, we want to 3-sew the
|
|
|
|
|
two initial 3-cells. \link CombinatorialMap::sew `sew<3>(1,5)`\endlink links by \f$ \beta_3\f$ the pairs
|
|
|
|
|
of darts (1,5), (2,8), (3,7) and (4,6). The eight vertex attributes
|
|
|
|
|
around the facet between the two 3-cells before the sew are merged by
|
|
|
|
|
pair during the sew operation (and the \link CellAttribute::On_merge `On_merge`\endlink functor is
|
|
|
|
|
called four times). Thus, after the sew, there are only four
|
|
|
|
|
0-attributes around the facet. By default, the attributes associated
|
|
|
|
|
with the first dart of the sew operation are kept (but this can be
|
|
|
|
|
modified by defining your own functor in the attribute class as
|
|
|
|
|
explained in the package combinatorial map, Section \ref sseclinkdarts "Sewing Orbits and Linking Darts").
|
|
|
|
|
Intuitively, the
|
|
|
|
|
geometry of the second 2-cell is deformed to fit to the first 2-cell.
|
|
|
|
|
For example, in \cgalFigureRef{fig_lcc_example_3d_sew}, we want to 3-sew the two initial 3-cells. `sew<3>(1,5)` links by \f$ \beta_3\f$ the pairs of darts (1,5), (2,8), (3,7) and (4,6). The eight vertex attributes around the facet between the two 3-cells before the sew are merged by pair during the sew operation (and the \link CellAttribute::On_merge `On_merge`\endlink functor is called four times). Thus, after the sew, there are only four 0-attributes around the facet. By default, the attributes associated with the first dart of the sew operation are kept (but this can be modified by defining your own functor in the attribute class as explained in the packages combinatorial map \tred{and generalized map}. Intuitively, the geometry of the second 2-cell is deformed to fit to the first 2-cell.
|
|
|
|
|
|
|
|
|
|
\cgalFigureBegin{fig_lcc_example_3d_sew,lcc_example_3d_sew.svg}
|
|
|
|
|
Example of 3-sew operation for linear cell complex. <B>Left</B>: A 3D linear cell complex containing two 3-cells that are not connected. Vertex attributes are drawn with circles containing point coordinates. Associations between darts and attributes are drawn with small lines between darts and disks. <B>Right</B>: The 3D linear cell complex obtained as result of \link CombinatorialMap::sew `sew<3>(1,5)`\endlink (or \link CombinatorialMap::sew `sew<3>(2,8)`\endlink, or \link CombinatorialMap::sew `sew<3>(3,7)`\endlink, or \link CombinatorialMap::sew `sew<3>(4,6)`\endlink). The eight 0-attributes around the facet between the two 3-cells before the sew operation, are merged into four 0-attributes after. The geometry of the pyramid is deformed since its base is fitted on the 2-cell of the cube.
|
|
|
|
|
\cgalFigureEnd
|
|
|
|
|
|
|
|
|
|
This is similar for link \link CombinatorialMap::unsew `unsew`\endlink operation, which removes \f$ \beta_i\f$ links
|
|
|
|
|
of all the darts in
|
|
|
|
|
\f$ \langle{}\f$\f$ \beta_1\f$,\f$ \ldots\f$,\f$ \beta_{i-2}\f$,\f$ \beta_{i+2}\f$,\f$ \ldots\f$,\f$ \beta_d\f$\f$ \rangle{}\f$(<I>d0</I>),
|
|
|
|
|
and updates
|
|
|
|
|
non void attributes which are no more associated to a same cell due to
|
|
|
|
|
the unlinks. If we take the linear cell complex given in
|
|
|
|
|
\cgalFigureRef{fig_lcc_example_3d_sew} (Right), and we call
|
|
|
|
|
\link CombinatorialMap::unsew `unsew<3>(2)`\endlink, we obtain the linear cell complex in
|
|
|
|
|
\cgalFigureRef{fig_lcc_example_3d_sew} (Left) except for the coordinates of
|
|
|
|
|
the new four vertices, which by default are copies of original
|
|
|
|
|
vertices (this behavior can be modified thanks to the functor
|
|
|
|
|
\link CellAttribute::On_split `On_split`\endlink in the attribute class).
|
|
|
|
|
The \link CombinatorialMap::unsew `unsew<3>`\endlink operation
|
|
|
|
|
has removed the four \f$ \beta_3\f$ links, and has duplicated the 0-attributes
|
|
|
|
|
since vertices are split in two after the unsew operation.
|
|
|
|
|
This is similar for `unsew` operation, which removes <I>i</I>-links of all the darts in a given <I>(i-1)</I>-cell, and updates non void attributes which are no more associated to a same cell due to the unlinks. If we take the linear cell complex given in \cgalFigureRef{fig_lcc_example_3d_sew} (Right), and we call \link CombinatorialMap::unsew `unsew<3>(2)`\endlink, we obtain the linear cell complex in \cgalFigureRef{fig_lcc_example_3d_sew} (Left) except for the coordinates of the new four vertices, which by default are copies of original vertices (this behavior can be modified thanks to the functor \link CellAttribute::On_split `On_split`\endlink in the attribute class). The \link CombinatorialMap::unsew `unsew<3>`\endlink operation has removed the four \f$ \beta_3\f$ links, and has duplicated the 0-attributes since vertices are split in two after the unsew operation.
|
|
|
|
|
|
|
|
|
|
\cgalAdvancedBegin
|
|
|
|
|
If \link CombinatorialMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink is called, all the future sew and unsew operations will not update non void attributes. These attributes will be updated latter by the call to \link CombinatorialMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink.
|
|
|
|
|
If \link `set_automatic_attributes_management(false)` is called, all the future sew and unsew operations will not update non void attributes. These attributes will be updated latter by the call to `set_automatic_attributes_management(true)`.
|
|
|
|
|
\cgalAdvancedEnd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\subsection Linear_cell_complexConstructionOperations Construction Operations
|
|
|
|
|
\anchor ssecconstructionsop
|
|
|
|
|
|
|
|
|
|
There are several member functions allowing to insert specific
|
|
|
|
|
configurations of darts into a linear cell complex. These functions
|
|
|
|
|
return a `Dart_handle` to the new object. Note
|
|
|
|
|
that the dimension of the linear cell complex must be large enough:
|
|
|
|
|
darts must contain all the \f$ \beta\f$ used by the operation. All these
|
|
|
|
|
methods add new darts in the current linear cell complex, existing
|
|
|
|
|
darts are not modified. These functions
|
|
|
|
|
are \link Linear_cell_complex::make_segment `make_segment`\endlink,
|
|
|
|
|
\link Linear_cell_complex::make_triangle `make_triangle`\endlink,
|
|
|
|
|
\link Linear_cell_complex::make_tetrahedron `make_tetrahedron`\endlink and
|
|
|
|
|
\link Linear_cell_complex::make_hexahedron `make_hexahedron`\endlink.
|
|
|
|
|
There are several member functions allowing to insert specific configurations of darts into a linear cell complex. These functions return a `Dart_handle` to the new object. Note that the dimension of the linear cell complex must be large enough: darts must contain all the \tred{applications (\f$ \alpha\f$ or \f$ \beta\f$) used by the operation. All these methods add new darts in the current linear cell complex, existing darts are not modified. These functions are \link Linear_cell_complex::make_segment `make_segment`\endlink, \link Linear_cell_complex::make_triangle `make_triangle`\endlink, \link Linear_cell_complex::make_tetrahedron `make_tetrahedron`\endlink and \link Linear_cell_complex::make_hexahedron `make_hexahedron`\endlink.
|
|
|
|
|
|
|
|
|
|
There are two functions allowing to build a linear cell complex
|
|
|
|
|
from two other \cgal data types:
|
|
|
|
|
There are two functions allowing to build a linear cell complex from two other \cgal data types:
|
|
|
|
|
<UL>
|
|
|
|
|
<LI>\link ::import_from_triangulation_3 `import_from_triangulation_3(lcc,atr)`\endlink: adds in `lcc` all
|
|
|
|
|
the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink;
|
|
|
|
|
<LI>\link ::import_from_polyhedron_3 `import_from_polyhedron_3(lcc,ap)`\endlink: adds in `lcc` all
|
|
|
|
|
the cells present in `ap`, a `Polyhedron_3`.
|
|
|
|
|
<LI>\link ::import_from_triangulation_3 `import_from_triangulation_3(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink;
|
|
|
|
|
<LI>\link ::import_from_polyhedron_3 `import_from_polyhedron_3(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`.
|
|
|
|
|
</UL>
|
|
|
|
|
|
|
|
|
|
Lastly, the function \link ::import_from_plane_graph `import_from_plane_graph(lcc,ais)`\endlink adds in
|
|
|
|
|
`lcc` all the cells reconstructed from the planar graph read in
|
|
|
|
|
`ais`, a `std::istream` (see the \link ::import_from_plane_graph `reference manual`\endlink for the file
|
|
|
|
|
format).
|
|
|
|
|
Lastly, the function \link ::import_from_plane_graph `import_from_plane_graph(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link ::import_from_plane_graph `reference manual`\endlink for the file format).
|
|
|
|
|
|
|
|
|
|
\subsection Linear_cell_complexModificationOperations Modification Operations
|
|
|
|
|
\anchor ssecmodifop
|
|
|
|
|
|
|
|
|
|
Some methods are defined in `Linear_cell_complex` class
|
|
|
|
|
to modify a linear cell complex and update the vertex attributes. In
|
|
|
|
|
the following, we denote by `dh0`, `dh1`, `dh2` the dart
|
|
|
|
|
handles for the darts `d0`, `d1`, `d2`, respectively. That
|
|
|
|
|
is `d0 == *dh0`.
|
|
|
|
|
Some methods are defined in `Linear_cell_complex` class to modify a linear cell complex and update the vertex attributes. In the following, we denote by `dh0`, `dh1`, `dh2` the dart handles for the darts `d0`, `d1`, `d2`, respectively. That is `d0 == *dh0`.
|
|
|
|
|
|
|
|
|
|
\cgalFigureBegin{fig_lcc_insert_vertex,lcc_insert_vertex.svg}
|
|
|
|
|
Example of \link Linear_cell_complex::insert_barycenter_in_cell `insert_barycenter_in_cell<1>`\endlink and \link CombinatorialMap::remove_cell `remove_cell<0>`\endlink operations. <B>Left</B>: Initial linear cell complex. <B>Right</B>: After the insertion of a point in the barycenter of the 1-cell containing dart <I>d1</I>. Now if we remove the 0-cell containing dart <I>d2</I>, we obtain a linear cell complex isomorphic to the initial one.
|
|
|
|
|
Example of \link Linear_cell_complex::insert_barycenter_in_cell `insert_barycenter_in_cell<1>`\endlink and `remove_cell<0>` operations. <B>Left</B>: Initial linear cell complex. <B>Right</B>: After the insertion of a point in the barycenter of the 1-cell containing dart <I>d1</I>. Now if we remove the 0-cell containing dart <I>d2</I>, we obtain a linear cell complex isomorphic to the initial one.
|
|
|
|
|
\cgalFigureEnd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\link Linear_cell_complex::insert_barycenter_in_cell `lcc.insert_barycenter_in_cell<unsigned int i>(dh0)`\endlink adds the
|
|
|
|
|
barycenter of the <I>i</I>-cell containing dart `d0`. This
|
|
|
|
|
operation is possible if `d0`\f$ \in\f$\link CombinatorialMap::darts `lcc.darts()`\endlink (see examples
|
|
|
|
|
on \cgalFigureRef{fig_lcc_insert_vertex} and
|
|
|
|
|
\cgalFigureRef{fig_lcc_triangulation}).
|
|
|
|
|
\link Linear_cell_complex::insert_barycenter_in_cell `lcc.insert_barycenter_in_cell<unsigned int i>(dh0)`\endlink adds the barycenter of the <I>i</I>-cell containing dart `d0`. This operation is possible if `d0`\f$ \in\f$`lcc.darts()` (see examples on \cgalFigureRef{fig_lcc_insert_vertex} and \cgalFigureRef{fig_lcc_triangulation}).
|
|
|
|
|
|
|
|
|
|
\link Linear_cell_complex::insert_point_in_cell `lcc.insert_point_in_cell<unsigned int i>(dh0,p)`\endlink is an operation
|
|
|
|
|
similar to the previous operation, the only difference being that the
|
|
|
|
|
coordinates of the new point are here given by `p` instead of being
|
|
|
|
|
computed as the barycenter of the <I>i</I>-cell. Currently, these two
|
|
|
|
|
operations are only defined for `i=1` to insert a point in an
|
|
|
|
|
edge, or `i=2` to insert a point in a facet.
|
|
|
|
|
\link Linear_cell_complex::insert_point_in_cell `lcc.insert_point_in_cell<unsigned int i>(dh0,p)`\endlink is an operation similar to the previous operation, the only difference being that the coordinates of the new point are here given by `p` instead of being computed as the barycenter of the <I>i</I>-cell. Currently, these two operations are only defined for `i=1` to insert a point in an edge, or `i=2` to insert a point in a facet.
|
|
|
|
|
|
|
|
|
|
\cgalFigureBegin{fig_lcc_triangulation,lcc_triangulation.svg}
|
|
|
|
|
Examples of \link Linear_cell_complex::insert_barycenter_in_cell `insert_barycenter_in_cell<2>`\endlink operation.
|
|
|
|
|
\cgalFigureEnd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
\link Linear_cell_complex::insert_dangling_cell_1_in_cell_2 `lcc.insert_dangling_cell_1_in_cell_2(dh0,p)`\endlink adds a 1-cell in
|
|
|
|
|
the 2-cell containing dart `d0`, the 1-cell being attached by only
|
|
|
|
|
one of its vertex to the 0-cell containing dart `d0`. The second
|
|
|
|
|
vertex of the new edge is associated with a new 0-attribute containing
|
|
|
|
|
a copy of `p` as point. This operation is possible if
|
|
|
|
|
`d0`\f$ \in\f$\link CombinatorialMap::darts `lcc.darts()`\endlink (see example on
|
|
|
|
|
\cgalFigureRef{fig_lcc_insert_edge}).
|
|
|
|
|
\link Linear_cell_complex::insert_dangling_cell_1_in_cell_2 `lcc.insert_dangling_cell_1_in_cell_2(dh0,p)`\endlink adds a 1-cell in the 2-cell containing dart `d0`, the 1-cell being attached by only one of its vertex to the 0-cell containing dart `d0`. The second vertex of the new edge is associated with a new 0-attribute containing a copy of `p` as point. This operation is possible if `d0`\f$ \in\f$`lcc.darts()` (see example on \cgalFigureRef{fig_lcc_insert_edge}).
|
|
|
|
|
|
|
|
|
|
\cgalFigureBegin{fig_lcc_insert_edge,lcc_insert_edge.svg}
|
|
|
|
|
Example of \link Linear_cell_complex::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2`\endlink, `::insert_cell_1_in_cell_2` and `::remove_cell<1>` operations. <B>Left</B>: Initial linear cell complex. <B>Right</B>: After the insertion of a dangling 1-cell in the 2-cell containing dart <I>d1</I>, and of a 1-cell in the 2-cell containing dart <I>d2</I>. Now if we remove the 1-cells containing dart <I>d4</I> and <I>d5</I>, we obtain a linear cell complex isomorphic to the initial one.
|
|
|
|
|
Example of \link Linear_cell_complex::insert_dangling_cell_1_in_cell_2 `insert_dangling_cell_1_in_cell_2`\endlink, `insert_cell_1_in_cell_2` and `remove_cell<1>` operations. <B>Left</B>: Initial linear cell complex. <B>Right</B>: After the insertion of a dangling 1-cell in the 2-cell containing dart <I>d1</I>, and of a 1-cell in the 2-cell containing dart <I>d2</I>. Now if we remove the 1-cells containing dart <I>d4</I> and <I>d5</I>, we obtain a linear cell complex isomorphic to the initial one.
|
|
|
|
|
\cgalFigureEnd
|
|
|
|
|
|
|
|
|
|
Some examples of use of these operations are given in
|
|
|
|
|
Section \ref ssec5dexample "A 4D Linear Cell Complex".
|
|
|
|
|
Some examples of use of these operations are given in Section \ref ssec5dexample "A 4D Linear Cell Complex".
|
|
|
|
|
|
|
|
|
|
\cgalAdvancedBegin
|
|
|
|
|
If \link CombinatorialMap::set_automatic_attributes_management `set_automatic_attributes_management(false)`\endlink is called, all the future insertion or removal operations will not update non void attributes. These attributes will be updated latter by the call to \link CombinatorialMap::set_automatic_attributes_management `set_automatic_attributes_management(true)`\endlink. This can be useful to speed up an algorithm which uses several successive insertion and removal operations. See example \ref ssecAttributesManagement "Automatic attributes management".
|
|
|
|
|
If `set_automatic_attributes_management(false)` is called, all the future insertion or removal operations will not update non void attributes. These attributes will be updated latter by the call to `set_automatic_attributes_management(true)`. This can be useful to speed up an algorithm which uses several successive insertion and removal operations. See example \ref ssecAttributesManagement "Automatic attributes management".
|
|
|
|
|
\cgalAdvancedEnd
|
|
|
|
|
|
|
|
|
|
\section Linear_cell_complexExamples Examples
|
|
|
|
|
@ -373,17 +260,7 @@ point: 1 1 0, color: 19
|
|
|
|
|
point: 1 0 0, color: 19
|
|
|
|
|
\endverbatim
|
|
|
|
|
|
|
|
|
|
Before applying the sew operation, the eight vertices of the first
|
|
|
|
|
cube are colored by `1`, and the eight vertices of the second cube by
|
|
|
|
|
`19`. After the sew operation, there are eight vertices which are merged
|
|
|
|
|
two by two, and due to the average functor, the color of the four
|
|
|
|
|
resulting vertices is now 10. Then we insert a vertex in the center
|
|
|
|
|
of the common 2-cell between the two cubes. The coordinates of this
|
|
|
|
|
vertex are initialized with the barycenter of the 2-cell
|
|
|
|
|
(-1,0.5,0.5), and its color is not initialized by the method, thus we
|
|
|
|
|
set its color manually by using the result of
|
|
|
|
|
\link Linear_cell_complex::insert_barycenter_in_cell `insert_barycenter_in_cell<2>`\endlink which is a dart incident to the
|
|
|
|
|
new vertex.
|
|
|
|
|
Before applying the sew operation, the eight vertices of the first cube are colored by `1`, and the eight vertices of the second cube by `19`. After the sew operation, there are eight vertices which are merged two by two, and due to the average functor, the color of the four resulting vertices is now 10. Then we insert a vertex in the center of the common 2-cell between the two cubes. The coordinates of this vertex are initialized with the barycenter of the 2-cell (-1,0.5,0.5), and its color is not initialized by the method, thus we set its color manually by using the result of \link Linear_cell_complex::insert_barycenter_in_cell `insert_barycenter_in_cell<2>`\endlink which is a dart incident to the new vertex.
|
|
|
|
|
|
|
|
|
|
\subsection Linear_cell_complexAutomaticAttributesManagement Automatic attributes management
|
|
|
|
|
\anchor ssecAttributesManagement
|
|
|
|
|
@ -396,9 +273,7 @@ We can observe that the second run is faster than the first one. Indeed, updatin
|
|
|
|
|
|
|
|
|
|
\section Linear_cell_complexDesign Design and Implementation History
|
|
|
|
|
|
|
|
|
|
This package was developed by Guillaume Damiand, with the help of
|
|
|
|
|
Andreas Fabri, Sébastien Loriot and Laurent Rineau. Monique
|
|
|
|
|
Teillaud and Bernd Gärtner contributed to the manual.
|
|
|
|
|
This package was developed by Guillaume Damiand, with the help of Andreas Fabri, Sébastien Loriot and Laurent Rineau. Monique Teillaud and Bernd Gärtner contributed to the manual.
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
} /* namespace CGAL */
|
|
|
|
|
|