29 #ifndef AVOID_GEOMTYPES_H 30 #define AVOID_GEOMTYPES_H 36 #include "libavoid/dllexport.h" 42 static const size_t XDIM = 0;
43 static const size_t YDIM = 1;
63 Point(
const double xv,
const double yv);
70 bool operator==(
const Point& rhs)
const;
79 bool equals(
const Point& rhs,
double epsilon = 0.0001)
const;
85 bool operator!=(
const Point& rhs)
const;
94 bool operator<(
const Point& rhs)
const;
100 double& operator[](
const size_t dimension);
101 const double& operator[](
const size_t dimension)
const;
120 static const unsigned short kUnassignedVertexNumber = 8;
123 static const unsigned short kShapeConnectionPin = 9;
141 double length(
size_t dimension)
const;
142 double width(
void)
const;
143 double height(
void)
const;
158 virtual void clear(
void) = 0;
160 virtual bool empty(
void)
const = 0;
162 virtual size_t size(
void)
const = 0;
164 virtual int id(
void)
const = 0;
167 virtual const Point& at(
size_t index)
const = 0;
171 Polygon boundingRectPolygon(
void)
const;
180 Box offsetBoundingBox(
double offset)
const;
182 Polygon offsetPolygon(
double offset)
const;
235 bool empty(
void)
const;
237 size_t size(
void)
const;
242 const Point& at(
size_t index)
const;
246 void setPoint(
size_t index,
const Point& point);
274 Polygon curvedPolyline(
const double curve_amount,
275 const bool closed =
false)
const;
280 void translate(
const double xDist,
const double yDist);
285 std::vector<Point>
ps;
301 std::vector<char>
ts;
314 std::vector<std::pair<size_t, Point> > checkpointsOnRoute;
321 std::vector<Point> checkpointsOnSegment(
size_t segmentLowerIndex,
322 int indexModifier = 0)
const;
342 bool empty(
void)
const;
343 size_t size(
void)
const;
345 const Point& at(
size_t index)
const;
348 std::vector<std::pair<const Polygon *, unsigned short> > psRef;
349 std::vector<Point> psPoints;
375 Rectangle(
const Point& centre,
const double width,
const double height);
A line between two points.
Definition: geomtypes.h:188
Polygon PolyLine
A multi-segment line, represented with the Polygon class.
Definition: geomtypes.h:328
int _id
An ID for the polygon.
Definition: geomtypes.h:283
double y
The y position.
Definition: geomtypes.h:109
The x-dimension (0).
Definition: rectangle.h:45
A bounding box, represented by the top-left and bottom-right corners.
Definition: geomtypes.h:133
Point max
The bottom-right point.
Definition: geomtypes.h:139
A dynamic Polygon, to which points can be easily added and removed.
Definition: geomtypes.h:207
virtual ~PolygonInterface()
Destructor.
Definition: geomtypes.h:156
PolygonInterface()
Constructor.
Definition: geomtypes.h:154
unsigned int id
The ID associated with this point.
Definition: geomtypes.h:111
double x
The x position.
Definition: geomtypes.h:107
Point Vector
A vector, represented by the Point class.
Definition: geomtypes.h:128
Point a
The first point.
Definition: geomtypes.h:192
A Polygon which just references its points from other Polygons.
Definition: geomtypes.h:336
unsigned short vn
The vertex number associated with this point.
Definition: geomtypes.h:113
std::vector< char > ts
If used, denotes whether the corresponding point in ps is a move-to operation or a Bezier curve-to...
Definition: geomtypes.h:301
A Rectangle, a simpler way to define the polygon for square or rectangular shapes.
Definition: geomtypes.h:356
Point b
The second point.
Definition: geomtypes.h:194
std::vector< Point > ps
A vector of the points that make up the Polygon.
Definition: geomtypes.h:285
The Point class defines a point in the plane.
Definition: geomtypes.h:52
libavoid: Object-avoiding orthogonal and polyline connector routing library.
Definition: actioninfo.cpp:33
The Router class represents a libavoid router instance.
Definition: router.h:386
Point min
The top-left point.
Definition: geomtypes.h:137
The y-dimension (1).
Definition: rectangle.h:49
A common interface used by the Polygon classes.
Definition: geomtypes.h:150