Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Get corners of a Kd_tree_rectangle as Point_d

Subject: CGAL users discussion list

List archive

[cgal-discuss] Get corners of a Kd_tree_rectangle as Point_d


Chronological Thread 
  • From: Frédérik Paradis <>
  • To:
  • Subject: [cgal-discuss] Get corners of a Kd_tree_rectangle as Point_d
  • Date: Fri, 15 Apr 2016 18:28:18 -0400
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=None ; spf=None
  • Ironport-phdr: 9a23:Km1czRyV8QW81T3XCy+O+j09IxM/srCxBDY+r6Qd0e4VIJqq85mqBkHD//Il1AaPBtWLra8UwLOK+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuSt6U0pT8jrz60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGwD884mosVPWKG/c6UjRqFDFxwnNXo07Yvlr0rtVwyKs1UG02mXiBtLSzDM9hj2X4y55iXiv/B0gHTKFdDxUaw9Rj3k5K49G0ygszsOKzNsqDKfscd3lq8O+B8=

HI,

I am using the class Point_containter to generate and split the bounding box of a point set. I would like to get the bounding box as an Iso_box_d. However, the Point_container class only offers a method bounding_box which return a Kd_tree_rectangle. The only way to retrieve the coordinates of the corners of the rectangle seems to be the methods min_coord and max_coord which both returns the cartesian coordinate for the dimension i with the type FT.

The problem arises when I'm using the Homogeneous_d kernel with whatever ring type because the ring type and the field type are not the same and thus trigger a compilation error.

Here is my current code:

      std::vector<FT> min;
      std::vector<FT> max;
      const Kd_tree_rectangle<FT, D>& kdbox = container.bounding_box();
      for(int i = 0; i < d; i++) {
        min.push_back(kdbox.min_coord(i));
        max.push_back(kdbox.max_coord(i));
      }
      bbox = Iso_box_d(Point_d(d, min.begin(), min.end()),
                        Point_d(d, max.begin(), max.end()));

Is there any way to make it work with Point_container or will I have to compute the corners by iterating over all points?

Thank you.

Frédérik




Archive powered by MHonArc 2.6.18.

Top of Page