mirror of https://github.com/CGAL/cgal
Add the functor Non_zero_dimension_3 to the Kernel
This commit is contained in:
parent
6a2be4d710
commit
e98198178f
|
|
@ -37,6 +37,41 @@ namespace CGAL {
|
||||||
|
|
||||||
namespace CommonKernelFunctors {
|
namespace CommonKernelFunctors {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template <typename K>
|
||||||
|
class Non_zero_dimension_3
|
||||||
|
{
|
||||||
|
typedef typename K::Vector_3 Vector_3;
|
||||||
|
|
||||||
|
public:
|
||||||
|
typedef int result_type;
|
||||||
|
|
||||||
|
int operator()(const Vector_3& vec) const
|
||||||
|
{
|
||||||
|
int dir = -1;
|
||||||
|
if(certainly_not(is_zero(vec.x()))){
|
||||||
|
dir = 0;
|
||||||
|
} else if(certainly_not(is_zero(vec.y()))){
|
||||||
|
dir = 1;
|
||||||
|
}else if(certainly_not(is_zero(vec.y()))){
|
||||||
|
dir = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(dir == -1){
|
||||||
|
if(! is_zero(vec.x())){
|
||||||
|
return 0;
|
||||||
|
} else if(! is_zero(vec.y())){
|
||||||
|
return 1;
|
||||||
|
} else if(! is_zero(vec.z())){
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename K>
|
template <typename K>
|
||||||
class Are_ordered_along_line_2
|
class Are_ordered_along_line_2
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -582,6 +582,8 @@ CGAL_Kernel_pred(Less_y_3,
|
||||||
less_y_3_object)
|
less_y_3_object)
|
||||||
CGAL_Kernel_pred(Less_z_3,
|
CGAL_Kernel_pred(Less_z_3,
|
||||||
less_z_3_object)
|
less_z_3_object)
|
||||||
|
CGAL_Kernel_pred(Non_zero_dimension_3,
|
||||||
|
non_zero_dimension_3_object)
|
||||||
CGAL_Kernel_pred_RT(Orientation_2,
|
CGAL_Kernel_pred_RT(Orientation_2,
|
||||||
orientation_2_object)
|
orientation_2_object)
|
||||||
CGAL_Kernel_pred_RT(Orientation_3,
|
CGAL_Kernel_pred_RT(Orientation_3,
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,9 @@ Bounded_side bounded_side_3(IteratorForward first,
|
||||||
we don't need to care about the plane orientation */
|
we don't need to care about the plane orientation */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typename R::Non_zero_dimension_3 non_zero_dimension_3;
|
||||||
|
int dir = non_zero_dimension_3(plane.orthogonal_vector());
|
||||||
|
#if 0
|
||||||
auto apv = approx(plane.orthogonal_vector());
|
auto apv = approx(plane.orthogonal_vector());
|
||||||
|
|
||||||
int dir = 0;
|
int dir = 0;
|
||||||
|
|
@ -112,7 +113,7 @@ Bounded_side bounded_side_3(IteratorForward first,
|
||||||
if(CGAL::abs(apv.z().sup()) > max){
|
if(CGAL::abs(apv.z().sup()) > max){
|
||||||
dir = 2;
|
dir = 2;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CGAL_assertion(!plane.is_degenerate());
|
CGAL_assertion(!plane.is_degenerate());
|
||||||
Point_2 (*t)(const Point_3&);
|
Point_2 (*t)(const Point_3&);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue