4 #include "rs_atomicentity.h"
7 * Holds the data that defines a point.
12 RS_PointData(const Vector & pos)
17 friend std::ostream & operator<<(std::ostream & os, const RS_PointData & pd)
19 os << "(" << pd.pos << ")";
27 * Class for a point entity.
29 * @author Andrew Mustun
31 class RS_Point: public RS_AtomicEntity
34 RS_Point(RS_EntityContainer * parent, const RS_PointData & d);
36 virtual RS_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 RS_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, RS_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, RS_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);
60 // virtual void draw(RS_Painter * painter, RS_GraphicView * view, double patternOffset = 0.0);
61 virtual void draw(PaintInterface * painter, RS_GraphicView * view, double patternOffset = 0.0);
63 friend std::ostream & operator<<(std::ostream & os, const RS_Point & p);
65 /** Recalculates the borders of this entity. */
66 virtual void calculateBorders();