CGAL 5.1 - 3D Polyhedral Surface
CGAL::Polyhedron_3< Traits >::Halfedge Class Reference

#include <CGAL/Polyhedron_3.h>

Definition

A halfedge is an oriented edge between two vertices.

It is always paired with a halfedge pointing in the opposite direction. The Halfedge::opposite() member function returns this halfedge of opposite orientation. If a halfedge is incident to a facet the Halfedge::next() member function points to the successor halfedge around this facet. For border edges the Halfedge::next() member function points to the successor halfedge along the hole. For more than two border edges at a vertex, the next halfedge along a hole is not uniquely defined, but a consistent assignment of the next halfedge will be maintained in the data structure. An invariant is that successive assignments of the form h = h->next() cycle counterclockwise around the facet (or hole) and traverse all halfedges incident to this facet (or hole). A similar invariant is that successive assignments of the form h = h->next()->opposite() cycle clockwise around the vertex and traverse all halfedges incident to this vertex. Two circulators are provided for these circular orders.

poly_optional.png
The three classes Vertex, Halfedge, and Facet of the polyhedral surface. Member functions with shaded background are mandatory. The others are optionally supported.

The incidences encoded in Halfedge::opposite() and Halfedge::next() are available for each instantiation of polyhedral surfaces. The other incidences are optionally available as indicated with type tags. The Halfedge::prev() member function points to the preceding halfedge around the same facet. It is always available, though it might perform a search around the facet using the Halfedge::next() member function to find the previous halfedge if the underlying halfedge data structure does not provide an efficient Halfedge::prev() member function for halfedges. Handles to the incident vertex and facet are optionally stored.

The circulators are assignable to the Halfedge_handle. The circulators are bidirectional if the halfedge provided to the polyhedron with the Items template argument provides a member function Halfedge::prev(), otherwise they are of the forward category.

See also
CGAL::Polyhedron_3::Vertex
CGAL::Polyhedron_3::Facet
CGAL::Polyhedron_3<Traits>

Implementation

The member functions Halfedge::prev() and Halfedge::prev_on_vertex() work in constant time if Supports_halfedge_prev \( \equiv\) CGAL::Tag_true. Otherwise both methods search for the previous halfedge around the incident facet.

Types

typedef unspecified_type Vertex
 type of incident vertices. More...
 
typedef unspecified_type Facet
 type of incident facets. More...
 
typedef unspecified_type Vertex_handle
 handle to vertex. More...
 
typedef unspecified_type Halfedge_handle
 handle to halfedge. More...
 
typedef unspecified_type Facet_handle
 handle to facet. More...
 
typedef unspecified_type Halfedge_around_vertex_circulator
 circulator of halfedges around a vertex. More...
 
typedef unspecified_type Halfedge_around_facet_circulator
 circulator of halfedges around a facet. More...
 
typedef unspecified_type Vertex_const_handle
 
typedef unspecified_type Halfedge_const_handle
 
typedef unspecified_type Facet_const_handle
 
typedef unspecified_type Halfedge_around_vertex_const_circulator
 
typedef unspecified_type Halfedge_around_facet_const_circulator
 
typedef unspecified_type Supports_halfedge_prev
 \( \equiv\) CGAL::Tag_true or CGAL::Tag_false. More...
 
typedef unspecified_type Supports_halfedge_vertex
 \( \equiv\) CGAL::Tag_true or CGAL::Tag_false. More...
 
typedef unspecified_type Supports_halfedge_face
 \( \equiv\) CGAL::Tag_true or CGAL::Tag_false. More...
 

Creation

 Halfedge ()
 default constructor. More...
 

Operations

Halfedge_handle opposite ()
 
Halfedge_const_handle opposite () const
 the opposite halfedge. More...
 
Halfedge_handle next ()
 
Halfedge_const_handle next () const
 the next halfedge around the facet. More...
 
Halfedge_handle prev ()
 
Halfedge_const_handle prev () const
 the previous halfedge around the facet. More...
 
Halfedge_handle next_on_vertex ()
 
Halfedge_const_handle next_on_vertex () const
 the next halfedge around the vertex (clockwise). More...
 
Halfedge_handle prev_on_vertex ()
 
Halfedge_const_handle prev_on_vertex () const
 the previous halfedge around the vertex (counterclockwise). More...
 
bool is_border () const
 is true if h is a border halfedge. More...
 
bool is_border_edge () const
 is true if this or the opposite halfedge is a border halfedge. More...
 
Halfedge_around_vertex_circulator vertex_begin ()
 
Halfedge_around_vertex_const_circulator vertex_begin () const
 circulator of halfedges around the vertex (clockwise), the vertex of the halfedges being *this. More...
 
Halfedge_around_facet_circulator facet_begin ()
 
Halfedge_around_facet_const_circulator facet_begin () const
 circulator of halfedges around the facet (counterclockwise). More...
 
std::size_t vertex_degree () const
 the degree of the incident vertex, i.e., number of edges emanating from this vertex. More...
 
bool is_bivalent () const
 returns true if the incident vertex has exactly two incident edges. More...
 
bool is_trivalent () const
 returns true if the incident vertex has exactly three incident edges. More...
 
std::size_t facet_degree () const
 the degree of the incident facet, i.e., number of edges on the boundary of this facet. More...
 
bool is_triangle () const
 returns true if the incident facet is a triangle. More...
 
bool is_quad () const
 returns true if the incident facet is a quadrilateral. More...
 

Operations available if Supports_halfedge_vertex is CGAL::Tag_true

Vertex_handle vertex ()
 
Vertex_const_handle vertex () const
 the incident vertex of the halfedge. More...
 

Operations available if Supports_halfedge_facet is CGAL::Tag_true

Facet_handle facet ()
 
Facet_const_handle facet () const
 the incident facet of the halfedge. More...
 

Member Typedef Documentation

◆ Facet

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Facet

type of incident facets.

◆ Facet_const_handle

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Facet_const_handle

◆ Facet_handle

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Facet_handle

handle to facet.

◆ Halfedge_around_facet_circulator

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Halfedge_around_facet_circulator

circulator of halfedges around a facet.

◆ Halfedge_around_facet_const_circulator

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Halfedge_around_facet_const_circulator

◆ Halfedge_around_vertex_circulator

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Halfedge_around_vertex_circulator

circulator of halfedges around a vertex.

◆ Halfedge_around_vertex_const_circulator

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Halfedge_around_vertex_const_circulator

◆ Halfedge_const_handle

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Halfedge_const_handle

◆ Halfedge_handle

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Halfedge_handle

handle to halfedge.

◆ Supports_halfedge_face

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Supports_halfedge_face

\( \equiv\) CGAL::Tag_true or CGAL::Tag_false.

◆ Supports_halfedge_prev

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Supports_halfedge_prev

\( \equiv\) CGAL::Tag_true or CGAL::Tag_false.

◆ Supports_halfedge_vertex

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Supports_halfedge_vertex

\( \equiv\) CGAL::Tag_true or CGAL::Tag_false.

◆ Vertex

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Vertex

type of incident vertices.

◆ Vertex_const_handle

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Vertex_const_handle

◆ Vertex_handle

template<typename Traits >
typedef unspecified_type CGAL::Polyhedron_3< Traits >::Halfedge::Vertex_handle

handle to vertex.

Constructor & Destructor Documentation

◆ Halfedge()

template<typename Traits >
CGAL::Polyhedron_3< Traits >::Halfedge::Halfedge ( )

default constructor.

Member Function Documentation

◆ facet() [1/2]

template<typename Traits >
Facet_handle CGAL::Polyhedron_3< Traits >::Halfedge::facet ( )

◆ facet() [2/2]

template<typename Traits >
Facet_const_handle CGAL::Polyhedron_3< Traits >::Halfedge::facet ( ) const

the incident facet of the halfedge.

If the hafedge is a border halfedge the result is default construction of the handle.

◆ facet_begin() [1/2]

template<typename Traits >
Halfedge_around_facet_circulator CGAL::Polyhedron_3< Traits >::Halfedge::facet_begin ( )

◆ facet_begin() [2/2]

template<typename Traits >
Halfedge_around_facet_const_circulator CGAL::Polyhedron_3< Traits >::Halfedge::facet_begin ( ) const

circulator of halfedges around the facet (counterclockwise).

◆ facet_degree()

template<typename Traits >
std::size_t CGAL::Polyhedron_3< Traits >::Halfedge::facet_degree ( ) const

the degree of the incident facet, i.e., number of edges on the boundary of this facet.

◆ is_bivalent()

template<typename Traits >
bool CGAL::Polyhedron_3< Traits >::Halfedge::is_bivalent ( ) const

returns true if the incident vertex has exactly two incident edges.

◆ is_border()

template<typename Traits >
bool CGAL::Polyhedron_3< Traits >::Halfedge::is_border ( ) const

is true if h is a border halfedge.

◆ is_border_edge()

template<typename Traits >
bool CGAL::Polyhedron_3< Traits >::Halfedge::is_border_edge ( ) const

is true if this or the opposite halfedge is a border halfedge.

◆ is_quad()

template<typename Traits >
bool CGAL::Polyhedron_3< Traits >::Halfedge::is_quad ( ) const

returns true if the incident facet is a quadrilateral.

◆ is_triangle()

template<typename Traits >
bool CGAL::Polyhedron_3< Traits >::Halfedge::is_triangle ( ) const

returns true if the incident facet is a triangle.

◆ is_trivalent()

template<typename Traits >
bool CGAL::Polyhedron_3< Traits >::Halfedge::is_trivalent ( ) const

returns true if the incident vertex has exactly three incident edges.

◆ next() [1/2]

template<typename Traits >
Halfedge_handle CGAL::Polyhedron_3< Traits >::Halfedge::next ( )

◆ next() [2/2]

template<typename Traits >
Halfedge_const_handle CGAL::Polyhedron_3< Traits >::Halfedge::next ( ) const

the next halfedge around the facet.

◆ next_on_vertex() [1/2]

template<typename Traits >
Halfedge_handle CGAL::Polyhedron_3< Traits >::Halfedge::next_on_vertex ( )

◆ next_on_vertex() [2/2]

template<typename Traits >
Halfedge_const_handle CGAL::Polyhedron_3< Traits >::Halfedge::next_on_vertex ( ) const

the next halfedge around the vertex (clockwise).

Is equal to h.next()->opposite().

◆ opposite() [1/2]

template<typename Traits >
Halfedge_handle CGAL::Polyhedron_3< Traits >::Halfedge::opposite ( )

◆ opposite() [2/2]

template<typename Traits >
Halfedge_const_handle CGAL::Polyhedron_3< Traits >::Halfedge::opposite ( ) const

the opposite halfedge.

◆ prev() [1/2]

template<typename Traits >
Halfedge_handle CGAL::Polyhedron_3< Traits >::Halfedge::prev ( )

◆ prev() [2/2]

template<typename Traits >
Halfedge_const_handle CGAL::Polyhedron_3< Traits >::Halfedge::prev ( ) const

the previous halfedge around the facet.

◆ prev_on_vertex() [1/2]

template<typename Traits >
Halfedge_handle CGAL::Polyhedron_3< Traits >::Halfedge::prev_on_vertex ( )

◆ prev_on_vertex() [2/2]

template<typename Traits >
Halfedge_const_handle CGAL::Polyhedron_3< Traits >::Halfedge::prev_on_vertex ( ) const

the previous halfedge around the vertex (counterclockwise).

Is equal to h.opposite()->prev().

◆ vertex() [1/2]

template<typename Traits >
Vertex_handle CGAL::Polyhedron_3< Traits >::Halfedge::vertex ( )

◆ vertex() [2/2]

template<typename Traits >
Vertex_const_handle CGAL::Polyhedron_3< Traits >::Halfedge::vertex ( ) const

the incident vertex of the halfedge.

◆ vertex_begin() [1/2]

template<typename Traits >
Halfedge_around_vertex_circulator CGAL::Polyhedron_3< Traits >::Halfedge::vertex_begin ( )

◆ vertex_begin() [2/2]

template<typename Traits >
Halfedge_around_vertex_const_circulator CGAL::Polyhedron_3< Traits >::Halfedge::vertex_begin ( ) const

circulator of halfedges around the vertex (clockwise), the vertex of the halfedges being *this.

◆ vertex_degree()

template<typename Traits >
std::size_t CGAL::Polyhedron_3< Traits >::Halfedge::vertex_degree ( ) const

the degree of the incident vertex, i.e., number of edges emanating from this vertex.