mirror of https://github.com/CGAL/cgal
Improved readability of weighted point-related functors (no real changes)
Fixed indentation, trailing whitespace, english, etc.
This commit is contained in:
parent
046058fabe
commit
1223f5f5a0
|
|
@ -418,7 +418,6 @@ scaled_distance_to_lineC2( const FT &px, const FT &py,
|
|||
return determinant<FT>(px-rx, py-ry, qx-rx, qy-ry);
|
||||
}
|
||||
|
||||
|
||||
template < class RT >
|
||||
void
|
||||
weighted_circumcenter_translateC2(const RT &dqx, const RT &dqy, const RT &dqw,
|
||||
|
|
@ -461,7 +460,6 @@ weighted_circumcenterC2( const RT &px, const RT &py, const We &pw,
|
|||
y += py;
|
||||
}
|
||||
|
||||
|
||||
template < class RT , class We>
|
||||
void
|
||||
radical_axisC2(const RT &px, const RT &py, const We &pw,
|
||||
|
|
|
|||
|
|
@ -403,7 +403,6 @@ squared_areaC3(const FT &px, const FT &py, const FT &pz,
|
|||
return (CGAL_NTS square(vx) + CGAL_NTS square(vy) + CGAL_NTS square(vz))/4;
|
||||
}
|
||||
|
||||
|
||||
template <class FT>
|
||||
void
|
||||
determinants_for_weighted_circumcenterC3(
|
||||
|
|
@ -448,8 +447,7 @@ determinants_for_weighted_circumcenterC3(
|
|||
|
||||
template <class FT>
|
||||
void
|
||||
determinants_for_circumcenterC3(
|
||||
const FT &px, const FT &py, const FT &pz,
|
||||
determinants_for_circumcenterC3(const FT &px, const FT &py, const FT &pz,
|
||||
const FT &qx, const FT &qy, const FT &qz,
|
||||
const FT &rx, const FT &ry, const FT &rz,
|
||||
const FT &sx, const FT &sy, const FT &sz,
|
||||
|
|
@ -488,17 +486,15 @@ determinants_for_circumcenterC3(
|
|||
spx,spy,spz);
|
||||
}
|
||||
|
||||
|
||||
template < class FT>
|
||||
void
|
||||
weighted_circumcenterC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
|
||||
const FT &sx, const FT &sy, const FT &sz, const FT &sw,
|
||||
FT &x, FT &y, FT &z)
|
||||
{
|
||||
// this function compute the weighted circumcenter point only
|
||||
// this function computes the weighted circumcenter point only
|
||||
|
||||
// Translate p to origin and compute determinants
|
||||
FT num_x, num_y, num_z, den;
|
||||
|
|
@ -518,14 +514,13 @@ weighted_circumcenterC3(
|
|||
|
||||
template < class FT>
|
||||
void
|
||||
weighted_circumcenterC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
|
||||
const FT &sx, const FT &sy, const FT &sz, const FT &sw,
|
||||
FT &x, FT &y, FT &z, FT &w)
|
||||
{
|
||||
// this function compute the weighted circumcenter point
|
||||
// this function computes the weighted circumcenter point
|
||||
// and the squared weighted circumradius
|
||||
|
||||
// Translate p to origin and compute determinants
|
||||
|
|
@ -547,7 +542,6 @@ weighted_circumcenterC3(
|
|||
* CGAL_NTS square(inv) - pw;
|
||||
}
|
||||
|
||||
|
||||
template< class FT >
|
||||
FT
|
||||
squared_radius_orthogonal_sphereC3(
|
||||
|
|
@ -556,8 +550,7 @@ squared_radius_orthogonal_sphereC3(
|
|||
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
|
||||
const FT &sx, const FT &sy, const FT &sz, const FT &sw)
|
||||
{
|
||||
|
||||
// this function compute the squared weighted circumradius only
|
||||
// this function computes the squared weighted circumradius only
|
||||
|
||||
// Translate p to origin and compute determinants
|
||||
FT num_x, num_y, num_z, den;
|
||||
|
|
@ -570,12 +563,10 @@ squared_radius_orthogonal_sphereC3(
|
|||
CGAL_assertion( ! CGAL_NTS is_zero(den) );
|
||||
FT inv = FT(1)/(FT(2) * den);
|
||||
|
||||
return
|
||||
(CGAL_NTS square(num_x)+CGAL_NTS square(num_y)+CGAL_NTS square(num_z))
|
||||
return (CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z))
|
||||
* CGAL_NTS square(inv) - pw;
|
||||
}
|
||||
|
||||
|
||||
template <class FT>
|
||||
void
|
||||
determinants_for_weighted_circumcenterC3(
|
||||
|
|
@ -584,9 +575,8 @@ determinants_for_weighted_circumcenterC3(
|
|||
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
|
||||
FT &num_x, FT &num_y, FT &num_z, FT &den)
|
||||
{
|
||||
// translate origin to p
|
||||
// and compute determinants for weighted_circumcenter and
|
||||
// circumradius
|
||||
// translate origin to p and compute determinants for weighted_circumcenter
|
||||
// and circumradius
|
||||
|
||||
// Translate s to origin to simplify the expression.
|
||||
FT qpx = qx - px;
|
||||
|
|
@ -632,13 +622,12 @@ determinants_for_weighted_circumcenterC3(
|
|||
|
||||
template < class FT >
|
||||
void
|
||||
weighted_circumcenterC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
|
||||
FT &x, FT &y, FT &z)
|
||||
{
|
||||
// this function compute the weighted circumcenter point only
|
||||
// this function computes the weighted circumcenter point only
|
||||
|
||||
// Translate p to origin and compute determinants
|
||||
FT num_x, num_y, num_z, den;
|
||||
|
|
@ -655,16 +644,14 @@ weighted_circumcenterC3(
|
|||
z = pz + num_z*inv;
|
||||
}
|
||||
|
||||
|
||||
template < class FT >
|
||||
void
|
||||
weighted_circumcenterC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
|
||||
FT &x, FT &y, FT &z, FT &w)
|
||||
{
|
||||
// this function compute the weighted circumcenter and
|
||||
// this function computes the weighted circumcenter and
|
||||
// the weighted squared circumradius
|
||||
|
||||
// Translate p to origin and compute determinants
|
||||
|
|
@ -685,7 +672,6 @@ weighted_circumcenterC3(
|
|||
*CGAL_NTS square(inv) - pw;
|
||||
}
|
||||
|
||||
|
||||
template< class FT >
|
||||
CGAL_MEDIUM_INLINE
|
||||
FT
|
||||
|
|
@ -694,7 +680,7 @@ squared_radius_smallest_orthogonal_sphereC3(
|
|||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
const FT &rx, const FT &ry, const FT &rz, const FT &rw)
|
||||
{
|
||||
// this function compute the weighted squared circumradius only
|
||||
// this function computes the weighted squared circumradius only
|
||||
|
||||
// Translate p to origin and compute determinants
|
||||
FT num_x, num_y, num_z, den;
|
||||
|
|
@ -706,21 +692,17 @@ squared_radius_smallest_orthogonal_sphereC3(
|
|||
CGAL_assertion( den != FT(0) );
|
||||
FT inv = FT(1)/(FT(2) * den);
|
||||
|
||||
return
|
||||
(CGAL_NTS square(num_x)+CGAL_NTS square(num_y)+CGAL_NTS square(num_z))
|
||||
return (CGAL_NTS square(num_x) + CGAL_NTS square(num_y) + CGAL_NTS square(num_z))
|
||||
* CGAL_NTS square(inv) - pw;
|
||||
}
|
||||
|
||||
|
||||
|
||||
template < class FT >
|
||||
void
|
||||
weighted_circumcenterC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
FT &x, FT &y, FT &z)
|
||||
{
|
||||
// this function compute the weighted circumcenter point only
|
||||
// this function computes the weighted circumcenter point only
|
||||
FT qpx = qx - px;
|
||||
FT qpy = qy - py;
|
||||
FT qpz = qz - pz;
|
||||
|
|
@ -734,15 +716,13 @@ weighted_circumcenterC3(
|
|||
z = pz + alpha * qpz;
|
||||
}
|
||||
|
||||
|
||||
template < class FT >
|
||||
void
|
||||
weighted_circumcenterC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
weighted_circumcenterC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
FT &x, FT &y, FT &z, FT &w)
|
||||
{
|
||||
// this function compute the weighted circumcenter point and
|
||||
// this function computes the weighted circumcenter point and
|
||||
// the weighted circumradius
|
||||
FT qpx = qx - px;
|
||||
FT qpy = qy - py;
|
||||
|
|
@ -759,7 +739,6 @@ weighted_circumcenterC3(
|
|||
w = CGAL_NTS square(alpha) * qp2 - pw;
|
||||
}
|
||||
|
||||
|
||||
template< class FT >
|
||||
CGAL_MEDIUM_INLINE
|
||||
FT
|
||||
|
|
@ -767,8 +746,7 @@ squared_radius_smallest_orthogonal_sphereC3(
|
|||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw)
|
||||
{
|
||||
// this function computes
|
||||
// the weighted circumradius only
|
||||
// this function computes the weighted circumradius only
|
||||
FT qpx = qx - px;
|
||||
FT qpy = qy - py;
|
||||
FT qpz = qz - pz;
|
||||
|
|
@ -780,11 +758,9 @@ squared_radius_smallest_orthogonal_sphereC3(
|
|||
return CGAL_NTS square(alpha)*qp2 - pw;
|
||||
}
|
||||
|
||||
|
||||
template< class FT >
|
||||
FT
|
||||
power_productC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
power_productC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw)
|
||||
{
|
||||
// computes the power product of two weighted points
|
||||
|
|
@ -817,8 +793,7 @@ radical_axisC3(const RT &px, const RT &py, const RT &pz, const We & /* pw */,
|
|||
// circle orthogonal (p,pw), (q,qw), (r,rw), (s,sw)
|
||||
template < class FT>
|
||||
FT
|
||||
power_to_orthogonal_sphereC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
power_to_orthogonal_sphereC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
|
||||
const FT &sx, const FT &sy, const FT &sz, const FT &sw,
|
||||
|
|
@ -851,17 +826,13 @@ power_to_orthogonal_sphereC3(
|
|||
dqx, dqy, dqz, dqt,
|
||||
drx, dry, drz, drt,
|
||||
dsx, dsy, dsz, dst);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// compute the critical weight tw
|
||||
// where weighted point t is orthogonal to weighted points p, q,r,s
|
||||
template < class FT>
|
||||
FT
|
||||
power_distance_to_power_sphereC3(
|
||||
const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
power_distance_to_power_sphereC3(const FT &px, const FT &py, const FT &pz, const FT &pw,
|
||||
const FT &qx, const FT &qy, const FT &qz, const FT &qw,
|
||||
const FT &rx, const FT &ry, const FT &rz, const FT &rw,
|
||||
const FT &sx, const FT &sy, const FT &sz, const FT &sw,
|
||||
|
|
@ -870,7 +841,6 @@ power_distance_to_power_sphereC3(
|
|||
// the 5x5 det is a linear function of tw ff(tw)= ff(0) + tw ff(1)
|
||||
// the critical value for tw is - ff(0)/( ff(1) - ff(0))
|
||||
|
||||
|
||||
FT ff0 = power_to_orthogonal_sphereC3(px, py, pz, pw,
|
||||
qx, qy, qz, qw,
|
||||
rx, ry, rz, rw,
|
||||
|
|
@ -886,8 +856,6 @@ power_distance_to_power_sphereC3(
|
|||
return -ff0/(ff1 - ff0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// I will use this to test if the radial axis of three spheres
|
||||
// intersect the triangle formed by the centers.
|
||||
// // resolution of the system (where we note c the center)
|
||||
|
|
@ -915,8 +883,6 @@ power_distance_to_power_sphereC3(
|
|||
// return (CGAL_NTS square(Lambda)*dp+CGAL_NTS square(Mu)*dq
|
||||
// + FT2*Lambda*Mu*dpdq - rw);
|
||||
|
||||
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
#endif // CGAL_CONSTRUCTIONS_KERNEL_FTC3_H
|
||||
|
|
|
|||
|
|
@ -635,7 +635,6 @@ side_of_oriented_lineC2(const FT &a, const FT &b, const FT &c,
|
|||
return CGAL_NTS sign(a*x+b*y+c);
|
||||
}
|
||||
|
||||
|
||||
template <class FT>
|
||||
Comparison_result
|
||||
compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt,
|
||||
|
|
@ -648,7 +647,6 @@ compare_power_distanceC2(const FT& px, const FT& py, const FT& pwt,
|
|||
return CGAL_NTS compare(d1, d2);
|
||||
}
|
||||
|
||||
|
||||
template <class FT>
|
||||
Oriented_side
|
||||
power_side_of_oriented_power_circleC2( const FT &px, const FT &py, const FT &pwt,
|
||||
|
|
@ -699,7 +697,6 @@ power_side_of_oriented_power_circleC2( const FT &px, const FT &py, const FT &pwt
|
|||
return cmpy * sign_of_determinant(dpy, dpz, dqy, dqz);
|
||||
}
|
||||
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
#endif // CGAL_PREDICATES_KERNEL_FTC2_H
|
||||
|
|
|
|||
|
|
@ -301,7 +301,6 @@ namespace CommonKernelFunctors {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
template < typename K >
|
||||
class Compare_power_distance_3
|
||||
{
|
||||
|
|
@ -322,8 +321,6 @@ namespace CommonKernelFunctors {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
template < typename K >
|
||||
class Construct_weighted_circumcenter_3
|
||||
{
|
||||
|
|
@ -371,8 +368,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
//////////////////////
|
||||
|
||||
// operator ()
|
||||
// return the sign of the power test of last weighted point
|
||||
// with respect to the smallest sphere orthogonal to the others
|
||||
|
|
@ -433,7 +428,6 @@ public:
|
|||
CGAL_NTS square(p.z()-q.z()) +
|
||||
p.weight() - q.weight()));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
template < typename K >
|
||||
|
|
@ -500,8 +494,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
template < typename K >
|
||||
class Compute_weight_3
|
||||
{
|
||||
|
|
@ -517,9 +509,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
template < typename K >
|
||||
class Compute_power_product_3
|
||||
{
|
||||
|
|
@ -537,7 +526,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
template < typename K >
|
||||
class Compute_squared_radius_smallest_orthogonal_circle_2
|
||||
{
|
||||
|
|
@ -583,8 +571,7 @@ public:
|
|||
const Weighted_point_3 & r,
|
||||
const Weighted_point_3 & s) const
|
||||
{
|
||||
return squared_radius_orthogonal_sphereC3(
|
||||
p.x(), p.y(), p.z(), p.weight(),
|
||||
return squared_radius_orthogonal_sphereC3(p.x(), p.y(), p.z(), p.weight(),
|
||||
q.x(), q.y(), q.z(), q.weight(),
|
||||
r.x(), r.y(), r.z(), r.weight(),
|
||||
s.x(), s.y(), s.z(), s.weight());
|
||||
|
|
@ -594,8 +581,7 @@ public:
|
|||
const Weighted_point_3 & q,
|
||||
const Weighted_point_3 & r) const
|
||||
{
|
||||
return squared_radius_smallest_orthogonal_sphereC3(
|
||||
p.x(), p.y(), p.z(), p.weight(),
|
||||
return squared_radius_smallest_orthogonal_sphereC3(p.x(), p.y(), p.z(), p.weight(),
|
||||
q.x(), q.y(), q.z(), q.weight(),
|
||||
r.x(), r.y(), r.z(), r.weight());
|
||||
}
|
||||
|
|
@ -603,8 +589,7 @@ public:
|
|||
FT operator()(const Weighted_point_3 & p,
|
||||
const Weighted_point_3 & q) const
|
||||
{
|
||||
return squared_radius_smallest_orthogonal_sphereC3(
|
||||
p.x(), p.y(), p.z(), p.weight(),
|
||||
return squared_radius_smallest_orthogonal_sphereC3(p.x(), p.y(), p.z(), p.weight(),
|
||||
q.x(), q.y(), q.z(), q.weight());
|
||||
}
|
||||
|
||||
|
|
@ -612,10 +597,8 @@ public:
|
|||
{
|
||||
return - p.weight();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Compute the square radius of the sphere centered in t
|
||||
// and orthogonal to the sphere orthogonal to p,q,r,s
|
||||
template< typename K>
|
||||
|
|
@ -641,29 +624,23 @@ class Compute_power_distance_to_power_sphere_3
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <typename K>
|
||||
class Compare_weighted_squared_radius_3
|
||||
{
|
||||
|
||||
public:
|
||||
typedef typename K::Weighted_point_3 Weighted_point_3;
|
||||
typedef typename K::Comparison_result Comparison_result;
|
||||
typedef typename K::FT FT;
|
||||
|
||||
public:
|
||||
typedef Comparison_result result_type;
|
||||
|
||||
|
||||
result_type operator() (
|
||||
const Weighted_point_3 & p,
|
||||
result_type operator()(const Weighted_point_3 & p,
|
||||
const Weighted_point_3 & q,
|
||||
const Weighted_point_3 & r,
|
||||
const Weighted_point_3 & s,
|
||||
const FT& w) const
|
||||
{
|
||||
return CGAL::compare(
|
||||
squared_radius_orthogonal_sphereC3(
|
||||
return CGAL::compare(squared_radius_orthogonal_sphereC3(
|
||||
p.x(),p.y(),p.z(),p.weight(),
|
||||
q.x(),q.y(),q.z(),q.weight(),
|
||||
r.x(),r.y(),r.z(),r.weight(),
|
||||
|
|
@ -671,47 +648,35 @@ public:
|
|||
w);
|
||||
}
|
||||
|
||||
result_type operator() (
|
||||
const Weighted_point_3 & p,
|
||||
result_type operator()(const Weighted_point_3 & p,
|
||||
const Weighted_point_3 & q,
|
||||
const Weighted_point_3 & r,
|
||||
const FT& w) const
|
||||
{
|
||||
return CGAL::compare(
|
||||
squared_radius_smallest_orthogonal_sphereC3(
|
||||
return CGAL::compare(squared_radius_smallest_orthogonal_sphereC3(
|
||||
p.x(),p.y(),p.z(),p.weight(),
|
||||
q.x(),q.y(),q.z(),q.weight(),
|
||||
r.x(),r.y(),r.z(),r.weight()),
|
||||
w);
|
||||
}
|
||||
|
||||
result_type operator() (
|
||||
const Weighted_point_3 & p,
|
||||
result_type operator()(const Weighted_point_3 & p,
|
||||
const Weighted_point_3 & q,
|
||||
const FT& w) const
|
||||
{
|
||||
return CGAL::compare(
|
||||
squared_radius_smallest_orthogonal_sphereC3(
|
||||
return CGAL::compare(squared_radius_smallest_orthogonal_sphereC3(
|
||||
p.x(),p.y(),p.z(),p.weight(),
|
||||
q.x(),q.y(),q.z(),q.weight()),
|
||||
w);
|
||||
}
|
||||
|
||||
result_type operator() (
|
||||
const Weighted_point_3 & p,
|
||||
result_type operator()(const Weighted_point_3 & p,
|
||||
const FT& w) const
|
||||
{
|
||||
return CGAL::compare(-p.weight(), w);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////
|
||||
|
||||
|
||||
|
||||
template <typename K>
|
||||
class Compare_squared_distance_2
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue