4 #include "atomicentity.h"
7 * Holds the data that defines a point.
12 PointData(const Vector & pos)
17 friend std::ostream & operator<<(std::ostream & os, const PointData & pd)
19 os << "(" << pd.pos << ")";
27 * Class for a point entity.
29 * @author Andrew Mustun
31 class Point: public AtomicEntity
34 Point(EntityContainer * parent, const PointData & d);
36 virtual Entity * clone();
37 virtual RS2::EntityType rtti() const;
38 virtual Vector getStartpoint() const;
39 virtual Vector getEndpoint() const;
40 virtual void moveStartpoint(const Vector & pos);
41 PointData getData() const;
42 virtual VectorSolutions getRefPoints();
44 void setPos(const Vector & pos);
46 virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL);
47 virtual Vector getNearestPointOnEntity(const Vector & coord,
48 bool onEntity = true, double * dist = NULL, Entity ** entity = NULL);
49 virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL);
50 virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL);
51 virtual Vector getNearestDist(double distance, const Vector & coord, double * dist = NULL);
52 virtual double getDistanceToPoint(const Vector& coord, Entity ** entity = NULL,
53 RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE);
55 virtual void move(Vector offset);
56 virtual void rotate(Vector center, double angle);
57 virtual void scale(Vector center, Vector factor);
58 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
59 virtual void draw(PaintInterface * painter, GraphicView * view, double patternOffset = 0.0);
61 friend std::ostream & operator<<(std::ostream & os, const Point & p);
63 /** Recalculates the borders of this entity. */
64 virtual void calculateBorders();