CGAL问题:
我正在尝试将一个属性添加到点类。我想第一步是继承一个内核并用我自己的替换点类,我从 CGAL 继承。但只是试图迈出这小小的第一步,我遇到了麻烦。
编辑:根据下面的评论,我将继承更改为手册中描述的方式。下面的代码给出了以下编译错误:
- 'typename CGAL::Extended_homogeneous::Base' 命名'CGAL::Extended_homogeneous::Base',它不是类模板|
其中。
MyBase.h
#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_> >
{};
最小化.cpp
#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;
}
如果将继承更改为“public K_Base::Base::template B::Type”,它将编译,但我想我想念扩展的属性?因为我得到了错误
“构造函数不适用于此内核”
当我运行程序时