Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
frechet::poly::CgalPoint Class Reference

Detailed Description

a polygon vertex to be used with CGAL::Polygon_2. Derives from CGAL::Point_2 but is convertible to an from QPoint (which is used troughout the rest of the program). Also stores the index of the polygon vertex.

Please note that CGAL uses a coordinate system different from Qt.

  • Qt assumes (0,0) on the TOP left of the drawing plane
  • CGAL assumes (0,0) on the BOTTOM left of the plane

In most cases this doesn't matter much, but sometimes you have to know this (e.g. when deciding if a polygon is oriented clock-wise or not).

Author
Peter Schäfer

Definition at line 43 of file poly_utils.h.

#include <poly_utils.h>

Inherits Point_2< Kernel >.

Public Types

typedef CGAL::Point_2< Kernelsuper
 

Public Member Functions

 CgalPoint ()
 empty constructor More...
 
 CgalPoint (const QPointF &p, int i=-1)
 default constructor from point More...
 
 CgalPoint (double x, double y, int i=-1)
 default constructor from coordinates. assumes CGAL coordinate plane (0,0 on BOTTOM left). More...
 
CgalPointoperator= (const QPointF &p)
 assignment operator from QPointF More...
 
 operator QPointF () const
 conversion operator to QPointF More...
 

Public Attributes

int i
 index of polygon vertex (-1 if not available) More...
 
bool erase
 used by PolgonUtilities::simplify to mark vertexes for deletion More...
 

Member Typedef Documentation

◆ super

typedef CGAL::Point_2<Kernel> frechet::poly::CgalPoint::super

Definition at line 46 of file poly_utils.h.

Constructor & Destructor Documentation

◆ CgalPoint() [1/3]

CgalPoint::CgalPoint ( )

empty constructor

Definition at line 313 of file poly_utils.cpp.

◆ CgalPoint() [2/3]

CgalPoint::CgalPoint ( const QPointF &  p,
int  i = -1 
)

default constructor from point

Parameters
ppoint in the plane. assumes Qt coordinate plane (0,0 on TOP left)
iindex of polygon vertex (optional)

Definition at line 317 of file poly_utils.cpp.

◆ CgalPoint() [3/3]

CgalPoint::CgalPoint ( double  x,
double  y,
int  i = -1 
)

default constructor from coordinates. assumes CGAL coordinate plane (0,0 on BOTTOM left).

Parameters
xx-coordinate of point
yy-coordinate of point
iindex of polygon vertex (optional)

Definition at line 321 of file poly_utils.cpp.

Member Function Documentation

◆ operator QPointF()

CgalPoint::operator QPointF ( ) const

conversion operator to QPointF

Definition at line 332 of file poly_utils.cpp.

◆ operator=()

CgalPoint & CgalPoint::operator= ( const QPointF &  p)

assignment operator from QPointF

Parameters
pa point
Returns
reference to this object, after assignment

Definition at line 325 of file poly_utils.cpp.

Member Data Documentation

◆ erase

bool frechet::poly::CgalPoint::erase
mutable

used by PolgonUtilities::simplify to mark vertexes for deletion

Definition at line 50 of file poly_utils.h.

◆ i

int frechet::poly::CgalPoint::i

index of polygon vertex (-1 if not available)

Definition at line 48 of file poly_utils.h.


The documentation for this class was generated from the following files: