Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Custum class inheriting CGAL::Bbox_3

Subject: CGAL users discussion list

List archive

[cgal-discuss] Custum class inheriting CGAL::Bbox_3


Chronological Thread 
  • From:
  • To:
  • Subject: [cgal-discuss] Custum class inheriting CGAL::Bbox_3
  • Date: Thu, 6 May 2010 23:00:29 +0300


Hello,

I want to use CGAL::Bbox_3 as an AABB tree primitive, but in order to do
that, I
must use a class that has a bbox() method, which Bbox_3 itself does not have.
So
I tried to use the following class as a datum myself, but for some reason it
won't compile:

template<class K>
class My_box:public CGAL::Bbox_3{
public:
CGAL::Bbox_3 bbox() const {
return K().construct_bbox_3_object()(copy);
}

My_box(typename K::Iso_cuboid_3& ic): CGAL::Bbox_3(ic.xmin(), ic.ymin(),
ic.zmin(), ic.xmax(), ic.ymax(), ic.zmax()){copy=*this;}
My_box(){}
};

the line "return K().construct_bbox_3_object()(copy);" produces the error:

Error 11 error C2664: 'CGAL::Bbox_3
CGAL::CartesianKernelFunctors::Construct_bbox_3<K>::operator ()(const
CGAL::Circle_3<R_> &) const' : cannot convert parameter 1 from 'const
CGAL::Bbox_3' to 'const CGAL::Circle_3<R_> &'

Please tell me how I can inherit this class safely so it can be cast as a bbox
object, but with the extra methods.

Thanks, Amir.


  • [cgal-discuss] Custum class inheriting CGAL::Bbox_3, avaxman, 05/06/2010

Archive powered by MHonArc 2.6.16.

Top of Page