diff --git a/Kernel_23/doc/Kernel_23/CGAL/Weighted_point_2.h b/Kernel_23/doc/Kernel_23/CGAL/Weighted_point_2.h index a692083ee3f..22cdb2a9dd7 100644 --- a/Kernel_23/doc/Kernel_23/CGAL/Weighted_point_2.h +++ b/Kernel_23/doc/Kernel_23/CGAL/Weighted_point_2.h @@ -3,7 +3,7 @@ namespace CGAL { /*! \ingroup kernel_classes2 -An object of the class `Weighted_point_2` is .... +An object of the class `Weighted_point_2` is a tuple of a 2D point and a scalar weight. \cgalHeading{Operators} @@ -15,7 +15,7 @@ The following operations can be applied on points: */ template< typename Kernel > -class Weighted_point_2 : public Point_2 { +class Weighted_point_2 { public: @@ -43,11 +43,16 @@ introduces a weighted point from point `p` and weight `w`. /// \name Operations /// @{ +/*! +returns the weight of the weighted point. +*/ + Point_2 point() const; + /*! returns the weight of the weighted point. */ - FT weight() const; + Kernel::FT weight() const; /// @} }; diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index 61c707368b2..f9b07b9f27a 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -922,9 +922,33 @@ public: \cgalRefines `AdaptableFunctor` (with three arguments) - \sa `Kernel::CompareSquaredDistance_3` - \sa `compare_distance_to_point_grp` - \sa `compare_squared_distance_grp` + \sa `CGAL::Weighted_point_2` + +*/ +class ComparePowerDistance_2 { + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! + compares the power distance between `p` and `q` to the power distance between `p` and `r`. + */ + Comparison_result operator()(const Kernel::Point_2& p, + const Kernel::Weighted_point_2& q, + const Kernel::Weighted_point_2& r); + + + + /// @} +}; + +/*! + \ingroup PkgKernel23ConceptsFunctionObjects + \cgalConcept + + \cgalRefines `AdaptableFunctor` (with three arguments) + + \sa `CGAL::Weighted_point_3` */ class ComparePowerDistance_3 { @@ -945,7 +969,7 @@ public: /// @} -}; /* end Kernel::CompareDistance_3 */ +}; /* end Kernel::ComparePowerDistance_3 */ @@ -2307,6 +2331,59 @@ public: }; /* end Kernel::ComputeHz_3 */ +/*! + \ingroup PkgKernel23ConceptsFunctionObjects + \cgalConcept + + \sa `CGAL::Weighted_point_3` + + \cgalRefines `AdaptableFunctor` (with five arguments) + +*/ +class ComputePowerDistanceToPowerSphere_3 { + + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! + returns the squared radius of the sphere centered in `t` +// and orthogonal to the sphere orthogonal to `p`, `q`, `r` ,and `s`. + */ + Kernel::FT operator()(const Kernel::Weighted_point_3& p, + const Kernel::Weighted_point_3& q, + const Kernel::Weighted_point_3& r, + const Kernel::Weighted_point_3& s, + const Kernel::Weighted_point_3& t + ) const; + + /// @} +}; + +/*! + \ingroup PkgKernel23ConceptsFunctionObjects + \cgalConcept + + \sa `CGAL::Weighted_point_3` + + \cgalRefines `AdaptableFunctor` (with two arguments) + +*/ +class ComputePowerProduct_3 { + + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! + returns the .... of `p` and `q`. + */ + Kernel::FT operator()(const Kernel::Weighted_point_3& p, + const Kernel::Weighted_point_3& q) const; + + /// @} +}; + /*! \ingroup PkgKernel23ConceptsFunctionObjects \cgalConcept @@ -5617,6 +5694,21 @@ public: }; /* end Kernel::ConstructProjectedXYPoint_2 */ + + +/*! + \ingroup PkgKernel23ConceptsFunctionObjects + \cgalConcept + + \cgalRefines `AdaptableFunctor` (with two arguments) + + \sa `CGAL::Weighted_point_2` + +*/ +class ConstructRadicalAxis_2 { +}; + + /*! \ingroup PkgKernel23ConceptsFunctionObjects \cgalConcept @@ -6632,6 +6724,29 @@ public: }; /* end Kernel::ConstructVertex_3 */ +/*! + \ingroup PkgKernel23ConceptsFunctionObjects +\cgalConcept + +\cgalRefines `AdaptableFunctor` (with two arguments) + +\sa `CGAL::Weighted_point_2` + +*/ +class ConstructWeightedCircumcenter_2 { +public: + + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! + constructs the point which is the center of the smallest orthogonal circle to the input weighted points. + */ + Kernel::Point_2 operator()(const Kernel::Weighted_point_2& p, const Kernel::Weighted_point_2& q, const Kernel::Weighted_point_3& s); + +}; /* end Kernel::ConstructWeightedCircumcenter_2 + /*! \ingroup PkgKernel23ConceptsFunctionObjects @@ -6710,69 +6825,6 @@ public: -/*! - \ingroup PkgKernel23ConceptsFunctionObjects - \cgalConcept - -*/ - class PowerSideOfPowerSphere_3 { - public: - /*! -Let \f$ {z(p,q,r,s)}^{(w)}\f$ be the power sphere of the weighted points -\f$ (p,q,r,s)\f$. Returns - -- `ON_ORIENTED_BOUNDARY` if `t` is orthogonal to - \f$ {z(p,q,r,s)}^{(w)}\f$, - -- `ON_NEGATIVE_SIDE` if `t` lies outside the oriented sphere of - center \f$ z(p,q,r,s)\f$ and radius \f$ \sqrt{ w_{z(p,q,r,s)}^2 + w_t^2 }\f$ - (which is equivalent to \f$ \Pi({t}^{(w)},{z(p,q,r,s)}^{(w)} >0\f$)), - -- `ON_POSITIVE_SIDE` if `t` lies inside this oriented sphere. - -\pre `p, q, r, s` are not coplanar. -Note that with this definition, if all the points have a weight equal -to 0, then -`power_side_of_power_sphere_3(p,q,r,s,t)` = `side_of_oriented_sphere(p,q,r,s,t)`. - - */ - Oriented_side operator()( const Kernel::Weighted_point_3& p, const Kernel::Weighted_point_3& q, const Kernel::Weighted_point_3& r, const Kernel::Weighted_point_3& s, const Kernel::Weighted_point_3& t) const; - - - /*! - Analogous to the previous method, for coplanar points, - with the power circle \f$ {z(p,q,r)}^{(w)}\f$. - \pre `p, q, r` are not collinear and `p, q, r, t` are coplanar. - If all the points have a weight equal to 0, then - `power_test_3(p,q,r,t)` = `side_of_oriented_circle(p,q,r,t)`. - */ - Oriented_side operator()( const Kernel::Weighted_point_3& p, const Kernel::Weighted_point_3& q, const Kernel::Weighted_point_3& r, const Kernel::Weighted_point_3& t) const; - - /*! - which is the same for collinear points, where \f$ {z(p,q)}^{(w)}\f$ is the - power segment of `p` and `q`. - \pre `p` and `q` have different bare points, and `p, q, t` are collinear. - If all points have a weight equal to 0, then - `power_side_of_power_sphere_3(p,q,t)` gives the same answer as the kernel predicate - `s(p,q).has_on(t)` would give, where `s(p,q)` denotes the - segment with endpoints `p` and `q`. - */ - - Oriented_side operator()( const Kernel::Weighted_point_3& p, const Kernel::Weighted_point_3& q, const Kernel::Weighted_point_3& t) const; - - /*! - which is the same for equal points, that is when `p` and `q` - have equal coordinates, then it returns the comparison of the weights - (`ON_POSITIVE_SIDE` when `q` is heavier than `p`). - \pre `p` and `q` have equal bare points. - */ - - Oriented_side operator()( const Kernel::Weighted_point_3& p, const Kernel::Weighted_point_3& q) const; - - - }; - - /*! \ingroup PkgKernel23ConceptsFunctionObjects @@ -7845,6 +7897,39 @@ public: }; /* end Kernel::HasOn_3 */ + + +/*! + \ingroup PkgKernel23ConceptsFunctionObjects + \cgalConcept + + \cgalRefines `AdaptableFunctor` (with five arguments) + + \sa `CGAL::Weighted_point_3` + +*/ +class InSmallestOrthogonalSphere_3 { +public: + + /// \name Operations + /// A model of this concept must provide: + /// @{ + + /*! + return the sign of the power test of last weighted point + with respect to the smallest sphere orthogonal to the others. + */ + CGAL::Sign + operator()(const Kernel::Weighted_point_3 & p, + const Kernel::Weighted_point_3 & q, + const Kernel::Weighted_point_3 & r, + const Kernel::Weighted_point_3 & s, + const Kernel::Weighted_point_3 & t); + + /// @} + +}; /* end Kernel::Intersect_2 */ + /*! \ingroup PkgKernel23ConceptsFunctionObjects \cgalConcept @@ -8557,6 +8642,116 @@ public: }; /* end Kernel::LessZ_3 */ + +/*! + \ingroup PkgKernel23ConceptsFunctionObjects + \cgalConcept + +*/ + class PowerSideOfPowerCircle_2 { + public: + +/*! +power test for points `p`, `q`, `r` and `s`. +\pre the bare points corresponding to `p`, `q`, `r` are not collinear. +*/ + + Oriented_side operator() ( const Kernel::Weighted_point_2& p, + const Kernel::Weighted_point_2& q, + const Kernel::Weighted_point_2& r, + const Kernel::Weighted_point_2& s); + +/*! + degenerated power test for collinear points `p`, `q`, `r`. + \pre the bare points corresponding to `p`, `q`, `r` are collinear and `p != q`. +*/ + Oriented_side operator() ( const Kernel::Weighted_point_2& p, + const Kernel::Weighted_point_2& q, + const Kernel::Weighted_point_2& r); +/*! +degenerated power test for weighted points +`p` and `q` whose corresponding bare-points are identical. +\pre the bare points corresponding to `p` and `q` are identical. +*/ +Oriented_side operator() ( Wconst Kernel::eighted_point_2& p, + const Kernel::Weighted_point_2& q); + + + }; + +/*! + \ingroup PkgKernel23ConceptsFunctionObjects + \cgalConcept + +*/ + class PowerSideOfPowerSphere_3 { + public: + /*! +Let \f$ {z(p,q,r,s)}^{(w)}\f$ be the power sphere of the weighted points +\f$ (p,q,r,s)\f$. Returns + +- `ON_ORIENTED_BOUNDARY` if `t` is orthogonal to + \f$ {z(p,q,r,s)}^{(w)}\f$, + +- `ON_NEGATIVE_SIDE` if `t` lies outside the oriented sphere of + center \f$ z(p,q,r,s)\f$ and radius \f$ \sqrt{ w_{z(p,q,r,s)}^2 + w_t^2 }\f$ + (which is equivalent to \f$ \Pi({t}^{(w)},{z(p,q,r,s)}^{(w)} >0\f$)), + +- `ON_POSITIVE_SIDE` if `t` lies inside this oriented sphere. + +\pre `p, q, r, s` are not coplanar. +Note that with this definition, if all the points have a weight equal +to 0, then +`power_side_of_power_sphere_3(p,q,r,s,t)` = `side_of_oriented_sphere(p,q,r,s,t)`. + + */ + Oriented_side operator()( const Kernel::Weighted_point_3& p, + const Kernel::Weighted_point_3& q, + const Kernel::Weighted_point_3& r, + const Kernel::Weighted_point_3& s, + const Kernel::Weighted_point_3& t) const; + + + /*! + Analogous to the previous method, for coplanar points, + with the power circle \f$ {z(p,q,r)}^{(w)}\f$. + \pre `p, q, r` are not collinear and `p, q, r, t` are coplanar. + If all the points have a weight equal to 0, then + `power_test_3(p,q,r,t)` = `side_of_oriented_circle(p,q,r,t)`. + */ + Oriented_side operator()( const Kernel::Weighted_point_3& p, + const Kernel::Weighted_point_3& q, + const Kernel::Weighted_point_3& r, + const Kernel::Weighted_point_3& t) const; + + /*! + which is the same for collinear points, where \f$ {z(p,q)}^{(w)}\f$ is the + power segment of `p` and `q`. + \pre `p` and `q` have different bare points, and `p, q, t` are collinear. + If all points have a weight equal to 0, then + `power_side_of_power_sphere_3(p,q,t)` gives the same answer as the kernel predicate + `s(p,q).has_on(t)` would give, where `s(p,q)` denotes the + segment with endpoints `p` and `q`. + */ + + Oriented_side operator()( const Kernel::Weighted_point_3& p, + const Kernel::Weighted_point_3& q, + const Kernel::Weighted_point_3& t) const; + + /*! + which is the same for equal points, that is when `p` and `q` + have equal coordinates, then it returns the comparison of the weights + (`ON_POSITIVE_SIDE` when `q` is heavier than `p`). + \pre `p` and `q` have equal bare points. + */ + + Oriented_side operator()( const Kernel::Weighted_point_3& p, + const Kernel::Weighted_point_3& q) const; + + + }; + + /*! \ingroup PkgKernel23ConceptsFunctionObjects \cgalConcept diff --git a/Kernel_23/doc/Kernel_23/Concepts/GeomObjects.h b/Kernel_23/doc/Kernel_23/Concepts/GeomObjects.h index 04916407240..45c1fbc8ee4 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/GeomObjects.h +++ b/Kernel_23/doc/Kernel_23/Concepts/GeomObjects.h @@ -775,4 +775,52 @@ public: }; /* end Kernel::Vector_3 */ + +/*! + \ingroup PkgKernel23ConceptsGeomObject +\cgalConcept + +A type representing weighted points in two dimensions. + +\cgalRefines CopyConstructible +\cgalRefines Assignable +\cgalRefines DefaultConstructible + +\sa `CGAL::Weighted_point_3` + +\sa `ComparePowerDistance_2` +\sa `ConstructWeightedCircumcenter_2` +\sa `PowerSideOfPowerCircle_2` + +*/ +class WeightedPoint_2 { +public: + +}; /* end Kernel::WeightedPoint_3 */ + +/*! + \ingroup PkgKernel23ConceptsGeomObject +\cgalConcept + +A type representing weighted points in three dimensions. + +\cgalRefines CopyConstructible +\cgalRefines Assignable +\cgalRefines DefaultConstructible + +\sa `CGAL::Weighted_point_3` + +\sa `ComparePowerDistance_3` +\sa `ComputePowerDistanceToPowerSphere_3` +\sa `ComputePowerProduct_3` +\sa `ConstructWeightedCircumcenter_3` +\sa `InSmallestOrthogonalSphere_3` +\sa `PowerSideOfPowerSphere_3` + +*/ +class WeightedPoint_3 { +public: + +}; /* end Kernel::WeightedPoint_3 */ + } /* end namespace Kernel */ diff --git a/Kernel_23/doc/Kernel_23/Concepts/Kernel.h b/Kernel_23/doc/Kernel_23/Concepts/Kernel.h index 0ae52b87ba6..c0650ef72eb 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/Kernel.h +++ b/Kernel_23/doc/Kernel_23/Concepts/Kernel.h @@ -126,7 +126,7 @@ public: typedef unspecified_type Point_2; /*! - a model of `Kernel::Weighted_point_2` + a model of `Kernel::WeightedPoint_2` */ typedef unspecified_type Weighted_point_2; @@ -777,7 +777,7 @@ public: typedef unspecified_type Point_3; /*! - a model of `Kernel::Weighted_point_3` + a model of `Kernel::WeightedPoint_3` */ typedef unspecified_type Weighted_point_3; diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 7d3cc29a974..a844f35f5dc 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -574,8 +574,8 @@ public: }; -// Compute the square radius of the circle centered in t -// and orthogonal to the circle orthogonal to p,q,r,s +// Compute the square radius of the sphere centered in t +// and orthogonal to the sphere orthogonal to p,q,r,s template< typename K> class Compute_power_distance_to_power_sphere_3 {