// ====================================================================== // // Copyright (c) 2001 The CGAL Consortium // // This software and related documentation is part of an INTERNAL release // of the Computational Geometry Algorithms Library (CGAL). It is not // intended for general use. // // ---------------------------------------------------------------------- // // release : // release_date : // // file : include/CGAL/Extended_internal_node.h // package : APSPAS // revision : 1.0 // revision_date : 2001/06/12 // maintainer : Hans Tangelder () // // ====================================================================== #ifndef CGAL_EXTENDED_INTERNAL_NODE_H #define CGAL_EXTENDED_INTERNAL_NODE_H #include #include namespace CGAL { template // = Kd_tree_traits_2d> class Extended_internal_node : public Internal_node { public: typedef Traits::Item Item; typedef typename Item::FT NT; typedef Traits::Separator Separator; typedef Base_node Node; typedef CGAL::Point_2< CGAL::Cartesian > Point_2D; typedef CGAL::Segment_2< CGAL::Cartesian > Segment_2D; private: NT low_val; NT high_val; public: inline const NT low_value() const { return low_val; } inline const NT high_value() const { return high_val; } // Extended_internal_node(const Node* lower, const Node* upper) : // lower_ch(lower), upper_ch(upper) {} Extended_internal_node(Points_container& c, int bucket_size) { Traits tr; Points_container c_low = Points_container(c.dimension()); Box bbox(c.bounding_box()); sep = tr.split(c, c_low, tr.selected_split_rule()); int cd = sep->cutting_dimension(); low_val = bbox.lower(cd); high_val = bbox.upper(cd); if (c_low.size() > bucket_size) lower_ch = new Extended_internal_node(c_low,bucket_size); else lower_ch = new Leaf_node(c_low); // delete *c_low; // delete []c_low; if (c.size() > bucket_size) upper_ch = new Extended_internal_node(c,bucket_size); else upper_ch = new Leaf_node(c); } ~Extended_internal_node() { } }; } // namespace CGAL #endif // CGAL_EXTENDED_INTERNAL_NODE_H