#include <CGAL/Min_circle_2_adapterH2.h>
| |
Data accessor for homogeneous coordinates.
| |
| |
Point type.
| |
| |
Circle type.
|
| |||
|
|
| |
returns constants CGAL_LEFTTURN, CGAL_COLLINEAR, or CGAL_RIGHTTURN iff r lies properly to the left, on, or properly to the right of the oriented line through p and q, resp. |
Note: In this release correct results are only guaranteed if exact arithmetic is used, so this example (using integer arithmetic with possible overflows) is only intended to illustrate the techniques.
#include <CGAL/Min_circle_2_adapterH2.h> #include <CGAL/Min_circle_2.h> // your own point class (homogeneous) class PtH { // ... public: PtH( int hx, int hy, int hw); int hx( ) const; int hy( ) const; int hw( ) const; // ... }; // the data accessor for PtH class PtH_DA { public: typedef int RT; void get( const PtH& p, int& hx, int& hy, int& hw) const { hx = p.hx(); hy = p.hy(); hw.phw(); } int get_x( const PtH& p) const { return( p.hx()); } int get_y( const PtH& p) const { return( p.hy()); } int get_w( const PtH& p) const { return( p.hw()); } void set( PtH& p, int hx, int hy, int hw) const { p = PtH( hx, hy, hw); } }; // some typedefs typedef CGAL_Min_circle_2_adapterH2< PtH, PtH_DA > AdapterH; typedef CGAL_Min_circle_2< AdapterH > Min_circle; // do something with Min_circle Min_circle mc( /*...*/ );