mirror of https://github.com/CGAL/cgal
merge next into feature branch
This commit is contained in:
commit
7ec484eac7
|
|
@ -1376,7 +1376,6 @@ Combinatorial_map/doc_tex/Combinatorial_map_ref/Dart_base.tex -text
|
|||
Combinatorial_map/doc_tex/Combinatorial_map_ref/intro.tex -text
|
||||
Combinatorial_map/doc_tex/Combinatorial_map_ref/main.tex -text
|
||||
Combinatorial_map/dont_submit -text
|
||||
Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt -text
|
||||
Combinatorial_map/examples/Combinatorial_map/map_3_marks.cpp -text
|
||||
Combinatorial_map/examples/Combinatorial_map/map_3_operations.cpp -text
|
||||
Combinatorial_map/examples/Combinatorial_map/map_3_simple_example.cpp -text
|
||||
|
|
@ -1770,6 +1769,7 @@ Installation/config/support/print_QT_version.cpp -text
|
|||
Installation/config/support/print_TAUCS_version.cpp -text
|
||||
Installation/config/support/print_ZLIB_version.cpp -text
|
||||
Installation/config/support/test_BOOST_THREAD.cpp -text
|
||||
Installation/config/testfiles/CGAL_CFG_NO_CPP0X_COPY_N.cpp -text
|
||||
Installation/config/testfiles/CGAL_CFG_NO_CPP0X_ISFINITE.cpp -text
|
||||
Installation/config/testfiles/CGAL_CFG_NO_CPP0X_NEXT_PREV.cpp -text
|
||||
Installation/config/version.h.in -text
|
||||
|
|
@ -2579,6 +2579,8 @@ Min_sphere_of_spheres_d/test_extensive/stability/maple/balls-on-boundary-3.mws -
|
|||
Min_sphere_of_spheres_d/web/figs/heuristic/excess.xfig -text svneol=unset#application/octet-stream
|
||||
Min_sphere_of_spheres_d/web/figs/mbex/mbex.xfig -text svneol=unset#application/octet-stream
|
||||
Min_sphere_of_spheres_d/web/figs/pivot/cex.xfig -text svneol=unset#application/octet-stream
|
||||
Minkowski_sum_2/benchmark/Minkowski_sum_2/print_utils.h -text
|
||||
Minkowski_sum_2/benchmark/Minkowski_sum_2/sum_by_decomposition.cpp -text
|
||||
Minkowski_sum_2/doc_tex/Minkowski_sum_2/fig/Minkowski_sum_2.png -text
|
||||
Minkowski_sum_2/doc_tex/Minkowski_sum_2/fig/approx_offset.fig -text svneol=unset#application/octet-stream
|
||||
Minkowski_sum_2/doc_tex/Minkowski_sum_2/fig/approx_offset.gif -text svneol=unset#image/gif
|
||||
|
|
@ -3328,6 +3330,9 @@ Ridges_3/examples/Ridges_3/data/poly2x^2+y^2-0.062500.off -text svneol=unset#app
|
|||
Ridges_3/examples/Ridges_3/skip_vcproj_auto_generation -text
|
||||
Ridges_3/test/Ridges_3/data/ellipsoid.off -text svneol=unset#application/octet-stream
|
||||
Robustness/demo/Robustness/help/index.html svneol=native#text/html
|
||||
STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt -text
|
||||
STL_Extension/benchmark/copy_n_benchmark/copy_n_benchmark.cpp -text
|
||||
STL_Extension/benchmark/copy_n_benchmark/copy_n_use_case_benchmark.cpp -text
|
||||
STL_Extension/doc_tex/STL_Extension/plusplus.png -text
|
||||
STL_Extension/include/CGAL/internal/boost/array_binary_tree.hpp -text
|
||||
STL_Extension/include/CGAL/internal/boost/mutable_heap.hpp -text
|
||||
|
|
|
|||
|
|
@ -1,186 +1,186 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | Reference manual page: AABB_tree.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% | 21.02.2009 Author
|
||||
% | Package: Package
|
||||
% |
|
||||
\RCSdef{\RCSAABBtreeRev}{$Id: header.tex 40270 2007-09-07 15:29:10Z lsaboret $}
|
||||
\RCSdefDate{\RCSAABBtreeDate}{$Date: 2007-09-07 17:29:10 +0200 (Ven, 07 sep 2007) $}
|
||||
% |
|
||||
\ccRefPageBegin
|
||||
%%RefPage: end of header, begin of main body
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
|
||||
\begin{ccRefClass}{AABB_tree<AT>} %% add template arg's if necessary
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[class]{} %% add further index entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
Class \ccRefName\ is a static data structure for efficient intersection and distance computations in 3D. It builds a hierarchy of axis-aligned bounding boxes (an AABB tree) from a set of 3D geometric objects, and can receive intersection and distance queries, provided that the corresponding predicates are implemented in the traits class \ccc{AT}. The template parameter \ccc{AT} stands for a traits class which must be a model of the concept \ccc{AABBTraits}.
|
||||
|
||||
\ccInclude{CGAL/AABB_tree.h}
|
||||
|
||||
\ccTypes
|
||||
\ccNestedType{size_type;}{Unsigned integral size type.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef AT::FT FT;}{Number type returned by the distance queries.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef AT::Point_3 Point;}{Type of 3D point.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef AT::Primitive Primitive;}{Type of input primitive.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef AT::Bounding_box Bounding_box;}{Type of bounding box.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef std::pair<Point, Primitive::Id> Point_and_primitive_id;}{}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef std::pair<CGAL::Object, Primitive::Id> Object_and_primitive_id;}{}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{tree}
|
||||
|
||||
\ccConstructor{AABB_tree();}{Constructs an empty tree.}
|
||||
\ccConstructor{template < class InputIterator>
|
||||
AABB_tree( InputIterator begin,
|
||||
InputIterator beyond);}{Builds the AABB tree data structure. Type \ccc{InputIterator} can be any const iterator such that \ccc{Primitive} has a constructor taking a \ccc{InputIterator} as argument. The tree stays empty if the memory allocation is not successful.}
|
||||
|
||||
\ccOperations
|
||||
|
||||
\ccMethod{template < class InputIterator>
|
||||
void rebuild(InputIterator begin,
|
||||
InputIterator beyond);}{Clears the current tree and rebuilds it from scratch. See constructor above for the parameters. }
|
||||
\ccGlue
|
||||
\ccMethod{void clear();}{Clears the AABB tree. }
|
||||
|
||||
\ccGlue
|
||||
\ccMethod{template <class InputIterator>
|
||||
void insert(InputIterator begin, InputIterator beyond);}
|
||||
{Add a sequence of primitives to the set of primitive of the AABB
|
||||
tree. Type \ccc{InputIterator} can be any const iterator such that \ccc{Primitive}
|
||||
has a constructor taking an InputIterator as argument.}
|
||||
\ccGlue
|
||||
\ccMethod{void insert(const Primitive p);}
|
||||
{Add a primitive to the set of primitives of the AABB tree.}
|
||||
|
||||
\begin{ccAdvanced}
|
||||
\ccMethod{void build();}
|
||||
{After one or more calls to \ccHtmlNoLinksFrom{\ccc{insert}}, the internal data structure
|
||||
of \ccRefName\ must be reconstructed. This procedure has a complexity of
|
||||
\ccc{O(n log(n))}, where n is the number of primitives of the tree. This
|
||||
procedure is called implicitly at the first call to a query member
|
||||
function. You can call \ccc{build()} explicitly to ensure that the
|
||||
next call to query functions will not trigger the reconstruction of the
|
||||
data structure.}
|
||||
\end{ccAdvanced}
|
||||
|
||||
|
||||
\ccGlue
|
||||
\ccMethod{Bounding_box bbox();}{Returns the axis-aligned bounding box of the whole tree. }
|
||||
\ccGlue
|
||||
\ccMethod{size_type size();}{Returns the number of primitives in the tree. }
|
||||
\ccGlue
|
||||
\ccMethod{bool empty();}{Returns \ccc{true}, iff tree contains no primitive. }
|
||||
|
||||
% INTERSECTION TESTS
|
||||
\ccHeading{Intersection Tests}
|
||||
|
||||
\ccMethod{template <class Query>
|
||||
bool do_intersect(const Query& query);}{Returns \ccc{true}, iff the query intersects at least one of the input primitives. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates are defined in the \ccc{AT} class.}
|
||||
\ccGlue
|
||||
\ccMethod{template <class Query>
|
||||
size_type number_of_intersected_primitives(const Query& query);}{Returns the number of primitives intersected by the query. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates are defined in the \ccc{AT} class.}
|
||||
\ccGlue
|
||||
\ccMethod{template <class Query, class OutputIterator>
|
||||
OutputIterator
|
||||
all_intersected_primitives(const Query& query,
|
||||
OutputIterator out);}{Outputs to the iterator the list of all intersected primitives ids. This function does not compute the intersection points and is hence faster than the function \ccc{all_intersections} function below. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates are defined in the \ccc{AT} class.}
|
||||
\ccGlue
|
||||
\ccMethod{template <class Query>
|
||||
boost::optional<Primitive::Id>
|
||||
any_intersected_primitive(const Query& query);}{Returns the first encountered intersected primitive id, iff the query intersects at least one of the input primitives. No particular order is guaranteed over the tree traversal, such that, e.g, the primitive returned is not necessarily the closest from the source point of a ray query. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates are defined in the \ccc{AT} class.}
|
||||
|
||||
|
||||
% INTERSECTIONS
|
||||
\ccHeading{Intersections}
|
||||
|
||||
\ccMethod{template <class Query, class OutputIterator>
|
||||
OutputIterator
|
||||
all_intersections(const Query& query,
|
||||
OutputIterator out);}{Outputs to the iterator the list of all intersections between the query and input data, as objects of type \ccc{Object_and_primitive_id}. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates and intersections are defined in the \ccc{AT} class.}
|
||||
\ccGlue
|
||||
\ccMethod{template <class Query>
|
||||
boost::optional<Object_and_primitive_id>
|
||||
any_intersection(const Query& query);}{Returns the first encountered intersection, iff the query intersects at least one of the input primitives. No particular order is guaranteed over the tree traversal, such that, e.g, the primitive returned is not necessarily the closest from the source point of a ray query. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates and intersections are defined in the \ccc{AT} class.}
|
||||
|
||||
|
||||
|
||||
% DISTANCE QUERIES
|
||||
\ccHeading{Distance Queries}
|
||||
|
||||
\ccMethod{FT
|
||||
squared_distance(const Point& query);}{Returns the minimum squared distance between the query point and all input primitives. Method \ccc{accelerate_distance_queries} should be called before the first distance query, so that an internal secondary search structure is build, for improving performance.}
|
||||
\ccGlue
|
||||
\ccMethod{Point
|
||||
closest_point(const Point& query);}{Returns the point in the union of all input primitives which is closest to the query. In case there are several closest points, one arbitrarily chosen closest point is returned. Method \ccc{accelerate_distance_queries} should be called before the first distance query, so that an internal secondary search structure is build, for improving performance.}
|
||||
\ccGlue
|
||||
\ccMethod{Point_and_primitive_id
|
||||
closest_point_and_primitive(const Point& query);}{Returns a \ccc{Point_and_primitive_id} which realizes the smallest distance between the query point and all input primitives. Method \ccc{accelerate_distance_queries} should be called before the first distance query, so that an internal secondary search structure is build, for improving performance.}
|
||||
|
||||
% ACCELERATING THE DISTANCE QUERIES
|
||||
|
||||
\ccHeading{Accelerating the Distance Queries}
|
||||
|
||||
\ccMethod{bool accelerate_distance_queries();}{ Constructs an internal data structure for accelerating distance queries. This method should be called once, before the first distance query.
|
||||
Returns \ccc{true}, iff the memory allocation is successful.}
|
||||
|
||||
\begin{ccAdvanced}
|
||||
In the following paragraphs, we discuss details of the implementation of the distance queries. We explain the internal use of hints, how the user can pass his own hints to the tree, and how the user can influence the construction of the secondary data structure used for accelerating distance queries.
|
||||
|
||||
Internally, the distance queries algorithms are initialized with some hint, which has the same type as the return type of the query, and this value is refined along a traversal of the tree, until it is optimal, that is to say until it realizes the shortest distance to the primitives. In particular, the exact specification of these internal algorithms is that they minimize the distance to the object composed of the union of the primitives and the hint.
|
||||
|
||||
It follows that
|
||||
\begin{itemize}
|
||||
\item in order to return the exact distance to the set of primitives, the algorithms need the hint to be exactly on the primitives;
|
||||
\item if this is not the case, and if the hint happens to be closer to the query point than any of the primitives, then the hint is returned.
|
||||
\end{itemize}
|
||||
This second observation is reasonable, in the sense that providing a hint to the algorithm means claiming that this hint belongs to the union of the primitives. These considerations about the hints being exactly on the primitives or not are important: in the case where the set of primitives is a triangle soup, and if some of the primitives are large, one may want to provide a much better hint than a vertex of the triangle soup could be. It could be, for example, the barycenter of one of the triangles. But, except with the use of an exact constructions kernel, one cannot easily construct points other than the vertices, that lie exactly on a triangle soup. Hence, providing a good hint sometimes means not being able to provide it exactly on the primitives. In rare occasions, this hint can be returned as the closest point.
|
||||
|
||||
In order to accelerate distance queries significantly, the AABB tree builds an internal KD-tree containing a set of potential hints, when the method \ccc{accelerate_distance_queries} is called. This KD-tree provides very good hints that allow the algorithms to run much faster than with a default hint (such as the \ccc{reference_point} of the first primitive). The set of potential hints is a sampling of the union of the primitives, which is obtained, by default, by calling the method \ccc{reference_point} of each of the primitives. However, such a sampling with one point per primitive may not be the most relevant one: if some primitives are very large, it helps inserting more than one sample on them. Conversely, a sparser sampling with less than one point per input primitive is relevant in some cases.
|
||||
|
||||
For this reason, the user can provide his own set of sample points:
|
||||
|
||||
\ccMethod{template <class InputIterator, class PointAndIdBuilder>
|
||||
bool accelerate_distance_queries(InputIterator begin,
|
||||
InputIterator beyond,
|
||||
PointAndIdBuilder idb =
|
||||
PointAndIdBuilder());}{ Constructs an internal KD-tree containing the specified point set, to be used as the set of potential hints for accelerating the distance queries. Iterator \ccc{InputIterator} must be accepted as argument by the operator provided by the \ccc{idb} object: this operator returns a \ccc{Point_and_primitive_id} corresponding to the object the iterator points to.}
|
||||
|
||||
Note that, in some cases, the user is not able to provide ids of the primitives on which the points lie. In these cases, providing a default value for the ids of the hints is possible. Still, the user should be aware that if she uses the \ccc{closest_point_and_primitive} method, there is a (tiny) chance that a hint is returned, along with this default value as corresponding primitive id. Hence, the validity of the returned primitive id should be checked in these cases.
|
||||
|
||||
As an alternative to using the KD-tree, the user can also provide the hints directly, by using the following methods:
|
||||
|
||||
\ccMethod{FT
|
||||
squared_distance(const Point& query, const Point& hint);}{Returns the minimum squared distance between the query point and all input primitives. The internal KD-tree is not used.}
|
||||
|
||||
\ccMethod{Point
|
||||
closest_point(const Point& query, const Point& hint);}{Returns the point in the union of all input primitives which is closest to the query. In case there are several closest points, one arbitrarily chosen closest point is returned. The internal KD-tree is not used.}
|
||||
|
||||
\ccMethod{Point_and_primitive_id
|
||||
closest_point_and_primitive(const Point& query, const Point_and_primitive_id& hint);}{Returns a \ccc{Point_and_primitive_id} which realizes the smallest distance between the query point and all input primitives. The internal KD-tree is not used.}
|
||||
|
||||
\end{ccAdvanced}
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{AABBTraits}, \\
|
||||
\ccc{AABBPrimitive}.
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
% +------------------------------------------------------------------------+
|
||||
%%RefPage: end of main body, begin of footer
|
||||
\ccRefPageEnd
|
||||
% EOF
|
||||
% +------------------------------------------------------------------------+
|
||||
% +------------------------------------------------------------------------+
|
||||
% | Reference manual page: AABB_tree.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% | 21.02.2009 Author
|
||||
% | Package: Package
|
||||
% |
|
||||
\RCSdef{\RCSAABBtreeRev}{$Id: header.tex 40270 2007-09-07 15:29:10Z lsaboret $}
|
||||
\RCSdefDate{\RCSAABBtreeDate}{$Date: 2007-09-07 17:29:10 +0200 (Ven, 07 sep 2007) $}
|
||||
% |
|
||||
\ccRefPageBegin
|
||||
%%RefPage: end of header, begin of main body
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
|
||||
\begin{ccRefClass}{AABB_tree<AT>} %% add template arg's if necessary
|
||||
|
||||
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||
%% \ccHtmlIndexC[class]{} %% add further index entries
|
||||
|
||||
\ccDefinition
|
||||
|
||||
Class \ccRefName\ is a static data structure for efficient intersection and distance computations in 3D. It builds a hierarchy of axis-aligned bounding boxes (an AABB tree) from a set of 3D geometric objects, and can receive intersection and distance queries, provided that the corresponding predicates are implemented in the traits class \ccc{AT}. The template parameter \ccc{AT} stands for a traits class which must be a model of the concept \ccc{AABBTraits}.
|
||||
|
||||
\ccInclude{CGAL/AABB_tree.h}
|
||||
|
||||
\ccTypes
|
||||
\ccNestedType{size_type;}{Unsigned integral size type.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef AT::FT FT;}{Number type returned by the distance queries.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef AT::Point_3 Point;}{Type of 3D point.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef AT::Primitive Primitive;}{Type of input primitive.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef AT::Bounding_box Bounding_box;}{Type of bounding box.}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef std::pair<Point, Primitive::Id> Point_and_primitive_id;}{}
|
||||
\ccGlue
|
||||
\ccTypedef{typedef std::pair<CGAL::Object, Primitive::Id> Object_and_primitive_id;}{}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{tree}
|
||||
|
||||
\ccConstructor{AABB_tree();}{Constructs an empty tree.}
|
||||
\ccConstructor{template < class InputIterator>
|
||||
AABB_tree( InputIterator begin,
|
||||
InputIterator beyond);}{Builds the AABB tree data structure. Type \ccc{InputIterator} can be any const iterator such that \ccc{Primitive} has a constructor taking a \ccc{InputIterator} as argument. The tree stays empty if the memory allocation is not successful.}
|
||||
|
||||
\ccOperations
|
||||
|
||||
\ccMethod{template < class InputIterator>
|
||||
void rebuild(InputIterator begin,
|
||||
InputIterator beyond);}{Clears the current tree and rebuilds it from scratch. See constructor above for the parameters. }
|
||||
\ccGlue
|
||||
\ccMethod{void clear();}{Clears the AABB tree. }
|
||||
|
||||
\ccGlue
|
||||
\ccMethod{template <class InputIterator>
|
||||
void insert(InputIterator begin, InputIterator beyond);}
|
||||
{Add a sequence of primitives to the set of primitive of the AABB
|
||||
tree. Type \ccc{InputIterator} can be any const iterator such that \ccc{Primitive}
|
||||
has a constructor taking an InputIterator as argument.}
|
||||
\ccGlue
|
||||
\ccMethod{void insert(const Primitive p);}
|
||||
{Add a primitive to the set of primitives of the AABB tree.}
|
||||
|
||||
\begin{ccAdvanced}
|
||||
\ccMethod{void build();}
|
||||
{After one or more calls to \ccHtmlNoLinksFrom{\ccc{insert}}, the internal data structure
|
||||
of \ccRefName\ must be reconstructed. This procedure has a complexity of
|
||||
\ccc{O(n log(n))}, where n is the number of primitives of the tree. This
|
||||
procedure is called implicitly at the first call to a query member
|
||||
function. You can call \ccc{build()} explicitly to ensure that the
|
||||
next call to query functions will not trigger the reconstruction of the
|
||||
data structure.}
|
||||
\end{ccAdvanced}
|
||||
|
||||
|
||||
\ccGlue
|
||||
\ccMethod{Bounding_box bbox() const;}{Returns the axis-aligned bounding box of the whole tree. }
|
||||
\ccGlue
|
||||
\ccMethod{size_type size() const;}{Returns the number of primitives in the tree. }
|
||||
\ccGlue
|
||||
\ccMethod{bool empty() const;}{Returns \ccc{true}, iff tree contains no primitive. }
|
||||
|
||||
% INTERSECTION TESTS
|
||||
\ccHeading{Intersection Tests}
|
||||
|
||||
\ccMethod{template <class Query>
|
||||
bool do_intersect(const Query& query) const;}{Returns \ccc{true}, iff the query intersects at least one of the input primitives. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates are defined in the \ccc{AT} class.}
|
||||
\ccGlue
|
||||
\ccMethod{template <class Query>
|
||||
size_type number_of_intersected_primitives(const Query& query) const;}{Returns the number of primitives intersected by the query. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates are defined in the \ccc{AT} class.}
|
||||
\ccGlue
|
||||
\ccMethod{template <class Query, class OutputIterator>
|
||||
OutputIterator
|
||||
all_intersected_primitives(const Query& query,
|
||||
OutputIterator out) const;}{Outputs to the iterator the list of all intersected primitives ids. This function does not compute the intersection points and is hence faster than the function \ccc{all_intersections} function below. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates are defined in the \ccc{AT} class.}
|
||||
\ccGlue
|
||||
\ccMethod{template <class Query>
|
||||
boost::optional<Primitive::Id>
|
||||
any_intersected_primitive(const Query& query) const;}{Returns the first encountered intersected primitive id, iff the query intersects at least one of the input primitives. No particular order is guaranteed over the tree traversal, such that, e.g, the primitive returned is not necessarily the closest from the source point of a ray query. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates are defined in the \ccc{AT} class.}
|
||||
|
||||
|
||||
% INTERSECTIONS
|
||||
\ccHeading{Intersections}
|
||||
|
||||
\ccMethod{template <class Query, class OutputIterator>
|
||||
OutputIterator
|
||||
all_intersections(const Query& query,
|
||||
OutputIterator out) const;}{Outputs to the iterator the list of all intersections between the query and input data, as objects of type \ccc{Object_and_primitive_id}. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates and intersections are defined in the \ccc{AT} class.}
|
||||
\ccGlue
|
||||
\ccMethod{template <class Query>
|
||||
boost::optional<Object_and_primitive_id>
|
||||
any_intersection(const Query& query) const;}{Returns the first encountered intersection, iff the query intersects at least one of the input primitives. No particular order is guaranteed over the tree traversal, such that, e.g, the primitive returned is not necessarily the closest from the source point of a ray query. Type \ccc{Query} must be a type for which \ccHtmlNoLinksFrom{\ccc{do_intersect}} predicates and intersections are defined in the \ccc{AT} class.}
|
||||
|
||||
|
||||
|
||||
% DISTANCE QUERIES
|
||||
\ccHeading{Distance Queries}
|
||||
|
||||
\ccMethod{FT
|
||||
squared_distance(const Point& query) const;}{Returns the minimum squared distance between the query point and all input primitives. Method \ccc{accelerate_distance_queries} should be called before the first distance query, so that an internal secondary search structure is build, for improving performance.}
|
||||
\ccGlue
|
||||
\ccMethod{Point
|
||||
closest_point(const Point& query) const;}{Returns the point in the union of all input primitives which is closest to the query. In case there are several closest points, one arbitrarily chosen closest point is returned. Method \ccc{accelerate_distance_queries} should be called before the first distance query, so that an internal secondary search structure is build, for improving performance.}
|
||||
\ccGlue
|
||||
\ccMethod{Point_and_primitive_id
|
||||
closest_point_and_primitive(const Point& query) const;}{Returns a \ccc{Point_and_primitive_id} which realizes the smallest distance between the query point and all input primitives. Method \ccc{accelerate_distance_queries} should be called before the first distance query, so that an internal secondary search structure is build, for improving performance.}
|
||||
|
||||
% ACCELERATING THE DISTANCE QUERIES
|
||||
|
||||
\ccHeading{Accelerating the Distance Queries}
|
||||
|
||||
\ccMethod{bool accelerate_distance_queries();}{ Constructs an internal data structure for accelerating distance queries. This method should be called once, before the first distance query.
|
||||
Returns \ccc{true}, iff the memory allocation is successful.}
|
||||
|
||||
\begin{ccAdvanced}
|
||||
In the following paragraphs, we discuss details of the implementation of the distance queries. We explain the internal use of hints, how the user can pass his own hints to the tree, and how the user can influence the construction of the secondary data structure used for accelerating distance queries.
|
||||
|
||||
Internally, the distance queries algorithms are initialized with some hint, which has the same type as the return type of the query, and this value is refined along a traversal of the tree, until it is optimal, that is to say until it realizes the shortest distance to the primitives. In particular, the exact specification of these internal algorithms is that they minimize the distance to the object composed of the union of the primitives and the hint.
|
||||
|
||||
It follows that
|
||||
\begin{itemize}
|
||||
\item in order to return the exact distance to the set of primitives, the algorithms need the hint to be exactly on the primitives;
|
||||
\item if this is not the case, and if the hint happens to be closer to the query point than any of the primitives, then the hint is returned.
|
||||
\end{itemize}
|
||||
This second observation is reasonable, in the sense that providing a hint to the algorithm means claiming that this hint belongs to the union of the primitives. These considerations about the hints being exactly on the primitives or not are important: in the case where the set of primitives is a triangle soup, and if some of the primitives are large, one may want to provide a much better hint than a vertex of the triangle soup could be. It could be, for example, the barycenter of one of the triangles. But, except with the use of an exact constructions kernel, one cannot easily construct points other than the vertices, that lie exactly on a triangle soup. Hence, providing a good hint sometimes means not being able to provide it exactly on the primitives. In rare occasions, this hint can be returned as the closest point.
|
||||
|
||||
In order to accelerate distance queries significantly, the AABB tree builds an internal KD-tree containing a set of potential hints, when the method \ccc{accelerate_distance_queries} is called. This KD-tree provides very good hints that allow the algorithms to run much faster than with a default hint (such as the \ccc{reference_point} of the first primitive). The set of potential hints is a sampling of the union of the primitives, which is obtained, by default, by calling the method \ccc{reference_point} of each of the primitives. However, such a sampling with one point per primitive may not be the most relevant one: if some primitives are very large, it helps inserting more than one sample on them. Conversely, a sparser sampling with less than one point per input primitive is relevant in some cases.
|
||||
|
||||
For this reason, the user can provide his own set of sample points:
|
||||
|
||||
\ccMethod{template <class InputIterator, class PointAndIdBuilder>
|
||||
bool accelerate_distance_queries(InputIterator begin,
|
||||
InputIterator beyond,
|
||||
PointAndIdBuilder idb =
|
||||
PointAndIdBuilder());}{ Constructs an internal KD-tree containing the specified point set, to be used as the set of potential hints for accelerating the distance queries. Iterator \ccc{InputIterator} must be accepted as argument by the operator provided by the \ccc{idb} object: this operator returns a \ccc{Point_and_primitive_id} corresponding to the object the iterator points to.}
|
||||
|
||||
Note that, in some cases, the user is not able to provide ids of the primitives on which the points lie. In these cases, providing a default value for the ids of the hints is possible. Still, the user should be aware that if she uses the \ccc{closest_point_and_primitive} method, there is a (tiny) chance that a hint is returned, along with this default value as corresponding primitive id. Hence, the validity of the returned primitive id should be checked in these cases.
|
||||
|
||||
As an alternative to using the KD-tree, the user can also provide the hints directly, by using the following methods:
|
||||
|
||||
\ccMethod{FT
|
||||
squared_distance(const Point& query, const Point& hint) const;}{Returns the minimum squared distance between the query point and all input primitives. The internal KD-tree is not used.}
|
||||
|
||||
\ccMethod{Point
|
||||
closest_point(const Point& query, const Point& hint) const;}{Returns the point in the union of all input primitives which is closest to the query. In case there are several closest points, one arbitrarily chosen closest point is returned. The internal KD-tree is not used.}
|
||||
|
||||
\ccMethod{Point_and_primitive_id
|
||||
closest_point_and_primitive(const Point& query, const Point_and_primitive_id& hint) const;}{Returns a \ccc{Point_and_primitive_id} which realizes the smallest distance between the query point and all input primitives. The internal KD-tree is not used.}
|
||||
|
||||
\end{ccAdvanced}
|
||||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccc{AABBTraits}, \\
|
||||
\ccc{AABBPrimitive}.
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
% +------------------------------------------------------------------------+
|
||||
%%RefPage: end of main body, begin of footer
|
||||
\ccRefPageEnd
|
||||
% EOF
|
||||
% +------------------------------------------------------------------------+
|
||||
|
|
|
|||
0
AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp
Executable file → Normal file
0
AABB_tree/examples/AABB_tree/AABB_custom_indexed_triangle_set_array_example.cpp
Executable file → Normal file
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) 2008 INRIA Sophia-Antipolis (France), ETH Zurich (Switzerland).
|
||||
// Copyright (c) 2008,2011 INRIA Sophia-Antipolis (France), ETH Zurich (Switzerland).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you may redistribute it under
|
||||
|
|
@ -27,6 +27,10 @@
|
|||
#include <CGAL/internal/AABB_tree/AABB_search_tree.h>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
/**
|
||||
|
|
@ -121,12 +125,12 @@ namespace CGAL {
|
|||
// returns true iff successful memory allocation
|
||||
template<typename ConstPointIterator>
|
||||
bool accelerate_distance_queries(ConstPointIterator first,
|
||||
ConstPointIterator beyond) const;
|
||||
ConstPointIterator beyond);
|
||||
|
||||
/// Construct internal search tree from
|
||||
/// a point set taken on the internal primitives
|
||||
// returns true iff successful memory allocation
|
||||
bool accelerate_distance_queries() const;
|
||||
bool accelerate_distance_queries();
|
||||
|
||||
// intersection tests
|
||||
template<typename Query>
|
||||
|
|
@ -165,7 +169,7 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
// clears internal KD tree
|
||||
void clear_search_tree() const
|
||||
void clear_search_tree()
|
||||
{
|
||||
delete m_p_search_tree;
|
||||
m_p_search_tree = NULL;
|
||||
|
|
@ -212,17 +216,26 @@ namespace CGAL {
|
|||
Primitives m_primitives;
|
||||
// single root node
|
||||
Node* m_p_root_node;
|
||||
|
||||
Node* root_node() const {
|
||||
if(m_need_build)
|
||||
const_cast< AABB_tree<AABBTraits>* >(this)->build();
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
mutable boost::mutex internal_tree_mutex;//mutex used to protect const calls inducing build()
|
||||
#endif
|
||||
|
||||
const Node* root_node() const {
|
||||
if(m_need_build){
|
||||
#ifdef CGAL_HAS_THREADS
|
||||
//this ensure that build() will be called once
|
||||
boost::mutex::scoped_lock scoped_lock(internal_tree_mutex);
|
||||
if(m_need_build)
|
||||
#endif
|
||||
const_cast< AABB_tree<AABBTraits>* >(this)->build();
|
||||
}
|
||||
return m_p_root_node;
|
||||
}
|
||||
|
||||
// search KD-tree
|
||||
mutable Search_tree* m_p_search_tree;
|
||||
mutable bool m_search_tree_constructed;
|
||||
mutable bool m_default_search_tree_constructed;
|
||||
const Search_tree* m_p_search_tree;
|
||||
bool m_search_tree_constructed;
|
||||
bool m_default_search_tree_constructed;
|
||||
bool m_need_build;
|
||||
|
||||
private:
|
||||
|
|
@ -329,7 +342,7 @@ namespace CGAL {
|
|||
template<typename Tr>
|
||||
template<typename ConstPointIterator>
|
||||
bool AABB_tree<Tr>::accelerate_distance_queries(ConstPointIterator first,
|
||||
ConstPointIterator beyond) const
|
||||
ConstPointIterator beyond)
|
||||
{
|
||||
// clears current KD tree
|
||||
clear_search_tree();
|
||||
|
|
@ -349,7 +362,7 @@ namespace CGAL {
|
|||
|
||||
// constructs the search KD tree from internal primitives
|
||||
template<typename Tr>
|
||||
bool AABB_tree<Tr>::accelerate_distance_queries() const
|
||||
bool AABB_tree<Tr>::accelerate_distance_queries()
|
||||
{
|
||||
CGAL_assertion(!m_primitives.empty());
|
||||
|
||||
|
|
|
|||
|
|
@ -121,8 +121,8 @@ namespace CGAL
|
|||
delete m_p_tree;
|
||||
}
|
||||
|
||||
// TOFIX: make it const
|
||||
Point_and_primitive_id closest_point(const Point& query)
|
||||
|
||||
Point_and_primitive_id closest_point(const Point& query) const
|
||||
{
|
||||
typedef typename Add_decorated_point<Traits, typename Traits::Primitive::Id>::Point_3 Decorated_point;
|
||||
Neighbor_search search(*m_p_tree, query, 1);
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ int main(){
|
|||
typedef FT::Numerator_type Numerator_type;
|
||||
typedef FT::Denominator_type Denominator_type;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<Numerator_type,CGAL::Gmpz>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<Denominator_type,CGAL::Gmpz>::value));
|
||||
CGAL_static_assertion((boost::is_same<Numerator_type,CGAL::Gmpz>::value));
|
||||
CGAL_static_assertion((boost::is_same<Denominator_type,CGAL::Gmpz>::value));
|
||||
|
||||
Numerator_type numerator;
|
||||
Denominator_type denominator;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ binary_func(const A& a , const B& b){
|
|||
typedef CGAL::Coercion_traits<A,B> CT;
|
||||
|
||||
// check for explicit interoperability
|
||||
BOOST_STATIC_ASSERT((CT::Are_explicit_interoperable::value));
|
||||
CGAL_static_assertion((CT::Are_explicit_interoperable::value));
|
||||
|
||||
// CT::Cast is used to to convert both types into the coercion type
|
||||
typename CT::Cast cast;
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ class Algebraic_structure_traits_base< Type_,
|
|||
Type& r ) const {
|
||||
typedef Coercion_traits< NT1, NT2 > CT;
|
||||
typedef typename CT::Type Type;
|
||||
BOOST_STATIC_ASSERT((
|
||||
CGAL_static_assertion((
|
||||
::boost::is_same<Type , Type >::value));
|
||||
|
||||
typename Coercion_traits< NT1, NT2 >::Cast cast;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
#define CGAL_IMPLICIT_INTEROPERABLE_BINARY_OPERATOR_WITH_RT( NT, Result_type ) \
|
||||
template < class CT_Type_1, class CT_Type_2 > \
|
||||
Result_type operator()( const CT_Type_1& x, const CT_Type_2& y ) const { \
|
||||
BOOST_STATIC_ASSERT((::boost::is_same< \
|
||||
CGAL_static_assertion((::boost::is_same< \
|
||||
typename Coercion_traits< CT_Type_1, CT_Type_2 >::Type, NT \
|
||||
>::value)); \
|
||||
\
|
||||
|
|
|
|||
|
|
@ -92,13 +92,13 @@ public:
|
|||
|
||||
// determine extractable scalar factor
|
||||
Scalar operator () (const NT& a) {
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same< NT,Scalar >::value));
|
||||
CGAL_static_assertion(( ::boost::is_same< NT,Scalar >::value));
|
||||
typedef typename Algebraic_structure_traits<NT>::Algebraic_category SAT;
|
||||
return scalar_factor(a, SAT());
|
||||
}
|
||||
// determine extractable scalar factor
|
||||
Scalar operator () (const NT& a, const Scalar& d) {
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same< NT,Scalar >::value));
|
||||
CGAL_static_assertion(( ::boost::is_same< NT,Scalar >::value));
|
||||
typedef typename Algebraic_structure_traits<NT>::Algebraic_category SAT;
|
||||
return scalar_factor(a,d,SAT());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <CGAL/Algebraic_structure_traits.h>
|
||||
//#include <CGAL/Real_embeddable_traits.h>
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <CGAL/assertions.h>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <CGAL/tags.h>
|
||||
#include <cassert>
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
template <typename AdaptableFunctor, typename ResultType>
|
||||
void check_result_type(AdaptableFunctor, ResultType){
|
||||
typedef typename AdaptableFunctor::result_type result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<result_type,ResultType>::value));
|
||||
CGAL_static_assertion((::boost::is_same<result_type,ResultType>::value));
|
||||
}
|
||||
// check nothing for CGAL::Null_functor
|
||||
template <typename ResultType>
|
||||
|
|
@ -110,12 +110,12 @@ void test_algebraic_structure_intern( const CGAL::Integral_domain_tag& ) {
|
|||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
using CGAL::Null_functor;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(!::boost::is_same< Integral_division, Null_functor >::value));
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Divides, Null_functor >::value));
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Is_zero, Null_functor >::value));
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Is_one, Null_functor >::value));
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Square, Null_functor >::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Divides, Null_functor >::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Is_zero, Null_functor >::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Is_one, Null_functor >::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Square, Null_functor >::value));
|
||||
|
||||
// functor
|
||||
const Is_zero is_zero = Is_zero();
|
||||
|
|
@ -194,7 +194,7 @@ void test_algebraic_structure_intern(
|
|||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
using CGAL::Null_functor;
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Gcd, Null_functor>::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Gcd, Null_functor>::value));
|
||||
|
||||
const Gcd gcd = Gcd();
|
||||
assert( gcd( AS ( 0), AS ( 0)) == unit_normal( AS (0) ) );
|
||||
|
|
@ -256,9 +256,9 @@ void test_algebraic_structure_intern( const CGAL::Euclidean_ring_tag&) {
|
|||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
using CGAL::Null_functor;
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Div, Null_functor>::value));
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Mod, Null_functor>::value));
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Div_mod, Null_functor>::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Div, Null_functor>::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Mod, Null_functor>::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Div_mod, Null_functor>::value));
|
||||
|
||||
const Div div=Div();
|
||||
const Mod mod=Mod();
|
||||
|
|
@ -374,7 +374,7 @@ void test_algebraic_structure_intern( const CGAL::Field_with_sqrt_tag& ) {
|
|||
|
||||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Sqrt, Null_functor>::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Sqrt, Null_functor>::value));
|
||||
const Sqrt sqrt =Sqrt();
|
||||
AS a(4);
|
||||
|
||||
|
|
@ -597,11 +597,11 @@ class Test_is_square {
|
|||
typedef typename Is_square::first_argument_type First_argument_type;
|
||||
typedef typename Is_square::second_argument_type Second_argument_type;
|
||||
typedef typename Is_square::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( ::boost::is_same< AS , First_argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( ::boost::is_same< AS& , Second_argument_type>::value));
|
||||
//BOOST_STATIC_ASSERT(( ::boost::is_same< bool , Result_type>::value));
|
||||
//CGAL_static_assertion(( ::boost::is_same< bool , Result_type>::value));
|
||||
bool b = Result_type(true); CGAL_USE(b);
|
||||
|
||||
AS test_number = AS(3)*AS(3);
|
||||
|
|
@ -630,8 +630,8 @@ public:
|
|||
void operator() (const Sqrt& sqrt) {
|
||||
typedef typename Sqrt::argument_type Argument_type;
|
||||
typedef typename Sqrt::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same< AS , Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same< AS , Result_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same< AS , Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same< AS , Result_type>::value));
|
||||
typedef Algebraic_structure_traits<AS> AST;
|
||||
typedef typename AST::Is_exact Is_exact;
|
||||
assert( !Is_exact::value || AS (3) == sqrt( AS (9)));
|
||||
|
|
@ -653,11 +653,11 @@ public:
|
|||
typedef typename Root::first_argument_type First_argument_type;
|
||||
typedef typename Root::second_argument_type Second_argument_type;
|
||||
typedef typename Root::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( ::boost::is_same<int, First_argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( ::boost::is_same< AS , Second_argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( ::boost::is_same< AS , Result_type>::value));
|
||||
AS epsilon(1);
|
||||
assert( test_equality_epsilon( AS (2),
|
||||
|
|
@ -781,7 +781,7 @@ void test_algebraic_structure(){
|
|||
typedef CGAL::Algebraic_structure_traits< AS > AST;
|
||||
CGAL_SNAP_AST_FUNCTORS(AST);
|
||||
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<AS,typename AST::Type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<AS,typename AST::Type>::value));
|
||||
|
||||
typedef typename AST::Boolean Boolean;
|
||||
assert(!Boolean());
|
||||
|
|
@ -794,14 +794,14 @@ void test_algebraic_structure(){
|
|||
using CGAL::Integral_domain_without_division_tag;
|
||||
using CGAL::Null_functor;
|
||||
// Test for desired exactness
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( ::boost::is_same< typename AST::Is_exact, Is_exact >::value));
|
||||
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_convertible< Tag,
|
||||
CGAL_static_assertion(( ::boost::is_convertible< Tag,
|
||||
Integral_domain_without_division_tag >::value ));
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same< Tag, Algebraic_category>::value));
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Simplify, Null_functor>::value));
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< Unit_part, Null_functor>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same< Tag, Algebraic_category>::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Simplify, Null_functor>::value));
|
||||
CGAL_static_assertion((!::boost::is_same< Unit_part, Null_functor>::value));
|
||||
const Simplify simplify=Simplify();;
|
||||
const Unit_part unit_part= Unit_part();
|
||||
|
||||
|
|
@ -919,7 +919,7 @@ void test_algebraic_structure( const AS & a, const AS & b, const AS & c) {
|
|||
|
||||
typedef CGAL::Algebraic_structure_traits<AS> AST;
|
||||
typedef typename AST::Is_numerical_sensitive Is_numerical_sensitive;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
!(::boost::is_same<Is_numerical_sensitive, CGAL::Null_tag>::value));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ void test_implicit_interoperable_one_way() {
|
|||
typedef typename CT::Type C;
|
||||
typedef typename CT::Are_implicit_interoperable Are_implicit_interoperable;
|
||||
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(::boost::is_same<Are_implicit_interoperable, CGAL::Tag_true>::value));
|
||||
assert((::boost::is_same<Are_implicit_interoperable, CGAL::Tag_true>::value));
|
||||
|
||||
|
|
@ -349,9 +349,9 @@ void test_explicit_interoperable_one_way(){
|
|||
typedef typename CT::Cast Cast;
|
||||
typedef typename Cast::result_type result_type;
|
||||
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<result_type,Type>::value));
|
||||
BOOST_STATIC_ASSERT((::boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<Type,RT>::value));
|
||||
CGAL_static_assertion((::boost::is_same<result_type,Type>::value));
|
||||
CGAL_static_assertion((::boost::is_same< typename CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
|
||||
CGAL_static_assertion((::boost::is_same<Type,RT>::value));
|
||||
typename CT::Cast cast;
|
||||
|
||||
A a(3);
|
||||
|
|
|
|||
|
|
@ -44,11 +44,11 @@ void test_fraction_traits(){
|
|||
typedef typename FT::Decompose Decompose;
|
||||
typedef typename FT::Compose Compose;
|
||||
|
||||
BOOST_STATIC_ASSERT( (::boost::is_same<Type,T>::value));
|
||||
BOOST_STATIC_ASSERT( (::boost::is_same<Is_fraction,Tag_true>::value));
|
||||
BOOST_STATIC_ASSERT(!(::boost::is_same<Common_factor,Null_functor>::value));
|
||||
BOOST_STATIC_ASSERT(!(::boost::is_same<Decompose,Null_functor>::value));
|
||||
BOOST_STATIC_ASSERT(!(::boost::is_same<Compose,Null_functor>::value));
|
||||
CGAL_static_assertion( (::boost::is_same<Type,T>::value));
|
||||
CGAL_static_assertion( (::boost::is_same<Is_fraction,Tag_true>::value));
|
||||
CGAL_static_assertion(!(::boost::is_same<Common_factor,Null_functor>::value));
|
||||
CGAL_static_assertion(!(::boost::is_same<Decompose,Null_functor>::value));
|
||||
CGAL_static_assertion(!(::boost::is_same<Compose,Null_functor>::value));
|
||||
|
||||
|
||||
// Decompose
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ void test_rational_traits(){
|
|||
|
||||
typedef Rational_traits<Rational> Rational_traits;
|
||||
typedef typename Rational_traits::RT RT;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<RT,RT>::value));
|
||||
CGAL_static_assertion((::boost::is_same<RT,RT>::value));
|
||||
|
||||
assert( Rational_traits().numerator(x) == RT(7));
|
||||
assert( Rational_traits().denominator(x) == RT(2));
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#include <CGAL/basic.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <CGAL/assertions.h>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
#include <cassert>
|
||||
|
|
@ -58,8 +58,8 @@ namespace CGAL {
|
|||
void operator() (const ToDouble& to_double) {
|
||||
typedef typename ToDouble::argument_type Argument_type;
|
||||
typedef typename ToDouble::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<Type, Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<double, Result_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<Type, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<double, Result_type>::value));
|
||||
assert(42.0 == to_double(Type(42)));
|
||||
}
|
||||
};
|
||||
|
|
@ -79,8 +79,8 @@ namespace CGAL {
|
|||
typedef typename To_interval::argument_type Argument_type;
|
||||
typedef typename To_interval::result_type Result_type;
|
||||
typedef std::pair<double,double> Interval_type;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<Type, Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<Interval_type, Result_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<Type, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<Interval_type, Result_type>::value));
|
||||
|
||||
// assert(NiX::in(42.0,to_Interval(Type(42))));
|
||||
// Instead of 'NiX::in':
|
||||
|
|
@ -145,7 +145,7 @@ void test_real_embeddable() {
|
|||
CGAL_SNAP_RET_FUNCTORS(RET);
|
||||
typedef typename RET::Is_real_embeddable Is_real_embeddable;
|
||||
using CGAL::Tag_true;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same< Is_real_embeddable, Tag_true>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same< Is_real_embeddable, Tag_true>::value));
|
||||
|
||||
typedef typename RET::Boolean Boolean;
|
||||
typedef typename RET::Sign Sign;
|
||||
|
|
@ -251,20 +251,20 @@ void test_not_real_embeddable() {
|
|||
typedef CGAL::Real_embeddable_traits<Type> RET;
|
||||
typedef typename RET::Is_real_embeddable Is_real_embeddable;
|
||||
using CGAL::Tag_false;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same< Is_real_embeddable, Tag_false>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same< Is_real_embeddable, Tag_false>::value));
|
||||
}
|
||||
|
||||
|
||||
//template <class Type, class CeilLog2Abs>
|
||||
//void test_rounded_log2_abs(Type zero, CGAL::Null_functor, CeilLog2Abs) {
|
||||
// typedef CGAL::Null_functor Null_functor;
|
||||
// BOOST_STATIC_ASSERT(( ::boost::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
// CGAL_static_assertion(( ::boost::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
//}
|
||||
//
|
||||
//template <class Type, class FloorLog2Abs, class CeilLog2Abs>
|
||||
//void test_rounded_log2_abs(Type zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) {
|
||||
// typedef CGAL::Null_functor Null_functor;
|
||||
// BOOST_STATIC_ASSERT((!::boost::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
// CGAL_static_assertion((!::boost::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
//
|
||||
// assert( fl_log(Type( 7)) == 2 );
|
||||
// assert( cl_log(Type( 7)) == 3 );
|
||||
|
|
|
|||
|
|
@ -8,27 +8,27 @@ int main(){
|
|||
typedef CGAL::Algebraic_extension_traits<int> AET;
|
||||
|
||||
typedef AET::Type Type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<int,Type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<int,Type>::value));
|
||||
|
||||
typedef AET::Is_extended Is_extended;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(::boost::is_same<CGAL::Tag_false,Is_extended>::value));
|
||||
|
||||
typedef AET::Normalization_factor Normalization_factor;
|
||||
{
|
||||
typedef Normalization_factor::argument_type argument_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<argument_type,int>::value));
|
||||
CGAL_static_assertion((::boost::is_same<argument_type,int>::value));
|
||||
typedef Normalization_factor::result_type result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<result_type,int>::value));
|
||||
CGAL_static_assertion((::boost::is_same<result_type,int>::value));
|
||||
Normalization_factor nfac;
|
||||
assert(nfac(3)==1);
|
||||
}
|
||||
typedef AET::Denominator_for_algebraic_integers DFAI;
|
||||
{
|
||||
typedef DFAI::argument_type argument_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<argument_type,int>::value));
|
||||
CGAL_static_assertion((::boost::is_same<argument_type,int>::value));
|
||||
typedef DFAI::result_type result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<result_type,int>::value));
|
||||
CGAL_static_assertion((::boost::is_same<result_type,int>::value));
|
||||
DFAI dfai;
|
||||
assert(dfai(3)==1);
|
||||
}
|
||||
|
|
@ -38,18 +38,18 @@ int main(){
|
|||
typedef CGAL::Algebraic_extension_traits<EXT> AET;
|
||||
|
||||
typedef AET::Type Type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<EXT,Type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<EXT,Type>::value));
|
||||
|
||||
typedef AET::Is_extended Is_extended;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(::boost::is_same<CGAL::Tag_true,Is_extended>::value));
|
||||
|
||||
typedef AET::Normalization_factor Normalization_factor;
|
||||
{
|
||||
typedef Normalization_factor::argument_type argument_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<argument_type,EXT>::value));
|
||||
CGAL_static_assertion((::boost::is_same<argument_type,EXT>::value));
|
||||
typedef Normalization_factor::result_type result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<result_type,EXT>::value));
|
||||
CGAL_static_assertion((::boost::is_same<result_type,EXT>::value));
|
||||
Normalization_factor nfac;
|
||||
assert(nfac(EXT(3))==1);
|
||||
assert(nfac(EXT(3,0,5))==1);
|
||||
|
|
@ -58,9 +58,9 @@ int main(){
|
|||
typedef AET::Denominator_for_algebraic_integers DFAI;
|
||||
{
|
||||
typedef DFAI::argument_type argument_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<argument_type,EXT>::value));
|
||||
CGAL_static_assertion((::boost::is_same<argument_type,EXT>::value));
|
||||
typedef DFAI::result_type result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<result_type,EXT>::value));
|
||||
CGAL_static_assertion((::boost::is_same<result_type,EXT>::value));
|
||||
DFAI dfai;
|
||||
assert(dfai(EXT(3))==1);
|
||||
assert(dfai(EXT(3,0,5))==1);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#define CGAL_IS_AST_NULL_FUNCTOR(NAME) \
|
||||
{ \
|
||||
typedef AST::NAME NAME; \
|
||||
BOOST_STATIC_ASSERT( \
|
||||
CGAL_static_assertion( \
|
||||
(::boost::is_same<CGAL::Null_functor,NAME>::value)); \
|
||||
}
|
||||
|
||||
|
|
@ -14,16 +14,16 @@ int main(){
|
|||
typedef CGAL::Algebraic_structure_traits<void> AST;
|
||||
|
||||
typedef AST::Type Type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<void,Type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<void,Type>::value));
|
||||
|
||||
typedef AST::Algebraic_category Algebraic_category;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(::boost::is_same<CGAL::Null_tag,Algebraic_category>::value));
|
||||
|
||||
typedef AST::Is_exact Is_exact;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<CGAL::Null_tag,Is_exact>::value));
|
||||
CGAL_static_assertion((::boost::is_same<CGAL::Null_tag,Is_exact>::value));
|
||||
typedef AST::Is_numerical_sensitive Is_sensitive;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<CGAL::Null_tag,Is_sensitive>::value));
|
||||
CGAL_static_assertion((::boost::is_same<CGAL::Null_tag,Is_sensitive>::value));
|
||||
|
||||
CGAL_IS_AST_NULL_FUNCTOR ( Simplify);
|
||||
CGAL_IS_AST_NULL_FUNCTOR ( Unit_part);
|
||||
|
|
|
|||
|
|
@ -4,21 +4,21 @@
|
|||
int main(){
|
||||
{
|
||||
typedef CGAL::Coercion_traits<int,int> CT;
|
||||
BOOST_STATIC_ASSERT(( boost::is_same<CT::Type,int>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(( boost::is_same<CT::Type,int>::value));
|
||||
CGAL_static_assertion(
|
||||
( boost::is_same<CT::Are_implicit_interoperable,CGAL::Tag_true>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( boost::is_same<CT::Are_explicit_interoperable,CGAL::Tag_true>::value));
|
||||
assert( 5 == CT::Cast()(5));
|
||||
}
|
||||
{
|
||||
typedef CGAL::Coercion_traits<CGAL::Tag_true,CGAL::Tag_false> CT;
|
||||
// BOOST_STATIC_ASSERT(( boost::is_same<CT::Type,CGAL::Null_type>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
// CGAL_static_assertion(( boost::is_same<CT::Type,CGAL::Null_type>::value));
|
||||
CGAL_static_assertion(
|
||||
( boost::is_same<CT::Are_implicit_interoperable,CGAL::Tag_false>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( boost::is_same<CT::Are_explicit_interoperable,CGAL::Tag_false>::value));
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( boost::is_same<CT::Cast,CGAL::Null_functor>::value));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#define CGAL_IS_RET_NULL_FUNCTOR(NAME) \
|
||||
{ \
|
||||
typedef RET::NAME NAME; \
|
||||
BOOST_STATIC_ASSERT( \
|
||||
CGAL_static_assertion( \
|
||||
(::boost::is_same<CGAL::Null_functor,NAME>::value)); \
|
||||
}
|
||||
|
||||
|
|
@ -14,10 +14,10 @@ int main(){
|
|||
typedef CGAL::Real_embeddable_traits<void> RET;
|
||||
|
||||
typedef RET::Type Type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<void,Type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<void,Type>::value));
|
||||
|
||||
typedef RET::Is_real_embeddable Is_real_embeddable;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<CGAL::Tag_false,Is_real_embeddable>::value));
|
||||
CGAL_static_assertion((::boost::is_same<CGAL::Tag_false,Is_real_embeddable>::value));
|
||||
|
||||
CGAL_IS_RET_NULL_FUNCTOR(Abs);
|
||||
CGAL_IS_RET_NULL_FUNCTOR(Sgn);
|
||||
|
|
|
|||
|
|
@ -6,27 +6,27 @@
|
|||
int main(){
|
||||
typedef CGAL::Scalar_factor_traits<int> SFT;
|
||||
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<int, SFT::Type>::value));
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<int, SFT::Scalar>::value));
|
||||
CGAL_static_assertion((::boost::is_same<int, SFT::Type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<int, SFT::Scalar>::value));
|
||||
|
||||
typedef SFT::Scalar_factor Scalar_factor;
|
||||
{
|
||||
typedef Scalar_factor::result_type result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<int, result_type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<int, result_type>::value));
|
||||
|
||||
typedef Scalar_factor::argument_type argument_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<int, argument_type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<int, argument_type>::value));
|
||||
}
|
||||
typedef SFT::Scalar_div Scalar_div;
|
||||
{
|
||||
typedef Scalar_div::result_type result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<void, result_type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<void, result_type>::value));
|
||||
|
||||
typedef Scalar_div::first_argument_type first_argument_type;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(::boost::is_same<int&, first_argument_type>::value));
|
||||
typedef Scalar_div::second_argument_type second_argument_type;
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(::boost::is_same<int, second_argument_type>::value));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
#include <limits>
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <CGAL/assertions.h>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
|
|
@ -562,16 +562,16 @@ public:
|
|||
Curve_analysis_2 _construct_defining_polynomial_from(Bound b) const {
|
||||
typedef CGAL::Fraction_traits<Bound> FT;
|
||||
// We rely on the fact that the Bound is a fraction
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<typename FT::Is_fraction,
|
||||
CGAL_static_assertion((::boost::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value));
|
||||
typedef typename FT::Numerator_type Numerator;
|
||||
typedef typename FT::Denominator_type Denominator;
|
||||
typedef CGAL::Coercion_traits<Numerator,Coefficient> Num_coercion;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same
|
||||
CGAL_static_assertion((::boost::is_same
|
||||
<Coefficient,
|
||||
typename Num_coercion::Type>::value));
|
||||
typedef CGAL::Coercion_traits<Denominator,Coefficient> Denom_coercion;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same
|
||||
CGAL_static_assertion((::boost::is_same
|
||||
<Coefficient,
|
||||
typename Denom_coercion::Type>::value));
|
||||
typename Num_coercion::Cast num_cast;
|
||||
|
|
@ -2649,16 +2649,16 @@ public:
|
|||
Polynomial_1 operator() (const Polynomial_2& f, Bound b) const {
|
||||
typedef CGAL::Fraction_traits<Bound> FT;
|
||||
// We rely on the fact that the Bound is a fraction
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<typename FT::Is_fraction,
|
||||
CGAL_static_assertion((::boost::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value));
|
||||
typedef typename FT::Numerator_type Numerator;
|
||||
typedef typename FT::Denominator_type Denominator;
|
||||
typedef CGAL::Coercion_traits<Numerator,Coefficient> Num_coercion;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same
|
||||
CGAL_static_assertion((::boost::is_same
|
||||
<Coefficient,
|
||||
typename Num_coercion::Type>::value));
|
||||
typedef CGAL::Coercion_traits<Denominator,Coefficient> Denom_coercion;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same
|
||||
CGAL_static_assertion((::boost::is_same
|
||||
<Coefficient,
|
||||
typename Denom_coercion::Type>::value));
|
||||
typename Num_coercion::Cast num_cast;
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class Algebraic_real_d_1 :
|
|||
public ::CGAL::Handle_with_policy< AlgebraicRealRep_d_1, HandlePolicy > {
|
||||
|
||||
// currently Rational is the only supported Bound type.
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
( ::boost::is_same <Rational_,
|
||||
typename Get_arithmetic_kernel<Coefficient_>::Arithmetic_kernel::Rational>::value));
|
||||
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ template<typename AlgebraicKernel_1,
|
|||
InputIterator end,
|
||||
OutputIterator output) {
|
||||
typedef typename AlgebraicKernel_1::Algebraic_real_1 Alg_real;
|
||||
BOOST_STATIC_ASSERT
|
||||
CGAL_static_assertion
|
||||
((::boost::is_same
|
||||
<Alg_real,
|
||||
typename std::iterator_traits<InputIterator>::value_type >::value));
|
||||
|
|
@ -237,12 +237,12 @@ template<typename Poly_coer_1,typename Polynomial_1>
|
|||
typedef typename CGAL::Polynomial_traits_d<Polynomial_1>::Coefficient_type
|
||||
Coefficient;
|
||||
typedef CGAL::Fraction_traits<Poly_coer_1> FT;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<typename FT::Is_fraction,
|
||||
CGAL_static_assertion((::boost::is_same<typename FT::Is_fraction,
|
||||
CGAL::Tag_true>::value));
|
||||
typedef typename FT::Numerator_type Numerator;
|
||||
typedef typename FT::Denominator_type Denominator;
|
||||
typedef CGAL::Coercion_traits<Numerator,Polynomial_1> Num_coercion;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same
|
||||
CGAL_static_assertion((::boost::is_same
|
||||
<Polynomial_1,
|
||||
typename Num_coercion::Type>::value));
|
||||
Numerator p_num;
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ void test_real_embeddable_extension(const NT_&){
|
|||
const Floor floor = Floor();
|
||||
typedef typename Floor::argument_type Argument_type;
|
||||
typedef typename Floor::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<NT, Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<Integer, Result_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<Integer, Result_type>::value));
|
||||
assert(Integer(42) == floor(NT(42)));
|
||||
assert(Integer(-42) == floor(NT(-42)));
|
||||
}
|
||||
|
|
@ -63,8 +63,8 @@ void test_real_embeddable_extension(const NT_&){
|
|||
const Floor_log2_abs floor_log2_abs = Floor_log2_abs();
|
||||
typedef typename Floor_log2_abs::argument_type Argument_type;
|
||||
typedef typename Floor_log2_abs::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<NT, Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<long, Result_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<long, Result_type>::value));
|
||||
|
||||
assert(long(0) == floor_log2_abs(NT(1)));
|
||||
assert(long(0) == floor_log2_abs(NT(-1)));
|
||||
|
|
@ -88,8 +88,8 @@ void test_real_embeddable_extension(const NT_&){
|
|||
const Ceil ceil = Ceil();
|
||||
typedef typename Ceil::argument_type Argument_type;
|
||||
typedef typename Ceil::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<NT, Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<Integer, Result_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<Integer, Result_type>::value));
|
||||
assert(Integer(42) == ceil(NT(42)));
|
||||
assert(Integer(-42) == ceil(NT(-42)));
|
||||
}
|
||||
|
|
@ -98,8 +98,8 @@ void test_real_embeddable_extension(const NT_&){
|
|||
const Ceil_log2_abs ceil_log2_abs = Ceil_log2_abs();
|
||||
typedef typename Ceil_log2_abs::argument_type Argument_type;
|
||||
typedef typename Ceil_log2_abs::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<NT, Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same<long, Result_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion(( ::boost::is_same<long, Result_type>::value));
|
||||
|
||||
assert(long(0) == ceil_log2_abs(NT(1)));
|
||||
assert(long(0) == ceil_log2_abs(NT(-1)));
|
||||
|
|
|
|||
|
|
@ -69,18 +69,18 @@ void test_algebraic_curve_kernel_2() {
|
|||
|
||||
typedef AlgebraicCurveKernel_2 AK_2;
|
||||
|
||||
/* BOOST_STATIC_ASSERT( (::boost::is_same<
|
||||
/* CGAL_static_assertion( (::boost::is_same<
|
||||
Algebraic_real_1, typename AK::Algebraic_real_1 >::value) );
|
||||
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<
|
||||
CGAL_static_assertion((::boost::is_same<
|
||||
Isolator,
|
||||
typename AK::Isolator >::value) );
|
||||
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<
|
||||
CGAL_static_assertion((::boost::is_same<
|
||||
Coefficient,
|
||||
typename AK::Coefficient >::value));
|
||||
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<
|
||||
CGAL_static_assertion((::boost::is_same<
|
||||
Polynomial_1,
|
||||
typename AK::Polynomial_1 >::value));*/
|
||||
|
||||
|
|
|
|||
|
|
@ -112,17 +112,17 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
|
|||
{ \
|
||||
typedef typename Name::argument_type AT_; \
|
||||
typedef typename Name::result_type RT_; \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<AT,AT_>::value));} \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<RT,RT_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT,AT_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<RT,RT_>::value));} \
|
||||
}
|
||||
#define CGAL_CHECK_BFUNCTION(Name,AT1,AT2,RT) \
|
||||
{ \
|
||||
typedef typename Name::first_argument_type AT1_; \
|
||||
typedef typename Name::second_argument_type AT2_; \
|
||||
typedef typename Name::result_type RT_; \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<AT1,AT1_>::value));} \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<AT2,AT2_>::value));} \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<RT,RT_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT1,AT1_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT2,AT2_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<RT,RT_>::value));} \
|
||||
}
|
||||
|
||||
// TODO: missing check for Construct_algebraic_real_1
|
||||
|
|
|
|||
|
|
@ -101,21 +101,21 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
|
|||
{ \
|
||||
typedef typename Name::argument_type AT_; \
|
||||
typedef typename Name::result_type RT_; \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<AT,AT_>::value));} \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<RT,RT_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT,AT_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<RT,RT_>::value));} \
|
||||
}
|
||||
#define CGAL_CHECK_BFUNCTION(Name,AT1,AT2,RT) \
|
||||
{ \
|
||||
typedef typename Name::first_argument_type AT1_; \
|
||||
typedef typename Name::second_argument_type AT2_; \
|
||||
typedef typename Name::result_type RT_; \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<AT1,AT1_>::value));} \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<AT2,AT2_>::value));} \
|
||||
{BOOST_STATIC_ASSERT(( ::boost::is_same<RT,RT_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT1,AT1_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<AT2,AT2_>::value));} \
|
||||
{CGAL_static_assertion(( ::boost::is_same<RT,RT_>::value));} \
|
||||
}
|
||||
|
||||
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same
|
||||
CGAL_static_assertion(( ::boost::is_same
|
||||
<Algebraic_real_2,
|
||||
typename Construct_algebraic_real_2::result_type>
|
||||
::value));
|
||||
|
|
@ -123,7 +123,7 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
|
|||
CGAL_CHECK_UFUNCTION(Make_square_free_2,Polynomial_2,Polynomial_2);
|
||||
// TODO: missing check for Square_free_factorize_2
|
||||
CGAL_CHECK_BFUNCTION(Is_coprime_2,Polynomial_2,Polynomial_2,bool);
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same
|
||||
CGAL_static_assertion(( ::boost::is_same
|
||||
<bool,typename Make_coprime_2::result_type>::value));
|
||||
CGAL_CHECK_BFUNCTION(Number_of_solutions_2,Polynomial_2,Polynomial_2,
|
||||
size_type);
|
||||
|
|
@ -133,7 +133,7 @@ void test_algebraic_kernel_2(const AlgebraicKernel_2& ak_2) {
|
|||
CGAL_CHECK_UFUNCTION(Compute_polynomial_y_2,Algebraic_real_2,Polynomial_1);
|
||||
CGAL_CHECK_BFUNCTION(Isolate_x_2,Algebraic_real_2,Polynomial_1,BInterval);
|
||||
CGAL_CHECK_BFUNCTION(Isolate_y_2,Algebraic_real_2,Polynomial_1,BInterval);
|
||||
BOOST_STATIC_ASSERT(( ::boost::is_same
|
||||
CGAL_static_assertion(( ::boost::is_same
|
||||
< BArray,typename Isolate_2::result_type>::value));
|
||||
CGAL_CHECK_BFUNCTION(Sign_at_2,Polynomial_2,Algebraic_real_2,Sign);
|
||||
CGAL_CHECK_BFUNCTION(Is_zero_at_2,Polynomial_2,Algebraic_real_2,bool);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
#include <NiX/NT_traits.h>
|
||||
#include <NiX/number_type_utils.h>*/
|
||||
#include <cstddef>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <CGAL/assertions.h>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
|
||||
|
|
@ -52,8 +52,8 @@ namespace internal {
|
|||
void operator() (ToDouble to_double) {
|
||||
typedef typename ToDouble::argument_type Argument_type;
|
||||
typedef typename ToDouble::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<NT, Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<double, Result_type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<double, Result_type>::value));
|
||||
assert(42.0 == to_double(NT(42)));
|
||||
}
|
||||
};
|
||||
|
|
@ -72,8 +72,8 @@ namespace internal {
|
|||
void operator() (ToInterval to_Interval) {
|
||||
typedef typename ToInterval::argument_type Argument_type;
|
||||
typedef typename ToInterval::result_type Result_type;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same<NT, Argument_type>::value));
|
||||
BOOST_STATIC_ASSERT((::boost::is_same< typename Argument_type::Interval, Result_type>::value));
|
||||
CGAL_static_assertion((::boost::is_same<NT, Argument_type>::value));
|
||||
CGAL_static_assertion((::boost::is_same< typename Argument_type::Interval, Result_type>::value));
|
||||
|
||||
// TODO: NiX::in not available!?
|
||||
//assert(NiX::in(42.0,to_Interval(NT(42))));
|
||||
|
|
@ -112,7 +112,7 @@ void test_real_comparable() {
|
|||
typedef CGAL::Real_embeddable_traits<NT> Traits;
|
||||
typedef typename Traits::Is_real_embeddable Is_real_comparable;
|
||||
using ::CGAL::Tag_true;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same< Is_real_comparable, Tag_true>::value));
|
||||
CGAL_static_assertion((::boost::is_same< Is_real_comparable, Tag_true>::value));
|
||||
typename Traits::Compare compare;
|
||||
typename Traits::Sign sign;
|
||||
typename Traits::Abs abs;
|
||||
|
|
@ -181,20 +181,20 @@ void test_not_real_comparable() {
|
|||
typedef CGAL::Real_embeddable_traits<NT> Traits;
|
||||
typedef typename Traits::Is_real_embeddable Is_real_comparable;
|
||||
using ::CGAL::Tag_false;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same< Is_real_comparable, Tag_false>::value));
|
||||
CGAL_static_assertion((::boost::is_same< Is_real_comparable, Tag_false>::value));
|
||||
}
|
||||
|
||||
|
||||
template <class NT, class CeilLog2Abs>
|
||||
void test_rounded_log2_abs(NT zero, ::CGAL::Null_functor, CeilLog2Abs) {
|
||||
typedef ::CGAL::Null_functor Nulltype;
|
||||
BOOST_STATIC_ASSERT((::boost::is_same< CeilLog2Abs, Nulltype>::value));
|
||||
CGAL_static_assertion((::boost::is_same< CeilLog2Abs, Nulltype>::value));
|
||||
}
|
||||
|
||||
template <class NT, class FloorLog2Abs, class CeilLog2Abs>
|
||||
void test_rounded_log2_abs(NT zero, FloorLog2Abs fl_log, CeilLog2Abs cl_log) {
|
||||
typedef ::CGAL::Null_functor Null_functor;
|
||||
BOOST_STATIC_ASSERT((!::boost::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
CGAL_static_assertion((!::boost::is_same< CeilLog2Abs, Null_functor>::value));
|
||||
|
||||
assert( fl_log(NT( 7)) == 2 );
|
||||
assert( cl_log(NT( 7)) == 3 );
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ file_input(OutputIterator out)
|
|||
int n;
|
||||
is >> n;
|
||||
std::cout << "Reading " << n << " points from file" << std::endl;
|
||||
CGAL::copy_n(std::istream_iterator<Point>(is), n, out);
|
||||
CGAL::cpp0x::copy_n(std::istream_iterator<Point>(is), n, out);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ file_input(OutputIterator out)
|
|||
int n;
|
||||
is >> n;
|
||||
std::cout << "Reading " << n << " points from file" << std::endl;
|
||||
CGAL::copy_n(std::istream_iterator<Point>(is), n, out);
|
||||
CGAL::cpp0x::copy_n(std::istream_iterator<Point>(is), n, out);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@ int main() {
|
|||
typedef AK::Bigfloat_interval BFI;
|
||||
{
|
||||
typedef CGAL::Get_arithmetic_kernel<Integer>::Arithmetic_kernel AK_;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<AK,AK_>::value));
|
||||
CGAL_static_assertion((boost::is_same<AK,AK_>::value));
|
||||
}
|
||||
{
|
||||
typedef CGAL::Get_arithmetic_kernel<Rational>::Arithmetic_kernel AK_;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<AK,AK_>::value));
|
||||
CGAL_static_assertion((boost::is_same<AK,AK_>::value));
|
||||
}
|
||||
{
|
||||
typedef CGAL::Get_arithmetic_kernel<BFI>::Arithmetic_kernel AK_;
|
||||
BOOST_STATIC_ASSERT((boost::is_same<AK,AK_>::value));
|
||||
CGAL_static_assertion((boost::is_same<AK,AK_>::value));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,11 +52,18 @@ parameter, with \ccc{Cartesian<NtTraits::Rational>} and
|
|||
respectively. The number types in this case are provided by the {\sc Core}
|
||||
library, with its ability to exactly represent simple algebraic numbers.
|
||||
|
||||
While \ccRefName{} models the concept
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}, the implementation of
|
||||
the \ccc{Arr_mergeable_2} operation does not enforce the input curves
|
||||
to have the same direction as a precondition. Moreover, \ccRefName{}
|
||||
supports the merging of curves of opposite directions.
|
||||
|
||||
\ccInclude{CGAL/Arr_Bezier_curve_traits_2.h}
|
||||
|
||||
\ccIsModel
|
||||
\ccc{ArrangementTraits_2}
|
||||
|
||||
\ccc{ArrangementTraits_2}\\
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}
|
||||
|
||||
\ccTypes
|
||||
%-------
|
||||
|
||||
|
|
|
|||
|
|
@ -37,11 +37,17 @@ enables efficient comparison among different extensions.
|
|||
|
||||
For more details see the documentation of \ccRefIdfierPage{CGAL::Sqrt_extension<NT,ROOT>}\\
|
||||
|
||||
While \ccRefName{} models the concept
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}, the implementation of
|
||||
the \ccc{Arr_mergeable_2} operation does not enforce the input curves
|
||||
to have the same direction as a precondition. Moreover, \ccRefName{}
|
||||
supports the merging of curves of opposite directions.
|
||||
|
||||
\ccInclude{CGAL/Arr_circle_segment_traits_2.h}
|
||||
|
||||
\ccIsModel
|
||||
\ccc{ArrangementTraits_2}
|
||||
\ccc{ArrangementTraits_2}\\
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}
|
||||
|
||||
\subsection*{Class
|
||||
Arr\_circle\_segment\_traits\_2$<$Kernel$>$::Point\_2}
|
||||
|
|
|
|||
|
|
@ -75,11 +75,18 @@ ability to exactly represent simple algebraic numbers.
|
|||
The traits class inherits its point type from \ccc{AlgKernel::Point_2},
|
||||
and defines a curve and $x$-monotone curve types, as detailed below.
|
||||
|
||||
While the \ccRefName{} models the concept
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}, the implementation of
|
||||
the \ccc{Arr_mergeable_2} operation does not enforce the input curves
|
||||
to have the same direction as a precondition. Moreover, \ccRefName{}
|
||||
supports the merging of curves of opposite directions.
|
||||
|
||||
\ccInclude{CGAL/Arr_conic_traits_2.h}
|
||||
|
||||
\ccIsModel
|
||||
\ccc{ArrangementTraits_2} \\
|
||||
\ccc{ArrangementLandmarkTraits_2} \\
|
||||
\ccc{ArrangementTraits_2}\\
|
||||
\ccc{ArrangementLandmarkTraits_2}\\
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}
|
||||
|
||||
\ccTypes
|
||||
%-------
|
||||
|
|
|
|||
|
|
@ -33,12 +33,19 @@ The \ccStyle{Arr_segment_traits_2} traits class avoids this cascading
|
|||
problem, and should be the default choice for implementing arrangements of
|
||||
line segments. It is recommended to use \ccRefName\ only for very sparse
|
||||
arrangements of huge sets of input segments.
|
||||
|
||||
|
||||
While \ccRefName{} models the concept
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}, the implementation of
|
||||
the \ccc{Arr_mergeable_2} operation does not enforce the input curves
|
||||
to have the same direction as a precondition. Moreover, \ccRefName{}
|
||||
supports the merging of curves of opposite directions.
|
||||
|
||||
\ccInclude{CGAL/Arr_non_caching_segment_traits_2.h}
|
||||
|
||||
\ccIsModel
|
||||
\ccc{ArrangementTraits_2} \\
|
||||
\ccc{ArrangementLandmarkTraits_2} \\
|
||||
\ccc{ArrangementTraits_2}\\
|
||||
\ccc{ArrangementLandmarkTraits_2}\\
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}
|
||||
|
||||
\ccInheritsFrom
|
||||
\ccc{Arr_non_caching_segment_basic_traits_2<Kernel>}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,12 @@ The cache is automatically cleaned up from time to time.
|
|||
The amortized clean up costs are constant. However, there is also a
|
||||
separate member function that cleans up the cache on demand.
|
||||
|
||||
While \ccRefName{} models the concept
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}, the implementation of
|
||||
the \ccc{Arr_mergeable_2} operation does not enforce the input curves
|
||||
to have the same direction as a precondition. Moreover, \ccRefName{}
|
||||
supports the merging of curves of opposite directions.
|
||||
|
||||
\ccInclude{CGAL/Arr_rational_function_traits_2.h}
|
||||
|
||||
\ccIsModel
|
||||
|
|
|
|||
|
|
@ -13,23 +13,23 @@
|
|||
\ccDefinition
|
||||
%============
|
||||
|
||||
The traits class \ccRefName\ is a model of the \ccc{ArrangementTraits_2}
|
||||
concept that allow the construction and maintenance of arrangements of
|
||||
The traits class \ccRefName{} is a model of the \ccc{ArrangementTraits_2}
|
||||
concept, which allows the construction and maintenance of arrangements of
|
||||
line segments. It should be parameterized with a \cgal-kernel model that is
|
||||
templated in turn with a number type. To avoid numerical errors and
|
||||
robustness problems, the number type should support exact rational
|
||||
arithmetic --- that is, the number type should support the arithmetic
|
||||
operations $+$, $-$, $\times$ and $\div$ that should be carried out
|
||||
without loss of precision.
|
||||
operations $+$, $-$, $\times$ and $\div$ carried out without loss of
|
||||
precision.
|
||||
|
||||
For example, instantiating the traits
|
||||
template with kernels such as \ccStyle{Cartesian<Quotient<MP_Float> >},
|
||||
or \ccStyle{Homogeneous<Gmpz>} ensures the exact and robust operation of
|
||||
template with kernels, such as \ccStyle{Cartesian<Quotient<MP_Float> >},
|
||||
or \ccStyle{Homogeneous<Gmpz>}, ensures the exact and robust operation of
|
||||
the application. In particular, the \ccStyle{Cartesian<Gmpq>} achieves
|
||||
the fastest running times in most cases. Using other (inexact) number
|
||||
the fastest running times in most cases. Using other inexact number
|
||||
types (for example, instantiating the template with
|
||||
\ccStyle{Simple_cartesian<double>}) is possible at the user's own risk:
|
||||
selecting an inexact number type usually leads to faster running time at
|
||||
\ccStyle{Simple_cartesian<double>}) is at the user's own risk:
|
||||
Selecting an inexact number type usually leads to faster running time at
|
||||
the expense of possible robustness problems.
|
||||
|
||||
For optimal performance, we recommend instantiating the traits class with
|
||||
|
|
@ -38,9 +38,9 @@ the default \ccc{Exact_predicates_exact_constructions_kernel} provided by
|
|||
only a minor overhead (in comparison to working with a fast, inexact number
|
||||
type) for most inputs.
|
||||
|
||||
\ccRefName\ defines \ccc{Kernel::Point_2} as its point type. However, it
|
||||
does {\sl not} define \ccc{Kernel::Segment_2} as its curve type, as one may
|
||||
expect. The reason is that the kernel segment is represented by its
|
||||
\ccRefName{} defines \ccc{Kernel::Point_2} as its point type. However, it
|
||||
does {\sl not} define \ccc{Kernel::Segment_2} as its curve type, as one
|
||||
may expect. The reason is that the kernel segment is represented by its
|
||||
two endpoints only, while the traits class needs to store extra data
|
||||
with its segments, in order to efficiently operate on them. Nevertheless,
|
||||
the nested \ccc{X_monotone_curve_2} and \ccc{Curve_2} types (in this
|
||||
|
|
@ -48,7 +48,7 @@ case both types refer to the same class, as {\sl every} line segment
|
|||
is (weakly) $x$-monotone) can however be converted to the type
|
||||
\ccc{Kernel::Segment_2}.
|
||||
|
||||
\ccRefName\ achieves faster running times than the
|
||||
\ccRefName{} achieves faster running times than the
|
||||
\ccStyle{Arr_non_caching_segment_traits_2<Kernel>} traits-class, when
|
||||
arrangements with relatively many intersection points are constructed.
|
||||
It also allows for working with less accurate, yet computationally
|
||||
|
|
@ -56,16 +56,23 @@ efficient number types, such as \ccStyle{Quotient<MP_Float>}, which
|
|||
represents floating-point numbers with an unbounded mantissa, but with
|
||||
a bounded exponent. Using this traits class is therefore highly recommended
|
||||
for almost all applications that rely on arrangements of line segments.
|
||||
On the other hand, \ccRefName\ uses more space and stores extra data with
|
||||
On the other hand, \ccRefName{} uses more space and stores extra data with
|
||||
each segment, so constructing arrangements of huge sets of non-intersecting
|
||||
segments (or segments that intersect very sparsely) could be more efficient
|
||||
with the \ccStyle{Arr_non_caching_segment_traits_2} traits-class.
|
||||
|
||||
While \ccRefName{} models the concept
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}, the implementation of
|
||||
the \ccc{Arr_mergeable_2} operation does not enforce the input curves
|
||||
to have the same direction as a precondition. Moreover, \ccRefName{}
|
||||
supports the merging of curves of opposite directions.
|
||||
|
||||
\ccInclude{CGAL/Arr_segment_traits_2.h}
|
||||
|
||||
\ccIsModel
|
||||
\ccc{ArrangementTraits_2} \\
|
||||
\ccc{ArrangementLandmarkTraits_2}
|
||||
\ccc{ArrangementTraits_2}\\
|
||||
\ccc{ArrangementLandmarkTraits_2}\\
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ supported, the \ccc{Has_merge_category} tag should be defined as
|
|||
\ccThree{Construct_x_monotone_curve_2~~~}{}{\hspace*{7cm}}
|
||||
\ccThreeToTwo
|
||||
|
||||
\ccCreationVariable{traits}
|
||||
% \ccCreation
|
||||
%==========
|
||||
\ccCreationVariable{traits}
|
||||
%==========================
|
||||
|
||||
\ccHeading{Accessing Functor Objects}
|
||||
% ===================================
|
||||
|
|
@ -109,9 +109,9 @@ the \ccc{Has_merge_category} tag should be defined as \ccc{Tag_true} (and
|
|||
|
||||
\ccCreationVariable{fo}
|
||||
|
||||
\ccMethod{Output_iterator intersect(ArrTraits::X_monotone_curve_2 xc1,
|
||||
ArrTraits::X_monotone_curve_2 xc2,
|
||||
Output_iterator& oi);}{%
|
||||
\ccMethod{Output_iterator operator()(ArrTraits::X_monotone_curve_2 xc1,
|
||||
ArrTraits::X_monotone_curve_2 xc2,
|
||||
Output_iterator& oi);}{%
|
||||
computes the intersections of \ccc{xc1} and \ccc{xc2} and
|
||||
inserts them {\sl in an ascending lexicographic $xy$-order} into the
|
||||
output iterator \ccc{oi}. The value-type of \ccc{Output_iterator} is
|
||||
|
|
@ -136,10 +136,10 @@ the \ccc{Has_merge_category} tag should be defined as \ccc{Tag_true} (and
|
|||
\ccCreationVariable{fo}
|
||||
|
||||
\def\ccTagRmConstRefPair{\ccFalse}%
|
||||
\ccMethod{void split(ArrTraits::X_monotone_curve_2 xc,
|
||||
ArrTraits::Point_2 p,
|
||||
ArrTraits::X_monotone_curve_2& xc1,
|
||||
ArrTraits::X_monotone_curve_2& xc2);}{%
|
||||
\ccMethod{void operator()(ArrTraits::X_monotone_curve_2 xc,
|
||||
ArrTraits::Point_2 p,
|
||||
ArrTraits::X_monotone_curve_2& xc1,
|
||||
ArrTraits::X_monotone_curve_2& xc2);}{%
|
||||
accepts an input curve \ccc{xc} and a split point \ccc{p} in its
|
||||
interior. It splits \ccc{xc} at the split point into two subcurves \ccc{xc1}
|
||||
and \ccc{xc2}, such that \ccc{p} is \ccc{xc1}'s {\sl right} endpoint and
|
||||
|
|
@ -158,11 +158,14 @@ the \ccc{Has_merge_category} tag should be defined as \ccc{Tag_true} (and
|
|||
|
||||
\ccCreationVariable{fo}
|
||||
|
||||
\ccMethod{bool are_mergeable(ArrTraits::X_monotone_curve_2 xc1,
|
||||
ArrTraits::X_monotone_curve_2 xc2);}{%
|
||||
accepts two $x$-monotone curves \ccc{xc1} and \ccc{xc2} that share
|
||||
a common endpoint, and determines whether they can be merged to form
|
||||
a single continuous $x$-monotone curve.}
|
||||
\ccMethod{bool operator()(ArrTraits::X_monotone_curve_2 xc1,
|
||||
ArrTraits::X_monotone_curve_2 xc2);}{%
|
||||
accepts two $x$-monotone curves \ccc{xc1} and \ccc{xc2} and determines
|
||||
whether they can be merged to form a single $x$-monotone curve.
|
||||
\ccc{xc1} and \ccc{xc2} are mergeable if their underlying curves are
|
||||
identical, they share a common endpoint, and they do not bend to form
|
||||
a non-$x$-monotone curve.}
|
||||
% \ccPrecond{\ccc{xc1} and \ccc{xc2} share a common endpoint.}}
|
||||
\end{ccRefConcept}
|
||||
\ccRefPageEnd
|
||||
|
||||
|
|
@ -179,9 +182,10 @@ the \ccc{Has_merge_category} tag should be defined as \ccc{Tag_true} (and
|
|||
\def\ccTagRmConstRefPair{\ccFalse}%
|
||||
\ccMethod{void merge(ArrTraits::X_monotone_curve_2 xc1,
|
||||
ArrTraits::X_monotone_curve_2 xc2,
|
||||
ArrTraits::X_monotone_curve_2& xc);}{%
|
||||
accepts two {\em mergeable} $x$-monotone curves \ccc{xc1} and \ccc{xc2}
|
||||
(see definition above), and sets\ccc{xc} to be the merged curve.}
|
||||
ArrTraits::X_monotone_curve_2& xc);}{%
|
||||
accepts two \emph{mergeable} $x$-monotone curves \ccc{xc1} and \ccc{xc2}
|
||||
and asigns \ccc{xc} with the merged curve.
|
||||
\ccPrecond{\ccc{are_mergeable_2}(\ccc{xc1}, \ccc{xc2}) is true.}}
|
||||
\ccTagDefaults
|
||||
\end{ccRefConcept}
|
||||
\ccRefPageEnd
|
||||
|
|
|
|||
|
|
@ -716,23 +716,38 @@ public:
|
|||
}
|
||||
|
||||
/*! \class Merge_2
|
||||
* The Merge_2 functor.
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2
|
||||
{
|
||||
typedef Arr_Bezier_curve_traits_2<Rat_kernel, Alg_kernel,
|
||||
Nt_traits, Bounding_traits> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_Bezier_curve_traits_2<Rat_kernel, Alg_kernel,
|
||||
Nt_traits, Bounding_traits>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve (segment).
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable, that is they are supported by the
|
||||
* same conic curve and share a common endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator() (const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2,
|
||||
X_monotone_curve_2& c) const
|
||||
{
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1));
|
||||
|
||||
c = cv1.merge (cv2);
|
||||
return;
|
||||
}
|
||||
|
|
@ -741,7 +756,7 @@ public:
|
|||
/*! Get a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object () const
|
||||
{
|
||||
return Merge_2();
|
||||
return Merge_2(this);
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace CGAL {
|
|||
/*! \class
|
||||
* A traits class for maintaining an arrangement of circles.
|
||||
*/
|
||||
template <class Kernel_, bool Filter_ = true>
|
||||
template <class Kernel_, bool Filter = true>
|
||||
class Arr_circle_segment_traits_2
|
||||
{
|
||||
public:
|
||||
|
|
@ -46,12 +46,12 @@ public:
|
|||
typedef typename Kernel::Point_2 Rational_point_2;
|
||||
typedef typename Kernel::Segment_2 Rational_segment_2;
|
||||
typedef typename Kernel::Circle_2 Rational_circle_2;
|
||||
typedef _One_root_point_2<NT, Filter_> Point_2;
|
||||
typedef _One_root_point_2<NT, Filter> Point_2;
|
||||
typedef typename Point_2::CoordNT CoordNT;
|
||||
typedef _Circle_segment_2<Kernel, Filter_> Curve_2;
|
||||
typedef _X_monotone_circle_segment_2<Kernel, Filter_> X_monotone_curve_2;
|
||||
typedef _Circle_segment_2<Kernel, Filter> Curve_2;
|
||||
typedef _X_monotone_circle_segment_2<Kernel, Filter> X_monotone_curve_2;
|
||||
typedef unsigned int Multiplicity;
|
||||
typedef Arr_circle_segment_traits_2<Kernel, Filter_> Self;
|
||||
typedef Arr_circle_segment_traits_2<Kernel, Filter> Self;
|
||||
|
||||
// Category tags:
|
||||
typedef Tag_true Has_left_category;
|
||||
|
|
@ -385,7 +385,7 @@ public:
|
|||
class Make_x_monotone_2
|
||||
{
|
||||
private:
|
||||
typedef Arr_circle_segment_traits_2<Kernel_, Filter_> Self;
|
||||
typedef Arr_circle_segment_traits_2<Kernel_, Filter> Self;
|
||||
|
||||
bool m_use_cache;
|
||||
|
||||
|
|
@ -608,32 +608,47 @@ public:
|
|||
return Are_mergeable_2();
|
||||
}
|
||||
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2
|
||||
{
|
||||
protected:
|
||||
typedef Arr_circle_segment_traits_2<Kernel, Filter> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_circle_segment_traits_2<Kernel, Filter>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve.
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable, that is they are supported by the
|
||||
* same conic curve and share a common endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator() (const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2,
|
||||
X_monotone_curve_2& c) const
|
||||
{
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1));
|
||||
|
||||
c = cv1;
|
||||
c.merge (cv2);
|
||||
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/*! Get a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object () const
|
||||
{
|
||||
return Merge_2();
|
||||
return Merge_2(this);
|
||||
}
|
||||
|
||||
class Compare_endpoints_xy_2
|
||||
|
|
|
|||
|
|
@ -660,32 +660,47 @@ public:
|
|||
return Are_mergeable_2();
|
||||
}
|
||||
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2
|
||||
{
|
||||
protected:
|
||||
typedef Arr_conic_traits_2<Rat_kernel, Alg_kernel, Nt_traits> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_conic_traits_2<Rat_kernel, Alg_kernel, Nt_traits>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve (segment).
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable, that is they are supported by the
|
||||
* same conic curve and share a common endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator() (const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2,
|
||||
X_monotone_curve_2& c) const
|
||||
{
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1));
|
||||
|
||||
c = cv1;
|
||||
c.merge (cv2);
|
||||
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/*! Get a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object () const
|
||||
/*! Obtain a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object() const
|
||||
{
|
||||
return Merge_2();
|
||||
return Merge_2(this);
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
|
|||
|
|
@ -338,6 +338,9 @@ public:
|
|||
return Are_mergeable_2 (this);
|
||||
}
|
||||
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2
|
||||
{
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -35,14 +35,14 @@
|
|||
#include <CGAL/function_objects.h>
|
||||
#include <CGAL/Iterator_project.h>
|
||||
#include <CGAL/Arrangement_2/Arrangement_2_iterators.h>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <CGAL/assertions.h>
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
inline void* _clean_pointer (const void* p)
|
||||
{
|
||||
BOOST_STATIC_ASSERT(sizeof(void*) == sizeof(size_t));
|
||||
CGAL_static_assertion(sizeof(void*) == sizeof(size_t));
|
||||
const size_t mask = ~1;
|
||||
const size_t val = (reinterpret_cast<size_t>(p) & mask);
|
||||
|
||||
|
|
|
|||
|
|
@ -1934,9 +1934,7 @@ public:
|
|||
* \param xc1 the first curve.
|
||||
* \param xc2 the second curve.
|
||||
* \param xc Output: the merged curve.
|
||||
* \pre the two curves are mergeable. That is, they are supported by the
|
||||
* same plane or oposite planes and share a common endpoint that is
|
||||
* not on the discontinuity arc.
|
||||
* \pre the two curves are mergeable.
|
||||
*/
|
||||
void operator()(const X_monotone_curve_2& xc1,
|
||||
const X_monotone_curve_2& xc2,
|
||||
|
|
|
|||
|
|
@ -2117,7 +2117,9 @@ public:
|
|||
Are_mergeable_2 are_mergeable_2_object() const
|
||||
{ return Are_mergeable_2(this); }
|
||||
|
||||
/*! A functor that merges two x-monotone arcs into one */
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2 {
|
||||
protected:
|
||||
typedef Arr_great_circular_arc_on_cylinder_traits_2<Kernel> Traits;
|
||||
|
|
@ -2137,9 +2139,7 @@ public:
|
|||
* \param xc1 the first curve.
|
||||
* \param xc2 the second curve.
|
||||
* \param xc Output: the merged curve.
|
||||
* \pre the two curves are mergeable. That is, they are supported by the
|
||||
* same plane or oposite planes and share a common endpoint that is
|
||||
* not on the discontinuity arc.
|
||||
* \pre the two curves are mergeable.
|
||||
*/
|
||||
void operator()(const X_monotone_curve_2 & xc1,
|
||||
const X_monotone_curve_2 & xc2,
|
||||
|
|
|
|||
|
|
@ -1511,68 +1511,72 @@ public:
|
|||
return Are_mergeable_2();
|
||||
}
|
||||
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2
|
||||
{
|
||||
protected:
|
||||
typedef Arr_linear_traits_2<Kernel> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_linear_traits_2<Kernel>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve (segment).
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable, that is they are supported by the
|
||||
* same line and share a common endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator() (const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2,
|
||||
X_monotone_curve_2& c) const
|
||||
{
|
||||
CGAL_precondition (! cv1.is_degenerate());
|
||||
CGAL_precondition (! cv2.is_degenerate());
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1));
|
||||
|
||||
Kernel kernel;
|
||||
typename Kernel::Equal_2 equal = kernel.equal_2_object();
|
||||
CGAL_precondition(!cv1.is_degenerate());
|
||||
CGAL_precondition(!cv2.is_degenerate());
|
||||
|
||||
CGAL_precondition
|
||||
(equal (cv1.supp_line(),
|
||||
cv2.supp_line()) ||
|
||||
equal (cv1.supp_line(),
|
||||
kernel.construct_opposite_line_2_object()(cv2.supp_line())));
|
||||
Equal_2 equal = m_traits->equal_2_object();
|
||||
|
||||
// Check which curve extends to the right of the other.
|
||||
if (cv1.has_right() && cv2.has_left() &&
|
||||
equal (cv1.right(), cv2.left()))
|
||||
equal(cv1.right(), cv2.left()))
|
||||
{
|
||||
// cv2 extends cv1 to the right.
|
||||
c = cv1;
|
||||
|
||||
if (cv2.has_right())
|
||||
c.set_right (cv2.right());
|
||||
c.set_right(cv2.right());
|
||||
else
|
||||
c.set_right(); // Unbounded endpoint.
|
||||
}
|
||||
else
|
||||
{
|
||||
CGAL_precondition (cv2.has_right() && cv1.has_left() &&
|
||||
equal (cv2.right(), cv1.left()));
|
||||
else {
|
||||
CGAL_precondition(cv2.has_right() && cv1.has_left() &&
|
||||
equal(cv2.right(), cv1.left()));
|
||||
|
||||
// cv1 extends cv2 to the right.
|
||||
c = cv2;
|
||||
|
||||
if (cv1.has_right())
|
||||
c.set_right (cv1.right());
|
||||
c.set_right(cv1.right());
|
||||
else
|
||||
c.set_right(); // Unbounded endpoint.
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/*! Obtain a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object () const
|
||||
{
|
||||
return Merge_2();
|
||||
}
|
||||
Merge_2 merge_2_object () const { return Merge_2(this); }
|
||||
//@}
|
||||
|
||||
/// \name Functor definitions for the landmarks point-location strategy.
|
||||
|
|
|
|||
|
|
@ -283,88 +283,106 @@ public:
|
|||
/*! \class
|
||||
* A functor for testing whether two segments are mergeable.
|
||||
*/
|
||||
class Are_mergeable_2
|
||||
{
|
||||
class Are_mergeable_2 {
|
||||
protected:
|
||||
typedef Arr_non_caching_segment_traits_2<Kernel> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Are_mergeable_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_non_caching_segment_traits_2<Kernel>;
|
||||
|
||||
public:
|
||||
|
||||
/*!
|
||||
* Check whether it is possible to merge two given x-monotone curves.
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \return (true) if the two segments are mergeable - if they are supported
|
||||
* by the same line and share a common endpoint; (false) otherwise.
|
||||
* \return (true) if the two curves are mergeable, that is, if they are
|
||||
* supported by the same line; (false) otherwise.
|
||||
* \pre cv1 and cv2 share a common endpoint.
|
||||
*/
|
||||
bool operator()(const X_monotone_curve_2 & cv1,
|
||||
const X_monotone_curve_2 & cv2) const
|
||||
{
|
||||
Base base;
|
||||
Equal_2 equal = base.equal_2_object();
|
||||
Construct_min_vertex_2 min_vertex = base.construct_min_vertex_2_object();
|
||||
Construct_max_vertex_2 max_vertex = base.construct_max_vertex_2_object();
|
||||
|
||||
const Base* base = m_traits;
|
||||
Equal_2 equal = base->equal_2_object();
|
||||
Construct_min_vertex_2 min_vertex = base->construct_min_vertex_2_object();
|
||||
Construct_max_vertex_2 max_vertex = base->construct_max_vertex_2_object();
|
||||
if (!equal(max_vertex(cv1), min_vertex(cv2)) &&
|
||||
!equal(max_vertex(cv2), min_vertex(cv1)))
|
||||
return false;
|
||||
|
||||
// Check if the two curves have the same supporting line.
|
||||
if (base.compare_slope_2_object()(cv1,cv2) != EQUAL)
|
||||
return (false);
|
||||
|
||||
// Check if the left endpoint of one curve is the right endpoint of the
|
||||
// other.
|
||||
return (equal(max_vertex(cv1), min_vertex(cv2)) ||
|
||||
equal(max_vertex(cv2), min_vertex(cv1)));
|
||||
return (base->compare_slope_2_object()(cv1, cv2) == EQUAL);
|
||||
}
|
||||
};
|
||||
|
||||
/*! Obtain an Are_mergeable_2 functor object */
|
||||
Are_mergeable_2 are_mergeable_2_object() const
|
||||
{
|
||||
return Are_mergeable_2();
|
||||
}
|
||||
{ return Are_mergeable_2(this); }
|
||||
|
||||
/*! \class
|
||||
* A functor for merging two segments into one.
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2
|
||||
{
|
||||
class Merge_2 {
|
||||
protected:
|
||||
typedef Arr_non_caching_segment_traits_2<Kernel> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_non_caching_segment_traits_2<Kernel>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given segments into a single segment.
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable, that is they are supported by the
|
||||
* same line and share a common endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator()(const X_monotone_curve_2 & cv1,
|
||||
const X_monotone_curve_2 & cv2,
|
||||
X_monotone_curve_2 & c) const
|
||||
{
|
||||
Base base;
|
||||
CGAL_precondition(base.compare_slope_2_object()(cv2, cv1) == EQUAL);
|
||||
Equal_2 equal = base.equal_2_object();
|
||||
Construct_min_vertex_2 min_vertex = base.construct_min_vertex_2_object();
|
||||
Construct_max_vertex_2 max_vertex = base.construct_max_vertex_2_object();
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1));
|
||||
|
||||
const Base* base = m_traits;
|
||||
Equal_2 equal = base->equal_2_object();
|
||||
Construct_min_vertex_2 min_vertex = base->construct_min_vertex_2_object();
|
||||
Construct_max_vertex_2 max_vertex = base->construct_max_vertex_2_object();
|
||||
|
||||
// Check which curve extends to the right of the other.
|
||||
const Point_2 & right1 = max_vertex(cv1);
|
||||
const Point_2 & left2 = min_vertex(cv2);
|
||||
const Point_2 & left1 = min_vertex(cv1);
|
||||
const Point_2 & right2 = max_vertex(cv2);
|
||||
const Point_2& left1 = min_vertex(cv1);
|
||||
const Point_2& right1 = max_vertex(cv1);
|
||||
const Point_2& left2 = min_vertex(cv2);
|
||||
const Point_2& right2 = max_vertex(cv2);
|
||||
|
||||
if (!equal(right1, left2)) {
|
||||
// cv1 extends cv2 to the right.
|
||||
CGAL_precondition(base.equal_2_object()(right2, left1));
|
||||
c = base.construct_segment_2_object()(left2, right1);
|
||||
if (equal(right1, left2)) {
|
||||
// cv2 extends cv1 to the right.
|
||||
c = base->construct_segment_2_object()(left1, right2);
|
||||
return;
|
||||
}
|
||||
// cv2 extends cv1 to the right.
|
||||
c = base.construct_segment_2_object()(left1, right2);
|
||||
// cv1 extends cv2 to the right.
|
||||
CGAL_precondition(equal(right2, left1));
|
||||
|
||||
c = base->construct_segment_2_object()(left2, right1);
|
||||
}
|
||||
};
|
||||
|
||||
/*! Obtain a Merge_2 functor object */
|
||||
Merge_2 merge_2_object() const
|
||||
{
|
||||
return Merge_2();
|
||||
}
|
||||
Merge_2 merge_2_object() const { return Merge_2(this); }
|
||||
//@}
|
||||
|
||||
//! \name Functor definitions for the Boolean set-operations.
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/or.hpp>
|
||||
#include <boost/type_traits.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <CGAL/assertions.h>
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
|
|
@ -73,16 +73,16 @@ void overlay (const Arrangement_on_surface_2<GeomTraitsA, TopTraitsA>& arr1,
|
|||
typedef Arrangement_on_surface_2<GeomTraitsRes, TopTraitsRes> ArrRes;
|
||||
|
||||
// some type assertions (not all, but better then nothing).
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible< \
|
||||
CGAL_static_assertion((boost::is_convertible< \
|
||||
typename GeomTraitsA::Point_2, \
|
||||
typename GeomTraitsRes::Point_2 >::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible< \
|
||||
CGAL_static_assertion((boost::is_convertible< \
|
||||
typename GeomTraitsB::Point_2, \
|
||||
typename GeomTraitsRes::Point_2 >::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible< \
|
||||
CGAL_static_assertion((boost::is_convertible< \
|
||||
typename GeomTraitsA::X_monotone_curve_2, \
|
||||
typename GeomTraitsRes::X_monotone_curve_2 >::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_convertible< \
|
||||
CGAL_static_assertion((boost::is_convertible< \
|
||||
typename GeomTraitsB::X_monotone_curve_2, \
|
||||
typename GeomTraitsRes::X_monotone_curve_2 >::value));
|
||||
|
||||
|
|
|
|||
|
|
@ -18,23 +18,23 @@
|
|||
// Author(s) : Efi Fogel <efif@post.tau.ac.il>
|
||||
// Ron Wein <wein@post.tau.ac.il>
|
||||
|
||||
#ifndef CGAL_ARR_POLYLINE_TRAITS_2_H
|
||||
#define CGAL_ARR_POLYLINE_TRAITS_2_H
|
||||
#ifndef CGAL_ARR_POLYCURVE_TRAITS_2_H
|
||||
#define CGAL_ARR_POLYCURVE_TRAITS_2_H
|
||||
|
||||
/*! \file
|
||||
* The traits-class for the linear piece-wiese(polyline) type of curves of the
|
||||
* The traits-class for the piece-wise type of curves of the
|
||||
* arrangement package.
|
||||
*/
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/tags.h>
|
||||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/Arr_geometry_traits/Polyline_2.h>
|
||||
#include <CGAL/Arr_geometry_traits/Polycurve_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template <class T_SegmentTraits_2>
|
||||
class Arr_polyline_traits_2 {
|
||||
class Arr_polycurve_traits_2 {
|
||||
public:
|
||||
typedef T_SegmentTraits_2 Segment_traits_2;
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ public:
|
|||
typedef Arr_oblivious_side_tag Right_side_category;
|
||||
|
||||
private:
|
||||
typedef Arr_polyline_traits_2<Segment_traits_2> Self;
|
||||
typedef Arr_polycurve_traits_2<Segment_traits_2> Self;
|
||||
|
||||
// Data members:
|
||||
Segment_traits_2 m_seg_traits; // The base segment-traits class.
|
||||
|
|
@ -59,11 +59,16 @@ private:
|
|||
|
||||
public:
|
||||
/*! Default constructor */
|
||||
Arr_polyline_traits_2() : m_seg_traits() {}
|
||||
Arr_polycurve_traits_2() : m_seg_traits() {}
|
||||
|
||||
/*! Obtain the segment traits.
|
||||
* \return the segment traits.
|
||||
*/
|
||||
const Segment_traits_2* segment_traits_2() const { return &m_seg_traits; }
|
||||
|
||||
/// \name Types and functors inherited from the base segment traits.
|
||||
//@{
|
||||
|
||||
|
||||
// Traits types:
|
||||
typedef typename Segment_traits_2::Point_2 Point_2;
|
||||
typedef typename Segment_traits_2::Curve_2 Segment_2;
|
||||
|
|
@ -183,7 +188,7 @@ public:
|
|||
|
||||
class Compare_y_at_x_2 {
|
||||
private:
|
||||
typedef Arr_polyline_traits_2<Segment_traits_2> Self;
|
||||
typedef Arr_polycurve_traits_2<Segment_traits_2> Self;
|
||||
const Segment_traits_2 * m_seg_traits;
|
||||
|
||||
public:
|
||||
|
|
@ -221,7 +226,7 @@ public:
|
|||
|
||||
class Compare_y_at_x_left_2 {
|
||||
private:
|
||||
typedef Arr_polyline_traits_2<Segment_traits_2> Self;
|
||||
typedef Arr_polycurve_traits_2<Segment_traits_2> Self;
|
||||
|
||||
const Segment_traits_2 * m_seg_traits;
|
||||
|
||||
|
|
@ -267,7 +272,7 @@ public:
|
|||
|
||||
class Compare_y_at_x_right_2 {
|
||||
private:
|
||||
typedef Arr_polyline_traits_2<Segment_traits_2> Self;
|
||||
typedef Arr_polycurve_traits_2<Segment_traits_2> Self;
|
||||
const Segment_traits_2 * m_seg_traits;
|
||||
|
||||
public:
|
||||
|
|
@ -521,7 +526,7 @@ public:
|
|||
class Split_2
|
||||
{
|
||||
private:
|
||||
typedef Arr_polyline_traits_2<Segment_traits_2> Self;
|
||||
typedef Arr_polycurve_traits_2<Segment_traits_2> Self;
|
||||
|
||||
const Segment_traits_2 * m_seg_traits;
|
||||
|
||||
|
|
@ -598,7 +603,7 @@ public:
|
|||
|
||||
class Intersect_2 {
|
||||
private:
|
||||
typedef Arr_polyline_traits_2<Segment_traits_2> Self;
|
||||
typedef Arr_polycurve_traits_2<Segment_traits_2> Self;
|
||||
const Segment_traits_2 * m_seg_traits;
|
||||
|
||||
public:
|
||||
|
|
@ -842,47 +847,59 @@ public:
|
|||
return Are_mergeable_2(&m_seg_traits);
|
||||
}
|
||||
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2 {
|
||||
private:
|
||||
const Segment_traits_2 * m_seg_traits;
|
||||
protected:
|
||||
typedef Arr_polycurve_traits_2<Kernel> Traits;
|
||||
|
||||
public:
|
||||
/*! Constructor. */
|
||||
Merge_2(const Segment_traits_2 * traits) : m_seg_traits(traits) {}
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_polycurve_traits_2<Kernel>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve(segment).
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable. That is, they share a common
|
||||
* endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator()(const X_monotone_curve_2 & cv1,
|
||||
const X_monotone_curve_2 & cv2,
|
||||
X_monotone_curve_2 & c) const
|
||||
{
|
||||
typename Segment_traits_2::Construct_min_vertex_2 min_vertex =
|
||||
m_seg_traits->construct_min_vertex_2_object();
|
||||
typename Segment_traits_2::Construct_max_vertex_2 max_vertex =
|
||||
m_seg_traits->construct_max_vertex_2_object();
|
||||
typename Segment_traits_2::Equal_2 equal = m_seg_traits->equal_2_object();
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv1, cv2));
|
||||
|
||||
const Segment_traits_2* seg_traits = m_traits->segment_traits_2();
|
||||
|
||||
Construct_min_vertex_2 min_vertex =
|
||||
m_traits->construct_min_vertex_2_object();
|
||||
Construct_max_vertex_2 max_vertex =
|
||||
m_traits->construct_max_vertex_2_object();
|
||||
Equal_2 equal = m_traits->equal_2_object();
|
||||
|
||||
const unsigned int n1 = cv1.size();
|
||||
const unsigned int n2 = cv2.size();
|
||||
unsigned int i;
|
||||
|
||||
c.clear();
|
||||
if (equal(max_vertex(cv1[n1 - 1]), min_vertex(cv2[0]))) {
|
||||
if (equal(max_vertex(cv1), min_vertex(cv2))) {
|
||||
// cv2 extends cv1 to the right:
|
||||
for (i = 0; i < n1 - 1; ++i)
|
||||
c.push_back(cv1[i]);
|
||||
|
||||
// Try to merge tthe to contiguous line segments:
|
||||
if (m_seg_traits->are_mergeable_2_object()(cv1[n1 - 1], cv2[0])) {
|
||||
// Try to merge the two contiguous line segments:
|
||||
if (seg_traits->are_mergeable_2_object()(cv1[n1 - 1], cv2[0])) {
|
||||
Segment_2 seg;
|
||||
m_seg_traits->merge_2_object()(cv1[n1 - 1], cv2[0], seg);
|
||||
seg_traits->merge_2_object()(cv1[n1 - 1], cv2[0], seg);
|
||||
c.push_back(seg);
|
||||
} else {
|
||||
c.push_back(cv1[n1 - 1]);
|
||||
|
|
@ -891,15 +908,17 @@ public:
|
|||
|
||||
for (i = 1; i < n2; ++i)
|
||||
c.push_back(cv2[i]);
|
||||
} else if (equal(max_vertex(cv2[n2 - 1]), min_vertex(cv1[0]))) {
|
||||
} else {
|
||||
CGAL_precondition(equal(max_vertex(cv2), min_vertex(cv1)));
|
||||
|
||||
// cv1 extends cv2 to the right:
|
||||
for (i = 0; i < n2 - 1; ++i)
|
||||
c.push_back(cv2[i]);
|
||||
|
||||
// Try to merge tthe to contiguous line segments:
|
||||
if (m_seg_traits->are_mergeable_2_object()(cv2[n2 - 1], cv1[0])) {
|
||||
// Try to merge the two contiguous line segments:
|
||||
if (seg_traits->are_mergeable_2_object()(cv2[n2 - 1], cv1[0])) {
|
||||
Segment_2 seg;
|
||||
m_seg_traits->merge_2_object()(cv2[n2 - 1], cv1[0], seg);
|
||||
seg_traits->merge_2_object()(cv2[n2 - 1], cv1[0], seg);
|
||||
c.push_back(seg);
|
||||
} else {
|
||||
c.push_back(cv2[n2 - 1]);
|
||||
|
|
@ -908,17 +927,12 @@ public:
|
|||
|
||||
for (i = 1; i < n1; ++i)
|
||||
c.push_back(cv1[i]);
|
||||
} else {
|
||||
CGAL_precondition_msg(false, "The curves are not mergeable.");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*! Get a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object() const
|
||||
{
|
||||
return Merge_2(&m_seg_traits);
|
||||
}
|
||||
Merge_2 merge_2_object() const { return Merge_2(this); }
|
||||
///@}
|
||||
|
||||
/// \name Functor definitions for the landmarks point-location strategy.
|
||||
|
|
|
|||
|
|
@ -61,6 +61,11 @@ public:
|
|||
/*! Default constructor */
|
||||
Arr_polyline_traits_2() : m_seg_traits() {}
|
||||
|
||||
/*! Obtain the segment traits.
|
||||
* \return the segment traits.
|
||||
*/
|
||||
const Segment_traits_2* segment_traits_2() const { return &m_seg_traits; }
|
||||
|
||||
/// \name Types and functors inherited from the base segment traits.
|
||||
//@{
|
||||
|
||||
|
|
@ -842,47 +847,59 @@ public:
|
|||
return Are_mergeable_2(&m_seg_traits);
|
||||
}
|
||||
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2 {
|
||||
private:
|
||||
const Segment_traits_2 * m_seg_traits;
|
||||
protected:
|
||||
typedef Arr_polyline_traits_2<Segment_traits_2> Traits;
|
||||
|
||||
public:
|
||||
/*! Constructor. */
|
||||
Merge_2(const Segment_traits_2 * traits) : m_seg_traits(traits) {}
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_polyline_traits_2<Segment_traits_2>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve(segment).
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable. That is, they share a common
|
||||
* endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator()(const X_monotone_curve_2 & cv1,
|
||||
const X_monotone_curve_2 & cv2,
|
||||
X_monotone_curve_2 & c) const
|
||||
{
|
||||
typename Segment_traits_2::Construct_min_vertex_2 min_vertex =
|
||||
m_seg_traits->construct_min_vertex_2_object();
|
||||
typename Segment_traits_2::Construct_max_vertex_2 max_vertex =
|
||||
m_seg_traits->construct_max_vertex_2_object();
|
||||
typename Segment_traits_2::Equal_2 equal = m_seg_traits->equal_2_object();
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv1, cv2));
|
||||
|
||||
const Segment_traits_2* seg_traits = m_traits->segment_traits_2();
|
||||
|
||||
Construct_min_vertex_2 min_vertex =
|
||||
m_traits->construct_min_vertex_2_object();
|
||||
Construct_max_vertex_2 max_vertex =
|
||||
m_traits->construct_max_vertex_2_object();
|
||||
Equal_2 equal = m_traits->equal_2_object();
|
||||
|
||||
const unsigned int n1 = cv1.size();
|
||||
const unsigned int n2 = cv2.size();
|
||||
unsigned int i;
|
||||
|
||||
c.clear();
|
||||
if (equal(max_vertex(cv1[n1 - 1]), min_vertex(cv2[0]))) {
|
||||
if (equal(max_vertex(cv1), min_vertex(cv2))) {
|
||||
// cv2 extends cv1 to the right:
|
||||
for (i = 0; i < n1 - 1; ++i)
|
||||
c.push_back(cv1[i]);
|
||||
|
||||
// Try to merge tthe to contiguous line segments:
|
||||
if (m_seg_traits->are_mergeable_2_object()(cv1[n1 - 1], cv2[0])) {
|
||||
if (seg_traits->are_mergeable_2_object()(cv1[n1 - 1], cv2[0])) {
|
||||
Segment_2 seg;
|
||||
m_seg_traits->merge_2_object()(cv1[n1 - 1], cv2[0], seg);
|
||||
seg_traits->merge_2_object()(cv1[n1 - 1], cv2[0], seg);
|
||||
c.push_back(seg);
|
||||
} else {
|
||||
c.push_back(cv1[n1 - 1]);
|
||||
|
|
@ -891,15 +908,17 @@ public:
|
|||
|
||||
for (i = 1; i < n2; ++i)
|
||||
c.push_back(cv2[i]);
|
||||
} else if (equal(max_vertex(cv2[n2 - 1]), min_vertex(cv1[0]))) {
|
||||
} else {
|
||||
CGAL_precondition(equal(max_vertex(cv2), min_vertex(cv1)));
|
||||
|
||||
// cv1 extends cv2 to the right:
|
||||
for (i = 0; i < n2 - 1; ++i)
|
||||
c.push_back(cv2[i]);
|
||||
|
||||
// Try to merge tthe to contiguous line segments:
|
||||
if (m_seg_traits->are_mergeable_2_object()(cv2[n2 - 1], cv1[0])) {
|
||||
if (seg_traits->are_mergeable_2_object()(cv2[n2 - 1], cv1[0])) {
|
||||
Segment_2 seg;
|
||||
m_seg_traits->merge_2_object()(cv2[n2 - 1], cv1[0], seg);
|
||||
seg_traits->merge_2_object()(cv2[n2 - 1], cv1[0], seg);
|
||||
c.push_back(seg);
|
||||
} else {
|
||||
c.push_back(cv2[n2 - 1]);
|
||||
|
|
@ -908,17 +927,12 @@ public:
|
|||
|
||||
for (i = 1; i < n1; ++i)
|
||||
c.push_back(cv1[i]);
|
||||
} else {
|
||||
CGAL_precondition_msg(false, "The curves are not mergeable.");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*! Get a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object() const
|
||||
{
|
||||
return Merge_2(&m_seg_traits);
|
||||
}
|
||||
Merge_2 merge_2_object() const { return Merge_2(this); }
|
||||
///@}
|
||||
|
||||
/// \name Functor definitions for the landmarks point-location strategy.
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ public:
|
|||
typedef std::vector<std::pair<Algebraic_real_1, Multiplicity> >
|
||||
Root_multiplicity_vector;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<Integer,Coefficient>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<Polynomial_1,
|
||||
CGAL_static_assertion((boost::is_same<Integer,Coefficient>::value));
|
||||
CGAL_static_assertion((boost::is_same<Polynomial_1,
|
||||
typename FT_poly_rat_1::Numerator_type>::value));
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@ public:
|
|||
|
||||
typedef Algebraic_point_2 Point_2;
|
||||
|
||||
BOOST_STATIC_ASSERT((boost::is_same<Integer, Coefficient>::value));
|
||||
BOOST_STATIC_ASSERT((boost::is_same<Polynomial_1,
|
||||
CGAL_static_assertion((boost::is_same<Integer, Coefficient>::value));
|
||||
CGAL_static_assertion((boost::is_same<Polynomial_1,
|
||||
typename FT_poly_rat_1::Numerator_type>::value));
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -505,33 +505,47 @@ public:
|
|||
return Are_mergeable_2();
|
||||
}
|
||||
|
||||
/*! A functor that merges two curves into one. */
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2
|
||||
{
|
||||
protected:
|
||||
typedef Arr_rational_arc_traits_2<Kernel> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_rational_arc_traits_2<Kernel>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve (segment).
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable, that is they are supported by the
|
||||
* same conic curve and share a common endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator() (const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2,
|
||||
X_monotone_curve_2& c) const
|
||||
{
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv1, cv2));
|
||||
|
||||
c = cv1;
|
||||
c.merge (cv2);
|
||||
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/*! Obtain a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object () const
|
||||
{
|
||||
return Merge_2();
|
||||
return Merge_2(this);
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
|
|||
|
|
@ -934,22 +934,38 @@ public:
|
|||
return Are_mergeable_2();
|
||||
}
|
||||
|
||||
/*! A functor that merges two curves into one. */
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2
|
||||
{
|
||||
protected:
|
||||
typedef Arr_rational_function_traits_2<Algebraic_kernel_d_1> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_rational_function_traits_2<Algebraic_kernel_d_1>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve (segment).
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable, that is they are supported by the
|
||||
* same conic curve and share a common endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator()(const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2,
|
||||
X_monotone_curve_2& c) const
|
||||
{
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv2, cv1));
|
||||
|
||||
c = cv1;
|
||||
c.merge(cv2);
|
||||
}
|
||||
|
|
@ -958,7 +974,7 @@ public:
|
|||
/*! Obtain a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object() const
|
||||
{
|
||||
return Merge_2();
|
||||
return Merge_2(this);
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
|
|||
|
|
@ -849,89 +849,100 @@ public:
|
|||
return Intersect_2();
|
||||
}
|
||||
|
||||
class Are_mergeable_2
|
||||
{
|
||||
class Are_mergeable_2 {
|
||||
protected:
|
||||
typedef Arr_segment_traits_2<Kernel> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Are_mergeable_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_segment_traits_2<Kernel>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Check whether it is possible to merge two given x-monotone curves.
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \return (true) if the two curves are mergeable - if they are supported
|
||||
* by the same line and share a common endpoint; (false) otherwise.
|
||||
* \return (true) if the two curves are mergeable, that is, if they are
|
||||
* supported by the same line; (false) otherwise.
|
||||
* \pre cv1 and cv2 share a common endpoint.
|
||||
*/
|
||||
bool operator() (const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2) const
|
||||
{
|
||||
Kernel kernel;
|
||||
typename Kernel::Equal_2 equal = kernel.equal_2_object();
|
||||
|
||||
// Check if the two curves have the same supporting line.
|
||||
if (! equal (cv1.line(), cv2.line()) &&
|
||||
! equal (cv1.line(),
|
||||
kernel.construct_opposite_line_2_object() (cv2.line())))
|
||||
return (false);
|
||||
|
||||
// Check if the left endpoint of one curve is the right endpoint of the
|
||||
// other.
|
||||
return (equal (cv1.right(), cv2.left()) ||
|
||||
equal (cv2.right(), cv1.left()));
|
||||
if (!m_traits->equal_2_object()(cv1.right(), cv2.left()) &&
|
||||
!m_traits->equal_2_object()(cv2.right(), cv1.left()))
|
||||
return false;
|
||||
|
||||
// Check whether the two curves have the same supporting line.
|
||||
const Kernel* kernel = m_traits;
|
||||
typename Kernel::Equal_2 equal = kernel->equal_2_object();
|
||||
return (equal(cv1.line(), cv2.line()) ||
|
||||
equal(cv1.line(),
|
||||
kernel->construct_opposite_line_2_object()(cv2.line())));
|
||||
}
|
||||
};
|
||||
|
||||
/*! Get an Are_mergeable_2 functor object. */
|
||||
Are_mergeable_2 are_mergeable_2_object () const
|
||||
{
|
||||
return Are_mergeable_2();
|
||||
}
|
||||
Are_mergeable_2 are_mergeable_2_object() const
|
||||
{ return Are_mergeable_2(this); }
|
||||
|
||||
class Merge_2
|
||||
{
|
||||
/*! \class Merge_2
|
||||
* A functor that merges two x-monotone arcs into one.
|
||||
*/
|
||||
class Merge_2 {
|
||||
protected:
|
||||
typedef Arr_segment_traits_2<Kernel> Traits;
|
||||
|
||||
/*! The traits (in case it has state) */
|
||||
const Traits* m_traits;
|
||||
|
||||
/*! Constructor
|
||||
* \param traits the traits (in case it has state)
|
||||
*/
|
||||
Merge_2(const Traits* traits) : m_traits(traits) {}
|
||||
|
||||
friend class Arr_segment_traits_2<Kernel>;
|
||||
|
||||
public:
|
||||
/*!
|
||||
* Merge two given x-monotone curves into a single curve (segment).
|
||||
* \param cv1 The first curve.
|
||||
* \param cv2 The second curve.
|
||||
* \param c Output: The merged curve.
|
||||
* \pre The two curves are mergeable, that is they are supported by the
|
||||
* same line and share a common endpoint.
|
||||
* \pre The two curves are mergeable.
|
||||
*/
|
||||
void operator() (const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2,
|
||||
X_monotone_curve_2& c) const
|
||||
void operator()(const X_monotone_curve_2& cv1,
|
||||
const X_monotone_curve_2& cv2,
|
||||
X_monotone_curve_2& c) const
|
||||
{
|
||||
Kernel kernel;
|
||||
typename Kernel::Equal_2 equal = kernel.equal_2_object();
|
||||
|
||||
CGAL_precondition
|
||||
(equal (cv1.line(), cv2.line()) ||
|
||||
equal (cv1.line(),
|
||||
kernel.construct_opposite_line_2_object() (cv2.line())));
|
||||
CGAL_precondition(m_traits->are_mergeable_2_object()(cv1, cv2));
|
||||
|
||||
Equal_2 equal = m_traits->equal_2_object();
|
||||
|
||||
// Check which curve extends to the right of the other.
|
||||
if (equal (cv1.right(), cv2.left()))
|
||||
{
|
||||
if (equal(cv1.right(), cv2.left())) {
|
||||
// cv2 extends cv1 to the right.
|
||||
c = cv1;
|
||||
c.set_right (cv2.right());
|
||||
c.set_right(cv2.right());
|
||||
}
|
||||
else
|
||||
{
|
||||
CGAL_precondition (equal (cv2.right(), cv1.left()));
|
||||
else {
|
||||
CGAL_precondition(equal(cv2.right(), cv1.left()));
|
||||
|
||||
// cv1 extends cv2 to the right.
|
||||
c = cv2;
|
||||
c.set_right (cv1.right());
|
||||
c.set_right(cv1.right());
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
/*! Get a Merge_2 functor object. */
|
||||
Merge_2 merge_2_object () const
|
||||
{
|
||||
return Merge_2();
|
||||
}
|
||||
Merge_2 merge_2_object () const { return Merge_2(this); }
|
||||
//@}
|
||||
|
||||
/// \name Functor definitions for the landmarks point-location strategy.
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
#define CGAL_PRINT_INSERT(a)
|
||||
#define CGAL_PRINT_ERASE(a)
|
||||
#define CGAL_PRINT_NEW_EVENT(p, e)
|
||||
#define CGAL_PRINT_UPDATE_EVENT(p, e)
|
||||
#define CGAL_PRINT(a)
|
||||
|
||||
#else
|
||||
|
|
@ -62,6 +63,9 @@
|
|||
#define CGAL_PRINT_NEW_EVENT(p, e) \
|
||||
{ std::cout << "%%% a new event was created at " << (p) << std::endl; \
|
||||
(e)->Print(); }
|
||||
#define CGAL_PRINT_UPDATE_EVENT(p, e) \
|
||||
{ std::cout << "%%% an event was updated at " << (p) << std::endl; \
|
||||
(e)->Print(); }
|
||||
#define CGAL_PRINT(a) { std::cout << a ; }
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -776,7 +776,7 @@ Arr_construction_sl_visitor<Hlpr>::insert_at_vertices
|
|||
if (res->is_on_inner_ccb() || res->twin()->is_on_inner_ccb()) {
|
||||
// In case a new face has been created (pointed by the new halfedge
|
||||
// we obtained), we have to examine the holes and isolated vertices
|
||||
// in the existing face (pointed be the twin halfedge) and relocate
|
||||
// in the existing face (pointed by the twin halfedge) and relocate
|
||||
// the relevant features in the new face.
|
||||
CGAL_assertion(res->face() != res->twin()->face());
|
||||
this->relocate_in_new_face (res);
|
||||
|
|
|
|||
|
|
@ -486,7 +486,7 @@ void Basic_sweep_line_2<Tr, Vis, Subcv, Evnt, Alloc>::_sort_left_curves()
|
|||
Subcurve *curve = *(m_currentEvent->left_curves_begin());
|
||||
Status_line_iterator sl_iter = curve->hint();
|
||||
CGAL_assertion (*sl_iter == curve);
|
||||
|
||||
//look for the first curve in the vertical ordering that is also in the left curve of the event
|
||||
for (++sl_iter; sl_iter != m_statusLine.end(); ++sl_iter)
|
||||
{
|
||||
if (std::find (m_currentEvent->left_curves_begin(),
|
||||
|
|
@ -530,7 +530,7 @@ void Basic_sweep_line_2<Tr, Vis, Subcv, Evnt, Alloc>::_sort_left_curves()
|
|||
m_currentEvent->left_curves_end(),
|
||||
*sl_iter) == m_currentEvent->left_curves_end())
|
||||
{
|
||||
m_currentEvent->replace_left_curves(++sl_iter,end);;
|
||||
m_currentEvent->replace_left_curves(++sl_iter,end);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -717,8 +717,11 @@ _push_event (const Point_2& pt, Attribute type,
|
|||
// Insert the new event into the queue using the hint we got when we
|
||||
// looked for it.
|
||||
m_queue->insert_before (pair_res.first, e);
|
||||
CGAL_PRINT_NEW_EVENT(pt, e);
|
||||
}
|
||||
else{
|
||||
CGAL_PRINT_UPDATE_EVENT(pt, e);
|
||||
}
|
||||
CGAL_PRINT_NEW_EVENT(pt, e);
|
||||
|
||||
// Return the resulting event and a flag indicating whether we have created
|
||||
// a new event.
|
||||
|
|
|
|||
|
|
@ -417,42 +417,30 @@ _intersect (Subcurve *c1, Subcurve *c2)
|
|||
|
||||
// The two subCurves may start at the same point, in that case we ignore the
|
||||
// first intersection point (if we got to that stage, they cannot overlap).
|
||||
if (reinterpret_cast<Event*>(c1->left_event()) == this->m_currentEvent &&
|
||||
reinterpret_cast<Event*>(c2->left_event()) == this->m_currentEvent)
|
||||
{
|
||||
CGAL_PRINT(" [Skipping common left endpoint...]\n";);
|
||||
++vi;
|
||||
}
|
||||
else
|
||||
{
|
||||
// In case both left curve-ends have boundary conditions and are not
|
||||
// open, check whether the left endpoints are the same. If they are,
|
||||
// skip the first intersection point.
|
||||
const Arr_parameter_space ps_x1 =
|
||||
this->m_traits->parameter_space_in_x_2_object()(c1->last_curve(),
|
||||
ARR_MIN_END);
|
||||
const Arr_parameter_space ps_y1 =
|
||||
this->m_traits->parameter_space_in_y_2_object()(c1->last_curve(),
|
||||
ARR_MIN_END);
|
||||
const Arr_parameter_space ps_x2 =
|
||||
this->m_traits->parameter_space_in_x_2_object()(c2->last_curve(),
|
||||
ARR_MIN_END);
|
||||
const Arr_parameter_space ps_y2 =
|
||||
this->m_traits->parameter_space_in_y_2_object()(c2->last_curve(),
|
||||
ARR_MIN_END);
|
||||
|
||||
if ((ps_x1 == ps_x2) && (ps_y1 == ps_y2) &&
|
||||
((ps_x1 != ARR_INTERIOR) || (ps_y2 != ARR_INTERIOR)) &&
|
||||
this->m_traits->is_closed_2_object()(c1->last_curve(), ARR_MIN_END) &&
|
||||
this->m_traits->is_closed_2_object()(c2->last_curve(), ARR_MIN_END))
|
||||
const Arr_parameter_space ps_x1 =
|
||||
this->m_traits->parameter_space_in_x_2_object()(c1->last_curve(),
|
||||
ARR_MIN_END);
|
||||
const Arr_parameter_space ps_y1 =
|
||||
this->m_traits->parameter_space_in_y_2_object()(c1->last_curve(),
|
||||
ARR_MIN_END);
|
||||
const Arr_parameter_space ps_x2 =
|
||||
this->m_traits->parameter_space_in_x_2_object()(c2->last_curve(),
|
||||
ARR_MIN_END);
|
||||
const Arr_parameter_space ps_y2 =
|
||||
this->m_traits->parameter_space_in_y_2_object()(c2->last_curve(),
|
||||
ARR_MIN_END);
|
||||
|
||||
if ((ps_x1 == ps_x2) && (ps_y1 == ps_y2) &&
|
||||
this->m_traits->is_closed_2_object()(c1->last_curve(), ARR_MIN_END) &&
|
||||
this->m_traits->is_closed_2_object()(c2->last_curve(), ARR_MIN_END))
|
||||
{
|
||||
if (this->m_traits->equal_2_object()
|
||||
(this->m_traits->construct_min_vertex_2_object()(c1->last_curve()),
|
||||
this->m_traits->construct_min_vertex_2_object()(c2->last_curve())))
|
||||
{
|
||||
if (this->m_traits->equal_2_object()
|
||||
(this->m_traits->construct_min_vertex_2_object() (c1->last_curve()),
|
||||
this->m_traits->construct_min_vertex_2_object() (c2->last_curve())))
|
||||
{
|
||||
CGAL_PRINT(" [Skipping common left endpoint on boundary ...]\n";);
|
||||
++vi;
|
||||
}
|
||||
CGAL_PRINT(" [Skipping common left endpoint on boundary ...]\n";);
|
||||
++vi;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -513,6 +501,7 @@ _intersect (Subcurve *c1, Subcurve *c2)
|
|||
|
||||
const std::pair<Point_2,Multiplicity> *xp_point;
|
||||
|
||||
// Efi: why not skipping in a loop?check only one (that is, why not in a loop)?
|
||||
if(vi != vi_end)
|
||||
{
|
||||
xp_point = object_cast<std::pair<Point_2,Multiplicity> > (&(*vi));
|
||||
|
|
|
|||
|
|
@ -271,38 +271,38 @@ int main ()
|
|||
|
||||
assert(ident12() == false);
|
||||
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(boost::is_same< CGAL::internal::Arr_complete_left_side_category< Traits5 >::Category,
|
||||
CGAL::Arr_oblivious_side_tag >::value)
|
||||
);
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(boost::is_same< CGAL::internal::Arr_complete_left_side_category< Traits1 >::Category,
|
||||
CGAL::Arr_open_side_tag >::value)
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(boost::is_same<CGAL::internal::Arr_complete_bottom_side_category< Traits5 >::Category,
|
||||
CGAL::Arr_oblivious_side_tag >::value)
|
||||
);
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(boost::is_same<CGAL::internal::Arr_complete_bottom_side_category< Traits1 >::Category,
|
||||
CGAL::Arr_open_side_tag >::value)
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(boost::is_same< CGAL::internal::Arr_complete_top_side_category< Traits5 >::Category,
|
||||
CGAL::Arr_oblivious_side_tag >::value)
|
||||
);
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(boost::is_same< CGAL::internal::Arr_complete_top_side_category< Traits1 >::Category,
|
||||
CGAL::Arr_open_side_tag >::value)
|
||||
);
|
||||
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(boost::is_same< CGAL::internal::Arr_complete_right_side_category< Traits5 >::Category,
|
||||
CGAL::Arr_oblivious_side_tag >::value)
|
||||
);
|
||||
BOOST_STATIC_ASSERT(
|
||||
CGAL_static_assertion(
|
||||
(boost::is_same< CGAL::internal::Arr_complete_right_side_category< Traits1 >::Category,
|
||||
CGAL::Arr_open_side_tag >::value)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
\begin{ccRefConcept}{ArrangementDirectionalXMonotoneTraits_2}
|
||||
|
||||
\ccDefinition
|
||||
|
||||
% ===========
|
||||
This concept refines the basic arrangement $x$-monotone traits concept.
|
||||
A model of this concept is able to handle \emph{directed} $x$-monotone curves
|
||||
that intersect in their interior. Namely, an instance of the
|
||||
|
|
@ -16,8 +16,8 @@ that intersect in their interior. Namely, an instance of the
|
|||
(lexicographically smaller) endpoint and a \emph{right} endpoint.
|
||||
If the traits class is also a model of
|
||||
\ccc{ArrangementDirectionalXMonotoneTraits_2}, the $x$-monotone curve is
|
||||
also required to have a direction, namely one of these two endpoint is
|
||||
viewed as its \emph{source} and the other as its \emph{target}.
|
||||
also required to have a direction, namely one of these two endpoint serves
|
||||
as its \emph{source} and the other as its \emph{target}.
|
||||
|
||||
\ccRefines
|
||||
\ccc{ArrangementXMonotoneTraits_2}
|
||||
|
|
@ -29,51 +29,22 @@ viewed as its \emph{source} and the other as its \emph{target}.
|
|||
\ccThreeToTwo
|
||||
|
||||
\ccNestedType{Compare_endpoints_xy_2}
|
||||
{provides the operator~: \\
|
||||
\ccc{Comparison_result operator() (X_monotone_curve_2 c)} \\
|
||||
which accepts an input curve \ccc{c} and compare its source and target
|
||||
point. It returns \ccc{SMALLER} if the curve is directed from left to right
|
||||
(lexicographically --- i.e., in case of a vertical line segment, this means
|
||||
it is directed upward), and \ccc{LARGER} if it is directed from right to
|
||||
left.}
|
||||
{models the concept \ccc{ArrDirectionalTraits::CompareEndpointsXy_2}.}
|
||||
|
||||
\ccNestedType{Construct_opposite_2}
|
||||
{provides the operator~: \\
|
||||
\ccc{X_monotone_curve_2 operator() (X_monotone_curve_2 c)} \\
|
||||
which accepts an $x$-monotone curve \ccc{c} and returns its opposite curve,
|
||||
namely a curve whose graph is the same as \ccc{c}'s, and whose source and
|
||||
target are swapped with respect to \ccc{c}'s source and target.}
|
||||
|
||||
In addition, the two following functors, required by the concept
|
||||
\ccc{ArrangementXMonotoneTraits_2} should operate as follows:
|
||||
{models the concept \ccc{ArrDirectionalTraits::ConstructOpposite_2}.}
|
||||
|
||||
\ccNestedType{Intersect_2}
|
||||
{provides the operator (templated by the \ccc{OutputIterator} type)~: \\
|
||||
\ccc{OutputIterator operator() (X_monotone_curve_2 c1, X_monotone_curve_2 c2,
|
||||
OutputIterator oi)} \\
|
||||
which computes the intersections of \ccc{c1} and \ccc{c2} and inserts them
|
||||
{\sl in an ascending lexicographic $xy$-order} into the output iterator.
|
||||
The value-type of \ccc{OutputIterator} is \ccc{CGAL::Object}, where each
|
||||
\ccc{Object} either wraps a \ccc{pair<Point_2,Multiplicity>} instance, which
|
||||
represents an intersection point with its multiplicity (in case the
|
||||
multiplicity is undefined or not known, it should be set to $0$) or an
|
||||
\ccc{X_monotone_curve_2} instance, representing an overlapping subcurve of
|
||||
\ccc{c1} and \ccc{c2}. In the latter case, if \ccc{c1} and \ccc{c2} have the
|
||||
same direction, then the overlapping subcurves should also be directed the
|
||||
same way; otherwise, they can be associated with an arbitrary direction.
|
||||
The operator returns a past-the-end iterator for the output sequence.}
|
||||
{models the concept \ccc{ArrDirectionalTraits::Intersect_2}.}
|
||||
|
||||
\ccNestedType{Split_2}
|
||||
{provides the operator~: \\
|
||||
\ccc{void operator() (X_monotone_curve_2 c, Point_2 p,
|
||||
X_monotone_curve_2& c1, X_monotone_curve_2& c2)} \\
|
||||
which accepts an input curve \ccc{c} and a split point \ccc{p} in its
|
||||
interior. It splits \ccc{c} at the split point into two subcurves \ccc{c1}
|
||||
and \ccc{c2}, such that \ccc{p} is \ccc{c1}'s {\sl right} endpoint and
|
||||
\ccc{c2}'s {\sl left} endpoint. The direction of \ccc{c} should be preserved:
|
||||
in case \ccc{c} is directed from left to right then \ccc{p} becomes \ccc{c1}'s
|
||||
target and \ccc{c2}'s source; otherwise, \ccc{p} becomes \ccc{c2}'s
|
||||
target and \ccc{c1}'s source.}
|
||||
{models the concept \ccc{ArrDirectionalTraits::Split_2}.}
|
||||
|
||||
\ccNestedType{Are_mergeable_2}
|
||||
{models the concept \ccc{ArrDirectionalTraits::AreMergeable_2}.}
|
||||
|
||||
\ccNestedType{Merge_2}
|
||||
{models the concept \ccc{ArrDirectionalTraits::Merge_2}.}
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{traits}
|
||||
|
|
@ -104,7 +75,9 @@ In addition, the two following functors, required by the concept
|
|||
\ccc{CGAL::Arr_non_caching_segment_traits_2<Kernel>} \\
|
||||
\ccc{CGAL::Arr_circle_segment_traits_2<Kernel>} \\
|
||||
\ccc{CGAL::Arr_conic_traits_2<RatKernel,AlgKernel,NtTraits>} \\
|
||||
\ccc{CGAL::Arr_rational_arc_traits_2<AlgKernel,NtTraits>}
|
||||
\ccc{CGAL::Arr_rational_function_traits_2<AlgKernel,NtTraits>}\\
|
||||
\ccc{CGAL::Arr_Bezier_curve_traits_2<RatKernel,AlgKernel,NtTraits>}\\
|
||||
\ccc{CGAL::Arr_algebraic_segment_traits_2<Coefficient>}
|
||||
|
||||
\ccSeeAlso
|
||||
%=========
|
||||
|
|
@ -115,3 +88,147 @@ In addition, the two following functors, required by the concept
|
|||
\end{ccRefConcept}
|
||||
|
||||
\ccRefPageEnd
|
||||
|
||||
%%%%%%%% Functors %%%%%%%%
|
||||
|
||||
%%%%%%%% Intersect_2
|
||||
% ==================
|
||||
\ccRefPageBegin
|
||||
\begin{ccRefConcept}{ArrDirectionalTraits::Intersect_2}
|
||||
\ccRefines{Functor}
|
||||
|
||||
\ccHasModels\ccc{ArrangementDirectionalXMonotoneTraits_2::Intersect_2}
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
|
||||
\ccMethod{Output_iterator operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1,
|
||||
ArrDirectionalTraits::X_monotone_curve_2 xc2,
|
||||
Output_iterator& oi);}
|
||||
{computes the intersections of \ccc{xc1} and \ccc{xc2} and
|
||||
inserts them \emph{in an ascending lexicographic $xy$-order} into the
|
||||
output iterator \ccc{oi}. The value-type of \ccc{Output_iterator} is
|
||||
\ccc{CGAL::Object}, where each \ccc{Object} wraps either a
|
||||
\ccc{pair<ArrDirectionalTraits::Point_2, ArrDirectionalTraits::Multiplicity>} object, which
|
||||
represents an intersection point with its multiplicity (in case the
|
||||
multiplicity is undefined or unknown, it is set to $0$) or an
|
||||
\ccc{ArrDirectionalTraits::X_monotone_curve_2} object, representing an
|
||||
overlapping subcurve of \ccc{xc1} and \ccc{xc2}. In the latter case,
|
||||
the overlapping subcurves are given the direction of \ccc{xc1} and
|
||||
\ccc{xc2} if their directions are identical. Otherwise, the overlapping
|
||||
subcurves are given an arbitrary direction. The operator returns a
|
||||
past-the-end iterator for the output sequence.}
|
||||
\end{ccRefConcept}
|
||||
\ccRefPageEnd
|
||||
|
||||
%%%%%%%% Split_2
|
||||
% ==============
|
||||
\ccRefPageBegin
|
||||
\begin{ccRefConcept}{ArrDirectionalTraits::Split_2}
|
||||
\ccRefines{Functor}
|
||||
|
||||
\ccHasModels\ccc{ArrangementDirectionalXMonotoneTraits_2::Split_2}
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
\def\ccTagRmConstRefPair{\ccFalse}%
|
||||
\ccMethod{void operator()(ArrDirectionalTraits::X_monotone_curve_2 xc,
|
||||
ArrDirectionalTraits::Point_2 p,
|
||||
ArrDirectionalTraits::X_monotone_curve_2& xc1,
|
||||
ArrDirectionalTraits::X_monotone_curve_2& xc2);}
|
||||
{accepts an input curve \ccc{xc} and a split point \ccc{p} in its
|
||||
interior. It splits \ccc{xc} at the split point into two subcurves
|
||||
\ccc{xc1} and \ccc{xc2}, such that \ccc{p} is \ccc{xc1}'s \emph{right}
|
||||
endpoint and \ccc{xc2}'s \emph{left} endpoint. The direction of \ccc{xc}
|
||||
is preserved. That is, in case \ccc{xc} is directed from left to right,
|
||||
\ccc{p} becomes \ccc{xc1}'s target and \ccc{c2}'s source;
|
||||
otherwise, \ccc{p} becomes \ccc{xc2}'s target and \ccc{xc1}'s source.}%
|
||||
\ccTagDefaults
|
||||
\end{ccRefConcept}
|
||||
\ccRefPageEnd
|
||||
|
||||
%%%%%%%% AreMergeable_2
|
||||
% =====================
|
||||
\ccRefPageBegin
|
||||
\begin{ccRefConcept}{ArrDirectionalTraits::AreMergeable_2}
|
||||
\ccRefines{Functor}
|
||||
|
||||
\ccHasModels\ccc{ArrangementDirectionalXMonotoneTraits_2::Are_mergeable_2}
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
\def\ccTagRmConstRefPair{\ccFalse}%
|
||||
\ccMethod{bool operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1,
|
||||
ArrDirectionalTraits::X_monotone_curve_2 xc2);}
|
||||
{accepts two $x$-monotone curves \ccc{xc1} and \ccc{xc2} and determines
|
||||
whether they can be merged to form a single $x$-monotone curve.
|
||||
\ccc{xc1} and \ccc{xc2} are mergeable if their underlying curves are
|
||||
identical, they share a common endpoint, and they do not bend to form
|
||||
a non-$x$-monotone curve.
|
||||
\ccPrecond{The target point of \ccc{xc1} and the source point \ccc{xc2}
|
||||
coincide or the source point of \ccc{xc2} and the target
|
||||
point \ccc{xc2} coincide.}}
|
||||
\end{ccRefConcept}
|
||||
\ccRefPageEnd
|
||||
|
||||
%%%%%%%% Merge_2
|
||||
% ==============
|
||||
\ccRefPageBegin
|
||||
\begin{ccRefConcept}{ArrDirectionalTraits::Merge_2}
|
||||
\ccRefines{Functor}
|
||||
|
||||
\ccHasModels\ccc{ArrangementDirectionalXMonotoneTraits_2::Merge_2}
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
\def\ccTagRmConstRefPair{\ccFalse}%
|
||||
\ccMethod{void operator()(ArrDirectionalTraits::X_monotone_curve_2 xc1,
|
||||
ArrDirectionalTraits::X_monotone_curve_2 xc2,
|
||||
ArrDirectionalTraits::X_monotone_curve_2& xc);}
|
||||
{accepts two \emph{mergeable} $x$-monotone curves \ccc{xc1} and
|
||||
\ccc{xc2} and asigns \ccc{xc} with the merged curve. If the target
|
||||
point of \ccc{xc1} and the source point of \ccc{xc2} coincide; then
|
||||
the source point of \ccc{xc1} and the target point of \ccc{xc2} become
|
||||
the source and target points of \ccc{xc}, respectively. If the target
|
||||
point of \ccc{xc2} and the source point of \ccc{xc1} coincide; then
|
||||
the source point of \ccc{xc2} and the target point of \ccc{xc1} become
|
||||
the source and target points of \ccc{xc}, respectively.
|
||||
\ccPrecond{\ccc{are_mergeable_2}(\ccc{xc1}, \ccc{xc2}) is true.}}
|
||||
\ccTagDefaults
|
||||
\end{ccRefConcept}
|
||||
\ccRefPageEnd
|
||||
|
||||
%%%%%%%% CompareEndpointsXy_2
|
||||
% ===========================
|
||||
\ccRefPageBegin
|
||||
\begin{ccRefConcept}{ArrDirectionalTraits::CompareEndpointsXy_2}
|
||||
\ccRefines{Functor}
|
||||
|
||||
\ccHasModels\ccc{ArrangementDirectionalXMonotoneTraits_2::CompareEndpointsXy_2}
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
\def\ccTagRmConstRefPair{\ccFalse}%
|
||||
\ccMethod{Comparison_result operator()(ArrDirectionalTraits::X_monotone_curve_2 xc);}
|
||||
{accepts an input curve \ccc{xc} and compares its source and target
|
||||
points. It returns \ccc{SMALLER} if the curve is directed from
|
||||
lexicographically left to right, and \ccc{LARGER} if it is directed
|
||||
from lexicographically right to left.}
|
||||
|
||||
\ccTagDefaults
|
||||
\end{ccRefConcept}
|
||||
\ccRefPageEnd
|
||||
|
||||
%%%%%%%% ConstructOpposite_2
|
||||
% ===========================
|
||||
\ccRefPageBegin
|
||||
\begin{ccRefConcept}{ArrDirectionalTraits::ConstructOpposite_2}
|
||||
\ccRefines{Functor}
|
||||
|
||||
\ccHasModels\ccc{ArrangementDirectionalXMonotoneTraits_2::ConstructOpposite_2}
|
||||
|
||||
\ccCreationVariable{fo}
|
||||
\def\ccTagRmConstRefPair{\ccFalse}%
|
||||
\ccMethod{ArrDirectionalTraits::X_monotone_curve_2 operator()(ArrDirectionalTraits::X_monotone_curve_2 xc);}
|
||||
{accepts an $x$-monotone curve \ccc{xc} and returns its opposite curve,
|
||||
namely a curve whose graph is the same as \ccc{xc}'s, and whose source and
|
||||
target are swapped with respect to \ccc{xc}'s source and target.}
|
||||
|
||||
\ccTagDefaults
|
||||
\end{ccRefConcept}
|
||||
\ccRefPageEnd
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ int main() {
|
|||
typedef CGAL::Join_input_iterator_3<Pts,Pts,Pts,Creator> Triangle_gen;
|
||||
Pts points( 1); // in centered cube [-1,1)^3
|
||||
Triangle_gen triangle_gen( points, points, points);
|
||||
CGAL::copy_n( triangle_gen, 10, std::back_inserter(triangles));
|
||||
CGAL::cpp0x::copy_n( triangle_gen, 10, std::back_inserter(triangles));
|
||||
|
||||
// Create the corresponding vector of bounding boxes
|
||||
std::vector<Box> boxes;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ int main() {
|
|||
typedef CGAL::Join_input_iterator_3<Pts,Pts,Pts,Creator> Triangle_gen;
|
||||
Pts points( 1); // in centered cube [-1,1)^3
|
||||
Triangle_gen triangle_gen( points, points, points);
|
||||
CGAL::copy_n( triangle_gen, 10, std::back_inserter(triangles));
|
||||
CGAL::cpp0x::copy_n( triangle_gen, 10, std::back_inserter(triangles));
|
||||
|
||||
// Create the corresponding vector of bounding boxes
|
||||
std::vector<Box> boxes;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ void generator::protected_run(int fn)
|
|||
switch(fn){
|
||||
case 0:{//random point in a circle
|
||||
CGAL::Random_points_in_disc_2<Point_2,Creator> gs( size);
|
||||
CGAL::copy_n( gs, nbelements, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( gs, nbelements, std::back_inserter(points));
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ void generator::protected_run(int fn)
|
|||
case 6:
|
||||
case 2://points in a square : side =
|
||||
{CGAL::Random_points_in_square_2<Point_2, Creator> gc (size);
|
||||
CGAL::copy_n( gc, nbelements, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( gc, nbelements, std::back_inserter(points));
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ void generator::protected_run(int fn)
|
|||
typedef CGAL::Creator_uniform_2< Point_2, Segment_2> Seg_creator;
|
||||
typedef CGAL::Join_input_iterator_2< P1, P2, Seg_creator> Seg_iterator;
|
||||
Seg_iterator g( p1, p2);
|
||||
CGAL::copy_n( g, nbelements, std::back_inserter(segments) );
|
||||
CGAL::cpp0x::copy_n( g, nbelements, std::back_inserter(segments) );
|
||||
break;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
# Created by the script cgal_create_cmake_script
|
||||
# This is the CMake script for compiling a CGAL application.
|
||||
|
||||
# cmake ../ -DCMAKE_BUILD_TYPE=Debug
|
||||
# ou
|
||||
# cmake ../ -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
project( Combinatorial_map_examples )
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5)
|
||||
|
||||
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -w -Wall -pedantic") # -Wextra")
|
||||
|
||||
if ( COMMAND cmake_policy )
|
||||
cmake_policy( SET CMP0003 NEW )
|
||||
endif()
|
||||
|
||||
# For the problem with valgrind
|
||||
# add_definition(-DCGAL_DISABLE_ROUNDING_MATH_CHECK)
|
||||
|
||||
find_package(CGAL QUIET COMPONENTS Core )
|
||||
|
||||
if ( CGAL_FOUND )
|
||||
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
include( CGAL_CreateSingleSourceCGALProgram )
|
||||
include_directories(BEFORE ../../include)
|
||||
|
||||
create_single_source_cgal_program( "map_3_simple_example.cpp" )
|
||||
create_single_source_cgal_program( "map_4_simple_example.cpp" )
|
||||
create_single_source_cgal_program( "map_3_with_colored_facets.cpp" )
|
||||
create_single_source_cgal_program( "map_3_operations.cpp" )
|
||||
create_single_source_cgal_program( "map_3_marks.cpp" )
|
||||
else()
|
||||
|
||||
message(STATUS "This program requires the CGAL library, and will not be compiled.")
|
||||
|
||||
endif()
|
||||
|
||||
|
|
@ -35,17 +35,6 @@
|
|||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
#endif
|
||||
|
||||
// Temporary patch since CGAL_static_assertion_msg is not yet available.
|
||||
#ifndef CGAL_static_assertion
|
||||
|
||||
# define CGAL_static_assertion(EX) \
|
||||
BOOST_STATIC_ASSERT(EX)
|
||||
# define CGAL_static_assertion_msg(EX,MSG) \
|
||||
BOOST_STATIC_ASSERT(EX)
|
||||
|
||||
#endif
|
||||
// end of temporary patch: to remove asap.
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
/** @file Combinatorial_map.h
|
||||
|
|
|
|||
|
|
@ -24,18 +24,6 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <bitset>
|
||||
|
||||
// Temporary patch since CGAL_static_assertion_msg is not yet available.
|
||||
#ifndef CGAL_static_assertion
|
||||
|
||||
# define CGAL_static_assertion(EX) \
|
||||
BOOST_STATIC_ASSERT(EX)
|
||||
# define CGAL_static_assertion_msg(EX,MSG) \
|
||||
BOOST_STATIC_ASSERT(EX)
|
||||
|
||||
#endif
|
||||
// end of temporary patch: to remove asap.
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
/** @file Dart.h
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include <CGAL/tuple.h>
|
||||
#include <CGAL/Compact_container.h>
|
||||
#include <iostream>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <CGAL/assertions.h>
|
||||
|
||||
#ifdef CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
|
@ -650,7 +650,7 @@ struct Fill_disabled
|
|||
template <class Type,int size, class Tuple>
|
||||
struct Fill_type{
|
||||
typedef void type;
|
||||
BOOST_STATIC_ASSERT(size < 10);
|
||||
CGAL_static_assertion(size < 10);
|
||||
};
|
||||
|
||||
template <class Type,int size>
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ int main(int argc,char** argv)
|
|||
if (argc==1){
|
||||
CGAL::Random_points_in_sphere_3<Point_3, PointCreator> gen(1.0);
|
||||
int nbpt=1000000;
|
||||
CGAL::copy_n( gen, nbpt, std::back_inserter(points) );
|
||||
CGAL::cpp0x::copy_n( gen, nbpt, std::back_inserter(points) );
|
||||
std::cout << "Using " << 1000000 << " random points in the unit ball\n";
|
||||
}
|
||||
else{
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ int main()
|
|||
points.reserve(nb_pts);
|
||||
|
||||
K::Point_3 p=*gen++,q=*gen++,r=*gen++;
|
||||
CGAL::copy_n(gen,nb_pts,std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n(gen,nb_pts,std::back_inserter(points));
|
||||
|
||||
std::vector<bool> res0; res0.reserve(nb_pts);
|
||||
std::vector<bool> res1; res1.reserve(nb_pts);
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ int main(int argc, char* argv[])
|
|||
Generator gen(100.0);
|
||||
|
||||
// generate num points and copy them to a vector
|
||||
CGAL::copy_n( gen, num, std::back_inserter(points) );
|
||||
CGAL::cpp0x::copy_n( gen, num, std::back_inserter(points) );
|
||||
|
||||
// define object to hold convex hull
|
||||
CGAL::Object ch_object;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ int main()
|
|||
|
||||
// generate 250 points randomly on a sphere of radius 100.0
|
||||
// and insert them into the triangulation
|
||||
CGAL::copy_n(gen, 250, std::back_inserter(points) );
|
||||
CGAL::cpp0x::copy_n(gen, 250, std::back_inserter(points) );
|
||||
Delaunay T;
|
||||
T.insert(points.begin(), points.end());
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ int main()
|
|||
std::vector<Point_3> V;
|
||||
// generate 250 points randomly on a sphere of radius 100.0 and copy
|
||||
// them to a vector
|
||||
CGAL::copy_n( gen, 250, std::back_inserter(V) );
|
||||
CGAL::cpp0x::copy_n( gen, 250, std::back_inserter(V) );
|
||||
|
||||
Polyhedron P; // define polyhedron to hold convex hull
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ int main()
|
|||
// generate 250 points randomly on a sphere of radius 100.0
|
||||
// and copy them to a vector
|
||||
std::vector<Point_3> points;
|
||||
CGAL::copy_n( gen, 250, std::back_inserter(points) );
|
||||
CGAL::cpp0x::copy_n( gen, 250, std::back_inserter(points) );
|
||||
|
||||
// define polyhedron to hold convex hull
|
||||
Polyhedron_3 poly;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
#include <CGAL/Convex_hull_traits_3.h>
|
||||
#include <CGAL/convex_hull_3.h>
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <CGAL/assertions.h>
|
||||
#include <boost/type_traits.hpp>
|
||||
|
||||
#ifdef CGAL_USE_LEDA
|
||||
|
|
@ -29,11 +29,11 @@ using namespace CGAL::internal::Convex_hull_3;
|
|||
|
||||
int main()
|
||||
{
|
||||
BOOST_STATIC_ASSERT( (boost::is_same<EPEC,Default_traits_for_Chull_3<EPEC::Point_3>::type>::value) );
|
||||
BOOST_STATIC_ASSERT( (boost::is_same<SCD,Default_traits_for_Chull_3<SCD::Point_3>::type>::value) );
|
||||
BOOST_STATIC_ASSERT( (boost::is_same<SCR,Default_traits_for_Chull_3<SCR::Point_3>::type>::value) );
|
||||
BOOST_STATIC_ASSERT( (boost::is_same<EPEC,Default_traits_for_Chull_3<EPEC::Point_3>::type>::value) );
|
||||
BOOST_STATIC_ASSERT( (boost::is_same<CGAL::Convex_hull_traits_3<EPIC>,Default_traits_for_Chull_3<EPIC::Point_3>::type>::value) );
|
||||
BOOST_STATIC_ASSERT( (boost::is_same<Is_on_positive_side_of_plane_3<CGAL::Convex_hull_traits_3<EPIC> >::Protector,CGAL::Protect_FPU_rounding<true> >::value) );
|
||||
CGAL_static_assertion( (boost::is_same<EPEC,Default_traits_for_Chull_3<EPEC::Point_3>::type>::value) );
|
||||
CGAL_static_assertion( (boost::is_same<SCD,Default_traits_for_Chull_3<SCD::Point_3>::type>::value) );
|
||||
CGAL_static_assertion( (boost::is_same<SCR,Default_traits_for_Chull_3<SCR::Point_3>::type>::value) );
|
||||
CGAL_static_assertion( (boost::is_same<EPEC,Default_traits_for_Chull_3<EPEC::Point_3>::type>::value) );
|
||||
CGAL_static_assertion( (boost::is_same<CGAL::Convex_hull_traits_3<EPIC>,Default_traits_for_Chull_3<EPIC::Point_3>::type>::value) );
|
||||
CGAL_static_assertion( (boost::is_same<Is_on_positive_side_of_plane_3<CGAL::Convex_hull_traits_3<EPIC> >::Protector,CGAL::Protect_FPU_rounding<true> >::value) );
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ void test_collinear()
|
|||
|
||||
// generate 100 points on the segment with endpoints (0,0) and (1,0)
|
||||
CGAL::Random_points_on_segment_2<Point_2> g(Point_2(0,0), Point_2(1,0));
|
||||
CGAL::copy_n(g, 100, std::back_inserter(point_2_list));
|
||||
CGAL::cpp0x::copy_n(g, 100, std::back_inserter(point_2_list));
|
||||
|
||||
std::list<Point_2>::iterator point_it = point_2_list.begin();
|
||||
point_3_list.push_back(Point_3(0,0,0));
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ int main()
|
|||
std::cerr << "Testing 500 random points" << std::endl;
|
||||
std::vector<Point_3> points;
|
||||
Generator g(500);
|
||||
CGAL::copy_n( g, num, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g, num, std::back_inserter(points));
|
||||
|
||||
assert(points.size() == num);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ int main()
|
|||
std::vector<Point_3> points;
|
||||
points.reserve(N);
|
||||
CGAL::Random_points_in_sphere_3<Point_3> g( 100.0);
|
||||
CGAL::copy_n( g, N, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g, N, std::back_inserter(points));
|
||||
timer.stop();
|
||||
std::cout << "Fill vector: " << timer.time() << " sec" << std::endl;
|
||||
timer.reset();
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ private slots:
|
|||
typedef CGAL::Creator_uniform_2< Point_2, Segment> Seg_creator;
|
||||
typedef CGAL::Join_input_iterator_2< P1, P2, Seg_creator> Seg_iterator;
|
||||
Seg_iterator g( p1, p2);
|
||||
CGAL::copy_n( g, 200, std::back_inserter(list_of_segments));
|
||||
CGAL::cpp0x::copy_n( g, 200, std::back_inserter(list_of_segments));
|
||||
something_changed();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Two kinds of point generators are provided: first, random point
|
|||
generators and second deterministic point generators. Most random
|
||||
point generators and a few deterministic point generators are provided
|
||||
as input iterators. The input iterators model an infinite sequence of
|
||||
points. The function \ccc{CGAL::copy_n()} can be used to copy a
|
||||
points. The function \ccc{CGAL::cpp0x::copy_n()} can be used to copy a
|
||||
finite sequence; see Section~\ref{sectionCopyN}. The iterator adaptor
|
||||
\ccc{Counting_iterator} can be used to create finite iterator
|
||||
ranges; see Section~\ref{sectionCountingIterator}.
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ spaced
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::points_on_segment<Point_2>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_disc_2<Point_2, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_disc_2<Point_2, Creator>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_sphere_3<Point_3, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_square_2<Point_2, Creator>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_sphere_3<Point_3, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ For every point $ p = \ccc{*g}$ and for all $ i<dim$ we have $ -a \le p[i] < a$.
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_square_2<Point_2, Creator>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_cube_3<Point_3, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Points_on_segment_2<Point_2>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_square_2<Point_2, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_disc_2<Point_2, Creator>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_cube_3<Point_3, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Points_on_segment_2<Point_2>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_disc_2<Point_2, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Points_on_segment_2<Point_2>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_disc_2<Point_2, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Points_on_segment_2<Point_2>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_disc_2<Point_2, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_on_circle_2<Point_2, Creator>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_cube_3<Point_3, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_on_circle_2<Point_2, Creator>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_on_sphere_3<Point_3, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ InputIterator \\
|
|||
|
||||
\ccSeeAlso
|
||||
|
||||
\ccRefIdfierPage{CGAL::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::cpp0x::copy_n} \\
|
||||
\ccRefIdfierPage{CGAL::Counting_iterator} \\
|
||||
\ccRefIdfierPage{CGAL::Points_on_segment_2<Point_2>} \\
|
||||
\ccRefIdfierPage{CGAL::Random_points_in_disc_2<Point_2, Creator>} \\
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ int main() {
|
|||
|
||||
// Create 600 points within a disc of radius 150.
|
||||
Random_points_in_disc_2<Point,Creator> g( 150.0);
|
||||
CGAL::copy_n( g, 600, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g, 600, std::back_inserter(points));
|
||||
|
||||
// Create 200 points from a 15 x 15 grid.
|
||||
points_on_square_grid_2( 250.0, 200, std::back_inserter(points),Creator());
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ int main() {
|
|||
|
||||
// Create 250 points within a disc of radius 150.
|
||||
Random_points_in_disc_2<Point,Creator> g( 150.0);
|
||||
CGAL::copy_n( g, 250, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g, 250, std::back_inserter(points));
|
||||
|
||||
// Check that we have really created 500 points.
|
||||
assert( points.size() == 500);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ int main() {
|
|||
typedef Creator_uniform_2< Point, Segment> Seg_creator;
|
||||
typedef Join_input_iterator_2< P1, P2, Seg_creator> Seg_iterator;
|
||||
Seg_iterator g( p1, p2);
|
||||
CGAL::copy_n( g, 200, std::back_inserter(segs));
|
||||
CGAL::cpp0x::copy_n( g, 200, std::back_inserter(segs));
|
||||
|
||||
assert( segs.size() == 200);
|
||||
for ( Vector::iterator i = segs.begin(); i != segs.end(); i++){
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ random_convex_set_2( std::size_t n,
|
|||
using std::partial_sum;
|
||||
using std::less;
|
||||
using std::max_element;
|
||||
using CGAL::copy_n;
|
||||
using CGAL::cpp0x::copy_n;
|
||||
|
||||
typedef typename Traits::Point_2 Point_2;
|
||||
typedef typename Traits::FT FT;
|
||||
|
|
@ -71,7 +71,7 @@ random_convex_set_2( std::size_t n,
|
|||
// build random point set:
|
||||
Container points;
|
||||
points.reserve( n);
|
||||
CGAL::copy_n( pg, n, back_inserter( points));
|
||||
CGAL::cpp0x::copy_n( pg, n, back_inserter( points));
|
||||
|
||||
// compute centroid of points:
|
||||
Point_2 centroid = CGAL::centroid( points.begin(), points.end(), t );
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ void test_point_generators_2() {
|
|||
std::vector<Point_2> points;
|
||||
points.reserve(1000);
|
||||
Random_points_in_disc_2<Point_2,Creator> g1( 100.0);
|
||||
CGAL::copy_n( g1, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g1, 100, std::back_inserter(points));
|
||||
Random_points_on_circle_2<Point_2,Creator> g2( 100.0);
|
||||
Random_points_in_square_2<Point_2,Creator> g3( 100.0);
|
||||
Random_points_on_square_2<Point_2,Creator> g4( 100.0);
|
||||
|
|
@ -65,11 +65,11 @@ void test_point_generators_2() {
|
|||
Points_on_segment_2<Point_2> g5a( Point_2( 50,-50),
|
||||
Point_2(-50, 50),
|
||||
50);
|
||||
CGAL::copy_n( g2, 100, std::back_inserter(points));
|
||||
CGAL::copy_n( g3, 100, std::back_inserter(points));
|
||||
CGAL::copy_n( g4, 100, std::back_inserter(points));
|
||||
CGAL::copy_n( g5, 50, std::back_inserter(points));
|
||||
CGAL::copy_n( g5a, 50, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g2, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g3, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g4, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g5, 50, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g5a, 50, std::back_inserter(points));
|
||||
points_on_square_grid_2( 50.0, (std::size_t)1,
|
||||
std::back_inserter(points), Creator());
|
||||
points_on_square_grid_2( 50.0, (std::size_t)2,
|
||||
|
|
@ -90,7 +90,7 @@ void test_point_generators_2() {
|
|||
// the 100 x 100 square. 10 pixel perturbation allowed.
|
||||
Random_points_in_square_2<Point_2,Creator> g6( 90.0);
|
||||
int count = 100 ;
|
||||
CGAL::copy_n( g6, count, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g6, count, std::back_inserter(points));
|
||||
std::vector<Point_2>::iterator i2 = points.end();
|
||||
std::vector<Point_2>::iterator i1 = i2 ;
|
||||
std::advance(i1,-count);
|
||||
|
|
@ -117,11 +117,11 @@ void test_point_generators_3() {
|
|||
std::vector<Point_3> points;
|
||||
points.reserve(500);
|
||||
Random_points_in_sphere_3<Point_3,Creator> g1( 100.0);
|
||||
CGAL::copy_n( g1, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g1, 100, std::back_inserter(points));
|
||||
Random_points_on_sphere_3<Point_3,Creator> g2( 100.0);
|
||||
Random_points_in_cube_3<Point_3,Creator> g3( 100.0);
|
||||
CGAL::copy_n( g2, 100, std::back_inserter(points));
|
||||
CGAL::copy_n( g3, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g2, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( g3, 100, std::back_inserter(points));
|
||||
points_on_cube_grid_3( 50.0, (std::size_t)1,
|
||||
std::back_inserter(points), Creator());
|
||||
points_on_cube_grid_3( 50.0, (std::size_t)2,
|
||||
|
|
@ -171,7 +171,7 @@ void test_point_generators_d()
|
|||
// 100 random points in dim 36
|
||||
std::cout<<" cube dim 36"<<std::flush;
|
||||
CGAL::Random_points_in_cube_d<Point> gen (36, 1.0);
|
||||
CGAL::copy_n( gen, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( gen, 100, std::back_inserter(points));
|
||||
i+=100;
|
||||
std::cout<<" done"<<std::endl;
|
||||
}
|
||||
|
|
@ -181,7 +181,7 @@ void test_point_generators_d()
|
|||
std::cout<<" in ball 4D"<<std::flush;
|
||||
Point o4(4,o,o+4);
|
||||
CGAL::Random_points_in_ball_d<Point> gen (4, 100.0);
|
||||
CGAL::copy_n( gen, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( gen, 100, std::back_inserter(points));
|
||||
std::cout<<" done"<<std::flush;
|
||||
for(ii=i+100; i<ii; ++i)
|
||||
CGAL_assertion( CGAL::squared_distance(o4,points[i]) <= 10000.0);
|
||||
|
|
@ -193,7 +193,7 @@ void test_point_generators_d()
|
|||
Point o3(3,o,o+3);
|
||||
Point g=o3;
|
||||
CGAL::Random_points_in_ball_d<Point> gen (3, 1.0);
|
||||
CGAL::copy_n( gen, nb_g, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( gen, nb_g, std::back_inserter(points));
|
||||
std::cout<<" done"<<std::flush;
|
||||
for(ii=i+nb_g; i<ii; ++i){
|
||||
CGAL_assertion( CGAL::squared_distance(o3,points[i]) <= 1.0);
|
||||
|
|
@ -208,7 +208,7 @@ void test_point_generators_d()
|
|||
std::cout<<" on sphere 26D"<<std::flush;
|
||||
Point o26(26,o,o+26);
|
||||
CGAL::Random_points_on_sphere_d<Point> gen (26, 1.0);
|
||||
CGAL::copy_n( gen, 100, std::back_inserter(points));
|
||||
CGAL::cpp0x::copy_n( gen, 100, std::back_inserter(points));
|
||||
std::cout<<" done"<<std::flush;
|
||||
for(ii=i+100; i<ii; ++i) {
|
||||
CGAL_assertion( CGAL::squared_distance(o26,points[i]) - 1.0 <= 0.1);
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ MainWindow::on_actionGenerateSegments_triggered()
|
|||
typedef CGAL::Creator_uniform_2< Point_2, Segment_2> Seg_creator;
|
||||
typedef CGAL::Join_input_iterator_2< Rpos_generator, Rpoc_generator, Seg_creator> Seg_iterator;
|
||||
Seg_iterator g( rpos, rpoc);
|
||||
CGAL::copy_n( g, 200, std::back_inserter(segments));
|
||||
CGAL::cpp0x::copy_n( g, 200, std::back_inserter(segments));
|
||||
|
||||
emit(changed());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ Nicolas Carrez
|
|||
Frédéric Cazals
|
||||
Raphaëlle Chaine
|
||||
Tran Kai Frank Da
|
||||
Guillaume Damiand
|
||||
Christophe Delage
|
||||
Olivier Devillers
|
||||
Katrin Dobrindt
|
||||
|
|
|
|||
|
|
@ -98,6 +98,20 @@ Number of lines of code of CGAL<br>
|
|||
|
||||
<HR>
|
||||
|
||||
<h2 id="release3.10">Release 3.10 </h2>
|
||||
<DIV>
|
||||
<p> Release date: XXX 2011</p>
|
||||
|
||||
<p>
|
||||
CGAL 3.10 offers the following improvements and new functionality : </p>
|
||||
|
||||
<h3>AABB tree</h3>
|
||||
<ul>
|
||||
<li>Document constness of member functions of the AABB_tree class.</li>
|
||||
<li>The class AABB_tree is now guaranteed to be read-only thread-safe. As usual in CGAL,
|
||||
this small overhead introduced for thread-safety can be deactivated by defining CGAL_HAS_NO_THREADS.</li>
|
||||
</ul>
|
||||
|
||||
<h2 id="release3.9">Release 3.9 </h2>
|
||||
<DIV>
|
||||
<p> Release date: XXX 2011</p>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue