CGAL question:
Im trying the add one property to the point class. The first step I guess is to inherit a kernel and replace the point class with my own which I inherit from CGAL's. But just trying to get this small first step I run into trouble.
Edit: Based on the comment below I changed the inheritance to the way it's described in the Manual. The code below gives the following compile error:
among others.
#include <CGAL/Extended_homogeneous.h>
template < typename K_, typename K_Base >
class My_base : public K_Base::template Base<K_>::Type
{
typedef typename K_Base::template Base<K_>::Type OldK;
public:
typedef K_ Kernel;
template < typename Kernel2 >
struct Base { typedef My_base<Kernel2, K_Base> Type; };
};
template < typename RT_ >
struct MyKernel : public CGAL::Type_equality_wrapper<My_base<MyKernel<RT_>, CGAL::Homogeneous<RT_> >, MyKernel<RT_> >
{};
#include "MyKernel.h"
#include <CGAL/Nef_polyhedron_3.h>
typedef MyKernel<CGAL::Gmpz> Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_Polyhedron;
typedef Nef_Polyhedron::Plane_3 Plane;
int main()
{
Nef_Polyhedron half_space(Plane(1,1,1,1), Nef_Polyhedron::EXCLUDED);
return 0;
}
If the inhertiance is changed to "public K_Base::Base::template B::Type" it will compile but Then I miss the propeties from the Extentensions I guess? Because I get the error
"Constructor not available for this kernel"
when I run the program
The correct way to define your own kernel is described on the following page.
The things look complicated because of the type equality wrapper which makes Kernel::Point_2 equal to Point_2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With