extra run of the script to remove tabs and trailing whitespaces

This commit is contained in:
Sébastien Loriot 2020-03-26 19:27:08 +01:00
parent 24a1bf5c23
commit f8414293d7
4 changed files with 558 additions and 558 deletions

View File

@ -12,7 +12,7 @@ in the triangulation.
The class `Constrained_triangulation_plus_2<Tr>`
inherits from its template parameter Tr, which has to be instantiated
by a constrained or constrained Delaunay triangulation.
The intersection tag of the base class determines whether
The intersection tag of the base class determines whether
intersecting input constraints are supported or not.
When intersections of input constraints are supported,
the base class constructs a triangulation of the arrangement
@ -28,7 +28,7 @@ either vertices of the input constraint or intersection points.
\todo The following description does not match the code
Two consecutive vertices of an input constraint form a *subconstraint*.
A subconstraint is a pair of vertex handles and corresponds to a constrained edge of the
triangulation, which is a pair of a face handle and an index.
triangulation, which is a pair of a face handle and an index.
The triangulation also enables the retrieval of the set
of subconstraints of the triangulation (not ordered along constraints).
@ -38,82 +38,82 @@ one can obtain the input constraints which induce `e`.
\tparam Tr must be either a CGAL::Constrained_triangulation_2 or a CGAL::Constrained_Delaunay_triangulation_2
\sa `CGAL::Constrained_triangulation_2<Traits,Tds>`
\sa `CGAL::Constrained_Delaunay_triangulation_2<Traits,Tds>`
\sa `ConstrainedTriangulationTraits_2`
\sa `ConstrainedDelaunayTriangulationTraits_2`
\sa `CGAL::Constrained_triangulation_2<Traits,Tds>`
\sa `CGAL::Constrained_Delaunay_triangulation_2<Traits,Tds>`
\sa `ConstrainedTriangulationTraits_2`
\sa `ConstrainedDelaunayTriangulationTraits_2`
*/
template< typename Tr >
class Constrained_triangulation_plus_2 : public Tr {
public:
/// \name Types
/// \name Types
/// @{
/*!
The triangulation base class.
*/
typedef Tr Triangulation;
/*!
The intersection tag as defined in `Tr`.
*/
typedef Tr::Intersection_tag Intersection_tag;
/*!
The identifier of a polyline constraint.
The class is model of `Assignable`, `CopyConstructible`, `DefaultConstructible`, `LessThanComparable` and `EqualityComparable`.
The triangulation base class.
*/
typedef Tr Triangulation;
/*!
The intersection tag as defined in `Tr`.
*/
typedef Tr::Intersection_tag Intersection_tag;
/*!
The identifier of a polyline constraint.
The class is model of `Assignable`, `CopyConstructible`, `DefaultConstructible`, `LessThanComparable` and `EqualityComparable`.
A default constructed `Constraint_id` is a singular value that can not be the ID of a constraint.
*/
typedef unspecified_type Constraint_id;
/*!
An iterator to visit
all the input constraints. The order of visit is undefined.
The value type of this iterator is `Constraint_id`.
*/
typedef unspecified_type Constraint_iterator;
/*!
An iterator to visit
all the input constraints. The order of visit is undefined.
The value type of this iterator is `Constraint_id`.
*/
typedef unspecified_type Constraint_iterator;
/*!
A range type for iterating over all constraints.
*/
*/
typedef Iterator_range<Constraint_iterator> Constraints;
/*!
A subconstraint is a pair of vertices that correspond to an `Edge`.
*/
typedef std::pair<Vertex_handle, Vertex_handle> Subconstraint;
/*!
An iterator
to visit all the subconstraints of the triangulation.
The order of visit is undefined.
The value type of this iterator is `std::pair<Subconstraint,std::list<Context>*>`
corresponding to the vertices of the
subconstraint.
*/
typedef unspecified_type Subconstraint_iterator;
/*!
An iterator
to visit all the subconstraints of the triangulation.
The order of visit is undefined.
The value type of this iterator is `std::pair<Subconstraint,std::list<Context>*>`
corresponding to the vertices of the
subconstraint.
*/
typedef unspecified_type Subconstraint_iterator;
/*!
A range type for iterating over all subconstraints.
*/
*/
typedef Iterator_range<Subconstraint_iterator> Subconstraints;
/*!
An iterator on the
vertices of the chain of subconstraints representing a
constraint. The value type of this iterator is `Vertex_handle`.
*/
typedef unspecified_type Vertices_in_constraint_iterator;
/*!
A context enables the access to the vertices of a constraint that pass
/*!
An iterator on the
vertices of the chain of subconstraints representing a
constraint. The value type of this iterator is `Vertex_handle`.
*/
typedef unspecified_type Vertices_in_constraint_iterator;
/*!
A context enables the access to the vertices of a constraint that pass
through a subconstraint.
*/
*/
class Context {
public:
/*!
@ -137,121 +137,121 @@ through a subconstraint.
correspond to the two vertices of the subconstraint.
*/
Vertices_in_constraint_iterator current() const;
};
};
/*!
An iterator on
constraints enclosing a given subconstraint. The value type of this
iterator
is `Context`.
*/
typedef unspecified_type Context_iterator;
/*!
An iterator on
constraints enclosing a given subconstraint. The value type of this
iterator
is `Context`.
*/
typedef unspecified_type Context_iterator;
/*!
range type for iterating over contexts.
*/
typedef Iterator_range<Context_iterator> Contexts;
/// @}
typedef Iterator_range<Context_iterator> Contexts;
/// @}
/// \name Creation
/// \name Creation
/// @{
/*!
/*!
Introduces an empty triangulation.
*/
Constrained_triangulation_plus_2(const Geom_traits& gt=Geom_traits());
*/
Constrained_triangulation_plus_2(const Geom_traits& gt=Geom_traits());
/*!
Copy constructor.
*/
Constrained_triangulation_plus_2(const
Constrained_triangulation_plus_2& ct);
/*!
Copy constructor.
*/
Constrained_triangulation_plus_2(const
Constrained_triangulation_plus_2& ct);
/*!
Introduces a constrained triangulation
/*!
Introduces a constrained triangulation
from the constraints in the range `[first,last)`.
\tparam ConstraintIterator must be an `InputIterator` with the value type `std::pair<Point,Point>` or `Segment`.
*/
template<class ConstraintIterator>
Constrained_triangulation_plus_2(
ConstraintIterator first,
\tparam ConstraintIterator must be an `InputIterator` with the value type `std::pair<Point,Point>` or `Segment`.
*/
template<class ConstraintIterator>
Constrained_triangulation_plus_2(
ConstraintIterator first,
ConstraintIterator last,
const Geom_traits& gt= Geom_traits());
const Geom_traits& gt= Geom_traits());
/// @}
/// @}
/// \name Assignment
/// \name Assignment
/// @{
/*!
Assignment. All the vertices and faces are duplicated.
/*!
Assignment. All the vertices and faces are duplicated.
The bidirectional mapping between constraints and subconstraints is also duplicated.
*/
Constrained_triangulation_plus_2 operator=(const
Constrained_triangulation_plus_2& tr);
*/
Constrained_triangulation_plus_2 operator=(const
Constrained_triangulation_plus_2& tr);
/*!
The triangulations `tr` and this triangulation are swapped.
This operation should be preferred to the assignment or to
the copy constructor if `tr` is deleted after that.
*/
void swap(Constrained_triangulation_plus_2 tr);
/*!
The triangulations `tr` and this triangulation are swapped.
This operation should be preferred to the assignment or to
the copy constructor if `tr` is deleted after that.
*/
void swap(Constrained_triangulation_plus_2 tr);
/// @}
/// @}
/// \name Insertion and Removal
/// \name Insertion and Removal
/// The class `Constrained_triangulation_plus_2` overwrites the
/// following insertion and removal member functions for points and
/// constraints.
/// @{
/*!
inserts point `p` as a vertex of the triangulation.
*/
Vertex_handle insert(const Point& p,
Face_handle start = Face_handle() );
/*!
inserts point `p` as a vertex of the triangulation.
*/
Vertex_handle insert(const Point& p,
Face_handle start = Face_handle() );
/*!
inserts point `p` in the triangulation at the location given by `(lt,loc,i)`.
/*!
inserts point `p` in the triangulation at the location given by `(lt,loc,i)`.
\sa `Triangulation_2::locate()`
*/
Vertex_handle insert(const Point& p,
Locate_type lt,
Face_handle loc, int li );
*/
Vertex_handle insert(const Point& p,
Locate_type lt,
Face_handle loc, int li );
/*!
Equivalent to `insert(p)`.
*/
Vertex_handle push_back(const Point& p);
/*!
Equivalent to `insert(p)`.
*/
Vertex_handle push_back(const Point& p);
/*!
/*!
inserts the points in the range `[first,last)`.
Returns the number of inserted points.
\tparam PointIterator must be an `InputIterator` with the value type `Point`.
*/
template < class PointIterator >
size_type
insert(PointIterator first, PointIterator last);
Returns the number of inserted points.
\tparam PointIterator must be an `InputIterator` with the value type `Point`.
*/
template < class PointIterator >
size_type
insert(PointIterator first, PointIterator last);
/*!
/*!
inserts the constraint segment `ab` in the triangulation.
If the two points are equal the point is inserted but no constraint,
and the default constructed `Constraint_id` is returned.
*/
*/
Constraint_id insert_constraint(Point a, Point b);
/*!
inserts the constraint `c`.
*/
void push_back(const std::pair<Point,Point>& c);
/*!
inserts the constraint `c`.
*/
void push_back(const std::pair<Point,Point>& c);
/*!
inserts a constraint whose endpoints are the vertices
/*!
inserts a constraint whose endpoints are the vertices
pointed by `va` and `vb` in the triangulation.
If the two vertex handles are equal no constraint is inserted,
and the default constructed `Constraint_id` is returned.
*/
*/
Constraint_id insert_constraint(Vertex_handle va, Vertex_handle vb);
/*!
@ -262,7 +262,7 @@ When traversing the vertices of a closed polyline constraint with a `Vertices_i
In case the range is empty `Constraint_id()`is returned.
In case all points are equal the point is inserted but no constraint,
and `Constraint_id()`is returned.
\tparam PointIterator must be an `InputIterator` with the value type `Point`.
\tparam PointIterator must be an `InputIterator` with the value type `Point`.
*/
template < class PointIterator>
Constraint_id insert_constraint(PointIterator first, PointIterator last, bool close=false);
@ -293,7 +293,7 @@ std::size_t insert_constraints(PointIterator points_first, PointIterator points_
IndicesIterator indices_first, IndicesIterator indices_last);
/*!
/*!
splits into constraints the graph of subconstraints.
Consider the graph `g={V,E}` where `V` is the set of vertices of the
@ -314,115 +314,115 @@ omitted, a function always returning `false` will be used, that is no
degree 2 vertex will be considered as a polyline endpoint.
\sa `split_graph_into_polylines()`
*/
*/
void split_subconstraint_graph_into_constraints(const std::function<bool(Vertex_handle)>& is_terminal);
/*!
/*!
removes the constraint `cid`, without removing the points from the triangulation.
*/
void remove_constraint(Constraint_id cid);
*/
void remove_constraint(Constraint_id cid);
/// @}
/// @}
/// \name Access
/// \name Access
/// @{
/*!
returns a `Constraint_iterator` that points at the first
constraint of the triangulation.
*/
Constraint_iterator constraints_begin() const;
/*!
returns a `Constraint_iterator` that points at the first
constraint of the triangulation.
*/
Constraint_iterator constraints_begin() const;
/*!
returns the past-the-end iterator of the constraints of the triangulation.
*/
Constraint_iterator constraints_end() const;
/*!
returns the past-the-end iterator of the constraints of the triangulation.
*/
Constraint_iterator constraints_end() const;
/*!
returns a range of constraints.
*/
Subconstraints constraints() const;
/*!
returns a `Subconstraint_iterator` pointing at the first
subconstraint of the triangulation.
*/
Subconstraint_iterator subconstraints_begin() const;
*/
Subconstraints constraints() const;
/*!
returns the past-the-end iterator of the subconstraints of the triangulation.
*/
Subconstraint_iterator subconstraints_end() const;
/*!
returns a `Subconstraint_iterator` pointing at the first
subconstraint of the triangulation.
*/
Subconstraint_iterator subconstraints_begin() const;
/*!
returns the past-the-end iterator of the subconstraints of the triangulation.
*/
Subconstraint_iterator subconstraints_end() const;
/*!
returns a range of subconstraints.
*/
Subconstraints subconstraints() const;
/*!
returns the number of constraints enclosing the subconstraint
`(va,vb)`.
\pre `va` and `vb` refer to the vertices of a constrained edge of the triangulation.
*/
int number_of_enclosing_constraints(Vertex_handle va,
Vertex_handle vb) const;
/*!
returns the `Context` relative to one of the constraints
enclosing the subconstraint `(va,vb)`.
\pre `va` and `vb` refer to the vertices of a constrained edge of the triangulation.
*/
Context context(Vertex_handle va, Vertex_handle vb) const;
/*!
returns an iterator pointing at the first `Context`
of the sequence of contexts
corresponding to the constraints enclosing the subconstraint `(va,vb)`.
\pre `va` and `vb` refer to the vertices of a constrained edge of the triangulation.
*/
Context_iterator contexts_begin(Vertex_handle va,
Vertex_handle vb) const;
*/
Subconstraints subconstraints() const;
/*!
returns an iterator past the end `Context`
returns the number of constraints enclosing the subconstraint
`(va,vb)`.
\pre `va` and `vb` refer to the vertices of a constrained edge of the triangulation.
*/
int number_of_enclosing_constraints(Vertex_handle va,
Vertex_handle vb) const;
/*!
returns the `Context` relative to one of the constraints
enclosing the subconstraint `(va,vb)`.
\pre `va` and `vb` refer to the vertices of a constrained edge of the triangulation.
*/
Context context(Vertex_handle va, Vertex_handle vb) const;
/*!
returns an iterator pointing at the first `Context`
of the sequence of contexts
corresponding to the constraints enclosing the subconstraint `(va,vb)`.
\pre `va` and `vb` refer to the vertices of a constrained edge of the triangulation.
*/
Context_iterator contexts_end(Vertex_handle va,
Vertex_handle vb) const;
corresponding to the constraints enclosing the subconstraint `(va,vb)`.
\pre `va` and `vb` refer to the vertices of a constrained edge of the triangulation.
*/
Context_iterator contexts_begin(Vertex_handle va,
Vertex_handle vb) const;
/*!
returns an iterator past the end `Context`
of the sequence of contexts
corresponding to the constraints enclosing the subconstraint `(va,vb)`.
\pre `va` and `vb` refer to the vertices of a constrained edge of the triangulation.
*/
Context_iterator contexts_end(Vertex_handle va,
Vertex_handle vb) const;
/*!
returns a range of contexts.
*/
Contexts contexts(Vertex_handle va,
Vertex_handle vb) const;
/*!
returns an iterator on the first vertex on the constraint `cid`.
*/
Vertices_in_constraint_iterator
vertices_in_constraint_begin(Constraint_id cid) const;
Contexts contexts(Vertex_handle va,
Vertex_handle vb) const;
/*!
returns an iterator past the last vertex on the constraint `cid`.
*/
Vertices_in_constraint_iterator
vertices_in_constraint_end(Constraint_id cid) const;
returns an iterator on the first vertex on the constraint `cid`.
*/
Vertices_in_constraint_iterator
vertices_in_constraint_begin(Constraint_id cid) const;
/*!
returns a range of the vertices on the constraint `cid`.
*/
returns an iterator past the last vertex on the constraint `cid`.
*/
Vertices_in_constraint_iterator
vertices_in_constraint_end(Constraint_id cid) const;
/*!
returns a range of the vertices on the constraint `cid`.
*/
Vertices_in_constraint
vertices_in_constraint(Constraint_id cid) const;
vertices_in_constraint(Constraint_id cid) const;
/// @}
/*! \name Polyline Simplification
\cgalAdvancedBegin
\cgalAdvancedBegin
The polyline simplification algorithm described in Chapter
\ref Chapter_2D_Polyline_simplification
\ref Chapter_2D_Polyline_simplification
operates on polyline constraints. The algorithm removes
in each simplification step
a vertex of a constraint and at the same time from the triangulation.
@ -430,16 +430,16 @@ The class `Constrained_triangulation_plus_2` stores
for each constraint not only the sequence of vertices but
also the original sequence of points at those vertices.
As the `Vertices_in_constraint_iterator` enables the traversal of
the current set of vertices, the `Points_in_constraint_iterator`
enables the traversal of the points that were in the constraint
the current set of vertices, the `Points_in_constraint_iterator`
enables the traversal of the points that were in the constraint
before the simplification algorithm started.
It enables the simplification algorithm to compute the error introduced by
It enables the simplification algorithm to compute the error introduced by
each simplification step:
it is the distance of the current sequence (vertices) to the original
sequence (points).
Those stored points which do not correspond to a vertex can be removed
Those stored points which do not correspond to a vertex can be removed
afterward either for a single constraint or for all constraints.
The simplification algorithm uses the following types and functions.
@ -467,7 +467,7 @@ Returns an iterator to the first point on the constraint before any simplificati
\cgalAdvancedEnd
*/
Points_in_constraint_iterator points_in_constraint_begin(Constraint_id cid) const;
/*!
\cgalAdvancedFunction
\cgalAdvancedBegin
@ -485,7 +485,7 @@ of the constraint until `remove_points_without_corresponding_vertex(Constraint_i
or `remove_points_without_corresponding_vertex()` is called.
The polyline simplification algorithm described in Chapter
\ref Chapter_2D_Polyline_simplification
\ref Chapter_2D_Polyline_simplification
operates on polyline constraints and applies `simplify()` to vertices in
constraints based on a cost and stop function.
@ -529,20 +529,20 @@ remove_points_without_corresponding_vertex();
Writes the triangulation as for `Tr`, then writes one constraint per line, starting with the number
of vertices and the indices of the vertices of the constraint.
\relates Constrained_triangulation_plus_2
\relates Constrained_triangulation_plus_2
*/
template <typename Tr>
std::ostream & operator<<(std::ostream& os, const Constrained_triangulation_plus_2<Tr> &ctp);
/*!
Reads a triangulation from stream `is` and assigns it to the triangulation.
\relates Constrained_triangulation_plus_2
/*!
Reads a triangulation from stream `is` and assigns it to the triangulation.
\relates Constrained_triangulation_plus_2
*/
template <typename Tr>
std::istream & operator>>(std::istream& is, Constrained_triangulation_plus_2<Tr> &ctp);
} /* end namespace CGAL */

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
//
// Author(s) : Andreas Fabri, Mariette Yvinec
@ -57,25 +57,25 @@ public:
}
}; // end class template Pct2_vertex_handle_less_xy
// Tr the base triangulation class
// Tr the base triangulation class
// Tr has to be Constrained or Constrained_Delaunay with Constrained_triangulation_plus_vertex_base
template < class Tr_ = Default >
class Constrained_triangulation_plus_2
: public
Default::Get< Tr_, Constrained_Delaunay_triangulation_2<
class Constrained_triangulation_plus_2
: public
Default::Get< Tr_, Constrained_Delaunay_triangulation_2<
Exact_predicates_inexact_constructions_kernel
, Triangulation_data_structure_2<
, Triangulation_data_structure_2<
Triangulation_vertex_base_2<Exact_predicates_inexact_constructions_kernel>
, Constrained_triangulation_face_base_2<Exact_predicates_inexact_constructions_kernel>
>
, CGAL::Exact_predicates_tag
> >::type
{
typedef typename
Default::Get< Tr_, Constrained_Delaunay_triangulation_2<
typedef typename
Default::Get< Tr_, Constrained_Delaunay_triangulation_2<
Exact_predicates_inexact_constructions_kernel
, Triangulation_data_structure_2<
, Triangulation_data_structure_2<
Triangulation_vertex_base_2<Exact_predicates_inexact_constructions_kernel>
, Constrained_triangulation_face_base_2<Exact_predicates_inexact_constructions_kernel>
>
@ -89,7 +89,7 @@ Default::Get< Tr_, Constrained_Delaunay_triangulation_2<
typedef typename CDT::Vertex_handle Vertex_handle;
typedef typename CDT::Face_handle Face_handle;
private:
typedef boost::tuple<Vertex_handle, Vertex_handle, Vertex_handle> TFace;
typedef boost::tuple<Vertex_handle, Vertex_handle, Vertex_handle> TFace;
std::vector<TFace> faces;
CDT& cdt;
@ -111,8 +111,8 @@ Default::Get< Tr_, Constrained_Delaunay_triangulation_2<
void
write_faces(OutputIterator out)
{
for(typename std::vector<TFace>::reverse_iterator
it = faces.rbegin(); it != faces.rend(); ++it) {
for(typename std::vector<TFace>::reverse_iterator
it = faces.rbegin(); it != faces.rend(); ++it) {
Face_handle fh;
if(cdt.is_face(boost::get<0>(*it), boost::get<1>(*it), boost::get<2>(*it), fh)){
*out++ = fh;
@ -127,7 +127,7 @@ public:
typedef Constrained_triangulation_plus_2<Tr_> Self;
typedef Tr Base;
#ifndef CGAL_CFG_USING_BASE_MEMBER_BUG_2
using Triangulation::vertices_begin;
using Triangulation::vertices_end;
@ -170,29 +170,29 @@ public:
typedef Tag_false Periodic_tag;
// for user interface with the constraint hierarchy
typedef typename Constraint_hierarchy::Vertex_it
typedef typename Constraint_hierarchy::Vertex_it
Vertices_in_constraint_iterator;
typedef Iterator_range<Vertices_in_constraint_iterator> Vertices_in_constraint;
typedef typename Constraint_hierarchy::Point_it
Points_in_constraint_iterator;
typedef Iterator_range<Points_in_constraint_iterator> Points_in_constraint;
typedef typename Constraint_hierarchy::Context Context;
typedef typename Constraint_hierarchy::Context_iterator Context_iterator;
typedef Iterator_range<Context_iterator> Contexts;
typedef typename Constraint_hierarchy::C_iterator Constraint_iterator;
typedef Iterator_range<Constraint_iterator> Constraints;
typedef typename Constraint_hierarchy::Subconstraint_iterator Subconstraint_iterator;
typedef Iterator_range<Subconstraint_iterator> Subconstraints;
typedef typename Constraint_hierarchy::Constraint_id Constraint_id;
typedef typename Constraint_hierarchy::Constraint_id Constraint_id;
typedef std::pair<Vertex_handle, Vertex_handle> Subconstraint;
using Triangulation::geom_traits;
using Triangulation::cw;
using Triangulation::ccw;
@ -200,14 +200,14 @@ public:
protected:
Constraint_hierarchy hierarchy;
public:
Constraint_hierarchy& hierarchy_ref()
{
return hierarchy;
}
Constrained_triangulation_plus_2(const Geom_traits& gt=Geom_traits())
Constrained_triangulation_plus_2(const Geom_traits& gt=Geom_traits())
: Triangulation(gt)
, hierarchy(Vh_less_xy(this))
{ }
@ -227,8 +227,8 @@ public:
template<class InputIterator>
Constrained_triangulation_plus_2(InputIterator first,
InputIterator last,
const Geom_traits& gt=Geom_traits() )
InputIterator last,
const Geom_traits& gt=Geom_traits() )
: Triangulation(gt)
, hierarchy(Vh_less_xy(this))
{
@ -238,7 +238,7 @@ public:
Constrained_triangulation_plus_2(const std::list<std::pair<Point,Point> > &constraints,
const Geom_traits& gt=Geom_traits() )
const Geom_traits& gt=Geom_traits() )
: Triangulation(gt)
, hierarchy(Vh_less_xy(this))
{
@ -251,12 +251,12 @@ public:
void swap(Constrained_triangulation_plus_2 &ctp);
// INSERTION
Vertex_handle insert(const Point& a,
Face_handle start = Face_handle() );
Vertex_handle insert(const Point& a,
Face_handle start = Face_handle() );
Vertex_handle insert(const Point& p,
Locate_type lt,
Face_handle loc, int li );
Locate_type lt,
Face_handle loc, int li );
Constraint_id insert_constraint(const Point& a, const Point& b)
{
Vertex_handle va= insert(a);
@ -264,14 +264,14 @@ public:
// close to point a
// Otherwise, to start here is as good as elsewhere
Vertex_handle vb = insert(b, va->face());
return insert_constraint(va, vb);
return insert_constraint(va, vb);
}
Constraint_id insert_constraint(const Constraint& c)
Constraint_id insert_constraint(const Constraint& c)
{
return insert_constraint(c.first, c.second);
}
Constraint_id insert_constraint(Vertex_handle va, Vertex_handle vb)
{
// protects against inserting a zero length constraint
@ -280,7 +280,7 @@ public:
}
// protects against inserting twice the same constraint
Constraint_id cid = hierarchy.insert_constraint_old_API(va, vb);
if (va != vb && (cid != Constraint_id(nullptr)) ) insert_subconstraint(va,vb);
if (va != vb && (cid != Constraint_id(nullptr)) ) insert_subconstraint(va,vb);
return cid;
}
@ -343,7 +343,7 @@ public:
}
// for backward compatibility
// not const Point&, because otherwise VC6/7 messes it up with
// not const Point&, because otherwise VC6/7 messes it up with
// the insert that takes an iterator range
Constraint_id insert(Point a, Point b) { return insert_constraint(a, b); }
Constraint_id insert(Vertex_handle va, Vertex_handle vb) { return insert_constraint(va,vb); }
@ -370,8 +370,8 @@ public:
Vertices_in_constraint_iterator
insert_vertex_in_constraint(Constraint_id cid, Vertices_in_constraint_iterator pos,
Vertex_handle vh)
insert_vertex_in_constraint(Constraint_id cid, Vertices_in_constraint_iterator pos,
Vertex_handle vh)
{
return insert_vertex_in_constraint(cid, pos, vh, Emptyset_iterator());
}
@ -385,8 +385,8 @@ public:
template <class OutputIterator>
Vertices_in_constraint_iterator
remove_vertex_from_constraint(Constraint_id cid, Vertices_in_constraint_iterator pos,
OutputIterator out)
remove_vertex_from_constraint(Constraint_id cid, Vertices_in_constraint_iterator pos,
OutputIterator out)
{
if(pos == vertices_in_constraint_begin(cid)){
++pos;
@ -427,7 +427,7 @@ public:
++pos;
tail = hierarchy.split(cid,pos);
}
Constraint_id aux = insert_constraint(a, b, std::back_inserter(fc));
pos = vertices_in_constraint_end(aux);
--pos;
@ -452,8 +452,8 @@ public:
// Writes the modified faces to out
template <class OutputIterator>
Vertices_in_constraint_iterator
insert_vertex_in_constraint(Constraint_id cid, Vertices_in_constraint_iterator pos,
Vertex_handle vh, OutputIterator out)
insert_vertex_in_constraint(Constraint_id cid, Vertices_in_constraint_iterator pos,
Vertex_handle vh, OutputIterator out)
{
// Insertion before the first vertex
if(pos == vertices_in_constraint_begin(cid)){
@ -461,7 +461,7 @@ public:
Constraint_id head = insert_constraint(vh, *pos, out);
hierarchy.concatenate2(head, cid);
return vertices_in_constraint_begin(cid);
}
}
// Insertion after the last vertex
if(pos == vertices_in_constraint_end(cid)){
@ -474,7 +474,7 @@ public:
return pos;
}
Vertex_handle b = *pos;
--pos;
--pos;
Vertex_handle a = *pos;
++pos;
Face_container<Constrained_triangulation_plus_2> fc(*this);
@ -483,7 +483,7 @@ public:
vcit = beg;
++beg;
// If the constraint consists only of a segment, and we want to insert
// in the middle
// in the middle
if((pos == vcit) && (beg == vertices_in_constraint_end(cid))){
//std::cout << "insertion in constraint which is a segment" << std::endl;
Constraint_id aux1 = insert_constraint(a, vh, std::back_inserter(fc));
@ -494,7 +494,7 @@ public:
remove_constraint(aux1, std::back_inserter(fc));
fc.write_faces(out);
return pos;
}
Constraint_id head = 0, tail = 0;
Vertices_in_constraint_iterator bit = vertices_in_constraint_begin(cid);
@ -513,9 +513,9 @@ public:
--eit;
if(pos != eit){
//std::cout << "split tail" << std::endl;
tail = split(cid, pos);
tail = split(cid, pos);
}
// make the new constraint
Constraint_id aux1 = insert_constraint(a, vh, std::back_inserter(fc));
Constraint_id aux2 = insert_constraint(vh, b, std::back_inserter(fc));
@ -551,7 +551,7 @@ public:
hint = vh->face();
// no duplicates
if(vertices.empty() || (vertices.back() != vh)){
vertices.push_back(vh);
vertices.push_back(vh);
}
}
int n = vertices.size();
@ -559,24 +559,24 @@ public:
return nullptr;
}
Constraint_id ca = hierarchy.insert_constraint(vertices[0],vertices[1]);
insert_subconstraint(vertices[0],vertices[1], std::back_inserter(fc));
insert_subconstraint(vertices[0],vertices[1], std::back_inserter(fc));
if(n>2){
for(int j=1; j<n-1; j++){
hierarchy.append_constraint(ca, vertices[j], vertices[j+1]);
insert_subconstraint(vertices[j], vertices[j+1], std::back_inserter(fc));
hierarchy.append_constraint(ca, vertices[j], vertices[j+1]);
insert_subconstraint(vertices[j], vertices[j+1], std::back_inserter(fc));
}
}
for(Vertices_in_constraint_iterator vcit = vertices_in_constraint_begin(ca);
vcit != vertices_in_constraint_end(ca);
vcit++){
vcit != vertices_in_constraint_end(ca);
vcit++){
insert_incident_faces(vcit, out);
}
//AF vertices_in_constraint_begin(ca)->fixed() = true;
// Vertices_in_constraint_iterator end = boost::prior(vertices_in_constraint_end(ca));
// end->fixed() = true;
fc.write_faces(out);
return ca;
}
@ -592,7 +592,7 @@ private:
hint = vh->face();
// no duplicates
if(vertices.empty() || (vertices.back() != vh)){
vertices.push_back(vh);
vertices.push_back(vh);
}
}
if(is_polygon && (vertices.size()>1) && (vertices.front() != vertices.back())){
@ -604,26 +604,26 @@ private:
return nullptr;
}
CGAL_assertion(n >= 2);
Constraint_id ca = hierarchy.insert_constraint(vertices[0],vertices[1]);
insert_subconstraint(vertices[0],vertices[1]);
insert_subconstraint(vertices[0],vertices[1]);
if(n>2){
for(std::size_t j=1; j<n-1; j++){
hierarchy.append_constraint(ca, vertices[j], vertices[j+1]);
insert_subconstraint(vertices[j], vertices[j+1]);
hierarchy.append_constraint(ca, vertices[j], vertices[j+1]);
insert_subconstraint(vertices[j], vertices[j+1]);
}
}
// fix first and last, one is redundant for is_polygon == true
// vertices.front()->fixed() = true;
// vertices.back()->fixed() = true;
return ca;
}
public:
void
file_output(std::ostream& os) const
{
@ -648,9 +648,9 @@ public:
void file_input(std::istream& is)
{
is >> static_cast<Tr&>(*this);
std::vector<Vertex_handle> V;
V.reserve(number_of_vertices());
for(Vertex_iterator vit = vertices_begin(); vit != vertices_end() ; ++vit){
@ -663,7 +663,7 @@ public:
while(is >> n){
is >> i0 >> i1;
cid = insert_constraint(V[i0],V[i1]);
for(int i = 2; i < n; i++){
i0 = i1;
is >> i1;
@ -673,7 +673,7 @@ public:
}
}
template <class OutputIterator>
typename Constrained_triangulation_plus_2<Tr>::Constraint_id
insert_constraint(Vertex_handle va, Vertex_handle vb, OutputIterator out)
@ -684,11 +684,11 @@ public:
}
// protects against inserting twice the same constraint
Constraint_id cid = hierarchy.insert_constraint(va, vb);
if (va != vb && (cid != nullptr) ) insert_subconstraint(va,vb,out);
if (va != vb && (cid != nullptr) ) insert_subconstraint(va,vb,out);
for(Vertices_in_constraint_iterator vcit = vertices_in_constraint_begin(cid);
vcit != vertices_in_constraint_end(cid);
vcit++){
vcit != vertices_in_constraint_end(cid);
vcit++){
insert_incident_faces(vcit, out);
}
return cid;
@ -713,26 +713,26 @@ public:
Vertex_handle vaa,
Vertex_handle vbb,
Exact_predicates_tag);
// REMOVAL
template <class OutputIterator>
void remove_constraint(Constraint_id cid, OutputIterator out)
{
std::list<Vertex_handle> vertices(hierarchy.vertices_in_constraint_begin(cid),
hierarchy.vertices_in_constraint_end(cid));
hierarchy.vertices_in_constraint_end(cid));
hierarchy.remove_constraint(cid);
for(typename std::list<Vertex_handle>::iterator it = vertices.begin(),
succ = it;
++succ != vertices.end();
++it){
for(typename std::list<Vertex_handle>::iterator it = vertices.begin(),
succ = it;
++succ != vertices.end();
++it){
if(! is_subconstraint(*it, *succ)){ // this checks whether other constraints pass
Face_handle fh;
int i;
bool b = Triangulation::is_edge(*it, *succ, fh, i);
CGAL_assume(b);
Triangulation::remove_constrained_edge(fh,i, out); // this does also flipping if necessary.
Face_handle fh;
int i;
bool b = Triangulation::is_edge(*it, *succ, fh, i);
CGAL_assume(b);
Triangulation::remove_constrained_edge(fh,i, out); // this does also flipping if necessary.
}
}
}
@ -741,18 +741,18 @@ public:
remove_constraint(cid, Emptyset_iterator());
}
void simplify(Vertices_in_constraint_iterator v)
{
Vertices_in_constraint_iterator u = boost::prior(v);
Vertices_in_constraint_iterator w = boost::next(v);
bool unew = (*u != *w);
hierarchy.simplify(u,v,w);
Triangulation::remove_incident_constraints(*v);
Triangulation::remove(*v);
if(unew){
Triangulation::insert_constraint(*u, *w);
}
@ -776,10 +776,10 @@ public:
// split a constraint in two constraints, so that vcit becomes the first
// vertex of the new constraint
// returns the new constraint
// returns the new constraint
Constraint_id
split(Constraint_id first, Vertices_in_constraint_iterator vcit);
// Query of the constraint hierarchy
Constraint_iterator constraints_begin() const;
Constraint_iterator constraints_end() const;
@ -787,7 +787,7 @@ public:
{
return Constraints(constraints_begin(),constraints_end());
}
Subconstraint_iterator subconstraints_begin() const;
Subconstraint_iterator subconstraints_end() const;
@ -795,31 +795,31 @@ public:
{
return Subconstraints(subconstraints_begin(),subconstraints_end());
}
Context context(Vertex_handle va, Vertex_handle vb); //AF: const;
bool is_subconstraint(Vertex_handle va,
Vertex_handle vb);
size_type number_of_enclosing_constraints(Vertex_handle va,
Context context(Vertex_handle va, Vertex_handle vb); //AF: const;
bool is_subconstraint(Vertex_handle va,
Vertex_handle vb);
size_type number_of_enclosing_constraints(Vertex_handle va,
Vertex_handle vb) const;
Context_iterator contexts_begin(Vertex_handle va,
Vertex_handle vb) const;
Context_iterator contexts_end(Vertex_handle va,
Vertex_handle vb) const;
Context_iterator contexts_begin(Vertex_handle va,
Vertex_handle vb) const;
Context_iterator contexts_end(Vertex_handle va,
Vertex_handle vb) const;
Contexts contexts(Vertex_handle va, Vertex_handle vb) const
{
return Contexts(contexts_begin(va,vb),contexts_end(va,vb));
}
Vertices_in_constraint_iterator vertices_in_constraint_begin(Constraint_id cid) const;
Vertices_in_constraint_iterator vertices_in_constraint_end(Constraint_id cid) const;
Vertices_in_constraint vertices_in_constraint(Constraint_id cid) const
{
return Vertices_in_constraint(vertices_in_constraint_begin(cid), vertices_in_constraint_end(cid));
}
Points_in_constraint_iterator points_in_constraint_begin(Constraint_id cid) const;
Points_in_constraint_iterator points_in_constraint_end(Constraint_id cid) const ;
@ -855,12 +855,12 @@ protected:
fc++;
}while(fc != done);
}
}
}
void
insert_subconstraint(Vertex_handle vaa,
Vertex_handle vbb)
Vertex_handle vbb)
{
insert_subconstraint(vaa,vbb,Emptyset_iterator());
}
@ -871,9 +871,9 @@ insert_subconstraint(Vertex_handle vaa,
template <class OutputItertator>
void
insert_subconstraint(Vertex_handle vaa,
Vertex_handle vbb,
OutputItertator out)
// insert the subconstraint [vaa vbb]
Vertex_handle vbb,
OutputItertator out)
// insert the subconstraint [vaa vbb]
// it will eventually be split into several subconstraints
{
std::stack<std::pair<Vertex_handle, Vertex_handle> > stack;
@ -883,7 +883,7 @@ insert_subconstraint(Vertex_handle vaa,
boost::tie(vaa,vbb) = stack.top();
stack.pop();
CGAL_triangulation_precondition( vaa != vbb);
Vertex_handle vi;
Face_handle fr;
@ -896,11 +896,11 @@ insert_subconstraint(Vertex_handle vaa,
}
continue;
}
List_faces intersected_faces;
List_edges conflict_boundary_ab, conflict_boundary_ba;
bool intersection = this->find_intersected_faces(
bool intersection = this->find_intersected_faces(
vaa, vbb,
intersected_faces,
conflict_boundary_ab,
@ -910,10 +910,10 @@ insert_subconstraint(Vertex_handle vaa,
if ( intersection) {
if (vi != vaa && vi != vbb) {
hierarchy.split_constraint(vaa,vbb,vi);
stack.push(std::make_pair(vaa,vi));
stack.push(std::make_pair(vi,vbb));
stack.push(std::make_pair(vaa,vi));
stack.push(std::make_pair(vi,vbb));
}
else stack.push(std::make_pair(vaa,vbb));
else stack.push(std::make_pair(vaa,vbb));
continue;
}
@ -954,7 +954,7 @@ insert_subconstraint(Vertex_handle vaa,
if (vi != vbb) {
hierarchy.split_constraint(vaa,vbb,vi);
stack.push(std::make_pair(vi,vbb));
stack.push(std::make_pair(vi,vbb));
}
}
}
@ -971,7 +971,7 @@ public:
#if defined(_MSC_VER)
std::ptrdiff_t insert(InputIterator first, InputIterator last, int i = 0)
#else
std::ptrdiff_t insert(InputIterator first, InputIterator last)
std::ptrdiff_t insert(InputIterator first, InputIterator last)
#endif
{
#if defined(_MSC_VER)
@ -1000,7 +1000,7 @@ copy_triangulation(const Constrained_triangulation_plus_2 &ctp)
{
Base::copy_triangulation(ctp);
//the following assumes that the triangulation and its copy
// iterate on their vertices in the same order
// iterate on their vertices in the same order
std::map<Vertex_handle,Vertex_handle> vmap;
Vertex_iterator vit = ctp.vertices_begin();
Vertex_iterator vvit = this->vertices_begin();
@ -1021,7 +1021,7 @@ swap(Constrained_triangulation_plus_2 &ctp)
}
template < class Tr >
inline
inline
typename Constrained_triangulation_plus_2<Tr>::Vertex_handle
Constrained_triangulation_plus_2<Tr>::
insert(const Point& a, Face_handle start)
@ -1059,17 +1059,17 @@ insert(const Point& a, Locate_type lt, Face_handle loc, int li)
}
template <class Tr>
typename Constrained_triangulation_plus_2<Tr>:: Vertex_handle
typename Constrained_triangulation_plus_2<Tr>:: Vertex_handle
Constrained_triangulation_plus_2<Tr>::
intersect(Face_handle f, int i,
Vertex_handle vaa,
Vertex_handle vbb)
intersect(Face_handle f, int i,
Vertex_handle vaa,
Vertex_handle vbb)
{
return intersect(f, i, vaa, vbb, Intersection_tag());
}
template <class Tr>
typename Constrained_triangulation_plus_2<Tr>:: Vertex_handle
typename Constrained_triangulation_plus_2<Tr>:: Vertex_handle
Constrained_triangulation_plus_2<Tr>::
intersect(Face_handle, int,
Vertex_handle,
@ -1093,13 +1093,13 @@ intersect(Face_handle, int,
}
template <class Tr>
typename Constrained_triangulation_plus_2<Tr>:: Vertex_handle
typename Constrained_triangulation_plus_2<Tr>:: Vertex_handle
Constrained_triangulation_plus_2<Tr>::
intersect(Face_handle f, int i,
Vertex_handle vaa,
Vertex_handle vbb,
Exact_intersections_tag)
// compute the intersection of the constraint edge (f,i)
intersect(Face_handle f, int i,
Vertex_handle vaa,
Vertex_handle vbb,
Exact_intersections_tag)
// compute the intersection of the constraint edge (f,i)
// with the subconstraint (vaa,vbb) being inserted
// insert the intersection point
// (the constraint edge (f,i) will be split in hierarchy by insert)
@ -1127,16 +1127,16 @@ intersect(Face_handle f, int i,
CGAL_triangulation_assertion(ok);
Vertex_handle vi = insert(pi, Triangulation::EDGE, f, i);
return vi;
return vi;
}
template <class Tr>
typename Constrained_triangulation_plus_2<Tr>::Vertex_handle
typename Constrained_triangulation_plus_2<Tr>::Vertex_handle
Constrained_triangulation_plus_2<Tr>::
intersect(Face_handle f, int i,
Vertex_handle vaa,
Vertex_handle vbb,
Exact_predicates_tag)
intersect(Face_handle f, int i,
Vertex_handle vaa,
Vertex_handle vbb,
Exact_predicates_tag)
{
Vertex_handle vcc, vdd;
vcc = f->vertex(cw(i));
@ -1158,7 +1158,7 @@ intersect(Face_handle f, int i,
case 0 : vi = vaa; break;
case 1 : vi = vbb; break;
case 2 : vi = vcc; break;
case 3 : vi = vdd; break;
case 3 : vi = vdd; break;
}
if(vi == vaa || vi == vbb) {
Triangulation::remove_constrained_edge(f, i);
@ -1171,15 +1171,15 @@ intersect(Face_handle f, int i,
// vi == vc or vi == vd may happen even if intersection==true
// due to approximate construction of the intersection
if (vi != vcc && vi != vdd) {
if (vi != vcc && vi != vdd) {
hierarchy.split_constraint(vcc,vdd,vi);
insert_subconstraint(vcc,vi);
insert_subconstraint(vcc,vi);
insert_subconstraint(vi, vdd);
}
}
else {
insert_subconstraint(vcc,vdd);
}
return vi;
return vi;
}
// CONCATENATE AND SPLIT
@ -1194,7 +1194,7 @@ Constrained_triangulation_plus_2<Tr>::concatenate(Constraint_id first, Constrain
// split a constraint in two constraints, so that vcit becomes the first
// vertex of the new constraint
// returns the new constraint
// returns the new constraint
template <class Tr>
typename Constrained_triangulation_plus_2<Tr>::Constraint_id
Constrained_triangulation_plus_2<Tr>::split(Constraint_id first, Vertices_in_constraint_iterator vcit)
@ -1205,8 +1205,8 @@ Constrained_triangulation_plus_2<Tr>::split(Constraint_id first, Vertices_in_con
template <class Tr>
std::ostream &
operator<<(std::ostream& os,
const Constrained_triangulation_plus_2<Tr> &ct)
operator<<(std::ostream& os,
const Constrained_triangulation_plus_2<Tr> &ct)
{
ct.file_output(os);
return os ;
@ -1214,8 +1214,8 @@ operator<<(std::ostream& os,
template <class Tr>
std::istream &
operator>>(std::istream& is,
Constrained_triangulation_plus_2<Tr> &ct)
operator>>(std::istream& is,
Constrained_triangulation_plus_2<Tr> &ct)
{
ct.file_input(is);
return is ;
@ -1275,13 +1275,13 @@ context(Vertex_handle va, Vertex_handle vb) // AF: const
template <class Tr>
inline
inline
typename Constrained_triangulation_plus_2<Tr>::size_type
Constrained_triangulation_plus_2<Tr>::
number_of_enclosing_constraints(Vertex_handle va, Vertex_handle vb) const
{
return static_cast<size_type>
(hierarchy.number_of_enclosing_constraints(va,vb));
return static_cast<size_type>
(hierarchy.number_of_enclosing_constraints(va,vb));
}
template <class Tr>
@ -1289,7 +1289,7 @@ inline bool
Constrained_triangulation_plus_2<Tr>::
is_subconstraint(Vertex_handle va, Vertex_handle vb)
{
return hierarchy.is_subconstrained_edge(va,vb);
return hierarchy.is_subconstrained_edge(va,vb);
}

View File

@ -5,7 +5,7 @@
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
//
//
// Author(s) : Simon Giraudot
@ -53,24 +53,24 @@ public:
typedef boost::transform_iterator<Subconstr_uf, typename CTP2::Subconstraint_iterator> edge_iterator;
CTP2_subconstraint_graph (CTP2& ctp2) : ctp2(ctp2) { }
friend Iterator_range<vertex_iterator> vertices (const CTP2_subconstraint_graph& g)
{
return make_range (vertex_iterator(g.ctp2.finite_vertices_begin()),
vertex_iterator(g.ctp2.finite_vertices_end()));
}
friend Iterator_range<edge_iterator> edges (const CTP2_subconstraint_graph& g)
{
return make_range (boost::make_transform_iterator(g.ctp2.subconstraints_begin(), Subconstr_uf(Subconstr_map())),
boost::make_transform_iterator(g.ctp2.subconstraints_end(), Subconstr_uf(Subconstr_map())));
}
friend vertex_descriptor source (edge_descriptor ed, const CTP2_subconstraint_graph&)
{
return ed.first;
}
friend vertex_descriptor target (edge_descriptor ed, const CTP2_subconstraint_graph&)
{
return ed.second;
@ -90,13 +90,13 @@ private:
public:
CTP2_graph_visitor (CTP2& ctp2) : ctp2 (ctp2) { }
void start_new_polyline()
{
latest_vertex = typename CTP2::Vertex_handle();
current = typename CTP2::Constraint_id();
}
void add_node (typename CTP2::Vertex_handle vh)
{
if (latest_vertex != typename CTP2::Vertex_handle())
@ -110,7 +110,7 @@ public:
}
latest_vertex = vh;
}
void end_polyline()
{
for (typename CTP2::Constraint_id id : to_remove)