Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
types.h
Go to the documentation of this file.
1 #ifndef DATA_TYPES_H
2 #define DATA_TYPES_H
3 
4 #include <QVector>
5 #include <QPolygon>
6 #include <QLineF>
7 #include <cmath>
8 
9 namespace frechet { namespace data {
14 typedef QPointF Point;
15 //typedef QLineF Segment;
20 typedef QPolygonF Curve;
24 typedef QVector<Curve> CurveList;
25 
35 struct Rect {
36  int i0;
37  int j0;
38  int i1;
39  int j1;
40 
42  Rect() {}
50  Rect(int a, int b, int c, int d) : i0(a),j0(b), i1(c),j1(d) { }
51 
57  bool operator==(const Rect& that) const {
58  return (i0==that.i0) && (j0==that.j0) && (i1==that.i1) && (j1==that.j1);
59  }
63  int width() const { return i1-i0; }
67  int height() const { return j1-j0; }
68 };
69 
70 
74 typedef unsigned int component_id_t;
75 
76 
77 } } // namespace frechet
78 
79 #endif // DATA_TYPES_H
80 
int j1
top bound, exclusive
Definition: types.h:39
global definitions for all algorithms.
int width() const
Definition: types.h:63
Rect(int a, int b, int c, int d)
constructor with bounds
Definition: types.h:50
Rect()
empty constructor; creates an undefined rectangle
Definition: types.h:42
int height() const
Definition: types.h:67
int i1
right bound, exclusive
Definition: types.h:38
QPointF Point
a point in the plane; with double floating point precision. This type is heavily used throughout all ...
Definition: types.h:14
a very simple Rectangle structure, with integer boundaries.
Definition: types.h:35
int j0
top bound, inclusive
Definition: types.h:37
QPolygonF Curve
a polygonal curve in the plane; with double floating point precision. This type is heavily used throu...
Definition: types.h:20
QVector< Curve > CurveList
a list of polygonal curves
Definition: types.h:24
int i0
left bound, inclusive
Definition: types.h:36
unsigned int component_id_t
used as identifier for free-space components
Definition: types.h:74
bool operator==(const Rect &that) const
equality comparator
Definition: types.h:57