Add static filter for Is_degenerate

This commit is contained in:
Andreas Fabri 2011-11-30 13:48:15 +00:00
parent f5bd032a9a
commit 63c1b84c0d
2 changed files with 89 additions and 1 deletions

View File

@ -0,0 +1,83 @@
// Copyright (c) 2011 GeometryFactory (France)
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
//
// Author(s) : Andreas Fabri, Laurent Rineau
#ifndef CGAL_INTERNAL_STATIC_FILTERS_IS_DEGENERATE_3_H
#define CGAL_INTERNAL_STATIC_FILTERS_IS_DEGENERATE_3_H
namespace CGAL {
namespace internal {
namespace Static_filters_predicates {
template < typename K_base >
class Is_degenerate_3
: public K_base::Is_degenerate_3
{
typedef typename K_base::Ray_3 Ray_3;
typedef typename K_base::Segment_3 Segment_3;
typedef typename K_base::Is_degenerate_3 Base;
typedef typename K_base::Construct_source_3 Construct_source_3;
typedef typename K_base::Construct_target_3 Construct_target_3;
typedef typename K_base::Construct_second_point_3 Construct_second_point_3;
typedef typename K_base::Equal_3 Equal_3;
public:
typedef typename Base::result_type result_type;
#ifndef CGAL_CFG_MATCHING_BUG_6
using Base::operator();
#else
template <typename T>
result_type
operator()(const T& t) const
{
return Base()(t);
}
#endif
result_type
operator()(const Segment_3& s) const
{
return Equal_3()(Construct_source_3()(s), Construct_target_3()(s));
}
result_type
operator()(const Ray_3& r) const
{
return Equal_3()(Construct_source_3()(r), Construct_second_point_3()(r));
}
}; // class Is_degenerate_3
} // namespace Static_filters_predicates
} // namespace internal
} //namespace CGAL
#endif // CGAL_INTERNAL_STATIC_FILTERS_IS_DEGENERATE_3_H

View File

@ -37,6 +37,7 @@
#include <CGAL/internal/Static_filters/tools.h>
#include <CGAL/internal/Static_filters/Orientation_2.h>
#include <CGAL/internal/Static_filters/Orientation_3.h>
# include <CGAL/internal/Static_filters/Is_degenerate_3.h>
#ifndef CGAL_NO_ANGLE_3_STATIC_FILTERS
# include <CGAL/internal/Static_filters/Angle_3.h>
#endif // CGAL_NO_ANGLE_3_STATIC_FILTERS
@ -88,7 +89,7 @@ class Static_filters : public K_base {
has_cheap_access_to_cartesian_coordinates> Self;
public:
typedef Static_filters_predicates::Is_degenerate_3<K_base> Is_degenerate_3;
typedef Static_filters_predicates::Orientation_2<K_base> Orientation_2;
typedef Static_filters_predicates::Orientation_3<K_base> Orientation_3;
#ifndef CGAL_NO_ANGLE_3_STATIC_FILTERS
@ -109,6 +110,10 @@ public:
orientation_3_object() const
{ return Orientation_3(); }
Is_degenerate_3
is_degenerate_3_object() const
{ return Is_degenerate_3(); }
#ifndef CGAL_NO_ANGLE_3_STATIC_FILTERS
Angle_3
angle_3_object() const