curve segment -> curve

This commit is contained in:
Laurent Rineau 2017-09-01 17:36:32 +02:00
parent 0b79594cfc
commit f3924fe8d6
40 changed files with 425 additions and 413 deletions

View File

@ -22,7 +22,7 @@ default parameter value `void`.
\cgalModels `MeshCellBase_3` \cgalModels `MeshCellBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveSegmentIndex>` \sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
\sa `CGAL::Mesh_cell_base_3<Gt, MD, Cb>` \sa `CGAL::Mesh_cell_base_3<Gt, MD, Cb>`
*/ */

View File

@ -28,7 +28,7 @@ of the concept `RegularTriangulationCellBaseWithWeightedCircumcenter_3` and defa
\cgalModels `MeshCellBase_3` \cgalModels `MeshCellBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveSegmentIndex>` \sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
\sa `CGAL::Compact_mesh_cell_base_3<Gt, MD, Tds>` \sa `CGAL::Compact_mesh_cell_base_3<Gt, MD, Tds>`
*/ */

View File

@ -19,8 +19,8 @@ vertex and cell base class are models of the concepts
\tparam CornerIndex is the type of the indices for corners. It must match the `Corner_index` of the model \tparam CornerIndex is the type of the indices for corners. It must match the `Corner_index` of the model
of the `MeshDomainWithFeatures_3` concept used for mesh generation. of the `MeshDomainWithFeatures_3` concept used for mesh generation.
\tparam CurveSegmentIndex is the type of the indices for curves segments. \tparam CurveIndex is the type of the indices for curves.
It must match the `Curve_segment_index` types of the model It must match the `Curve_index` types of the model
of the `MeshDomainWithFeatures_3` concept used for mesh generation. of the `MeshDomainWithFeatures_3` concept used for mesh generation.
Those two last template parameters defaults to `int`, so that they can be ignored Those two last template parameters defaults to `int`, so that they can be ignored
@ -37,7 +37,7 @@ is a model of the concept `MeshDomain_3`).
\sa `MeshVertexBase_3` \sa `MeshVertexBase_3`
*/ */
template< typename Tr, typename CornerIndex, typename CurveSegmentIndex > template< typename Tr, typename CornerIndex, typename CurveIndex >
class Mesh_complex_3_in_triangulation_3 { class Mesh_complex_3_in_triangulation_3 {
public: public:
@ -65,9 +65,9 @@ typedef Tr::Cell::Subdomain_index Subdomain_index;
typedef CornerIndex Corner_index; typedef CornerIndex Corner_index;
/*! /*!
Curve segment index type. Curve index type.
*/ */
typedef CurveSegmentIndex Curve_segment_index; typedef CurveIndex Curve_index;
/// @} /// @}

View File

@ -115,7 +115,7 @@ The description of each parameter is as follows:
- `edge_size`: a scalar field (resp. a constant) providing a space varying - `edge_size`: a scalar field (resp. a constant) providing a space varying
(resp. a uniform) (resp. a uniform)
upper bound for the lengths of curve segment edges. This parameter has to be set to a positive upper bound for the lengths of curve edges. This parameter has to be set to a positive
value when 1-dimensional features protection is used. value when 1-dimensional features protection is used.
- `facet_angle`: a lower bound for the angles (in degrees) of the - `facet_angle`: a lower bound for the angles (in degrees) of the

View File

@ -35,9 +35,9 @@ public:
typedef int Corner_index; typedef int Corner_index;
/*! /*!
`Curve_segment_index` type. `Curve_index` type.
*/ */
typedef int Curve_segment_index; typedef int Curve_index;
/// @} /// @}

View File

@ -33,7 +33,7 @@ typedef Tr::Geom_traits::FT FT;
/*! /*!
Returns an object to serve as criteria for edges. Returns an object to serve as criteria for edges.
The argument `length_bound` is an upper bound The argument `length_bound` is an upper bound
for the length of the edges which are used to discretize the curve segments. for the length of the edges which are used to discretize the curves.
Note that if one parameter is set to 0, then its corresponding criteria is ignored. Note that if one parameter is set to 0, then its corresponding criteria is ignored.
*/ */
Mesh_edge_criteria_3( Mesh_edge_criteria_3(

View File

@ -11,13 +11,13 @@ be checked on each surface facet during the mesh refinement process.
*/ */
enum Mesh_facet_topology { enum Mesh_facet_topology {
FACET_VERTICES_ON_SURFACE = 1, //!< Each vertex of the facet have FACET_VERTICES_ON_SURFACE = 1, //!< Each vertex of the facet have
//!< to be on the surface, on a curve segment, or on a corner. //!< to be on the surface, on a curve, or on a corner.
FACET_VERTICES_ON_SAME_SURFACE_PATCH, //!< The three vertices of a facet belonging FACET_VERTICES_ON_SAME_SURFACE_PATCH, //!< The three vertices of a facet belonging
//!< to a surface patch `s` have to be on //!< to a surface patch `s` have to be on
//!< the same surface patch `s`, on a curve segment or on a corner. //!< the same surface patch `s`, on a curve or on a corner.
/*! /*!
The three vertices of a facet belonging to a surface patch `s` The three vertices of a facet belonging to a surface patch `s`
have to be on the same surface patch `s`, or on a curve segment have to be on the same surface patch `s`, or on a curve
incident to the surface patch `s` or on a corner incident to the incident to the surface patch `s` or on a corner incident to the
surface patch `s`. surface patch `s`.
*/ */

View File

@ -32,7 +32,7 @@ and defaults to `Compact_mesh_cell_base_3<Gt, MD>`.
will have type `Robust_weighted_circumcenter_filtered_traits_3<Gt>`. will have type `Robust_weighted_circumcenter_filtered_traits_3<Gt>`.
\sa `make_mesh_3()` \sa `make_mesh_3()`
\sa `Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveSegmentIndex>` \sa `Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
*/ */
template< typename MD, typename Gt, template< typename MD, typename Gt,

View File

@ -21,7 +21,7 @@ of the concept `TriangulationVertexBase_3` and defaults to
\cgalModels `MeshVertexBase_3` \cgalModels `MeshVertexBase_3`
\sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveSegmentIndex>` \sa `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
*/ */
template< typename Gt, typename MD, typename Vb > template< typename Gt, typename MD, typename Vb >

View File

@ -43,7 +43,7 @@ respectively.
\tparam MeshDomain_3 is required to be a model of \tparam MeshDomain_3 is required to be a model of
the concept `MeshDomain_3`, or of the refined concept the concept `MeshDomain_3`, or of the refined concept
`MeshDomainWithFeatures_3` `MeshDomainWithFeatures_3`
if the domain has corners and curve segments that need to be accurately represented in the mesh. if the domain has corners and curves that need to be accurately represented in the mesh.
The argument `domain` The argument `domain`
is the sole link through which the domain is the sole link through which the domain
to be discretized is known by the mesh generation algorithm. to be discretized is known by the mesh generation algorithm.

View File

@ -198,7 +198,7 @@ parameters::internal::Exude_options exude(
The function `parameters::features()` provides a value of internal type `Features` The function `parameters::features()` provides a value of internal type `Features`
to specify if 0 and 1-dimensional features have to be taken into account. to specify if 0 and 1-dimensional features have to be taken into account.
The provided value is a default value that triggers the representation The provided value is a default value that triggers the representation
of corners and curve segments in the mesh when the domain is a model of corners and curves in the mesh when the domain is a model
of `MeshDomainWithFeatures_3`. of `MeshDomainWithFeatures_3`.
Provides a `Features_options` value such that Provides a `Features_options` value such that
@ -284,7 +284,7 @@ parameters::internal::Exude_options no_exude();
The function `parameters::no_features()` allows the user to prevent the handling The function `parameters::no_features()` allows the user to prevent the handling
of 0 and 1-dimensional features. This is useful when the of 0 and 1-dimensional features. This is useful when the
domain is a model of `MeshDomainWithFeatures_3` domain is a model of `MeshDomainWithFeatures_3`
and the user does not want corners and curve segments and the user does not want corners and curves
to be accurately represented to be accurately represented
in the mesh. in the mesh.

View File

@ -16,7 +16,7 @@ faces of the triangulation,
we call we call
respectively <I>subdomains</I>, respectively <I>subdomains</I>,
<I>surface patches</I> <I>surface patches</I>
<I>curve segments</I> and <I>corners</I> the faces <I>curves</I> and <I>corners</I> the faces
of the complex with respective dimensions \f$ 3\f$, \f$ 2\f$, \f$ 1\f$ and \f$ 0\f$. of the complex with respective dimensions \f$ 3\f$, \f$ 2\f$, \f$ 1\f$ and \f$ 0\f$.
The triangulations faces are called respectively The triangulations faces are called respectively
cells, facets, edges and vertices. cells, facets, edges and vertices.
@ -24,9 +24,9 @@ cells, facets, edges and vertices.
Each subdomain of the embedded 3D complex is a union of Each subdomain of the embedded 3D complex is a union of
triangulation cells. triangulation cells.
Likewise, each surface patch is a union of Likewise, each surface patch is a union of
triangulation facets and each curve segment is a union of triangulation edges. triangulation facets and each curve is a union of triangulation edges.
The corners form a subset of the triangulation vertices. The corners form a subset of the triangulation vertices.
Note that subdomains, surface patches and and curved segments are not Note that subdomains, and surface patches are not
necessarily connected. Likewise each corner may be related to several necessarily connected. Likewise each corner may be related to several
mesh vertices. mesh vertices.
Triangulation facets that belong to some Triangulation facets that belong to some
@ -35,7 +35,7 @@ surface patch are called surface facets.
The concept `MeshComplexWithFeatures_3InTriangulation_3` allows us to mark and retrieve the The concept `MeshComplexWithFeatures_3InTriangulation_3` allows us to mark and retrieve the
cells of the triangulation belonging to the subdomains, cells of the triangulation belonging to the subdomains,
the facets of the triangulation belonging to surface patches, the facets of the triangulation belonging to surface patches,
the edges belonging to curve segments and the vertices that are corners of the embedded complex. the edges belonging to curves and the vertices that are corners of the embedded complex.
Within the mesh generation functions, Within the mesh generation functions,
the concept `MeshComplexWithFeatures_3InTriangulation_3` is the concept describing the concept `MeshComplexWithFeatures_3InTriangulation_3` is the concept describing
@ -43,12 +43,12 @@ the data structure used to maintain the current approximation of the input domai
At the end of the meshing process, the data structure encodes the resulting mesh. At the end of the meshing process, the data structure encodes the resulting mesh.
In particular, each subdomain (resp. surface patch) of the input domain In particular, each subdomain (resp. surface patch) of the input domain
is then approximated by a subdomain (resp. a surface patch) of the embedded complex is then approximated by a subdomain (resp. a surface patch) of the embedded complex
while the curve segments and corners represent the \f$ 1\f$ and \f$ 0\f$-dimensional features while the curves and corners represent the \f$ 1\f$ and \f$ 0\f$-dimensional features
of the input complex. of the input complex.
\cgalRefines `MeshComplex_3InTriangulation_3` \cgalRefines `MeshComplex_3InTriangulation_3`
\cgalHasModel `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveSegmentIndex>` \cgalHasModel `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
\sa `MeshComplex_3InTriangulation_3` \sa `MeshComplex_3InTriangulation_3`
\sa `MeshDomainWithFeatures_3` \sa `MeshDomainWithFeatures_3`
@ -62,11 +62,11 @@ public:
/// @{ /// @{
/*! /*!
A type for indexes of curve segment. The type must match the type A type for indexes of curve. The type must match the type
`MeshDomainWithFeatures_3::Curve_segment_index` `MeshDomainWithFeatures_3::Curve_index`
when the concept is used for mesh generation. when the concept is used for mesh generation.
*/ */
typedef unspecified_type Curve_segment_index; typedef unspecified_type Curve_index;
/*! /*!
A type for indexes of corners. A type for indexes of corners.
@ -78,7 +78,7 @@ typedef unspecified_type Corner_index;
/*! /*!
An iterator type to visit the edges An iterator type to visit the edges
of the triangulation belonging to curve segments. of the triangulation belonging to curves.
*/ */
typedef unspecified_type Edges_in_complex_iterator; typedef unspecified_type Edges_in_complex_iterator;
@ -95,16 +95,16 @@ typedef unspecified_type Vertices_in_complex_iterator;
/*! /*!
Adds edge `e` as an element of the curve segment with index `index`. Adds edge `e` as an element of the curve with index `index`.
*/ */
void add_to_complex(Edge e, const Curve_segment_index& index); void add_to_complex(Edge e, const Curve_index& index);
/*! /*!
Same as above with `e=(v1,v2)`. Same as above with `e=(v1,v2)`.
*/ */
void add_to_complex(const Vertex_handle& v1, void add_to_complex(const Vertex_handle& v1,
const Vertex_handle& v2, const Curve_segment_index& index); const Vertex_handle& v2, const Curve_index& index);
/*! /*!
@ -139,15 +139,15 @@ void remove_from_complex(const Vertex_handle& v);
/*! /*!
Returns the number of edges which belong to curve segments. Returns the number of edges which belong to curves.
*/ */
size_type number_of_edges() const; size_type number_of_edges() const;
/*! /*!
Returns the number of edges which belong to curve segment with index `index`. Returns the number of edges which belong to curve with index `index`.
*/ */
size_type number_of_edges(Curve_segment_index index) const; size_type number_of_edges(Curve_index index) const;
/*! /*!
@ -163,7 +163,7 @@ size_type number_of_corners(Corner_index index) const;
/*! /*!
Returns `true` Returns `true`
iff edge `e` belongs to some curve segment. iff edge `e` belongs to some curve.
*/ */
bool is_in_complex(const Edge& e) const; bool is_in_complex(const Edge& e) const;
@ -182,16 +182,16 @@ bool is_in_complex(const Vertex_handle& v) const;
/*! /*!
Returns `Curve_segment_index` of edge `e`. The default `Curve_segment_index` Returns `Curve_index` of edge `e`. The default `Curve_index`
value is returned if edge `e` does not belong to any curve segment. value is returned if edge `e` does not belong to any curve.
*/ */
Curve_segment_index curve_segment_index(const Edge& e); Curve_index curve_index(const Edge& e);
/*! /*!
Same as above with `e=(v1,v2)`. Same as above with `e=(v1,v2)`.
*/ */
Curve_segment_index curve_segment_index(const Vertex_handle& v1, const Vertex_handle& v2); Curve_index curve_index(const Vertex_handle& v1, const Vertex_handle& v2);
/*! /*!
@ -207,7 +207,7 @@ Corner_index corner_index(const Vertex_handle& v);
/*! /*!
Returns an `Edges_in_complex_iterator` to visit the edges of the triangulation belonging to curve segments. Returns an `Edges_in_complex_iterator` to visit the edges of the triangulation belonging to curves.
*/ */
Edges_in_complex_iterator edges_in_complex_begin() const; Edges_in_complex_iterator edges_in_complex_begin() const;
@ -219,22 +219,22 @@ Edge_in_complex_iterator edges_in_complex_end() const;
/*! /*!
Returns an `Edges_in_complex_iterator` to visit the edges of the triangulation belonging to curve segments Returns an `Edges_in_complex_iterator` to visit the edges of the triangulation belonging to curves
of index `index`. of index `index`.
*/ */
Edges_in_complex_iterator edges_in_complex_begin(Curve_segment_index index) const; Edges_in_complex_iterator edges_in_complex_begin(Curve_index index) const;
/*! /*!
Returns the past-the-end iterator for the above iterator. Returns the past-the-end iterator for the above iterator.
*/ */
Edge_in_complex_iterator edges_in_complex_end(Curve_segment_index index) const; Edge_in_complex_iterator edges_in_complex_end(Curve_index index) const;
/*! /*!
Fills `out` with the vertices of the triangulation that are adjacent to vertex `v` Fills `out` with the vertices of the triangulation that are adjacent to vertex `v`
through an edge belonging to some curve segment. through an edge belonging to some curve.
The value type of `out` must be `std::pair<Vertex_handle,Curve_segment_index>`. The value type of `out` must be `std::pair<Vertex_handle,Curve_index>`.
\pre `c3t3.in_dimension(v) < 2` \pre `c3t3.in_dimension(v) < 2`
*/ */
template <typename OutputIterator> template <typename OutputIterator>

View File

@ -42,7 +42,7 @@ the current approximation of each subdomain
and each boundary surface patch. and each boundary surface patch.
The data structure encodes the final mesh at the end of the meshing process. The data structure encodes the final mesh at the end of the meshing process.
\cgalHasModel `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveSegmentIndex>` \cgalHasModel `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
\sa `MeshDomain_3` \sa `MeshDomain_3`
\sa `MeshComplexWithFeatures_3InTriangulation_3` \sa `MeshComplexWithFeatures_3InTriangulation_3`

View File

@ -7,9 +7,14 @@ While the concept
`MeshDomain_3` only exposes the 2-dimensional and 3-dimensional features of `MeshDomain_3` only exposes the 2-dimensional and 3-dimensional features of
the domain through different queries, the concept `MeshDomainWithFeatures_3` also exposes 0 and the domain through different queries, the concept `MeshDomainWithFeatures_3` also exposes 0 and
1-dimensional features. The exposed features of the domain are respectively called 1-dimensional features. The exposed features of the domain are respectively called
subdomains, surface patches, curve segments subdomains, surface patches, curves
and corners according to their respective dimensions 3,2,1 and 0. and corners according to their respective dimensions 3,2,1 and 0.
Each curve is assumed to be bounded, with only one connected component, and
without auto-intersection. Each curve is also assumed to be
oriented. Therefore it is possible to defined the signed geodesic distance
between two ordered points on the same curve.
\cgalRefines `MeshDomain_3` \cgalRefines `MeshDomain_3`
\cgalHasModel `CGAL::Mesh_domain_with_polyline_features_3<MeshDomain_3>` \cgalHasModel `CGAL::Mesh_domain_with_polyline_features_3<MeshDomain_3>`
@ -37,13 +42,13 @@ Numerical type.
typedef unspecified_type FT; typedef unspecified_type FT;
/*! /*!
Type of indices for curve segments (\f$ 1\f$-dimensional features) Type of indices for curves (\f$ 1\f$-dimensional features)
of the input domain. of the input domain.
Must be a model of CopyConstructible, Assignable, DefaultConstructible and Must be a model of CopyConstructible, Assignable, DefaultConstructible and
LessThanComparable. The default constructed value must be the value of an edge which LessThanComparable. The default constructed value must be the value of an edge which
does not approximate a 1-dimensional feature of the input domain. does not approximate a 1-dimensional feature of the input domain.
*/ */
typedef unspecified_type Curve_segment_index; typedef unspecified_type Curve_index;
/*! /*!
Type of indices for corners (i.e.\ 0-dimensional features) Type of indices for corners (i.e.\ 0-dimensional features)
@ -56,30 +61,22 @@ typedef unspecified_type Corner_index;
/// @} /// @}
/*! \name Operations /*! \name Operations
Each connected component of a curve segment is assumed
to be oriented. The orientation is defined by the ordering
of the two incident corners at the origin and endpoint.
Therefore it is possible
to defined the signed geodesic distance between two ordered
points on the same connected component of a curve segment.
A cycle is a connected component of a curve segment incident to
0 or 1 corner.
\note `construct_point_on_curve segment` is assumed to return
a uniquely defined point. Therefore it is not possible to handle as a single
curve segment, a singular curve with several branches incident
to the same point.
*/ */
/// @{ /// @{
/*! /*!
Returns a point on the curve segment with index `ci` Returns a point on the curve with index `ci`
at signed geodesic distance `d` from point `p`. at signed geodesic distance `d` from point `p`.
\pre Point `p` is supposed to be on curve segment `ci`. If ` d > 0`, the signed geodesic distance from `p` to the endpoint of the connected component of `ci` including \f$ p\f$, should be greater than \f$ d\f$. If ` d < 0`, the signed geodesic distance from `p` to the origin of the connected component should be less than \f$ d\f$ from the origin of the connected component. \pre Point `p` is supposed to be on curve `ci`. If ` d > 0`, the signed
geodesic distance from `p` to the endpoint of `ci` should be greater than
\f$ d\f$. If ` d < 0`, the signed geodesic distance from `p` to the origin
of the curve should be less than \f$ d\f$ from the origin.
*/ */
Point_3 construct_point_on_curve_segment( Point_3 construct_point_on_curve(
const Point_3& p, const Curve_segment_index& ci, FT d) const; const Point_3& p, const Curve_index& ci, FT d) const;
/// @} /// @}
@ -87,57 +84,55 @@ const Point_3& p, const Curve_segment_index& ci, FT d) const;
/// @{ /// @{
/*! /*!
Returns the length of the curve segment, on the curve with index Returns the length of the curve segment from \c p to \c q, on the curve
\c curve_index, from \c p to \c q with index \c curve_index.
If the curve connected component containing \c p and \c q is a cycle, If the curve with index \c curve_index is a loop, the
the orientation identifies which portion of the cycle orientation identifies which portion of the loop corresponds to the curve
corresponds to the arc, otherwise \c orientation must be compatible segment, otherwise \c orientation must be compatible with the orientation
with the orientation of \c p and \c q on the curve segment. of \c p and \c q on the curve.
*/ */
FT arc_length(const Point_3& p, const Point_3 q, FT curve_segment_length(const Point_3& p, const Point_3 q,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
CGAL::Orientation orientation) const; CGAL::Orientation orientation) const;
/*! /*!
Returns `CGAL::POSITIVE` if the signed geodesic distance from Returns `CGAL::POSITIVE` if the signed geodesic distance from
`p` to `q` on the way through `r` along cycle with index `ci` `p` to `q` on the way through `r` along loop with index `ci`
is positive, `CGAL::NEGATIVE` if the distance is negative. is positive, `CGAL::NEGATIVE` if the distance is negative.
\pre `p != q && p != r && r != q` \pre `p != q && p != r && r != q`
*/ */
CGAL::Sign distance_sign_along_cycle(const Point_3& p, const Point_3& q, CGAL::Sign distance_sign_along_loop(const Point_3& p, const Point_3& q,
const Point_3& r, const Curve_segment_index& ci) const; const Point_3& r, const Curve_index& ci) const;
/*! /*!
Returns the sign of the geodesic distance from `p` to `q`, on the curve Returns the sign of the geodesic distance from `p` to `q`, on the curve
with index `ci`. with index `ci`.
*/ */
CGAL::Sign distance_sign(const Point_3& p, const Point_3& q, CGAL::Sign distance_sign(const Point_3& p, const Point_3& q,
const Curve_segment_index& ci) const; const Curve_index& ci) const;
/*! /*!
Returns the length of the connected component of curve with index Returns the length of curve with index
\c curve_index that includes the point \c p \c curve_index
*/ */
FT curve_segment_length(const Point_3& p, FT curve_length(const Curve_index& curve_index) const;
const Curve_segment_index& curve_index) const;
/*! /*!
Returns `true` if the portion of the curve segment of index \c index, Returns `true` if the portion of the curve of index \c index,
between the points \c c1 and \c c2, is covered by the spheres of between the points \c c1 and \c c2, is covered by the spheres of
centers \c c1 and \c c2 and squared radii \c sq_r1 and \c sq_r2 centers \c c1 and \c c2 and squared radii \c sq_r1 and \c sq_r2
respectively. The points \c c1 and \c c2 are assumed to lie on the curve respectively. The points \c c1 and \c c2 are assumed to lie on the curve.
segment.
*/ */
bool is_curve_segment_covered(const Curve_segment_index& index, bool is_curve_segment_covered(const Curve_index& index,
CGAL::Orientation orientation, CGAL::Orientation orientation,
const Point_3& c1, const Point_3& c2, const Point_3& c1, const Point_3& c2,
const FT sq_r1, const FT sq_r2) const; const FT sq_r1, const FT sq_r2) const;
/*! /*!
Returns `true` if the connected component of curve segment Returns `true` if the curve
`ci` including point `p` is a cycle. `ci` is a loop.
*/ */
bool is_cycle(const Point_3& p, const Curve_segment_index& ci) const; bool is_loop(const Curve_index& ci) const;
/// @} /// @}
@ -154,21 +149,21 @@ get_corners(OutputIterator corners) const;
/*! /*!
Fills `curves` with the curve segments Fills `curves` with the curves
of the input domain. of the input domain.
`curves` value type must be `curves` value type must be
`CGAL::cpp11::tuple<Curve_segment_index,std::pair<Point_3,%Index>,std::pair<Point_3,%Index> >`. `CGAL::cpp11::tuple<Curve_index,std::pair<Point_3,%Index>,std::pair<Point_3,%Index> >`.
If the curve segment corresponding to an entry If the curve corresponding to an entry
in curves is not a cycle, the pair of associated points should in curves is not a loop, the pair of associated points should
belong to belong to
two corners incident on the curve segment. two corners incident on the curve.
If it is a cycle, then the same `Point_3` should be given twice and must be any If it is a loop, then the same `Point_3` should be given twice and must be any
point on the cycle. point on the loop.
The `%Index` values associated to the points are their indices w.r.t.\ their dimension. The `%Index` values associated to the points are their indices w.r.t.\ their dimension.
*/ */
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator OutputIterator
get_curve_segments(OutputIterator curves) const; get_curves(OutputIterator curves) const;
/// @} /// @}
@ -177,17 +172,17 @@ get_curve_segments(OutputIterator curves) const;
/*! /*!
Returns the index to be stored at a vertex lying on the curve segment identified Returns the index to be stored at a vertex lying on the curve identified
by `curve_segment_index`. by `curve_index`.
*/ */
Index index_from_curve_segment_index(const Curve_segment_index& curve_segment_index) const; Index index_from_curve_index(const Curve_index& curve_index) const;
/*! /*!
Returns the `Curve_segment_index` of the curve segment where lies a vertex with Returns the `Curve_index` of the curve where lies a vertex with
dimension 1 and index `index`. dimension 1 and index `index`.
*/ */
Curve_segment_index curve_segment_index(const Index& index) const; Curve_index curve_index(const Index& index) const;
/*! /*!

View File

@ -46,7 +46,7 @@ or with respect to some user customized quality criteria.
The meshing engine used in this mesh generator The meshing engine used in this mesh generator
is based on Delaunay refinement \cgalCite{c-gqmgc-93}, \cgalCite{r-draq2d-95}, \cgalCite{s-tmgdr-98}. is based on Delaunay refinement \cgalCite{c-gqmgc-93}, \cgalCite{r-draq2d-95}, \cgalCite{s-tmgdr-98}.
It uses the notion of restricted Delaunay triangulation It uses the notion of restricted Delaunay triangulation
to approximate 1-dimensional curve segments and surface patches \cgalCite{cgal:bo-pgsms-05}. to approximate 1-dimensional curves and surface patches \cgalCite{cgal:bo-pgsms-05}.
Before the refinement, a mechanism of protecting balls is set up on 1-dimensional features, if any, Before the refinement, a mechanism of protecting balls is set up on 1-dimensional features, if any,
to ensure a fair representation to ensure a fair representation
of those features in the mesh, and also to guarantee the termination of the refinement process, of those features in the mesh, and also to guarantee the termination of the refinement process,
@ -77,14 +77,14 @@ some 3D faces may have dangling 2D or 1D faces in their boundary faces.
In the rest of the documentation, we will refer to the In the rest of the documentation, we will refer to the
input 3D complex as the input domain. The faces of the input domain input 3D complex as the input domain. The faces of the input domain
with dimension 0, 1, 2 and 3 are called respectively with dimension 0, 1, 2 and 3 are called respectively
<I>corners</I>, <I>curve segments</I>, <I>surface patches</I> and <I>subdomains</I> <I>corners</I>, <I>curves</I>, <I>surface patches</I> and <I>subdomains</I>
to clearly distinguish them from the faces of the mesh to clearly distinguish them from the faces of the mesh
that are called vertices, edges, facets and cells. that are called vertices, edges, facets and cells.
Note that the input complex faces are not required to be linear nor smooth. Note that the input complex faces are not required to be linear nor smooth.
Surface patches, for instance, may be smooth surface patches, Surface patches, for instance, may be smooth surface patches,
or portions of surface meshes with boundaries. or portions of surface meshes with boundaries.
Curve segments may be for instance straight segments, curved segments Curves may be for instance straight segments, parameterized curves
or polylines. Each of those features will be accurately represented in the final mesh. or polylines. Each of those features will be accurately represented in the final mesh.
The 0 and 1-dimensional features of the input domain are usually singular points The 0 and 1-dimensional features of the input domain are usually singular points
@ -102,7 +102,7 @@ in the final mesh.
Note also that input complex faces are not required to be connected. Note also that input complex faces are not required to be connected.
Faces of the input domain are identified by indexes. Faces of the input domain are identified by indexes.
If a subdomain is not connected, its different components receive the same index. If a subdomain is not connected, its different components receive the same index.
Likewise different surface patches, segment curves or corners may share the same index. Likewise different surface patches, curves or corners may share the same index.
Each connected component of a feature will be accurately represented Each connected component of a feature will be accurately represented
in the final mesh. in the final mesh.
Note however that the occurrence of multiply connected faces in the Note however that the occurrence of multiply connected faces in the
@ -143,7 +143,7 @@ This \cgal component also provides a function to convert the reconstructed mesh
- `facets_in_complex_3_to_triangle_mesh()` - `facets_in_complex_3_to_triangle_mesh()`
The 3D triangulation provides approximations of the The 3D triangulation provides approximations of the
subdomains, surface patches and curve segments subdomains, surface patches and curves
and corners, according to the restricted and corners, according to the restricted
Delaunay triangulation paradigm. This means that each subdomain Delaunay triangulation paradigm. This means that each subdomain
is approximated by the union of the tetrahedral cells is approximated by the union of the tetrahedral cells
@ -376,11 +376,11 @@ the concept `MeshDomainWithFeatures_3` provides
the incidence the incidence
graph of 0, 1 and 2-dimensional features, graph of 0, 1 and 2-dimensional features,
and a member function to construct and a member function to construct
sample points on curve segments. sample points on curves.
Using the parameter of type `Features`, the user Using the parameter of type `Features`, the user
whose domain is a model of `MeshDomainWithFeatures_3` whose domain is a model of `MeshDomainWithFeatures_3`
can choose to have the corners and curve segments of the domain can choose to have the corners and curves of the domain
represented in the mesh or not. represented in the mesh or not.
The type `Features` of this parameter is an internal undescribed type. The type `Features` of this parameter is an internal undescribed type.
The library provides functions to construct appropriate values of that type. The library provides functions to construct appropriate values of that type.
@ -428,7 +428,7 @@ provides an upper bound for the distance between the circumcenter
of a surface facet and the center of a surface Delaunay ball of this facet. of a surface facet and the center of a surface Delaunay ball of this facet.
<LI><I>`facet_topology`.</I> This parameters controls the set of topological constraints <LI><I>`facet_topology`.</I> This parameters controls the set of topological constraints
which have to be verified by each surface facet. By default, each vertex of a surface which have to be verified by each surface facet. By default, each vertex of a surface
facet has to be located on a surface patch, on a curve segment, or on a corner. It can facet has to be located on a surface patch, on a curve, or on a corner. It can
also be set to check whether the three vertices of a surface facet belongs to the same also be set to check whether the three vertices of a surface facet belongs to the same
surface patch. This has to be done cautiously, as such a criteria needs that each surface surface patch. This has to be done cautiously, as such a criteria needs that each surface
patches intersection is an input 1-dimensional feature. patches intersection is an input 1-dimensional feature.

View File

@ -79,7 +79,7 @@ related to the template parameters of some models of the main concepts:
## Classes ## ## Classes ##
- `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveSegmentIndex>` - `CGAL::Mesh_complex_3_in_triangulation_3<Tr,CornerIndex,CurveIndex>`
- `CGAL::Mesh_triangulation_3<MD,Gt,Concurrency_tag,Vertex_base,Cell_base>` - `CGAL::Mesh_triangulation_3<MD,Gt,Concurrency_tag,Vertex_base,Cell_base>`
- `CGAL::Mesh_vertex_base_3<Gt,MD,Vb>` - `CGAL::Mesh_vertex_base_3<Gt,MD,Vb>`
- `CGAL::Compact_mesh_cell_base_3<Gt,MD,Tds>` - `CGAL::Compact_mesh_cell_base_3<Gt,MD,Tds>`

View File

@ -25,7 +25,7 @@ typedef CGAL::Sequential_tag Concurrency_tag;
typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -23,7 +23,7 @@ typedef CGAL::Sequential_tag Concurrency_tag;
typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -26,7 +26,7 @@ typedef CGAL::Sequential_tag Concurrency_tag;
// Triangulation // Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -21,7 +21,7 @@ typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain;
typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,CGAL::Sequential_tag>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,CGAL::Sequential_tag>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -32,7 +32,7 @@ typedef CGAL::Sequential_tag Concurrency_tag;
typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain,CGAL::Default,Concurrency_tag>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -17,7 +17,7 @@ typedef CGAL::Mesh_polyhedron_3<K>::type Polyhedron;
// Triangulation // Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -124,7 +124,7 @@ public:
typedef typename C3T3::Triangulation Triangulation; typedef typename C3T3::Triangulation Triangulation;
typedef typename C3T3::Edge Edge; typedef typename C3T3::Edge Edge;
typedef typename MeshDomain::Curve_segment_index Curve_segment_index; typedef typename MeshDomain::Curve_index Curve_index;
typedef typename MeshDomain::Corner_index Corner_index; typedef typename MeshDomain::Corner_index Corner_index;
typedef typename MeshDomain::Index Index; typedef typename MeshDomain::Index Index;
@ -141,9 +141,9 @@ public:
} }
private: private:
typedef std::vector<std::pair<Curve_segment_index,Bare_point> > Incident_edges; typedef std::vector<std::pair<Curve_index,Bare_point> > Incident_edges;
typedef std::vector<Vertex_handle> Vertex_vector; typedef std::vector<Vertex_handle> Vertex_vector;
typedef std::vector<std::pair<Vertex_handle,Curve_segment_index> > Incident_vertices; typedef std::vector<std::pair<Vertex_handle,Curve_index> > Incident_vertices;
private: private:
/// Insert corners of the mesh /// Insert corners of the mesh
@ -196,7 +196,7 @@ private:
template <typename ErasedVeOutIt> template <typename ErasedVeOutIt>
ErasedVeOutIt insert_balls(const Vertex_handle& vp, ErasedVeOutIt insert_balls(const Vertex_handle& vp,
const Vertex_handle& vq, const Vertex_handle& vq,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
ErasedVeOutIt out); ErasedVeOutIt out);
@ -213,7 +213,7 @@ private:
const FT size_q, const FT size_q,
const FT pq_length, const FT pq_length,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
ErasedVeOutIt out); ErasedVeOutIt out);
/// Returns `true` if balls of \c va and \c vb intersect, and (va,vb) is not /// Returns `true` if balls of \c va and \c vb intersect, and (va,vb) is not
@ -234,10 +234,10 @@ private:
/// \param orientation Orientation of the curve segment between \c v1 and /// \param orientation Orientation of the curve segment between \c v1 and
/// \c v2, given the orientation of the curve of index /// \c v2, given the orientation of the curve of index
/// \c curve_index /// \c curve_index
/// \pre `c3t3.curve_segment_index(v1, v2) == curve_index` /// \pre `c3t3.curve_index(v1, v2) == curve_index`
bool is_sampling_dense_enough(const Vertex_handle& v1, bool is_sampling_dense_enough(const Vertex_handle& v1,
const Vertex_handle& v2, const Vertex_handle& v2,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
const CGAL::Orientation orientation) const; const CGAL::Orientation orientation) const;
/// Takes an iterator on Vertex_handle as input and check if the sampling /// Takes an iterator on Vertex_handle as input and check if the sampling
@ -256,11 +256,11 @@ private:
/// \c start to \c next is oriented in the same orientation as the curve /// \c start to \c next is oriented in the same orientation as the curve
/// segment with index \c curve_index, or `CGAL::NEGATIVE` otherwise. /// segment with index \c curve_index, or `CGAL::NEGATIVE` otherwise.
/// ///
/// \pre `c3t3.curve_segment_index(v1, v2) == curve_index` /// \pre `c3t3.curve_index(v1, v2) == curve_index`
CGAL::Orientation CGAL::Orientation
orientation_of_walk(const Vertex_handle& start, orientation_of_walk(const Vertex_handle& start,
const Vertex_handle& next, const Vertex_handle& next,
Curve_segment_index curve_index) const; Curve_index curve_index) const;
/// Walk along edge from \c start, following the direction \c start to /// Walk along edge from \c start, following the direction \c start to
/// \c next, and fills \c out with the vertices which do not fullfill /// \c next, and fills \c out with the vertices which do not fullfill
@ -270,23 +270,23 @@ private:
/// \c v2, given the orientation of the curve of index /// \c v2, given the orientation of the curve of index
/// \c curve_index /// \c curve_index
/// ///
/// \pre `c3t3.curve_segment_index(v1, v2) == curve_index` /// \pre `c3t3.curve_index(v1, v2) == curve_index`
template <typename ErasedVeOutIt> template <typename ErasedVeOutIt>
ErasedVeOutIt ErasedVeOutIt
walk_along_edge(const Vertex_handle& start, walk_along_edge(const Vertex_handle& start,
const Vertex_handle& next, const Vertex_handle& next,
Curve_segment_index curve_index, Curve_index curve_index,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
ErasedVeOutIt out) const; ErasedVeOutIt out) const;
/// Returns next vertex along edge, i.e vertex after \c start, following /// Returns next vertex along edge, i.e vertex after \c start, following
/// the direction from \c previous to \c start /// the direction from \c previous to \c start
/// \pre (previous,start) is in c3t3 /// \pre (previous,start) is in c3t3
/// \pre `c3t3.curve_segment_index(start, previous) == curve_index` /// \pre `c3t3.curve_index(start, previous) == curve_index`
Vertex_handle Vertex_handle
next_vertex_along_curve_segment(const Vertex_handle& start, next_vertex_along_curve(const Vertex_handle& start,
const Vertex_handle& previous, const Vertex_handle& previous,
const Curve_segment_index& curve_index) const; const Curve_index& curve_index) const;
/// Replace vertices between ]begin,last[ by new vertices, along curve /// Replace vertices between ]begin,last[ by new vertices, along curve
/// identified by \c curve_index /// identified by \c curve_index
@ -299,7 +299,7 @@ private:
template <typename InputIterator, typename ErasedVeOutIt> template <typename InputIterator, typename ErasedVeOutIt>
ErasedVeOutIt repopulate(InputIterator begin, ErasedVeOutIt repopulate(InputIterator begin,
InputIterator last, InputIterator last,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
ErasedVeOutIt out); ErasedVeOutIt out);
@ -307,7 +307,7 @@ private:
ErasedVeOutIt ErasedVeOutIt
analyze_and_repopulate(InputIterator begin, analyze_and_repopulate(InputIterator begin,
InputIterator last, InputIterator last,
const Curve_segment_index& index, const Curve_index& index,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
ErasedVeOutIt out); ErasedVeOutIt out);
@ -316,7 +316,7 @@ private:
bool is_sizing_field_correct(const Vertex_handle& v1, bool is_sizing_field_correct(const Vertex_handle& v1,
const Vertex_handle& v2, const Vertex_handle& v2,
const Vertex_handle& v3, const Vertex_handle& v3,
const Curve_segment_index& index, const Curve_index& index,
const CGAL::Orientation orientation) const; const CGAL::Orientation orientation) const;
/// Repopulate all incident curve around corner \c v /// Repopulate all incident curve around corner \c v
@ -326,13 +326,13 @@ private:
repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out); repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out);
/// Returns `true` if edge with index \c curve_index is already treated /// Returns `true` if edge with index \c curve_index is already treated
bool is_treated(const Curve_segment_index& curve_index) const bool is_treated(const Curve_index& curve_index) const
{ {
return ( treated_edges_.find(curve_index) != treated_edges_.end() ); return ( treated_edges_.find(curve_index) != treated_edges_.end() );
} }
/// Set edge with index \c curve_index as treated /// Set edge with index \c curve_index as treated
void set_treated(const Curve_segment_index& curve_index) void set_treated(const Curve_index& curve_index)
{ {
treated_edges_.insert(curve_index); treated_edges_.insert(curve_index);
} }
@ -409,7 +409,7 @@ private:
SizingFunction size_; SizingFunction size_;
FT minimal_size_; FT minimal_size_;
Weight minimal_weight_; Weight minimal_weight_;
std::set<Curve_segment_index> treated_edges_; std::set<Curve_index> treated_edges_;
std::set<Vertex_handle> unchecked_vertices_; std::set<Vertex_handle> unchecked_vertices_;
int refine_balls_iteration_nb; int refine_balls_iteration_nb;
bool nonlinear_growth_of_balls; bool nonlinear_growth_of_balls;
@ -852,19 +852,19 @@ Protect_edges_sizing_field<C3T3, MD, Sf>::
insert_balls_on_edges() insert_balls_on_edges()
{ {
// Get features // Get features
typedef CGAL::cpp11::tuple<Curve_segment_index, typedef CGAL::cpp11::tuple<Curve_index,
std::pair<Bare_point,Index>, std::pair<Bare_point,Index>,
std::pair<Bare_point,Index> > Feature_tuple; std::pair<Bare_point,Index> > Feature_tuple;
typedef std::vector<Feature_tuple> Input_features; typedef std::vector<Feature_tuple> Input_features;
Input_features input_features; Input_features input_features;
domain_.get_curve_segments(std::back_inserter(input_features)); domain_.get_curves(std::back_inserter(input_features));
// Interate on edges // Interate on edges
for ( typename Input_features::iterator fit = input_features.begin(), for ( typename Input_features::iterator fit = input_features.begin(),
end = input_features.end() ; fit != end ; ++fit ) end = input_features.end() ; fit != end ; ++fit )
{ {
const Curve_segment_index& curve_index = CGAL::cpp11::get<0>(*fit); const Curve_index& curve_index = CGAL::cpp11::get<0>(*fit);
if ( ! is_treated(curve_index) ) if ( ! is_treated(curve_index) )
{ {
#if CGAL_MESH_3_PROTECTION_DEBUG & 1 #if CGAL_MESH_3_PROTECTION_DEBUG & 1
@ -877,7 +877,7 @@ insert_balls_on_edges()
const Index& q_index = CGAL::cpp11::get<2>(*fit).second; const Index& q_index = CGAL::cpp11::get<2>(*fit).second;
Vertex_handle vp,vq; Vertex_handle vp,vq;
if ( ! domain_.is_cycle(p, curve_index) ) if ( ! domain_.is_loop(curve_index) )
{ {
vp = get_vertex_corner_from_point(p,p_index); vp = get_vertex_corner_from_point(p,p_index);
vq = get_vertex_corner_from_point(q,q_index); vq = get_vertex_corner_from_point(q,q_index);
@ -897,10 +897,10 @@ insert_balls_on_edges()
// with the third of the distance from 'p' to 'q'. // with the third of the distance from 'p' to 'q'.
FT p_size = query_size(p, 1, p_index); FT p_size = query_size(p, 1, p_index);
FT curve_lenght = domain_.curve_segment_length(p, curve_index); FT curve_lenght = domain_.curve_length(curve_index);
Bare_point other_point = Bare_point other_point =
domain_.construct_point_on_curve_segment(p, domain_.construct_point_on_curve(p,
curve_index, curve_index,
curve_lenght / 2); curve_lenght / 2);
p_size = (std::min)(p_size, p_size = (std::min)(p_size,
@ -958,7 +958,7 @@ ErasedVeOutIt
Protect_edges_sizing_field<C3T3, MD, Sf>:: Protect_edges_sizing_field<C3T3, MD, Sf>::
insert_balls(const Vertex_handle& vp, insert_balls(const Vertex_handle& vp,
const Vertex_handle& vq, const Vertex_handle& vq,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
ErasedVeOutIt out) ErasedVeOutIt out)
{ {
@ -972,13 +972,13 @@ insert_balls(const Vertex_handle& vp,
const FT sp = get_radius(vp); const FT sp = get_radius(vp);
const FT sq = get_radius(vq); const FT sq = get_radius(vq);
CGAL_assertion(vp != vq || domain_.is_cycle(p, curve_index)); CGAL_assertion(vp != vq || domain_.is_loop(curve_index));
// Compute geodesic distance // Compute geodesic distance
const FT pq_length = (vp == vq) ? const FT pq_length = (vp == vq) ?
domain_.curve_segment_length(p, curve_index) domain_.curve_length(curve_index)
: :
domain_.arc_length(p, q, curve_index, orientation); domain_.curve_segment_length(p, q, curve_index, orientation);
// Insert balls // Insert balls
return return
@ -999,7 +999,7 @@ insert_balls(const Vertex_handle& vp,
const FT sq, const FT sq,
const FT d, const FT d,
const CGAL::Orientation d_sign, const CGAL::Orientation d_sign,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
ErasedVeOutIt out) ErasedVeOutIt out)
{ {
typename C3T3::Triangulation::Geom_traits::Construct_point_3 wp2p = typename C3T3::Triangulation::Geom_traits::Construct_point_3 wp2p =
@ -1078,16 +1078,17 @@ insert_balls(const Vertex_handle& vp,
<< n << "\n between points (" << n << "\n between points ("
<< vp->point() << ") and (" << vq->point() << vp->point() << ") and (" << vq->point()
<< ") (arc length: " << ") (arc length: "
<< domain_.arc_length(wp2p(vp->point()), wp2p(vq->point()), << domain_.curve_segment_length(wp2p(vp->point()),
wp2p(vq->point()),
curve_index, d_sign) curve_index, d_sign)
<< ")\n"; << ")\n";
#endif #endif
const Bare_point new_point = const Bare_point new_point =
domain_.construct_point_on_curve_segment(wp2p(vp->point()), domain_.construct_point_on_curve(wp2p(vp->point()),
curve_index, curve_index,
d_sign * d / 2); d_sign * d / 2);
const int dim = 1; // new_point is on edge const int dim = 1; // new_point is on edge
const Index index = domain_.index_from_curve_segment_index(curve_index); const Index index = domain_.index_from_curve_index(curve_index);
const FT point_weight = CGAL::square(size_(new_point, dim, index)); const FT point_weight = CGAL::square(size_(new_point, dim, index));
#if CGAL_MESH_3_PROTECTION_DEBUG & 1 #if CGAL_MESH_3_PROTECTION_DEBUG & 1
std::cerr << " middle point: " << new_point << std::endl; std::cerr << " middle point: " << new_point << std::endl;
@ -1167,14 +1168,14 @@ insert_balls(const Vertex_handle& vp,
{ {
// New point position // New point position
Bare_point new_point = Bare_point new_point =
domain_.construct_point_on_curve_segment(p, curve_index, pt_dist); domain_.construct_point_on_curve(p, curve_index, pt_dist);
// Weight (use as size the min between norm_step_size and linear interpolation) // Weight (use as size the min between norm_step_size and linear interpolation)
FT current_size = (std::min)(norm_step_size, sp + CGAL::abs(pt_dist)/d*(sq-sp)); FT current_size = (std::min)(norm_step_size, sp + CGAL::abs(pt_dist)/d*(sq-sp));
FT point_weight = current_size * current_size; FT point_weight = current_size * current_size;
// Index and dimension // Index and dimension
Index index = domain_.index_from_curve_segment_index(curve_index); Index index = domain_.index_from_curve_index(curve_index);
int dim = 1; // new_point is on edge int dim = 1; // new_point is on edge
// Insert point into c3t3 // Insert point into c3t3
@ -1552,7 +1553,7 @@ check_and_fix_vertex_along_edge(const Vertex_handle& v, ErasedVeOutIt out)
// mesh is only two balls on the cycle: then each ball has only one // mesh is only two balls on the cycle: then each ball has only one
// neighbor. // neighbor.
const Curve_segment_index& curve_index = incident_vertices.front().second; const Curve_index& curve_index = incident_vertices.front().second;
CGAL_assertion(incident_vertices.back().second== curve_index); CGAL_assertion(incident_vertices.back().second== curve_index);
// Walk along edge to find the edge piece which is not correctly sampled // Walk along edge to find the edge piece which is not correctly sampled
@ -1610,22 +1611,22 @@ template <typename C3T3, typename MD, typename Sf>
bool bool
Protect_edges_sizing_field<C3T3, MD, Sf>:: Protect_edges_sizing_field<C3T3, MD, Sf>::
is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2, is_sampling_dense_enough(const Vertex_handle& v1, const Vertex_handle& v2,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
const CGAL::Orientation orientation) const const CGAL::Orientation orientation) const
{ {
using CGAL::Mesh_3::internal::min_intersection_factor; using CGAL::Mesh_3::internal::min_intersection_factor;
CGAL_precondition(c3t3_.curve_segment_index(v1,v2) == curve_index); CGAL_precondition(c3t3_.curve_index(v1,v2) == curve_index);
// Get sizes // Get sizes
FT size_v1 = get_radius(v1); FT size_v1 = get_radius(v1);
FT size_v2 = get_radius(v2); FT size_v2 = get_radius(v2);
CGAL_assertion(get_dimension(v1) != 1 || CGAL_assertion(get_dimension(v1) != 1 ||
curve_index == domain_.curve_segment_index(v1->index())); curve_index == domain_.curve_index(v1->index()));
CGAL_assertion(get_dimension(v2) != 1 || CGAL_assertion(get_dimension(v2) != 1 ||
curve_index == domain_.curve_segment_index(v2->index())); curve_index == domain_.curve_index(v2->index()));
FT arc_length = domain_.arc_length(v1->point().point(), FT arc_length = domain_.curve_segment_length(v1->point().point(),
v2->point().point(), v2->point().point(),
curve_index, curve_index,
orientation); orientation);
@ -1678,19 +1679,19 @@ CGAL::Orientation
Protect_edges_sizing_field<C3T3, MD, Sf>:: Protect_edges_sizing_field<C3T3, MD, Sf>::
orientation_of_walk(const Vertex_handle& start, orientation_of_walk(const Vertex_handle& start,
const Vertex_handle& next, const Vertex_handle& next,
Curve_segment_index curve_index) const Curve_index curve_index) const
{ {
typename C3T3::Triangulation::Geom_traits::Construct_point_3 wp2p = typename C3T3::Triangulation::Geom_traits::Construct_point_3 wp2p =
c3t3_.triangulation().geom_traits().construct_point_3_object(); c3t3_.triangulation().geom_traits().construct_point_3_object();
if(domain_.is_cycle(wp2p(start->point()), curve_index)) { if(domain_.is_loop(curve_index)) {
// if the curve is a cycle, the direction is the direction passing // if the curve is a cycle, the direction is the direction passing
// through the next vertex, and the next-next vertex // through the next vertex, and the next-next vertex
return return
(domain_.distance_sign_along_cycle (domain_.distance_sign_along_loop
(wp2p(start->point()), (wp2p(start->point()),
wp2p(next->point()), wp2p(next->point()),
wp2p(next_vertex_along_curve_segment(next,start,curve_index)->point()), wp2p(next_vertex_along_curve(next,start,curve_index)->point()),
curve_index)); curve_index));
} else { } else {
// otherwise, the sign is just the sign of the geodesic distance // otherwise, the sign is just the sign of the geodesic distance
@ -1704,7 +1705,7 @@ template <typename ErasedVeOutIt>
ErasedVeOutIt ErasedVeOutIt
Protect_edges_sizing_field<C3T3, MD, Sf>:: Protect_edges_sizing_field<C3T3, MD, Sf>::
walk_along_edge(const Vertex_handle& start, const Vertex_handle& next, walk_along_edge(const Vertex_handle& start, const Vertex_handle& next,
Curve_segment_index curve_index, Curve_index curve_index,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
ErasedVeOutIt out) const ErasedVeOutIt out) const
{ {
@ -1736,7 +1737,7 @@ walk_along_edge(const Vertex_handle& start, const Vertex_handle& next,
// Get next vertex along edge // Get next vertex along edge
Vertex_handle next = Vertex_handle next =
next_vertex_along_curve_segment(current,previous,curve_index); next_vertex_along_curve(current,previous,curve_index);
previous = current; previous = current;
current = next; current = next;
} }
@ -1748,16 +1749,13 @@ walk_along_edge(const Vertex_handle& start, const Vertex_handle& next,
template <typename C3T3, typename MD, typename Sf> template <typename C3T3, typename MD, typename Sf>
typename Protect_edges_sizing_field<C3T3, MD, Sf>::Vertex_handle typename Protect_edges_sizing_field<C3T3, MD, Sf>::Vertex_handle
Protect_edges_sizing_field<C3T3, MD, Sf>:: Protect_edges_sizing_field<C3T3, MD, Sf>::
next_vertex_along_curve_segment(const Vertex_handle& start, next_vertex_along_curve(const Vertex_handle& start,
const Vertex_handle& previous, const Vertex_handle& previous,
const Curve_segment_index& curve_index) const const Curve_index& curve_index) const
{ {
typename C3T3::Triangulation::Geom_traits::Construct_point_3 wp2p = CGAL_USE(curve_index);
c3t3_.triangulation().geom_traits().construct_point_3_object(); CGAL_precondition( c3t3_.curve_index(start, previous) == curve_index);
CGAL_precondition( domain_.is_loop(curve_index) ||
CGAL_USE(curve_index); CGAL_USE(wp2p);
CGAL_precondition( c3t3_.curve_segment_index(start, previous) == curve_index);
CGAL_precondition( domain_.is_cycle(wp2p(start->point()), curve_index) ||
(! c3t3_.is_in_complex(start)) ); (! c3t3_.is_in_complex(start)) );
Incident_vertices incident_vertices; Incident_vertices incident_vertices;
@ -1786,7 +1784,7 @@ template <typename InputIterator, typename ErasedVeOutIt>
ErasedVeOutIt ErasedVeOutIt
Protect_edges_sizing_field<C3T3, MD, Sf>:: Protect_edges_sizing_field<C3T3, MD, Sf>::
repopulate(InputIterator begin, InputIterator last, repopulate(InputIterator begin, InputIterator last,
const Curve_segment_index& index, const Curve_index& index,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
ErasedVeOutIt out) ErasedVeOutIt out)
{ {
@ -1851,7 +1849,7 @@ template <typename InputIterator, typename ErasedVeOutIt>
ErasedVeOutIt ErasedVeOutIt
Protect_edges_sizing_field<C3T3, MD, Sf>:: Protect_edges_sizing_field<C3T3, MD, Sf>::
analyze_and_repopulate(InputIterator begin, InputIterator last, analyze_and_repopulate(InputIterator begin, InputIterator last,
const Curve_segment_index& index, const Curve_index& index,
const CGAL::Orientation orientation, const CGAL::Orientation orientation,
ErasedVeOutIt out) ErasedVeOutIt out)
{ {
@ -1928,7 +1926,7 @@ Protect_edges_sizing_field<C3T3, MD, Sf>::
is_sizing_field_correct(const Vertex_handle& v1, is_sizing_field_correct(const Vertex_handle& v1,
const Vertex_handle& v2, const Vertex_handle& v2,
const Vertex_handle& v3, const Vertex_handle& v3,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
const CGAL::Orientation orientation) const const CGAL::Orientation orientation) const
{ {
typename C3T3::Triangulation::Geom_traits::Construct_point_3 wp2p = typename C3T3::Triangulation::Geom_traits::Construct_point_3 wp2p =
@ -1937,9 +1935,9 @@ is_sizing_field_correct(const Vertex_handle& v1,
FT s1 = get_radius(v1); FT s1 = get_radius(v1);
FT s2 = get_radius(v2); FT s2 = get_radius(v2);
FT s3 = get_radius(v3); FT s3 = get_radius(v3);
FT D = domain_.arc_length(wp2p(v1->point()), wp2p(v3->point()), FT D = domain_.curve_segment_length(wp2p(v1->point()), wp2p(v3->point()),
curve_index, orientation); curve_index, orientation);
FT d = domain_.arc_length(wp2p(v1->point()), wp2p(v2->point()), FT d = domain_.curve_segment_length(wp2p(v1->point()), wp2p(v2->point()),
curve_index, orientation); curve_index, orientation);
return ( s2 >= (s1 + d/D*(s3-s1)) ); return ( s2 >= (s1 + d/D*(s3-s1)) );
@ -1954,9 +1952,6 @@ repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out)
{ {
CGAL_precondition(c3t3_.is_in_complex(v)); CGAL_precondition(c3t3_.is_in_complex(v));
typename C3T3::Triangulation::Geom_traits::Construct_point_3 wp2p =
c3t3_.triangulation().geom_traits().construct_point_3_object();
Incident_vertices incident_vertices; Incident_vertices incident_vertices;
c3t3_.adjacent_vertices_in_complex(v, std::back_inserter(incident_vertices)); c3t3_.adjacent_vertices_in_complex(v, std::back_inserter(incident_vertices));
@ -1964,12 +1959,12 @@ repopulate_edges_around_corner(const Vertex_handle& v, ErasedVeOutIt out)
vend = incident_vertices.end() ; vit != vend ; ++vit ) vend = incident_vertices.end() ; vit != vend ; ++vit )
{ {
const Vertex_handle& next = vit->first; const Vertex_handle& next = vit->first;
const Curve_segment_index& curve_index = vit->second; const Curve_index& curve_index = vit->second;
// if `v` is incident to a cycle, it might be that the full cycle, // if `v` is incident to a cycle, it might be that the full cycle,
// including the edge `[next, v]`, has already been processed by // including the edge `[next, v]`, has already been processed by
// `analyze_and_repopulate()` walking in the other direction. // `analyze_and_repopulate()` walking in the other direction.
if(domain_.is_cycle(wp2p(v->point()), curve_index) && if(domain_.is_loop(curve_index) &&
!c3t3_.is_in_complex(v, next)) continue; !c3t3_.is_in_complex(v, next)) continue;

View File

@ -101,7 +101,7 @@ protected:
case 1: case 1:
{ {
++nb_vertices_on_curves; ++nb_vertices_on_curves;
const typename MeshDomain::Curve_segment_index curve_id = const typename MeshDomain::Curve_index curve_id =
domain->curve_segment_index(v->index()); domain->curve_segment_index(v->index());
Index_set set; Index_set set;
domain->get_incidences(curve_id, std::back_inserter(set)); domain->get_incidences(curve_id, std::back_inserter(set));

View File

@ -205,7 +205,7 @@ public:
else if (dim == 1) else if (dim == 1)
{ {
#ifdef CGAL_MESH_3_EXPERIMENTAL_USE_PATCHES_IDS #ifdef CGAL_MESH_3_EXPERIMENTAL_USE_PATCHES_IDS
const typename MeshDomain::Curve_segment_index& curve_id = const typename MeshDomain::Curve_index& curve_id =
m_domain.curve_segment_index(index); m_domain.curve_segment_index(index);
const Patches_ids& ids = patches_ids_map[curve_id]; const Patches_ids& ids = patches_ids_map[curve_id];

View File

@ -51,7 +51,7 @@ struct Sizing_field_with_aabb_tree
typedef typename MeshDomain::Index Index; typedef typename MeshDomain::Index Index;
typedef typename MeshDomain::Corner_index Corner_index; typedef typename MeshDomain::Corner_index Corner_index;
typedef typename MeshDomain::Curve_segment_index Curve_index; typedef typename MeshDomain::Curve_index Curve_index;
typedef typename MeshDomain::Surface_patch_index Patch_index; typedef typename MeshDomain::Surface_patch_index Patch_index;
typedef boost::container::flat_set<Curve_index> Curves_ids; typedef boost::container::flat_set<Curve_index> Curves_ids;
@ -293,7 +293,7 @@ struct Sizing_field_with_aabb_tree
return result; return result;
} }
else { // dim == 1 else { // dim == 1
const typename MeshDomain::Curve_segment_index& curve_id = const typename MeshDomain::Curve_index& curve_id =
domain.curve_segment_index(id); domain.curve_segment_index(id);
if(!aabb_tree.empty()) { if(!aabb_tree.empty()) {
const Patches_ids& ids = curves_incident_patches[curve_id]; const Patches_ids& ids = curves_incident_patches[curve_id];

View File

@ -48,7 +48,7 @@ namespace CGAL {
template <typename Tr, template <typename Tr,
typename CornerIndex = int, typename CornerIndex = int,
typename CurveSegmentIndex = int> typename CurveIndex = int>
class Mesh_complex_3_in_triangulation_3 : class Mesh_complex_3_in_triangulation_3 :
public Mesh_3::Mesh_complex_3_in_triangulation_3_base< public Mesh_3::Mesh_complex_3_in_triangulation_3_base<
Tr, typename Tr::Concurrency_tag> Tr, typename Tr::Concurrency_tag>
@ -59,7 +59,7 @@ public:
private: private:
typedef Mesh_complex_3_in_triangulation_3< typedef Mesh_complex_3_in_triangulation_3<
Tr,CornerIndex,CurveSegmentIndex> Self; Tr,CornerIndex,CurveIndex> Self;
typedef Mesh_3::Mesh_complex_3_in_triangulation_3_base< typedef Mesh_3::Mesh_complex_3_in_triangulation_3_base<
Tr,Concurrency_tag> Base; Tr,Concurrency_tag> Base;
@ -72,7 +72,11 @@ public:
typedef typename Base::Vertex_handle Vertex_handle; typedef typename Base::Vertex_handle Vertex_handle;
typedef typename Base::Cell_handle Cell_handle; typedef typename Base::Cell_handle Cell_handle;
typedef CornerIndex Corner_index; typedef CornerIndex Corner_index;
typedef CurveSegmentIndex Curve_segment_index; typedef CurveIndex Curve_index;
#ifndef CGAL_NO_DEPRECATED_CODE
CGAL_DEPRECATED typedef CurveIndex Curve_segment_index;
#endif
typedef typename Base::Triangulation Triangulation; typedef typename Base::Triangulation Triangulation;
typedef typename Base::Subdomain_index Subdomain_index; typedef typename Base::Subdomain_index Subdomain_index;
@ -83,12 +87,12 @@ private:
// Type to store the edges: // Type to store the edges:
// - a set of std::pair<Vertex_handle,Vertex_handle> (ordered at insertion) // - a set of std::pair<Vertex_handle,Vertex_handle> (ordered at insertion)
// - which allows fast lookup from one Vertex_handle // - which allows fast lookup from one Vertex_handle
// - each element of the set has an associated info (Curve_segment_index) value // - each element of the set has an associated info (Curve_index) value
typedef boost::bimaps::bimap< typedef boost::bimaps::bimap<
boost::bimaps::multiset_of<Vertex_handle>, boost::bimaps::multiset_of<Vertex_handle>,
boost::bimaps::multiset_of<Vertex_handle>, boost::bimaps::multiset_of<Vertex_handle>,
boost::bimaps::set_of_relation<>, boost::bimaps::set_of_relation<>,
boost::bimaps::with_info<Curve_segment_index> > Edge_map; boost::bimaps::with_info<Curve_index> > Edge_map;
typedef typename Edge_map::value_type Internal_edge; typedef typename Edge_map::value_type Internal_edge;
@ -156,10 +160,10 @@ public:
/** /**
* Add edge e to complex, with Curve_segment_index index * Add edge e to complex, with Curve_index index
*/ */
void add_to_complex(const Edge& e, void add_to_complex(const Edge& e,
const Curve_segment_index& index) const Curve_index& index)
{ {
add_to_complex(e.first->vertex(e.second), add_to_complex(e.first->vertex(e.second),
e.first->vertex(e.third), e.first->vertex(e.third),
@ -167,11 +171,11 @@ public:
} }
/** /**
* Add edge (v1,v2) to complex, with Curve_segment_index index * Add edge (v1,v2) to complex, with Curve_index index
*/ */
void add_to_complex(const Vertex_handle& v1, void add_to_complex(const Vertex_handle& v1,
const Vertex_handle& v2, const Vertex_handle& v2,
const Curve_segment_index& index) const Curve_index& index)
{ {
add_to_complex(make_internal_edge(v1,v2), index); add_to_complex(make_internal_edge(v1,v2), index);
} }
@ -315,23 +319,35 @@ public:
} }
/** /**
* Returns Curve_segment_index of edge \c e * Returns Curve_index of edge \c e
*/ */
Curve_segment_index curve_segment_index(const Edge& e) const Curve_index curve_index(const Edge& e) const
{ {
return curve_segment_index(e.first->vertex(e.second), return curve_index(e.first->vertex(e.second),
e.first->vertex(e.third)); e.first->vertex(e.third));
} }
/** Curve_index curve_index(const Vertex_handle& v1,
* Returns Curve_segment_index of edge \c (v1,v2)
*/
Curve_segment_index curve_segment_index(const Vertex_handle& v1,
const Vertex_handle& v2) const const Vertex_handle& v2) const
{ {
return curve_index(make_internal_edge(v1,v2)); return curve_index(make_internal_edge(v1,v2));
} }
#ifndef CGAL_NO_DEPRECATED_CODE
CGAL_DEPRECATED
Curve_index curve_segment_index(const Edge& e) const
{
return curve_index(e);
}
CGAL_DEPRECATED
Curve_index curve_segment_index(const Vertex_handle& v1,
const Vertex_handle& v2) const
{
return curve_index(v1, v2);
}
#endif // CGAL_NO_DEPRECATED_CODE
/** /**
* Returns Corner_index of vertex \c v * Returns Corner_index of vertex \c v
*/ */
@ -371,7 +387,7 @@ public:
/** /**
* Fills \c out with incident edges (1-dimensional features of \c v. * Fills \c out with incident edges (1-dimensional features of \c v.
* OutputIterator value type is std::pair<Vertex_handle,Curve_segment_index> * OutputIterator value type is std::pair<Vertex_handle,Curve_index>
* \pre v->in_dimension() < 2 * \pre v->in_dimension() < 2
*/ */
template <typename OutputIterator> template <typename OutputIterator>
@ -394,18 +410,18 @@ private:
class Edge_iterator_not_in_complex class Edge_iterator_not_in_complex
{ {
const Self& c3t3_; const Self& c3t3_;
const Curve_segment_index index_; const Curve_index index_;
public: public:
Edge_iterator_not_in_complex(const Self& c3t3, Edge_iterator_not_in_complex(const Self& c3t3,
const Curve_segment_index& index = Curve_segment_index()) const Curve_index& index = Curve_index())
: c3t3_(c3t3) : c3t3_(c3t3)
, index_(index) { } , index_(index) { }
template <typename Iterator> template <typename Iterator>
bool operator()(Iterator it) const bool operator()(Iterator it) const
{ {
if ( index_ == Curve_segment_index() ) { return ! c3t3_.is_in_complex(*it); } if ( index_ == Curve_index() ) { return ! c3t3_.is_in_complex(*it); }
else { return c3t3_.curve_segment_index(*it) != index_; } else { return c3t3_.curve_index(*it) != index_; }
} }
}; };
@ -486,7 +502,7 @@ public:
/// Returns a Facets_in_complex_iterator to the first facet of the 1D complex /// Returns a Facets_in_complex_iterator to the first facet of the 1D complex
Edges_in_complex_iterator Edges_in_complex_iterator
edges_in_complex_begin(const Curve_segment_index& index) const edges_in_complex_begin(const Curve_index& index) const
{ {
return CGAL::filter_iterator(this->triangulation().finite_edges_end(), return CGAL::filter_iterator(this->triangulation().finite_edges_end(),
Edge_iterator_not_in_complex(*this,index), Edge_iterator_not_in_complex(*this,index),
@ -494,7 +510,7 @@ public:
} }
/// Returns past-the-end iterator on facet of the 1D complex /// Returns past-the-end iterator on facet of the 1D complex
Edges_in_complex_iterator edges_in_complex_end(const Curve_segment_index& = Curve_segment_index()) const Edges_in_complex_iterator edges_in_complex_end(const Curve_index& = Curve_index()) const
{ {
return CGAL::filter_iterator(this->triangulation().finite_edges_end(), return CGAL::filter_iterator(this->triangulation().finite_edges_end(),
Edge_iterator_not_in_complex(*this)); Edge_iterator_not_in_complex(*this));
@ -544,13 +560,13 @@ private:
*/ */
bool is_in_complex(const Internal_edge& edge) const bool is_in_complex(const Internal_edge& edge) const
{ {
return (curve_index(edge) != Curve_segment_index() ); return (curve_index(edge) != Curve_index() );
} }
/** /**
* Add edge \c edge to complex, with Curve_segment_index index * Add edge \c edge to complex, with Curve_index index
*/ */
void add_to_complex(const Internal_edge& edge, const Curve_segment_index& index) void add_to_complex(const Internal_edge& edge, const Curve_index& index)
{ {
CGAL_precondition(!is_in_complex(edge)); CGAL_precondition(!is_in_complex(edge));
#if CGAL_MESH_3_PROTECTION_DEBUG & 1 #if CGAL_MESH_3_PROTECTION_DEBUG & 1
@ -571,13 +587,13 @@ private:
} }
/** /**
* Returns Curve_segment_index of edge \c edge * Returns Curve_index of edge \c edge
*/ */
Curve_segment_index curve_index(const Internal_edge& edge) const Curve_index curve_index(const Internal_edge& edge) const
{ {
typename Edge_map::const_iterator it = edges_.find(edge); typename Edge_map::const_iterator it = edges_.find(edge);
if ( edges_.end() != it ) { return it->info; } if ( edges_.end() != it ) { return it->info; }
return Curve_segment_index(); return Curve_index();
} }
private: private:

View File

@ -98,8 +98,8 @@ public:
return points_.size() > 1; return points_.size() > 1;
} }
/// Returns `true` if polyline is a cycle /// Returns `true` if polyline is a loop
bool is_cycle() const bool is_loop() const
{ {
return start_point() == end_point(); return start_point() == end_point();
} }
@ -108,7 +108,7 @@ public:
if(orientation == POSITIVE) { if(orientation == POSITIVE) {
CGAL_assertion(it != (points_.end() - 1)); CGAL_assertion(it != (points_.end() - 1));
if(it == (points_.end() - 2)) { if(it == (points_.end() - 2)) {
CGAL_assertion(is_cycle()); CGAL_assertion(is_loop());
it = points_.begin(); it = points_.begin();
} else { } else {
++it; ++it;
@ -117,7 +117,7 @@ public:
CGAL_assertion(orientation == NEGATIVE); CGAL_assertion(orientation == NEGATIVE);
CGAL_assertion(it != points_.begin()); CGAL_assertion(it != points_.begin());
if(it == (points_.begin() + 1)) { if(it == (points_.begin() + 1)) {
CGAL_assertion(is_cycle()); CGAL_assertion(is_loop());
it = points_.end() - 1; it = points_.end() - 1;
} else { } else {
--it; --it;
@ -162,16 +162,16 @@ public:
return cover_pred(s1, s2, *c2_it, c2); return cover_pred(s1, s2, *c2_it, c2);
} }
FT arc_length(const Point_3& p, const Point_3 q, FT curve_segment_length(const Point_3& p, const Point_3 q,
CGAL::Orientation orientation) const CGAL::Orientation orientation) const
{ {
CGAL_assertion(orientation != CGAL::ZERO); CGAL_assertion(orientation != CGAL::ZERO);
const_iterator p_it = locate(p); const_iterator p_it = locate(p);
const_iterator q_it = locate(q); const_iterator q_it = locate(q);
return arc_length(p, q, orientation, p_it, q_it); return curve_segment_length(p, q, orientation, p_it, q_it);
} }
FT arc_length(const Point_3& p, const Point_3 q, FT curve_segment_length(const Point_3& p, const Point_3 q,
CGAL::Orientation orientation, CGAL::Orientation orientation,
const_iterator p_it, const_iterator p_it,
const_iterator q_it) const const_iterator q_it) const
@ -210,9 +210,9 @@ public:
/// Returns the angle at the first point. /// Returns the angle at the first point.
/// \pre The polyline must be a cycle. /// \pre The polyline must be a loop.
Angle angle_at_first_point() const { Angle angle_at_first_point() const {
CGAL_precondition(is_cycle()); CGAL_precondition(is_loop());
const Point_3& first = points_.front(); const Point_3& first = points_.front();
const Point_3& next_p = points_[1]; const Point_3& next_p = points_[1];
const Point_3& prev = points_[points_.size() - 2]; const Point_3& prev = points_[points_.size() - 2];
@ -253,16 +253,16 @@ public:
else else
{ return -result; } { return -result; }
} }
if(is_cycle()) { if(is_loop()) {
const FT positive_distance = arc_length(p, q, CGAL::POSITIVE, pit, qit); const FT positive_distance = curve_segment_length(p, q, CGAL::POSITIVE, pit, qit);
const FT negative_distance = arc_length(p, q, CGAL::NEGATIVE, pit, qit); const FT negative_distance = curve_segment_length(p, q, CGAL::NEGATIVE, pit, qit);
return (positive_distance < negative_distance) return (positive_distance < negative_distance)
? positive_distance ? positive_distance
: (- negative_distance); : (- negative_distance);
} else { } else {
return (pit <= qit) return (pit <= qit)
? arc_length(p, q, CGAL::POSITIVE) ? curve_segment_length(p, q, CGAL::POSITIVE)
: ( - arc_length(p, q, CGAL::NEGATIVE) ); : ( - curve_segment_length(p, q, CGAL::NEGATIVE) );
} }
} }
@ -273,10 +273,10 @@ public:
Point_3 point_at(const Point_3& p, FT distance) const Point_3 point_at(const Point_3& p, FT distance) const
{ {
// use first point of the polyline instead of p // use first point of the polyline instead of p
distance += arc_length(start_point(),p,CGAL::POSITIVE); distance += curve_segment_length(start_point(),p,CGAL::POSITIVE);
// If polyline is a cycle, ensure that distance is given from start_point() // If polyline is a loop, ensure that distance is given from start_point()
if ( is_cycle() ) if ( is_loop() )
{ {
if ( distance < FT(0) ) { distance += length(); } if ( distance < FT(0) ) { distance += length(); }
else if ( distance > length() ) { distance -= length(); } else if ( distance > length() ) { distance -= length(); }
@ -314,7 +314,7 @@ public:
bool are_ordered_along(const Point_3& p, const Point_3& q) const bool are_ordered_along(const Point_3& p, const Point_3& q) const
{ {
CGAL_precondition(!is_cycle()); CGAL_precondition(!is_loop());
// Locate p & q on polyline // Locate p & q on polyline
const_iterator pit = locate(p); const_iterator pit = locate(p);
@ -343,7 +343,7 @@ private:
/// Returns an iterator on the starting point of the segment of the /// Returns an iterator on the starting point of the segment of the
/// polyline which contains p /// polyline which contains p
/// if end_point_first is true, then --end is returned instead of begin /// if end_point_first is true, then --end is returned instead of begin
/// if p is the starting point of a cycle. /// if p is the starting point of a loop.
const_iterator locate(const Point_3& p, bool end_point_first=false) const const_iterator locate(const Point_3& p, bool end_point_first=false) const
{ {
CGAL_precondition(is_valid()); CGAL_precondition(is_valid());
@ -356,7 +356,7 @@ private:
{ return --result; } { return --result; }
else else
{ {
// Treat cycles // Treat loops
if ( end_point_first && p == end_point() ) if ( end_point_first && p == end_point() )
{ return last_segment_source(); } { return last_segment_source(); }
else else
@ -483,7 +483,7 @@ struct Mesh_domain_segment_of_curve_primitive{
template <typename MDwPF, bool patch_id_is_streamable> template <typename MDwPF, bool patch_id_is_streamable>
struct Display_incidences_to_patches_aux { struct Display_incidences_to_patches_aux {
template <typename Container, typename Point> template <typename Container, typename Point>
void operator()(std::ostream& os, Point p, typename MDwPF::Curve_segment_index id, void operator()(std::ostream& os, Point p, typename MDwPF::Curve_index id,
const Container&) const; const Container&) const;
}; };
@ -491,21 +491,21 @@ template <typename MDwPF> //specialization when patch_id_is_streamable == false
struct Display_incidences_to_patches_aux<MDwPF, false> { struct Display_incidences_to_patches_aux<MDwPF, false> {
template <typename Container, typename Point> template <typename Container, typename Point>
void operator()(std::ostream& os, Point p, void operator()(std::ostream& os, Point p,
typename MDwPF::Curve_segment_index id, typename MDwPF::Curve_index id,
const Container&) const; const Container&) const;
}; };
template <typename MDwPF, bool curve_id_is_streamable> template <typename MDwPF, bool curve_id_is_streamable>
struct Display_incidences_to_curves_aux { struct Display_incidences_to_curves_aux {
template <typename Container, typename Point> template <typename Container, typename Point>
void operator()(std::ostream& os, Point p, typename MDwPF::Curve_segment_index id, void operator()(std::ostream& os, Point p, typename MDwPF::Curve_index id,
const Container&) const; const Container&) const;
}; };
template <typename MDwPF> //specialization when curve_id_is_streamable == false template <typename MDwPF> //specialization when curve_id_is_streamable == false
struct Display_incidences_to_curves_aux<MDwPF, false> { struct Display_incidences_to_curves_aux<MDwPF, false> {
template <typename Container, typename Point> template <typename Container, typename Point>
void operator()(std::ostream& os, Point p, typename MDwPF::Curve_segment_index id, void operator()(std::ostream& os, Point p, typename MDwPF::Curve_index id,
const Container&) const; const Container&) const;
}; };
@ -534,9 +534,13 @@ public:
typedef typename Base::Surface_patch_index typedef typename Base::Surface_patch_index
Surface_patch_index; Surface_patch_index;
typedef int Curve_segment_index; typedef int Curve_index;
typedef int Corner_index; typedef int Corner_index;
#ifndef CGAL_NO_DEPRECATED_CODE
CGAL_DEPRECATED typedef Curve_index Curve_segment_index;
#endif
typedef typename Base::R Gt; typedef typename Base::R Gt;
typedef Gt R; typedef Gt R;
typedef typename Base::Point_3 Point_3; typedef typename Base::Point_3 Point_3;
@ -599,70 +603,69 @@ public:
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator get_corners(OutputIterator out) const; OutputIterator get_corners(OutputIterator out) const;
/// OutputIterator value type is CGAL::cpp11::tuple<Curve_segment_index, /// OutputIterator value type is CGAL::cpp11::tuple<Curve_index,
/// std::pair<Point_3,Index>, std::pair<Point_3,Index> > /// std::pair<Point_3,Index>, std::pair<Point_3,Index> >
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator get_curve_segments(OutputIterator out) const; OutputIterator get_curves(OutputIterator out) const;
/// Returns the length of the curve segment, on the curve with index /// Returns the length of the curve segment, on the curve with index
/// \c curve_index, from \c p to \c q, in the orientation /// \c curve_index, from \c p to \c q, in the orientation
/// \c orientation /// \c orientation
/// ///
/// If the curve connected component containing \c p and \c q is a cycle, /// If the curve containing \c p and \c q is a loop,
/// the orientation gives identifies which portion of the cycle /// the orientation gives identifies which portion of the loop
/// corresponds to the arc, otherwise \c orientation must be compatible /// corresponds to the arc, otherwise \c orientation must be compatible
/// with the orientation of \c p and \c q on the curve segment. /// with the orientation of \c p and \c q on the curve segment.
FT arc_length(const Point_3& p, const Point_3 q, FT curve_segment_length(const Point_3& p, const Point_3 q,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
CGAL::Orientation orientation) const; CGAL::Orientation orientation) const;
/// Returns the length of the connected component of curve with index /// Returns the length of the curve with index
/// \c curve_index including point \c p /// \c curve_index
FT curve_segment_length(const Point_3& p, FT curve_length(const Curve_index& curve_index) const;
const Curve_segment_index& curve_index) const;
/// Returns the signed geodesic distance between points \c p and \c q /// Returns the signed geodesic distance between points \c p and \c q
/// of curve \c curve_index /// of curve \c curve_index
FT signed_geodesic_distance(const Point_3& p, const Point_3& q, FT signed_geodesic_distance(const Point_3& p, const Point_3& q,
const Curve_segment_index& curve_index) const; const Curve_index& curve_index) const;
/// Construct a point on curve \c curve_index at geodesic distance \c distance /// Construct a point on curve \c curve_index at geodesic distance \c distance
/// of \c starting_point /// of \c starting_point
Point_3 Point_3
construct_point_on_curve_segment(const Point_3& starting_point, construct_point_on_curve(const Point_3& starting_point,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
FT distance) const; FT distance) const;
/// Returns the sign of the orientation of p,q,r along curve segment /// Returns the sign of the orientation of p,q,r along curve segment
/// of index \c index /// of index \c index
CGAL::Sign distance_sign_along_cycle(const Point_3& p, CGAL::Sign distance_sign_along_loop(const Point_3& p,
const Point_3& q, const Point_3& q,
const Point_3& r, const Point_3& r,
const Curve_segment_index& index) const; const Curve_index& index) const;
/// Returns the sign of the geodesic distance between \c p and \c q /// Returns the sign of the geodesic distance between \c p and \c q
/// \pre Curve segment of index \c index is not a cycle /// \pre Curve of index \c index is not a loop
CGAL::Sign distance_sign(const Point_3& p, const Point_3& q, CGAL::Sign distance_sign(const Point_3& p, const Point_3& q,
const Curve_segment_index& index) const; const Curve_index& index) const;
/// Returns `true` if curve \c curve_index is a cycle /// Returns `true` if curve \c curve_index is a loop
bool is_cycle(const Point_3&, const Curve_segment_index& index) const; bool is_loop(const Curve_index& index) const;
/// Returns `true` if the portion of the curve segment of index \c index, /// Returns `true` if the portion of the curve segment of index \c index,
/// between the points \c c1 and \c c2, is covered by the spheres of /// from \c c1 to \c c2 in the orientation \c orientation, is covered by the spheres of
/// centers \c c1 and \c c2 and squared radii \c sq_r1 and \c sq_r2 /// centers \c c1 and \c c2 and squared radii \c sq_r1 and \c sq_r2
/// respectively. /// respectively.
bool is_curve_segment_covered(const Curve_segment_index& index, bool is_curve_segment_covered(const Curve_index& index,
CGAL::Orientation orientation, CGAL::Orientation orientation,
const Point_3& c1, const Point_3& c2, const Point_3& c1, const Point_3& c2,
const FT sq_r1, const FT sq_r2) const; const FT sq_r1, const FT sq_r2) const;
/// Returns an Index from a Curve_segment_index /// Returns an Index from a Curve_index
Index index_from_curve_segment_index(const Curve_segment_index& index) const Index index_from_curve_index(const Curve_index& index) const
{ return Index(index); } { return Index(index); }
/// Returns an Curve_segment_index from an Index /// Returns an Curve_index from an Index
Curve_segment_index curve_segment_index(const Index& index) const Curve_index curve_index(const Index& index) const
{ return boost::get<Curve_segment_index>(index); } { return boost::get<Curve_index>(index); }
/// Returns an Index from a Corner_index /// Returns an Index from a Corner_index
Index index_from_corner_index(const Corner_index& index) const Index index_from_corner_index(const Corner_index& index) const
@ -676,7 +679,7 @@ public:
/// + InputIterator type should have begin() and end() function /// + InputIterator type should have begin() and end() function
/// + InputIterator::iterator value type must be Point_3 /// + InputIterator::iterator value type must be Point_3
// + IndicesOutputIterator is an output iterator of value_type equal // + IndicesOutputIterator is an output iterator of value_type equal
/// to Curve_segment_index /// to Curve_index
template <typename InputIterator, typename IndicesOutputIterator> template <typename InputIterator, typename IndicesOutputIterator>
IndicesOutputIterator IndicesOutputIterator
add_features(InputIterator first, InputIterator last, add_features(InputIterator first, InputIterator last,
@ -706,7 +709,7 @@ public:
template <typename IndicesOutputIterator> template <typename IndicesOutputIterator>
IndicesOutputIterator IndicesOutputIterator
get_incidences(Curve_segment_index id, IndicesOutputIterator out) const; get_incidences(Curve_index id, IndicesOutputIterator out) const;
template <typename IndicesOutputIterator> template <typename IndicesOutputIterator>
IndicesOutputIterator IndicesOutputIterator
@ -719,17 +722,17 @@ public:
typedef std::set<Surface_patch_index> Surface_patch_index_set; typedef std::set<Surface_patch_index> Surface_patch_index_set;
const Surface_patch_index_set& const Surface_patch_index_set&
get_incidences(Curve_segment_index id) const; get_incidences(Curve_index id) const;
void display_corner_incidences(std::ostream& os, Point_3, Corner_index id); void display_corner_incidences(std::ostream& os, Point_3, Corner_index id);
/// Insert one edge into domain /// Insert one edge into domain
/// InputIterator value type is Point_3 /// InputIterator value type is Point_3
template <typename InputIterator> template <typename InputIterator>
Curve_segment_index insert_edge(InputIterator first, InputIterator last); Curve_index insert_edge(InputIterator first, InputIterator last);
private: private:
void register_corner(const Point_3& p, const Curve_segment_index& index); void register_corner(const Point_3& p, const Curve_index& index);
void compute_corners_incidences(); void compute_corners_incidences();
/// Returns Index associated to p (p must be the coordinates of a corner /// Returns Index associated to p (p must be the coordinates of a corner
@ -740,9 +743,9 @@ private:
typedef std::map<Point_3,Corner_index> Corners; typedef std::map<Point_3,Corner_index> Corners;
typedef internal::Mesh_3::Polyline<Gt> Polyline; typedef internal::Mesh_3::Polyline<Gt> Polyline;
typedef std::map<Curve_segment_index, Polyline> Edges; typedef std::map<Curve_index, Polyline> Edges;
typedef std::map<Curve_segment_index, Surface_patch_index_set > Edges_incidences; typedef std::map<Curve_index, Surface_patch_index_set > Edges_incidences;
typedef std::map<Corner_index, std::set<Curve_segment_index> > Corners_tmp_incidences; typedef std::map<Corner_index, std::set<Curve_index> > Corners_tmp_incidences;
typedef std::map<Corner_index, Surface_patch_index_set > Corners_incidences; typedef std::map<Corner_index, Surface_patch_index_set > Corners_incidences;
typedef internal::Mesh_3::Mesh_domain_segment_of_curve_primitive< typedef internal::Mesh_3::Mesh_domain_segment_of_curve_primitive<
@ -758,7 +761,7 @@ private:
Corners_incidences corners_incidences_; Corners_incidences corners_incidences_;
Edges edges_; Edges edges_;
Curve_segment_index current_curve_index_; Curve_index current_curve_index_;
Edges_incidences edges_incidences_; Edges_incidences edges_incidences_;
public: public:
@ -779,8 +782,8 @@ public:
if(!curves_aabb_tree_is_built) build_curves_aabb_tree(); if(!curves_aabb_tree_is_built) build_curves_aabb_tree();
return curves_aabb_tree_; return curves_aabb_tree_;
} }
Curve_segment_index maximal_curve_segment_index() const { Curve_index maximal_curve_index() const {
if(edges_incidences_.empty()) return Curve_segment_index(); if(edges_incidences_.empty()) return Curve_index();
return boost::prior(edges_incidences_.end())->first; return boost::prior(edges_incidences_.end())->first;
} }
@ -842,7 +845,7 @@ template <class MD_>
template <typename OutputIterator> template <typename OutputIterator>
OutputIterator OutputIterator
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
get_curve_segments(OutputIterator out) const get_curves(OutputIterator out) const
{ {
for ( typename Edges::const_iterator for ( typename Edges::const_iterator
eit = edges_.begin(), end = edges_.end() ; eit != end ; ++eit ) eit = edges_.begin(), end = edges_.end() ; eit != end ; ++eit )
@ -853,14 +856,14 @@ get_curve_segments(OutputIterator out) const
const Point_3& q = eit->second.end_point(); const Point_3& q = eit->second.end_point();
Index p_index, q_index; Index p_index, q_index;
if ( ! eit->second.is_cycle() ) if ( ! eit->second.is_loop() )
{ {
p_index = point_corner_index(p); p_index = point_corner_index(p);
q_index = point_corner_index(q); q_index = point_corner_index(q);
} }
else else
{ {
p_index = index_from_curve_segment_index(eit->first); p_index = index_from_curve_index(eit->first);
q_index = p_index; q_index = p_index;
} }
@ -892,23 +895,22 @@ point_corner_index(const Point_3& p) const
template <class MD_> template <class MD_>
typename Mesh_domain_with_polyline_features_3<MD_>::FT typename Mesh_domain_with_polyline_features_3<MD_>::FT
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
arc_length(const Point_3& p, const Point_3 q, curve_segment_length(const Point_3& p, const Point_3 q,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
CGAL::Orientation orientation) const CGAL::Orientation orientation) const
{ {
// Get corresponding polyline // Get corresponding polyline
typename Edges::const_iterator eit = edges_.find(curve_index); typename Edges::const_iterator eit = edges_.find(curve_index);
CGAL_assertion(eit != edges_.end()); CGAL_assertion(eit != edges_.end());
return eit->second.arc_length(p, q, orientation); return eit->second.curve_segment_length(p, q, orientation);
} }
template <class MD_> template <class MD_>
typename Mesh_domain_with_polyline_features_3<MD_>::FT typename Mesh_domain_with_polyline_features_3<MD_>::FT
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
curve_segment_length(const Point_3&, curve_length(const Curve_index& curve_index) const
const Curve_segment_index& curve_index) const
{ {
// Get corresponding polyline // Get corresponding polyline
typename Edges::const_iterator eit = edges_.find(curve_index); typename Edges::const_iterator eit = edges_.find(curve_index);
@ -922,7 +924,7 @@ template <class MD_>
typename Mesh_domain_with_polyline_features_3<MD_>::FT typename Mesh_domain_with_polyline_features_3<MD_>::FT
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
signed_geodesic_distance(const Point_3& p, const Point_3& q, signed_geodesic_distance(const Point_3& p, const Point_3& q,
const Curve_segment_index& curve_index) const const Curve_index& curve_index) const
{ {
// Get corresponding polyline // Get corresponding polyline
typename Edges::const_iterator eit = edges_.find(curve_index); typename Edges::const_iterator eit = edges_.find(curve_index);
@ -936,8 +938,8 @@ signed_geodesic_distance(const Point_3& p, const Point_3& q,
template <class MD_> template <class MD_>
typename Mesh_domain_with_polyline_features_3<MD_>::Point_3 typename Mesh_domain_with_polyline_features_3<MD_>::Point_3
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
construct_point_on_curve_segment(const Point_3& starting_point, construct_point_on_curve(const Point_3& starting_point,
const Curve_segment_index& curve_index, const Curve_index& curve_index,
FT distance) const FT distance) const
{ {
// Get corresponding polyline // Get corresponding polyline
@ -987,7 +989,7 @@ add_features_with_context(InputIterator first, InputIterator last,
std::copy(first->context.adjacent_patches_ids.begin(), std::copy(first->context.adjacent_patches_ids.begin(),
first->context.adjacent_patches_ids.end(), first->context.adjacent_patches_ids.end(),
std::inserter(ids_p2, ids_p2.begin())); std::inserter(ids_p2, ids_p2.begin()));
Curve_segment_index curve_id = Curve_index curve_id =
insert_edge(first->polyline_content.begin(), first->polyline_content.end()); insert_edge(first->polyline_content.begin(), first->polyline_content.end());
edges_incidences_[curve_id] = first->context.adjacent_patches_ids; edges_incidences_[curve_id] = first->context.adjacent_patches_ids;
*indices_out++ = curve_id; *indices_out++ = curve_id;
@ -1033,7 +1035,7 @@ template <class MD_>
template <typename IndicesOutputIterator> template <typename IndicesOutputIterator>
IndicesOutputIterator IndicesOutputIterator
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
get_incidences(Curve_segment_index id, get_incidences(Curve_index id,
IndicesOutputIterator indices_out) const IndicesOutputIterator indices_out) const
{ {
typename Edges_incidences::const_iterator it = edges_incidences_.find(id); typename Edges_incidences::const_iterator it = edges_incidences_.find(id);
@ -1066,7 +1068,7 @@ get_corner_incident_curves(Corner_index id,
{ {
typename Corners_tmp_incidences::const_iterator it = typename Corners_tmp_incidences::const_iterator it =
corners_tmp_incidences_.find(id); corners_tmp_incidences_.find(id);
const std::set<Curve_segment_index>& incidences = it->second; const std::set<Curve_index>& incidences = it->second;
return std::copy(incidences.begin(), incidences.end(), indices_out); return std::copy(incidences.begin(), incidences.end(), indices_out);
} }
@ -1077,12 +1079,12 @@ template <typename MDwPF_, bool curve_id_is_streamable>
template <typename Container2, typename Point> template <typename Container2, typename Point>
void void
Display_incidences_to_curves_aux<MDwPF_,curve_id_is_streamable>:: Display_incidences_to_curves_aux<MDwPF_,curve_id_is_streamable>::
operator()(std::ostream& os, Point p, typename MDwPF_::Curve_segment_index id, operator()(std::ostream& os, Point p, typename MDwPF_::Curve_index id,
const Container2& corners_tmp_incidences_of_id) const const Container2& corners_tmp_incidences_of_id) const
{ {
os << "Corner #" << id << " (" << p os << "Corner #" << id << " (" << p
<< ") is incident to the following curves: {"; << ") is incident to the following curves: {";
BOOST_FOREACH(typename MDwPF_::Curve_segment_index curve_index, BOOST_FOREACH(typename MDwPF_::Curve_index curve_index,
corners_tmp_incidences_of_id) corners_tmp_incidences_of_id)
{ {
os << " " << curve_index; os << " " << curve_index;
@ -1095,7 +1097,7 @@ template <class MDwPF_>
template <typename Container2, typename Point> template <typename Container2, typename Point>
void void
Display_incidences_to_curves_aux<MDwPF_,false>:: Display_incidences_to_curves_aux<MDwPF_,false>::
operator()(std::ostream& os, Point p, typename MDwPF_::Curve_segment_index id, operator()(std::ostream& os, Point p, typename MDwPF_::Curve_index id,
const Container2& corners_tmp_incidences_of_id) const const Container2& corners_tmp_incidences_of_id) const
{ {
os << "Corner #" << id << " (" << p os << "Corner #" << id << " (" << p
@ -1109,7 +1111,7 @@ template <typename MDwPF_, bool patch_id_is_streamable>
template <typename Container, typename Point> template <typename Container, typename Point>
void void
Display_incidences_to_patches_aux<MDwPF_,patch_id_is_streamable>:: Display_incidences_to_patches_aux<MDwPF_,patch_id_is_streamable>::
operator()(std::ostream& os, Point p, typename MDwPF_::Curve_segment_index id, operator()(std::ostream& os, Point p, typename MDwPF_::Curve_index id,
const Container& corners_incidences_of_id) const const Container& corners_incidences_of_id) const
{ {
os << "Corner #" << id << " (" << p os << "Corner #" << id << " (" << p
@ -1127,7 +1129,7 @@ template <class MDwPF_>
template <typename Container, typename Point> template <typename Container, typename Point>
void void
Display_incidences_to_patches_aux<MDwPF_,false>:: Display_incidences_to_patches_aux<MDwPF_,false>::
operator()(std::ostream& os, Point p, typename MDwPF_::Curve_segment_index id, operator()(std::ostream& os, Point p, typename MDwPF_::Curve_index id,
const Container& corners_incidences_id) const const Container& corners_incidences_id) const
{ {
os << "Corner #" << id << " (" << p << ") is incident to " os << "Corner #" << id << " (" << p << ") is incident to "
@ -1144,7 +1146,7 @@ display_corner_incidences(std::ostream& os, Point_3 p, Corner_index id)
{ {
typedef Mesh_domain_with_polyline_features_3<MD_> Mdwpf; typedef Mesh_domain_with_polyline_features_3<MD_> Mdwpf;
typedef is_streamable<Surface_patch_index> i_s_spi; typedef is_streamable<Surface_patch_index> i_s_spi;
typedef is_streamable<Curve_segment_index> i_s_csi; typedef is_streamable<Curve_index> i_s_csi;
using namespace internal::Mesh_3; using namespace internal::Mesh_3;
typedef Display_incidences_to_curves_aux<Mdwpf,i_s_csi::value> D_i_t_c; typedef Display_incidences_to_curves_aux<Mdwpf,i_s_csi::value> D_i_t_c;
@ -1168,13 +1170,13 @@ compute_corners_incidences()
corner_tmp_incidences = corners_tmp_incidences_[id]; corner_tmp_incidences = corners_tmp_incidences_[id];
// If the corner is incident to only one curve, and that curve is a // If the corner is incident to only one curve, and that curve is a
// cycle, then remove the corner from the set, only if the angle is not // loop, then remove the corner from the set, only if the angle is not
// acute. If the angle is acute, the corner must remain as a corner, // acute. If the angle is acute, the corner must remain as a corner,
// to deal correctly with the angle. // to deal correctly with the angle.
if(corner_tmp_incidences.size() == 1 && if(corner_tmp_incidences.size() == 1 &&
is_cycle(Point_3(), *corner_tmp_incidences.begin())) is_loop(*corner_tmp_incidences.begin()))
{ {
const Curve_segment_index curve_id = *corner_tmp_incidences.begin(); const Curve_index curve_id = *corner_tmp_incidences.begin();
const Polyline& polyline = edges_[curve_id]; const Polyline& polyline = edges_[curve_id];
if(polyline.angle_at_first_point() == OBTUSE) { if(polyline.angle_at_first_point() == OBTUSE) {
typename Corners::iterator to_erase = cit; typename Corners::iterator to_erase = cit;
@ -1187,7 +1189,7 @@ compute_corners_incidences()
Surface_patch_index_set& incidences = corners_incidences_[id]; Surface_patch_index_set& incidences = corners_incidences_[id];
// That should be an empty set. // That should be an empty set.
BOOST_FOREACH(Curve_segment_index curve_index, corner_tmp_incidences) BOOST_FOREACH(Curve_index curve_index, corner_tmp_incidences)
{ {
get_incidences(curve_index, get_incidences(curve_index,
std::inserter(incidences, std::inserter(incidences,
@ -1205,7 +1207,7 @@ compute_corners_incidences()
template <class MD_> template <class MD_>
const typename Mesh_domain_with_polyline_features_3<MD_>::Surface_patch_index_set& const typename Mesh_domain_with_polyline_features_3<MD_>::Surface_patch_index_set&
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
get_incidences(Curve_segment_index id) const get_incidences(Curve_index id) const
{ {
typename Edges_incidences::const_iterator it = edges_incidences_.find(id); typename Edges_incidences::const_iterator it = edges_incidences_.find(id);
return it->second; return it->second;
@ -1214,7 +1216,7 @@ get_incidences(Curve_segment_index id) const
template <class MD_> template <class MD_>
void void
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
register_corner(const Point_3& p, const Curve_segment_index& curve_index) register_corner(const Point_3& p, const Curve_index& curve_index)
{ {
typename Corners::iterator cit = corners_.lower_bound(p); typename Corners::iterator cit = corners_.lower_bound(p);
@ -1236,20 +1238,20 @@ register_corner(const Point_3& p, const Curve_segment_index& curve_index)
template <class MD_> template <class MD_>
template <typename InputIterator> template <typename InputIterator>
typename Mesh_domain_with_polyline_features_3<MD_>::Curve_segment_index typename Mesh_domain_with_polyline_features_3<MD_>::Curve_index
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
insert_edge(InputIterator first, InputIterator last) insert_edge(InputIterator first, InputIterator last)
{ {
CGAL_assertion(std::distance(first,last) > 1); CGAL_assertion(std::distance(first,last) > 1);
const Curve_segment_index curve_index = current_curve_index_++; const Curve_index curve_index = current_curve_index_++;
// Fill corners // Fill corners
// //
// For a cycle, the "first" point of the cycle is registered as a // For a loop, the "first" point of the loop is registered as a
// corner. If at the end, during the call to // corner. If at the end, during the call to
// 'compute_corners_incidences()', that corner is incident only to a // 'compute_corners_incidences()', that corner is incident only to a
// cycle, then it will be removed from the set of corners. // loop, then it will be removed from the set of corners.
register_corner(*first, curve_index); register_corner(*first, curve_index);
if ( *first != *boost::prior(last) ) if ( *first != *boost::prior(last) )
{ {
@ -1273,11 +1275,11 @@ template <class MD_>
CGAL::Sign CGAL::Sign
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
distance_sign(const Point_3& p, const Point_3& q, distance_sign(const Point_3& p, const Point_3& q,
const Curve_segment_index& index) const const Curve_index& index) const
{ {
typename Edges::const_iterator eit = edges_.find(index); typename Edges::const_iterator eit = edges_.find(index);
CGAL_assertion(eit != edges_.end()); CGAL_assertion(eit != edges_.end());
CGAL_precondition( ! eit->second.is_cycle() ); CGAL_precondition( ! eit->second.is_loop() );
if ( p == q ) if ( p == q )
return CGAL::ZERO; return CGAL::ZERO;
@ -1291,10 +1293,10 @@ distance_sign(const Point_3& p, const Point_3& q,
template <class MD_> template <class MD_>
CGAL::Sign CGAL::Sign
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
distance_sign_along_cycle(const Point_3& p, distance_sign_along_loop(const Point_3& p,
const Point_3& q, const Point_3& q,
const Point_3& r, const Point_3& r,
const Curve_segment_index& index) const const Curve_index& index) const
{ {
CGAL_assertion(p != q); CGAL_assertion(p != q);
CGAL_assertion(p != r); CGAL_assertion(p != r);
@ -1303,10 +1305,10 @@ distance_sign_along_cycle(const Point_3& p,
// Find edge // Find edge
typename Edges::const_iterator eit = edges_.find(index); typename Edges::const_iterator eit = edges_.find(index);
CGAL_assertion(eit != edges_.end()); CGAL_assertion(eit != edges_.end());
CGAL_assertion(eit->second.is_cycle()); CGAL_assertion(eit->second.is_loop());
FT pq = eit->second.arc_length(p,q,CGAL::POSITIVE); FT pq = eit->second.curve_segment_length(p,q,CGAL::POSITIVE);
FT pr = eit->second.arc_length(p,r,CGAL::POSITIVE); FT pr = eit->second.curve_segment_length(p,r,CGAL::POSITIVE);
// Compare pq and pr // Compare pq and pr
if ( pq <= pr ) { return CGAL::POSITIVE; } if ( pq <= pr ) { return CGAL::POSITIVE; }
@ -1316,19 +1318,19 @@ distance_sign_along_cycle(const Point_3& p,
template <class MD_> template <class MD_>
bool bool
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
is_cycle(const Point_3&, const Curve_segment_index& index) const is_loop(const Curve_index& index) const
{ {
// Find edge // Find edge
typename Edges::const_iterator eit = edges_.find(index); typename Edges::const_iterator eit = edges_.find(index);
CGAL_assertion(eit != edges_.end()); CGAL_assertion(eit != edges_.end());
return eit->second.is_cycle(); return eit->second.is_loop();
} }
template <class MD_> template <class MD_>
bool bool
Mesh_domain_with_polyline_features_3<MD_>:: Mesh_domain_with_polyline_features_3<MD_>::
is_curve_segment_covered(const Curve_segment_index& index, is_curve_segment_covered(const Curve_index& index,
CGAL::Orientation orientation, CGAL::Orientation orientation,
const Point_3& c1, const Point_3& c2, const Point_3& c1, const Point_3& c2,
const FT sq_r1, const FT sq_r2) const const FT sq_r1, const FT sq_r2) const

View File

@ -313,7 +313,7 @@ public:
/// @{ /// @{
/// The types are `int` or types compatible with `int`. /// The types are `int` or types compatible with `int`.
typedef typename Base::Corner_index Corner_index; typedef typename Base::Corner_index Corner_index;
typedef typename Base::Curve_segment_index Curve_segment_index; typedef typename Base::Curve_index Curve_index;
typedef typename Base::Surface_patch_index Surface_patch_index; typedef typename Base::Surface_patch_index Surface_patch_index;
typedef typename Base::Subdomain_index Subdomain_index; typedef typename Base::Subdomain_index Subdomain_index;
/// @} /// @}
@ -338,7 +338,7 @@ public:
typedef CGAL::Tag_true Has_features; typedef CGAL::Tag_true Has_features;
typedef std::vector<Point_3> Bare_polyline; typedef std::vector<Point_3> Bare_polyline;
typedef Mesh_3::Polyline_with_context<Surface_patch_index, Curve_segment_index, typedef Mesh_3::Polyline_with_context<Surface_patch_index, Curve_index,
Bare_polyline > Polyline_with_context; Bare_polyline > Polyline_with_context;
/// @endcond /// @endcond

View File

@ -222,10 +222,14 @@ public:
// Index types // Index types
typedef typename Base::Index Index; typedef typename Base::Index Index;
typedef typename Base::Corner_index Corner_index; typedef typename Base::Corner_index Corner_index;
typedef typename Base::Curve_segment_index Curve_segment_index; typedef typename Base::Curve_index Curve_index;
typedef typename Base::Surface_patch_index Surface_patch_index; typedef typename Base::Surface_patch_index Surface_patch_index;
typedef typename Base::Subdomain_index Subdomain_index; typedef typename Base::Subdomain_index Subdomain_index;
#ifndef CGAL_NO_DEPRECATED_CODE
CGAL_DEPRECATED typedef Curve_index Curve_segment_index; ///< Backward-compatibility
#endif
typedef typename boost::property_map<Polyhedron, typedef typename boost::property_map<Polyhedron,
face_patch_id_t<Patch_id> face_patch_id_t<Patch_id>
>::type Face_patch_id_pmap; >::type Face_patch_id_pmap;
@ -244,7 +248,7 @@ public:
typedef CGAL::Tag_true Has_features; typedef CGAL::Tag_true Has_features;
typedef std::vector<Point_3> Bare_polyline; typedef std::vector<Point_3> Bare_polyline;
typedef Mesh_3::Polyline_with_context<Surface_patch_index, Curve_segment_index, typedef Mesh_3::Polyline_with_context<Surface_patch_index, Curve_index,
Bare_polyline > Polyline_with_context; Bare_polyline > Polyline_with_context;
/// Constructors /// Constructors
Polyhedral_mesh_domain_with_features_3(const Polyhedron& p, Polyhedral_mesh_domain_with_features_3(const Polyhedron& p,

View File

@ -64,7 +64,7 @@ struct Read_mesh_domain_index {
return ci; return ci;
break; break;
case 1: case 1:
typename MT::Curve_segment_index si; typename MT::Curve_index si;
if(is_ascii(is)) is >> si; if(is_ascii(is)) is >> si;
else CGAL::read(is, si); else CGAL::read(is, si);
return si; return si;
@ -83,7 +83,7 @@ struct Write_mesh_domain_index {
typedef Mesh_domain MT; // was named "mesh traits" previously typedef Mesh_domain MT; // was named "mesh traits" previously
typedef typename MT::Corner_index Ci; typedef typename MT::Corner_index Ci;
typedef typename MT::Curve_segment_index Si; typedef typename MT::Curve_index Si;
void void
operator()(std::ostream& os, int dimension, operator()(std::ostream& os, int dimension,

View File

@ -19,7 +19,7 @@ struct MD_homogeneous_types {
typedef CGAL::Tag_false Has_features; typedef CGAL::Tag_false Has_features;
typedef int Subdomain_index; typedef int Subdomain_index;
typedef int Surface_patch_index; typedef int Surface_patch_index;
typedef int Curve_segment_index; typedef int Curve_index;
typedef int Corner_index; typedef int Corner_index;
typedef int Index; typedef int Index;
@ -27,8 +27,8 @@ struct MD_homogeneous_types {
static Subdomain_index get_sub_domain_index_2() { return 2; } static Subdomain_index get_sub_domain_index_2() { return 2; }
static Surface_patch_index get_surface_patch_index_1() { return 3; } static Surface_patch_index get_surface_patch_index_1() { return 3; }
static Surface_patch_index get_surface_patch_index_2() { return 4; } static Surface_patch_index get_surface_patch_index_2() { return 4; }
static Curve_segment_index get_curve_segment_index_1() { return 5; } static Curve_index get_curve_index_1() { return 5; }
static Curve_segment_index get_curve_segment_index_2() { return 6; } static Curve_index get_curve_index_2() { return 6; }
static Corner_index get_corner_index_1() { return 7; } static Corner_index get_corner_index_1() { return 7; }
static Corner_index get_corner_index_2() { return 8; } static Corner_index get_corner_index_2() { return 8; }
@ -44,18 +44,18 @@ struct MD_heterogeneous_types {
enum Subdomain_index_enum { Z = 0, A, B, C, D}; enum Subdomain_index_enum { Z = 0, A, B, C, D};
typedef Subdomain_index_enum Subdomain_index; typedef Subdomain_index_enum Subdomain_index;
typedef std::pair<int, int> Surface_patch_index; typedef std::pair<int, int> Surface_patch_index;
typedef int Curve_segment_index; typedef int Curve_index;
typedef double Corner_index; typedef double Corner_index;
typedef boost::variant<Subdomain_index, typedef boost::variant<Subdomain_index,
Surface_patch_index, Surface_patch_index,
Curve_segment_index, Curve_index,
Corner_index> Index; Corner_index> Index;
static Subdomain_index get_sub_domain_index_1() { return A; } static Subdomain_index get_sub_domain_index_1() { return A; }
static Subdomain_index get_sub_domain_index_2() { return B; } static Subdomain_index get_sub_domain_index_2() { return B; }
static Surface_patch_index get_surface_patch_index_1() { return std::make_pair(1, 2); } static Surface_patch_index get_surface_patch_index_1() { return std::make_pair(1, 2); }
static Surface_patch_index get_surface_patch_index_2() { return std::make_pair(3, 4); } static Surface_patch_index get_surface_patch_index_2() { return std::make_pair(3, 4); }
static Curve_segment_index get_curve_segment_index_1() { return 5; } static Curve_index get_curve_index_1() { return 5; }
static Curve_segment_index get_curve_segment_index_2() { return 6; } static Curve_index get_curve_index_2() { return 6; }
static Corner_index get_corner_index_1() { return 7.; } static Corner_index get_corner_index_1() { return 7.; }
static Corner_index get_corner_index_2() { return 8.; } static Corner_index get_corner_index_2() { return 8.; }
@ -201,7 +201,7 @@ template <typename Mesh_domain>
struct Test_c3t3_io { struct Test_c3t3_io {
typedef typename Mesh_domain::Subdomain_index Subdomain_index; typedef typename Mesh_domain::Subdomain_index Subdomain_index;
typedef typename Mesh_domain::Surface_patch_index Surface_patch_index; typedef typename Mesh_domain::Surface_patch_index Surface_patch_index;
typedef typename Mesh_domain::Curve_segment_index Curve_segment_index; typedef typename Mesh_domain::Curve_index Curve_index;
typedef typename Mesh_domain::Corner_index Corner_index; typedef typename Mesh_domain::Corner_index Corner_index;
typedef typename Mesh_domain::Index Index; typedef typename Mesh_domain::Index Index;
@ -209,7 +209,7 @@ struct Test_c3t3_io {
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr, Tr,
Corner_index, Corner_index,
Curve_segment_index Curve_index
> C3t3; > C3t3;
typedef typename Tr::Point Point; typedef typename Tr::Point Point;
@ -422,8 +422,8 @@ struct Test_c3t3_io {
c3t3.add_to_complex(c2, Mesh_domain::get_sub_domain_index_2()); c3t3.add_to_complex(c2, Mesh_domain::get_sub_domain_index_2());
c3t3.add_to_complex(f1, Mesh_domain::get_surface_patch_index_1()); c3t3.add_to_complex(f1, Mesh_domain::get_surface_patch_index_1());
c3t3.add_to_complex(f2, Mesh_domain::get_surface_patch_index_2()); c3t3.add_to_complex(f2, Mesh_domain::get_surface_patch_index_2());
c3t3.add_to_complex(e1, Mesh_domain::get_curve_segment_index_1()); c3t3.add_to_complex(e1, Mesh_domain::get_curve_index_1());
c3t3.add_to_complex(e2, Mesh_domain::get_curve_segment_index_2()); c3t3.add_to_complex(e2, Mesh_domain::get_curve_index_2());
c3t3.add_to_complex(v1, Mesh_domain::get_corner_index_1()); c3t3.add_to_complex(v1, Mesh_domain::get_corner_index_1());
c3t3.add_to_complex(v2, Mesh_domain::get_corner_index_2()); c3t3.add_to_complex(v2, Mesh_domain::get_corner_index_2());
@ -433,9 +433,9 @@ struct Test_c3t3_io {
v2->set_dimension(0); v2->set_dimension(0);
v2->set_index(Mesh_domain::get_corner_index_2()); v2->set_index(Mesh_domain::get_corner_index_2());
v3->set_dimension(1); v3->set_dimension(1);
v3->set_index(Mesh_domain::get_curve_segment_index_1()); v3->set_index(Mesh_domain::get_curve_index_1());
v4->set_dimension(1); v4->set_dimension(1);
v4->set_index(Mesh_domain::get_curve_segment_index_2()); v4->set_index(Mesh_domain::get_curve_index_2());
v5->set_dimension(2); v5->set_dimension(2);
v5->set_index(Mesh_domain::get_surface_patch_index_1()); v5->set_index(Mesh_domain::get_surface_patch_index_1());
v6->set_dimension(3); v6->set_dimension(3);

View File

@ -45,7 +45,7 @@ struct Tester
typedef CGAL::Mesh_domain_with_polyline_features_3<Base_domain> Md; typedef CGAL::Mesh_domain_with_polyline_features_3<Base_domain> Md;
typedef typename CGAL::Mesh_triangulation_3<Md>::type Tr; typedef typename CGAL::Mesh_triangulation_3<Md>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr, typename Md::Corner_index, typename Md::Curve_segment_index> C3t3; Tr, typename Md::Corner_index, typename Md::Curve_index> C3t3;
typedef typename Tr::Bare_point Bare_point; typedef typename Tr::Bare_point Bare_point;
typedef typename Tr::Weighted_point Weighted_point; typedef typename Tr::Weighted_point Weighted_point;
@ -61,7 +61,7 @@ struct Tester
typedef typename C3t3::Edges_in_complex_iterator Edge_iterator; typedef typename C3t3::Edges_in_complex_iterator Edge_iterator;
typedef typename C3t3::Vertices_in_complex_iterator Vertices_iterator; typedef typename C3t3::Vertices_in_complex_iterator Vertices_iterator;
typedef typename C3t3::Curve_segment_index Curve_segment_index; typedef typename C3t3::Curve_index Curve_index;
typedef typename C3t3::Corner_index Corner_index; typedef typename C3t3::Corner_index Corner_index;
typedef typename C3t3::Index Index; typedef typename C3t3::Index Index;
@ -99,9 +99,9 @@ struct Tester
Corner_index corner_index (1); Corner_index corner_index (1);
Corner_index corner_index_bis (2); Corner_index corner_index_bis (2);
Curve_segment_index curve_segment_index (1); Curve_index curve_index (1);
Curve_segment_index curve_segment_index_bis (2); Curve_index curve_index_bis (2);
Index vertex_index (curve_segment_index); Index vertex_index (curve_index);
//------------------------------------------------------- //-------------------------------------------------------
// Add edge to c3t3 and verify // Add edge to c3t3 and verify
@ -116,7 +116,7 @@ struct Tester
const Vertex_handle& ev1 = e.first->vertex(e.second); const Vertex_handle& ev1 = e.first->vertex(e.second);
const Vertex_handle& ev2 = e.first->vertex(e.third); const Vertex_handle& ev2 = e.first->vertex(e.third);
c3t3.add_to_complex(e,curve_segment_index); c3t3.add_to_complex(e,curve_index);
std::cerr << "\tNumber of edges in c3t3: " std::cerr << "\tNumber of edges in c3t3: "
<< c3t3.number_of_edges_in_complex() << std::endl; << c3t3.number_of_edges_in_complex() << std::endl;
@ -129,7 +129,7 @@ struct Tester
c3t3.edges_in_complex_end()))); c3t3.edges_in_complex_end())));
assert(c3t3.is_in_complex(e)); assert(c3t3.is_in_complex(e));
assert(c3t3.is_in_complex(ev1, ev2)); assert(c3t3.is_in_complex(ev1, ev2));
assert(c3t3.curve_segment_index(e) == curve_segment_index); assert(c3t3.curve_index(e) == curve_index);
//------------------------------------------------------- //-------------------------------------------------------
// Remove cell from c3t3 and verify // Remove cell from c3t3 and verify
@ -146,8 +146,8 @@ struct Tester
assert(c3t3.number_of_edges_in_complex() == 0); assert(c3t3.number_of_edges_in_complex() == 0);
assert(! c3t3.is_in_complex(e)); assert(! c3t3.is_in_complex(e));
assert(! c3t3.is_in_complex(ev1, ev2)); assert(! c3t3.is_in_complex(ev1, ev2));
assert(c3t3.curve_segment_index(e) == Curve_segment_index()); assert(c3t3.curve_index(e) == Curve_index());
assert(c3t3.curve_segment_index(ev1, ev2) == Curve_segment_index()); assert(c3t3.curve_index(ev1, ev2) == Curve_index());
//------------------------------------------------------- //-------------------------------------------------------
// Add corner to c3t3 and verify // Add corner to c3t3 and verify
@ -191,9 +191,9 @@ struct Tester
//------------------------------------------------------- //-------------------------------------------------------
std::cerr << "Insert 1 curve segment (3 edges + 2 corners) in c3t3" << std::endl; std::cerr << "Insert 1 curve segment (3 edges + 2 corners) in c3t3" << std::endl;
c3t3.add_to_complex(vp1,vp2,curve_segment_index); c3t3.add_to_complex(vp1,vp2,curve_index);
c3t3.add_to_complex(vp2,vp3,curve_segment_index); c3t3.add_to_complex(vp2,vp3,curve_index);
c3t3.add_to_complex(vp3,vp4,curve_segment_index); c3t3.add_to_complex(vp3,vp4,curve_index);
c3t3.add_to_complex(vp1,corner_index); c3t3.add_to_complex(vp1,corner_index);
c3t3.add_to_complex(vp4,corner_index); c3t3.add_to_complex(vp4,corner_index);
c3t3.set_dimension(vp1,0); c3t3.set_dimension(vp1,0);
@ -229,7 +229,7 @@ struct Tester
//------------------------------------------------------- //-------------------------------------------------------
// Check adjacencies // Check adjacencies
//------------------------------------------------------- //-------------------------------------------------------
std::vector<std::pair<Vertex_handle,Curve_segment_index> > incident_vertices; std::vector<std::pair<Vertex_handle,Curve_index> > incident_vertices;
c3t3.adjacent_vertices_in_complex(vp1,std::back_inserter(incident_vertices)); c3t3.adjacent_vertices_in_complex(vp1,std::back_inserter(incident_vertices));
assert(incident_vertices.size() == 1); assert(incident_vertices.size() == 1);
@ -259,7 +259,7 @@ struct Tester
c3t3_bis.triangulation().insert(points.begin(),points.end()); c3t3_bis.triangulation().insert(points.begin(),points.end());
Edge e_bis = *(c3t3_bis.triangulation().finite_edges_begin()); Edge e_bis = *(c3t3_bis.triangulation().finite_edges_begin());
c3t3_bis.add_to_complex(e_bis,curve_segment_index_bis); c3t3_bis.add_to_complex(e_bis,curve_index_bis);
Vertex_handle v_bis = ++c3t3_bis.triangulation().finite_vertices_begin(); Vertex_handle v_bis = ++c3t3_bis.triangulation().finite_vertices_begin();
c3t3_bis.add_to_complex(v_bis,corner_index_bis); c3t3_bis.add_to_complex(v_bis,corner_index_bis);
@ -317,24 +317,24 @@ struct Tester
std::cout << "Test edge iterators\n"; std::cout << "Test edge iterators\n";
const Edge& edge_to_modify = *(c3t3.edges_in_complex_begin()); const Edge& edge_to_modify = *(c3t3.edges_in_complex_begin());
c3t3.remove_from_complex(edge_to_modify); c3t3.remove_from_complex(edge_to_modify);
c3t3.add_to_complex(edge_to_modify,curve_segment_index_bis); c3t3.add_to_complex(edge_to_modify,curve_index_bis);
typename C3t3::Edges_in_complex_iterator curve_eit = typename C3t3::Edges_in_complex_iterator curve_eit =
c3t3.edges_in_complex_begin(curve_segment_index); c3t3.edges_in_complex_begin(curve_index);
typename C3t3::Edges_in_complex_iterator curve_eit_bis = typename C3t3::Edges_in_complex_iterator curve_eit_bis =
c3t3.edges_in_complex_begin(curve_segment_index_bis); c3t3.edges_in_complex_begin(curve_index_bis);
typename C3t3::Edges_in_complex_iterator eend = typename C3t3::Edges_in_complex_iterator eend =
c3t3.edges_in_complex_end(); c3t3.edges_in_complex_end();
std::cout << "\tNumber of edges of index '" << curve_segment_index << "': " std::cout << "\tNumber of edges of index '" << curve_index << "': "
<< std::distance(curve_eit,eend) << std::endl; << std::distance(curve_eit,eend) << std::endl;
std::cout << "\tNumber of edges of index '" << curve_segment_index_bis << "': " std::cout << "\tNumber of edges of index '" << curve_index_bis << "': "
<< std::distance(curve_eit_bis,eend) << std::endl; << std::distance(curve_eit_bis,eend) << std::endl;
assert ( std::distance(curve_eit,eend) == 2 ); assert ( std::distance(curve_eit,eend) == 2 );
assert ( std::distance(curve_eit_bis,eend) == 1 ); assert ( std::distance(curve_eit_bis,eend) == 1 );
assert ( c3t3.curve_segment_index(*curve_eit) == curve_segment_index ); assert ( c3t3.curve_index(*curve_eit) == curve_index );
assert ( c3t3.curve_segment_index(*curve_eit_bis) == curve_segment_index_bis ); assert ( c3t3.curve_index(*curve_eit_bis) == curve_index_bis );
//------------------------------------------------------- //-------------------------------------------------------
// Test vertex iterators // Test vertex iterators

View File

@ -51,7 +51,7 @@ class Domain_with_polyline_tester
typedef std::list<Polyline> Polylines; typedef std::list<Polyline> Polylines;
typedef Mesh_domain::Corner_index Ci; typedef Mesh_domain::Corner_index Ci;
typedef Mesh_domain::Curve_segment_index Csi; typedef Mesh_domain::Curve_index Csi;
typedef Mesh_domain::Index Index; typedef Mesh_domain::Index Index;
typedef std::vector<std::pair<Ci, Point> > Corners_vector; typedef std::vector<std::pair<Ci, Point> > Corners_vector;
@ -64,7 +64,7 @@ public:
: p1_(1,0,0), p2_(1,1,0), p3_(1,2,0.1), p4_(0.9, 0.9, 1) : p1_(1,0,0), p2_(1,1,0), p3_(1,2,0.1), p4_(0.9, 0.9, 1)
{ } { }
void build_curve_segment() void build_curve()
{ {
Polylines polylines (1); Polylines polylines (1);
Polyline& polyline = polylines.front(); Polyline& polyline = polylines.front();
@ -90,7 +90,7 @@ public:
domain_.add_features(polylines.begin(),polylines.end()); domain_.add_features(polylines.begin(),polylines.end());
} }
void test_curve_segment_corners() const void test_curve_corners() const
{ {
Corners_vector corners; Corners_vector corners;
domain_.get_corners(std::back_inserter(corners)); domain_.get_corners(std::back_inserter(corners));
@ -108,7 +108,7 @@ public:
assert(corners.size() == 1); assert(corners.size() == 1);
} }
void test_curve_segments() const void test_curves() const
{ {
std::pair<Point,Point> extremities = get_extremities(); std::pair<Point,Point> extremities = get_extremities();
@ -129,10 +129,10 @@ public:
std::pair<Point,Point> extremities = get_extremities(); std::pair<Point,Point> extremities = get_extremities();
const Point& p = extremities.first; const Point& p = extremities.first;
const Point& q = extremities.second; const Point& q = extremities.second;
const Csi& curve_index = get_curve_segment_index(); const Csi& curve_index = get_curve_index();
const FT geod (1.3); const FT geod (1.3);
Point r = domain_.construct_point_on_curve_segment(p,curve_index,geod); Point r = domain_.construct_point_on_curve(p,curve_index,geod);
const FT& pq_geo = domain_.signed_geodesic_distance(p,q,curve_index); const FT& pq_geo = domain_.signed_geodesic_distance(p,q,curve_index);
assert(CGAL::squared_distance(p,r) < CGAL::square(geod)); assert(CGAL::squared_distance(p,r) < CGAL::square(geod));
@ -144,12 +144,12 @@ public:
private: private:
std::pair<Point,Point> get_extremities() const std::pair<Point,Point> get_extremities() const
{ {
Curves_vector curve_segments; Curves_vector curves;
domain_.get_curve_segments(std::back_inserter(curve_segments)); domain_.get_curves(std::back_inserter(curves));
assert(curve_segments.size() == 1); assert(curves.size() == 1);
const Point& p = get_first_point(curve_segments.front()); const Point& p = get_first_point(curves.front());
const Point& q = get_second_point(curve_segments.front()); const Point& q = get_second_point(curves.front());
return std::make_pair(p,q); return std::make_pair(p,q);
} }
@ -164,16 +164,16 @@ private:
return CGAL::cpp11::get<2>(tuple).first; return CGAL::cpp11::get<2>(tuple).first;
} }
Csi get_curve_segment_index() const Csi get_curve_index() const
{ {
Curves_vector curve_segments; Curves_vector curves;
domain_.get_curve_segments(std::back_inserter(curve_segments)); domain_.get_curves(std::back_inserter(curves));
assert(curve_segments.size() == 1); assert(curves.size() == 1);
return get_curve_segment_index(curve_segments.front()); return get_curve_index(curves.front());
} }
Csi get_curve_segment_index(const Curve_tuple& tuple) const Csi get_curve_index(const Curve_tuple& tuple) const
{ {
return CGAL::cpp11::get<0>(tuple); return CGAL::cpp11::get<0>(tuple);
} }
@ -193,10 +193,10 @@ int main()
{ {
std::cout << "Test curve segments" << std::endl; std::cout << "Test curve segments" << std::endl;
Domain_with_polyline_tester domain_tester; Domain_with_polyline_tester domain_tester;
domain_tester.build_curve_segment(); domain_tester.build_curve();
domain_tester.test_curve_segment_corners(); domain_tester.test_curve_corners();
domain_tester.test_curve_segments(); domain_tester.test_curves();
domain_tester.test_geodesic_distance(); domain_tester.test_geodesic_distance();
std::cout << "Test cycles" << std::endl; std::cout << "Test cycles" << std::endl;

View File

@ -28,7 +28,7 @@ typedef Tr::Geom_traits Gt;
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr, typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr,
Mesh_domain::Corner_index, Mesh_domain::Corner_index,
Mesh_domain::Curve_segment_index> C3t3; Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -22,7 +22,7 @@ typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain;
// Triangulation // Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
// Mesh Criteria // Mesh Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -61,7 +61,7 @@ struct Polyhedral_complex_tester : public Tester<K>
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr, Tr,
typename Mesh_domain::Corner_index, typename Mesh_domain::Corner_index,
typename Mesh_domain::Curve_segment_index> C3t3; typename Mesh_domain::Curve_index> C3t3;
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
//Input //Input

View File

@ -47,7 +47,7 @@ struct Polyhedron_with_features_tester : public Tester<K>
typedef CGAL::Mesh_complex_3_in_triangulation_3 < typedef CGAL::Mesh_complex_3_in_triangulation_3 <
Tr, Tr,
typename Mesh_domain::Corner_index, typename Mesh_domain::Corner_index,
typename Mesh_domain::Curve_segment_index > C3t3; typename Mesh_domain::Curve_index > C3t3;
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;
typedef typename Mesh_criteria::Edge_criteria Edge_criteria; typedef typename Mesh_criteria::Edge_criteria Edge_criteria;

View File

@ -20,7 +20,7 @@ typedef CGAL::Mesh_polyhedron_3<K>::type Polyhedron;
// Triangulation // Triangulation
typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr; typedef CGAL::Mesh_triangulation_3<Mesh_domain>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3< typedef CGAL::Mesh_complex_3_in_triangulation_3<
Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_segment_index> C3t3; Tr,Mesh_domain::Corner_index,Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;

View File

@ -26,7 +26,7 @@ struct Polyhedron_tester : public Tester<K>
Concurrency_tag>::type Tr; Concurrency_tag>::type Tr;
typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr, typedef CGAL::Mesh_complex_3_in_triangulation_3<Tr,
typename Mesh_domain::Corner_index, typename Mesh_domain::Corner_index,
typename Mesh_domain::Curve_segment_index> C3t3; typename Mesh_domain::Curve_index> C3t3;
// Criteria // Criteria
typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria; typedef CGAL::Mesh_criteria_3<Tr> Mesh_criteria;