1 #ifndef RS_CONSTRUCTIONLINE_H
2 #define RS_CONSTRUCTIONLINE_H
4 #include "rs_atomicentity.h"
8 * Holds the data that defines a construction line (a line
9 * which is not limited to both directions).
11 class RS_ConstructionLineData
15 * Default constructor. Leaves the data object uninitialized.
17 RS_ConstructionLineData() {}
19 RS_ConstructionLineData(const Vector & point1, const Vector & point2)
21 this->point1 = point1;
22 this->point2 = point2;
25 friend class RS_ConstructionLine;
27 friend std::ostream & operator<<(std::ostream & os, const RS_ConstructionLineData & ld)
29 os << "(" << ld.point1 <<
41 * Class for a construction line entity.
43 * @author Andrew Mustun
45 class RS_ConstructionLine: public RS_AtomicEntity
48 RS_ConstructionLine(RS_EntityContainer * parent, const RS_ConstructionLineData & d);
49 virtual ~RS_ConstructionLine();
51 virtual RS_Entity * clone();
52 virtual RS2::EntityType rtti() const;
53 virtual Vector getStartpoint() const;
54 virtual Vector getEndpoint() const;
55 RS_ConstructionLineData getData() const;
56 Vector getPoint1() const;
57 Vector getPoint2() const;
58 virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL);
59 virtual Vector getNearestPointOnEntity(const Vector & coord,
60 bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL);
61 virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL);
62 virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL);
63 virtual Vector getNearestDist(double distance, const Vector & coord,
64 double * dist = NULL);
65 virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL,
66 RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE);
67 virtual void move(Vector offset);
68 virtual void rotate(Vector center, double angle);
69 virtual void scale(Vector center, Vector factor);
70 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
71 virtual void draw(PaintInterface * /*painter*/, RS_GraphicView * /*view*/,
72 double /*patternOffset*/) {}
74 friend std::ostream & operator<<(std::ostream & os, const RS_ConstructionLine & l);
75 virtual void calculateBorders();
78 RS_ConstructionLineData data;