CGAL 6.2 - 3D Constrained Triangulations

Loading...
Searching...
No Matches
List of all members | Public Types | Public Member Functions
CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr > Class Template Reference
Reference Manual » Classes and Class Templates

`#include <CGAL/Conforming_constrained_Delaunay_triangulation_3.h>`

## Definition

template<typename Traits, typename Tr = CGAL::Default>
class CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >

This class template represents a 3D conforming constrained Delaunay triangulation.

It contains a data member of type `Tr` and provides additional functionality for handling polygonal constraints during the triangulation process.

Template Parameters

  Traits | is the geometric traits class and must be a model of `ConformingConstrainedDelaunayTriangulationTraits_3`.
  Tr | is the underlying triangulation class. It must be `CGAL::Default` or an instance of the `CGAL::Triangulation_3` class template with the same `Traits` template parameter. Its `Vertex` type must be a model of `ConformingConstrainedDelaunayTriangulationVertexBase_3`, and its `Cell` type must be a model of `ConformingConstrainedDelaunayTriangulationCellBase_3`. The default value is `Triangulation_3<Traits, TDS>` where `TDS` is `Triangulation_data_structure_3<Conforming_constrained_Delaunay_triangulation_vertex_base_3<Traits>, Conforming_constrained_Delaunay_triangulation_cell_base_3<Traits>>`.

Examples
  Constrained_triangulation_3/ccdt_3_after_autorefinement.cpp, Constrained_triangulation_3/ccdt_3_preprocessing.cpp, and Constrained_triangulation_3/remesh_constrained_Delaunay_triangulation_3.cpp.

## Public Types
using | Triangulation = typename CGAL::Default::Get< Tr, Triangulation_3< Traits, Triangulation_data_structure_3< Conforming_constrained_Delaunay_triangulation_vertex_base_3< Traits >, Conforming_constrained_Delaunay_triangulation_cell_base_3< Traits > > > >::type
| The internal triangulation type.
using | Vertex_handle = typename Triangulation::Vertex_handle
using | size_type = typename Triangulation::size_type
using | Constrained_facets_iterator = unspecified_type
| A bidirectional iterator for visiting all constrained facets of the triangulation.
using | Constrained_facets_range = CGAL::Iterator_range< Constrained_facets_iterator >
| defines a range type for iterating over the constrained facets.

## Public Member Functions
CDT_3::Debug_options & | debug ()
| Access debug options.
const CDT_3::Debug_options & | debug () const
void | use_finite_edges_map (bool b)
void | set_segment_vertex_epsilon (double eps)
bool | is_conforming () const
bool | is_valid (bool verbose=false) const
bool | write_missing_segments_file (std::ostream &out)
void | write_all_segments_file (std::ostream &out)
size_type | number_of_vertices () const
size_type | number_of_cells () const
auto | finite_vertex_handles () const
auto | finite_cell_handles () const
auto | all_cell_handles () const
auto | finite_facets () const
Triangulation::Cell_handle | infinite_cell () const
auto | ancestors_of_Steiner_vertex_on_edge (Vertex_handle v) const
template<typename CDT , typename FacetRange >
void | write_facets (std::ostream &out, const CDT &cdt, FacetRange &&facets) const

## Constructors
`Conforming_constrained_Delaunay_triangulation_3` can be constructed from either a polygon soup or a polygon mesh. ## Input Data The input data requirements are described in the documentation of the function templates.
| Conforming_constrained_Delaunay_triangulation_3 ()
| Default constructor.
template<typename PolygonMesh , typename NamedParameters = CGAL::parameters::Default_named_parameters>
| Conforming_constrained_Delaunay_triangulation_3 (const PolygonMesh &mesh, const NamedParameters &np=parameters::default_values())
| creates a 3D constrained Delaunay triangulation conforming to the faces of a polygon mesh, following the same API and requirements as the function template make_conforming_constrained_Delaunay_triangulation_3().
template<typename PointRange , typename PolygonRange , typename NamedParams = parameters::Default_named_parameters>
| Conforming_constrained_Delaunay_triangulation_3 (const PointRange &points, const PolygonRange &polygons, const NamedParams &np=parameters::default_values())
| creates a 3D constrained Delaunay triangulation conforming to the faces of a polygon soup, following the same API and requirements as the function template make_conforming_constrained_Delaunay_triangulation_3().

## Accessors for the Underlying Triangulation
const Triangulation & | triangulation () const &
| returns a const reference to the underlying triangulation.
Triangulation | triangulation () &&
| moves and returns the underlying triangulation, then clears the object.

## Accessors for Constrained Facets
bool | is_facet_constrained (const typename Triangulation::Facet &f) const
| returns whether a facet is constrained or not.
bool | is_facet_constrained (typename Triangulation::Cell_handle ch, int index) const
| same as `is_facet_constrained(f)` with `f` being `Triangulation::Facet(ch, index)`.
CDT_3_signed_index | face_constraint_index (typename Triangulation::Cell_handle ch, int i) const
| same as `face_constraint_index(f)` with `f` being `Triangulation::Facet(ch, index)`.
CDT_3_signed_index | face_constraint_index (const typename Triangulation::Facet &f) const
| returns the index of the constraint that constrains the facet `f`
Triangulation::size_type | number_of_constrained_facets () const
| returns the number of constrained facets in the triangulation.
Constrained_facets_iterator | constrained_facets_begin () const
| returns an iterator to the start of the sequence of constrained facets.
Constrained_facets_iterator | constrained_facets_end () const
| returns the past-the-end iterator of the sequence of constrained facets.
Constrained_facets_range | constrained_facets () const
| returns a range of the constrained facets.

## Member Typedef Documentation

## ◆ Constrained_facets_iterator

template<typename Traits , typename Tr = CGAL::Default>

using CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::Constrained_facets_iterator = unspecified_type

A bidirectional iterator for visiting all constrained facets of the triangulation.

The value type of this iterator is `Triangulation::Facet`.

## ◆ Constrained_facets_range

template<typename Traits , typename Tr = CGAL::Default>

using CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::Constrained_facets_range = CGAL::Iterator_range<Constrained_facets_iterator>

defines a range type for iterating over the constrained facets.

This type is used to iterate through all facets that are constrained. Its iterator type is `Constrained_facets_iterator`.

## Constructor & Destructor Documentation

## ◆ Conforming_constrained_Delaunay_triangulation_3()

template<typename Traits , typename Tr = CGAL::Default>

CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::Conforming_constrained_Delaunay_triangulation_3 | ( |  | ) |

Default constructor.

This constructor initializes an empty `Conforming_constrained_Delaunay_triangulation_3` object.

## Member Function Documentation

## ◆ constrained_facets()

template<typename Traits , typename Tr = CGAL::Default>

Constrained_facets_range CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::constrained_facets | ( |  | ) | const

returns a range of the constrained facets.

Its iterator type is `Constrained_facets_iterator`

## ◆ constrained_facets_begin()

template<typename Traits , typename Tr = CGAL::Default>

Constrained_facets_iterator CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::constrained_facets_begin | ( |  | ) | const

returns an iterator to the start of the sequence of constrained facets.

This function provides an iterator to the first facet that is constrained within the triangulation. The sequence of constrained facets is in an arbitrary order.

## ◆ debug()

template<typename Traits , typename Tr = CGAL::Default>

CDT_3::Debug_options & CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::debug | ( |  | ) |

Access debug options.

Returns a reference to the debug options object that controls various debugging and algorithmic behaviors. Use this to configure debug flags:

ccdt.debug().Steiner_points(true);
ccdt.debug().input_faces(true);

## ◆ face_constraint_index() [1/2]

template<typename Traits , typename Tr = CGAL::Default>

CDT_3_signed_index CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::face_constraint_index | ( | const typename Triangulation::Facet & | f | ) | const

returns the index of the constraint that constrains the facet `f`

Precondition
  `is_facet_constrained`(`f`)

## ◆ face_constraint_index() [2/2]

template<typename Traits , typename Tr = CGAL::Default>

CDT_3_signed_index CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::face_constraint_index | ( | typename Triangulation::Cell_handle | ch,
|  | int | i
| ) |  | const

same as `face_constraint_index(f)` with `f` being `Triangulation::Facet(ch, index)`.

Precondition
  `is_facet_constrained`(`f`)

## ◆ is_facet_constrained()

template<typename Traits , typename Tr = CGAL::Default>

bool CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::is_facet_constrained | ( | const typename Triangulation::Facet & | f | ) | const

returns whether a facet is constrained or not.

Parameters

  f | is a facet of the triangulation, of type `Triangulation::Facet`, as defined by its triangulation data structure.

## ◆ triangulation() [1/2]

template<typename Traits , typename Tr = CGAL::Default>

Triangulation CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::triangulation | ( |  | ) | &&

moves and returns the underlying triangulation, then clears the object.

This function allows the underlying triangulation to be moved out of this object.

Example usage:

auto tr = std::move(ccdt).triangulation();
// Now `tr` is a valid `CGAL::Triangulation_3` object that can be used for further processing.
// and the triangulation of `ccdt` is empty.
std::cout << "Number of vertices in the triangulation `tr`: "
<< tr.number_of_vertices() << '\n';
std::cout << "Number of vertices in `ccdt`: "
<< ccdt.triangulation().number_of_vertices() << '\n';
assert(ccdt.triangulation().number_of_vertices() == 0);

After calling this function, `ccdt` will be empty and `tr` will be move-constructed from the underlying triangulation, avoiding any copy.

Note
  This function is available only when the object is an rvalue.

Postcondition
  After this function is called, the object is in a state equivalent to that of a default-constructed object.

## ◆ triangulation() [2/2]

template<typename Traits , typename Tr = CGAL::Default>

const Triangulation & CGAL::Conforming_constrained_Delaunay_triangulation_3< Traits, Tr >::triangulation | ( |  | ) | const &

returns a const reference to the underlying triangulation.

This allows the use of all non-modifying functions of the base triangulation. See the other overload for a way to move the triangulation out of this object and then modify it.

Example usage:

std::cout << "Number of vertices in the CDT: "
<< ccdt.triangulation().number_of_vertices() << '\n';