CGAL 6.2 - Halfedge Data Structures

Loading...
Searching...
No Matches
List of all members
CGAL::HalfedgeDS_list< Traits, HalfedgeDSItems, Alloc > Class Template Reference
Reference Manual » Halfedge Data Structures

`#include <CGAL/HalfedgeDS_list.h>`

## Definition

template<typename Traits, typename HalfedgeDSItems, typename Alloc>
class CGAL::HalfedgeDS_list< Traits, HalfedgeDSItems, Alloc >

The class `HalfedgeDS_list` is a model for the `HalfedgeDS` concept.

`HalfedgeDS_list` is a list-based representation with bidirectional iterators that supports removal.

Is model of
  `HalfedgeDS<Traits,Items,Alloc>`

See also
  `CGAL::HalfedgeDS_default`
  `CGAL::HalfedgeDS_vector`
  `HalfedgeDSItems`
  `CGAL::Polyhedron_3<Traits>`
  `CGAL::HalfedgeDS_items_decorator<HDS>`
  `CGAL::HalfedgeDS_decorator<HDS>`
  `CGAL::HalfedgeDS_const_decorator<HDS>`

Implementation

`HalfedgeDS_list` uses internally the `CGAL::In_place_list` container class. The copy constructor and the assignment operator need \(O(n)\) time with \( n\) the total number of vertices, halfedges, and faces.

`CGAL_ALLOCATOR(int)` is used as default argument for the `Alloc` template parameter.

Examples
  HalfedgeDS/hds_prog_compact2.cpp.

## Types
typedef bidirectional_iterator_tag | iterator_category
typedef CGAL::Tag_true | Supports_removal

## Operations
Besides operations required from the concept `HalfedgeDS<Traits,Items,Alloc>`, this class supports additionally:
void | vertices_splice (Vertex_iterator target, Self &source, Vertex_iterator first, Vertex_iterator last)
| inserts elements in the range [`first, last`) before position `target` and removes the elements from `source`.
void | halfedges_splice (Halfedge_iterator target, Self &source, Halfedge_iterator first, Halfedge_iterator last)
| inserts elements in the range [`first, last`) before position `target` and removes the elements from `source`.
void | faces_splice (Face_iterator target, Self &source, Face_iterator first, Face_iterator last)
| inserts elements in the range [`first, last`) before position `target` and removes the elements from `source`.

## Member Function Documentation

## ◆ faces_splice()

template<typename Traits , typename HalfedgeDSItems , typename Alloc >

void CGAL::HalfedgeDS_list< Traits, HalfedgeDSItems, Alloc >::faces_splice | ( | Face_iterator | target,
|  | Self & | source,
|  | Face_iterator | first,
|  | Face_iterator | last
| ) |  |

inserts elements in the range [`first, last`) before position `target` and removes the elements from `source`.

It takes constant time if `&source == &``hds`; otherwise, it takes linear time in the size of the range.

Precondition
  [`first, last`) is a valid range in `source`. `target` is not in the range [`first, last`).

## ◆ halfedges_splice()

template<typename Traits , typename HalfedgeDSItems , typename Alloc >

void CGAL::HalfedgeDS_list< Traits, HalfedgeDSItems, Alloc >::halfedges_splice | ( | Halfedge_iterator | target,
|  | Self & | source,
|  | Halfedge_iterator | first,
|  | Halfedge_iterator | last
| ) |  |

inserts elements in the range [`first, last`) before position `target` and removes the elements from `source`.

It takes constant time if `&source == &``hds`; otherwise, it takes linear time in the size of the range.

Precondition
  [`first, last`) is a valid range in `source`. `target` is not in the range [`first, last`).

## ◆ vertices_splice()

template<typename Traits , typename HalfedgeDSItems , typename Alloc >

void CGAL::HalfedgeDS_list< Traits, HalfedgeDSItems, Alloc >::vertices_splice | ( | Vertex_iterator | target,
|  | Self & | source,
|  | Vertex_iterator | first,
|  | Vertex_iterator | last
| ) |  |

inserts elements in the range [`first, last`) before position `target` and removes the elements from `source`.

It takes constant time if `&source == &``hds`; otherwise, it takes linear time in the size of the range.

Precondition
  [`first, last`) is a valid range in `source`. `target` is not in the range [`first, last`).