29#ifndef AVOID_GEOMTYPES_H
30#define AVOID_GEOMTYPES_H
42static const size_t XDIM = 0;
43static 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;
100 double& operator[](
const size_t dimension);
101 const double& operator[](
const size_t dimension)
const;
141 double length(
size_t dimension)
const;
142 double width(
void)
const;
143 double height(
void)
const;
162 virtual size_t size(
void)
const = 0;
164 virtual int id(
void)
const = 0;
171 Polygon boundingRectPolygon(
void)
const;
180 Box offsetBoundingBox(
double offset)
const;
235 bool empty(
void)
const;
237 size_t size(
void)
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;
321 std::vector<Point> checkpointsOnSegment(
size_t segmentLowerIndex,
322 int indexModifier = 0)
const;
342 bool empty(
void)
const;
343 size_t size(
void)
const;
348 std::vector<std::pair<const Polygon *, unsigned short> >
psRef;
pair< double, double > Point
static bool operator<(const Baseline &a, const Baseline &b)
A bounding box, represented by the top-left and bottom-right corners.
Point min
The top-left point.
Point max
The bottom-right point.
A line between two points.
The Point class defines a point in the plane.
unsigned short vn
The vertex number associated with this point.
unsigned int id
The ID associated with this point.
A common interface used by the Polygon classes.
virtual void clear(void)=0
Resets this to the empty polygon.
virtual const Point & at(size_t index) const =0
Returns a specific point in the polygon.
virtual ~PolygonInterface()
Destructor.
virtual size_t size(void) const =0
Returns the number of points in this polygon.
PolygonInterface()
Constructor.
virtual int id(void) const =0
Returns the ID value associated with this polygon.
virtual bool empty(void) const =0
Returns true if this polygon is empty.
A dynamic Polygon, to which points can be easily added and removed.
std::vector< char > ts
If used, denotes whether the corresponding point in ps is a move-to operation or a Bezier curve-to.
int _id
An ID for the polygon.
std::vector< Point > ps
A vector of the points that make up the Polygon.
std::vector< std::pair< size_t, Point > > checkpointsOnRoute
A Rectangle, a simpler way to define the polygon for square or rectangular shapes.
A Polygon which just references its points from other Polygons.
std::vector< std::pair< const Polygon *, unsigned short > > psRef
std::vector< Point > psPoints
The Router class represents a libavoid router instance.
sufficient_stats operator-(sufficient_stats const &a, sufficient_stats const &b)
sufficient_stats operator+(sufficient_stats const &a, sufficient_stats const &b)
libavoid: Object-avoiding orthogonal and polyline connector routing library.
static const unsigned short kUnassignedVertexNumber
Constant value representing an unassigned vertex number.
Point Vector
A vector, represented by the Point class.
static const unsigned short kShapeConnectionPin
Constant value representing a ShapeConnectionPin.
Polygon PolyLine
A multi-segment line, represented with the Polygon class.