Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Inheritance of Polygon_2.

Subject: CGAL users discussion list

List archive

[cgal-discuss] Inheritance of Polygon_2.


Chronological Thread 
  • From: <>
  • To:
  • Subject: [cgal-discuss] Inheritance of Polygon_2.
  • Date: Sat, 3 Oct 2009 14:46:30 +0200 (CEST)

Hello,

Beware : I might be a silly question !

To be able to add some functionalities (like void draw() or void setName) to
Polygon_2 class, I'm looking for the way to inherit from the class.

To aim that I did the following declaration for my new class :

...

#include <CGAL/Polygon_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point;
typedef CGAL::Polygon_2<K> Polygon_2;

class AC_Polygon : public CGAL::Polygon_2<Polygon_2>
{
public:
AC_Polygon();
~AC_Polygon();

void draw() const;
};

...

It compiles well, but when I instantiate my new class AC_Polygon,
I do not have the methods like :

is_simple()

is_convex()

the compiler says :

/usr/include/CGAL/Polygon_2/Polygon_2_simplicity.h:135: erreur: no type named
«Orientation_2» in «class
CGAL::Polygon_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double> >,
std::vector<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> >,
std::allocator<CGAL::Point_2<CGAL::Filtered_kernel<CGAL::Simple_cartesian<double>
> > > > >»


Any ideas

Gilles


Archive powered by MHonArc 2.6.16.

Top of Page