Add a member function AABB_tree::count_intersections

This commit is contained in:
Laurent Rineau 2009-04-06 12:10:09 +00:00
parent d51fcf2fa2
commit 85bd8c4adb
1 changed files with 17 additions and 15 deletions

View File

@ -240,7 +240,7 @@ public:
Counting_iterator(int& i_) : i(i_) {}; Counting_iterator(int& i_) : i(i_) {};
struct Proxy { struct Proxy {
Proxy& operator=(const Value_type&) {}; Proxy& operator=(const Value_type&) { return *this; };
}; };
Proxy operator*() { Proxy operator*() {
@ -249,30 +249,32 @@ public:
Self& operator++() { Self& operator++() {
++i; ++i;
return *this;
} }
Self& operator++(int) { Self& operator++(int) {
++i; ++i;
return *this;
} }
}; };
// The following function template is restricted to that T can only be in // The following function template is restricted to that T can only be in
// {Ray, Line, Segment}. It return type is int. // {Ray, Line, Segment}. It return type is int.
// The trick uses enable_if and the Boost MPL. // The trick uses enable_if and the Boost MPL.
// template <class T> template <class T>
// typename boost::enable_if< typename boost::enable_if<
// typename boost::mpl::contains<Allowed_query_types, typename boost::mpl::contains<Allowed_query_types,
// T>::type, T>::type,
// int>::type int>::type
// count_intersections(const T& x) count_intersections(const T& x)
// { {
// typedef Listing_traits<T, Counting_iterator<Point> > Traits; typedef Listing_traits<T, Counting_iterator<Point>, Point> Traits;
// int result; int result = 0;
// Counting_iterator<Point> counting_it(result); Counting_iterator<Point> counting_it(result);
// Traits traits(counting_it); Traits traits(counting_it);
// m_root->template traversal<Traits,T>(x, traits, m_data.size()); m_root->template traversal<Traits,T>(x, traits, m_data.size());
// return result ; return result ;
// } }
}; // end class AABB_tree }; // end class AABB_tree
} // end namespace CGAL } // end namespace CGAL