mirror of https://github.com/CGAL/cgal
use an input range instead of an input iterator in the traits
This commit is contained in:
parent
c0f0b1cd32
commit
201e76025a
|
|
@ -20,10 +20,10 @@ public:
|
|||
/// It must provide `Geom_traits::FT`, `Geom_traits::Point_3` and `Geom_traits::Vector_3`.
|
||||
/// `Geom_traits::FT` must be a floating point number type like `double` or `float`.
|
||||
typedef unspecified_type Geom_traits;
|
||||
/// Random access iterator used to get the input points and normals.
|
||||
typedef InputIt Input_iterator;
|
||||
/// a model of `ReadablePropertyMap` with `Input_iterator` as key type and `Geom_traits::Point_3` as value type
|
||||
typedef Ppmap Point_map;
|
||||
/// a model of `ReadablePropertyMap` with `Input_iterator` as key type and `Geom_traits::Vector_3` as value type
|
||||
typedef Npmap Normal_map;
|
||||
/// Model of the concept `boost:RandomAccessRange` providing input points and normals.
|
||||
typedef unspecified_type Input_range;
|
||||
/// a model of `ReadablePropertyMap` with `Input_range::iterator` as key type and `Geom_traits::Point_3` as value type.
|
||||
typedef unspecified_type Point_map;
|
||||
/// a model of `ReadablePropertyMap` with `Input_range::iterator` as key type and `Geom_traits::Vector_3` as value type.
|
||||
typedef unspecified_type Normal_map;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ typedef CGAL::Normal_of_point_with_normal_pmap<Kernel> Normal_map;
|
|||
// In Efficient_RANSAC_traits the basic types, i.e., Point and Vector types
|
||||
// as well as iterator type and property maps, are defined.
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC_traits
|
||||
<Kernel, Pwn_vector::iterator, Point_map, Normal_map> Traits;
|
||||
<Kernel, Pwn_vector, Point_map, Normal_map> Traits;
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC<Traits> Efficient_ransac;
|
||||
typedef CGAL::Shape_detection_3::Plane<Traits> Plane;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ typedef CGAL::Normal_of_point_with_normal_pmap<Kernel> Normal_map;
|
|||
// In Efficient_RANSAC_traits the basic types, i.e., Point and Vector types
|
||||
// as well as iterator type and property maps, are defined.
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC_traits<Kernel,
|
||||
Pwn_vector::iterator, Point_map, Normal_map> Traits;
|
||||
Pwn_vector, Point_map, Normal_map> Traits;
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC<Traits> Efficient_ransac;
|
||||
typedef CGAL::Shape_detection_3::Cone<Traits> Cone;
|
||||
typedef CGAL::Shape_detection_3::Cylinder<Traits> Cylinder;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ typedef CGAL::Normal_of_point_with_normal_pmap<Kernel> Normal_map;
|
|||
// In Efficient_RANSAC_traits the basic types, i.e., Point and Vector types
|
||||
// as well as iterator type and property maps, are defined.
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC_traits<Kernel,
|
||||
Pwn_vector::iterator, Point_map, Normal_map> Traits;
|
||||
Pwn_vector, Point_map, Normal_map> Traits;
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC<Traits> Efficient_ransac;
|
||||
typedef CGAL::Shape_detection_3::Plane<Traits> Plane;
|
||||
|
||||
|
|
|
|||
|
|
@ -51,8 +51,6 @@ namespace CGAL {
|
|||
class Cone : public Shape_base<Traits> {
|
||||
public:
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
typedef typename Traits::Input_iterator Input_iterator;
|
||||
///< random access iterator for input data.
|
||||
typedef typename Traits::Point_map Point_map;
|
||||
///< property map to access the location of an input point.
|
||||
typedef typename Traits::Normal_map Normal_map;
|
||||
|
|
|
|||
|
|
@ -49,8 +49,6 @@ namespace CGAL {
|
|||
class Cylinder : public Shape_base<Traits> {
|
||||
public:
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
typedef typename Traits::Input_iterator Input_iterator;
|
||||
///< random access iterator for input data.
|
||||
typedef typename Traits::Point_map Point_map;
|
||||
///< property map to access the location of an input point.
|
||||
typedef typename Traits::Normal_map Normal_map;
|
||||
|
|
|
|||
|
|
@ -88,8 +88,7 @@ shape. The implementation follows \cgalCite{Schnabel07}.
|
|||
|
||||
/// \name Types
|
||||
/// @{
|
||||
typedef typename Traits::Input_iterator Input_iterator;
|
||||
///< random access iterator for input data.
|
||||
typedef typename Traits::Input_range::iterator Input_iterator;
|
||||
typedef typename Traits::Geom_traits::FT FT; ///< number type.
|
||||
typedef typename Traits::Geom_traits::Point_3 Point; ///< point type.
|
||||
typedef typename Traits::Geom_traits::Vector_3 Vector; ///< vector type.
|
||||
|
|
@ -109,7 +108,7 @@ shape. The implementation follows \cgalCite{Schnabel07}.
|
|||
///< Range of extracted shapes with typ `Shape *`. Model of the `ConstRange` concept.
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
typedef unspecified_type Point_index_range; ///< Range of indices of points of type `std::size_t` into the provided Input_iterator. Model of the `boost::BidirectionalRange` concept.
|
||||
typedef unspecified_type Point_index_range; ///< Range of indices of points of type `std::size_t` into the provided input point range. Model of the `boost::BidirectionalRange` concept.
|
||||
|
||||
#else
|
||||
typedef typename boost::iterator_range<Point_index_iterator>
|
||||
|
|
@ -184,10 +183,9 @@ shape. The implementation follows \cgalCite{Schnabel07}.
|
|||
results is required. The data in the input range is reordered during
|
||||
`detect()` and `build_octrees()`. `clear()` is first called by this function.
|
||||
*/
|
||||
template <class RandomAccessInputRange>
|
||||
void set_input_data(
|
||||
///< Range of input data providing 'Input_iterator' for random access. Model of the 'boost:RandomAccessRange'.
|
||||
RandomAccessInputRange &input_range,
|
||||
///< Range of input data points.
|
||||
typename Traits::Input_range& input_range,
|
||||
///< past-the-end random access iterator over the input points.
|
||||
Point_map point_pmap = Point_map(),
|
||||
///< property map to access the position of an input point.
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ namespace CGAL {
|
|||
`key_type = InputIterator` and `value_type = Gt::Vector_3`.
|
||||
*/
|
||||
template <class Gt,
|
||||
class InputIterator,
|
||||
class InputRange,
|
||||
class Ppmap,
|
||||
class Npmap>
|
||||
struct Efficient_RANSAC_traits {
|
||||
///
|
||||
typedef Gt Geom_traits;
|
||||
///
|
||||
typedef InputIterator Input_iterator;
|
||||
typedef InputRange Input_range;
|
||||
///
|
||||
typedef Ppmap Point_map;
|
||||
///
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ namespace CGAL {
|
|||
class DirectPointAccessor {
|
||||
public:
|
||||
typedef Sdt Sd_traits;
|
||||
typedef typename Sd_traits::Input_iterator Input_iterator;
|
||||
typedef typename Sd_traits::Input_range::iterator Input_iterator;
|
||||
|
||||
DirectPointAccessor() {}
|
||||
DirectPointAccessor(const Input_iterator &begin,
|
||||
|
|
@ -104,7 +104,7 @@ namespace CGAL {
|
|||
class IndexedPointAccessor {
|
||||
public:
|
||||
typedef Sdt Sd_traits;
|
||||
typedef typename Sd_traits::Input_iterator Input_iterator;
|
||||
typedef typename Sd_traits::Input_range::iterator Input_iterator;
|
||||
|
||||
IndexedPointAccessor() {}
|
||||
IndexedPointAccessor(const Input_iterator &begin,
|
||||
|
|
@ -165,7 +165,7 @@ namespace CGAL {
|
|||
class Octree : public PointAccessor {
|
||||
|
||||
typedef typename PointAccessor::Sd_traits Sd_traits;
|
||||
typedef typename Sd_traits::Input_iterator Input_iterator;
|
||||
typedef typename Sd_traits::Input_range::iterator Input_iterator;
|
||||
typedef Shape_base<Sd_traits> Shape;
|
||||
typedef typename Sd_traits::Geom_traits::Point_3 Point;
|
||||
typedef typename Sd_traits::Geom_traits::Vector_3 Vector;
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@ namespace CGAL {
|
|||
class Plane : public Shape_base<Traits> {
|
||||
public:
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
typedef typename Traits::Input_iterator Input_iterator;
|
||||
///< random access iterator for input data.
|
||||
typedef typename Traits::Point_map Point_map;
|
||||
///< property map to access the location of an input point.
|
||||
typedef typename Traits::Normal_map Normal_map;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ namespace CGAL {
|
|||
|
||||
public:
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
typedef typename Traits::Input_iterator Input_iterator;
|
||||
typedef typename Traits::Input_range::iterator Input_iterator;
|
||||
///< random access iterator for input data.
|
||||
typedef typename Traits::Point_map Point_map;
|
||||
///< property map to access the location of an input point.
|
||||
|
|
|
|||
|
|
@ -39,8 +39,6 @@ namespace CGAL {
|
|||
class Sphere : public Shape_base<Traits> {
|
||||
public:
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
typedef typename Traits::Input_iterator Input_iterator;
|
||||
///< random access iterator for input data.
|
||||
typedef typename Traits::Point_map Point_map;
|
||||
///< property map to access the location of an input point.
|
||||
typedef typename Traits::Normal_map Normal_map;
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ namespace CGAL {
|
|||
class Torus : public Shape_base<Traits> {
|
||||
public:
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
typedef typename Traits::Input_iterator Input_iterator;
|
||||
///< random access iterator for input data.
|
||||
typedef typename Traits::Point_map Point_map;
|
||||
///< property map to access the location of an input point.
|
||||
typedef typename Traits::Normal_map Normal_map;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ void Polyhedron_demo_point_set_shape_detection_plugin::on_actionDetect_triggered
|
|||
typedef CGAL::Identity_property_map<Point_set::Point_with_normal> PointPMap;
|
||||
typedef CGAL::Normal_of_point_with_normal_pmap<Point_set::Geom_traits> NormalPMap;
|
||||
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC_traits<Epic_kernel, Point_set::iterator, PointPMap, NormalPMap> Traits;
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC_traits<Epic_kernel, Point_set, PointPMap, NormalPMap> Traits;
|
||||
typedef CGAL::Shape_detection_3::Efficient_RANSAC<Traits> Shape_detection;
|
||||
|
||||
Shape_detection shape_detection;
|
||||
|
|
|
|||
Loading…
Reference in New Issue