1 #ifndef __CONSTRUCTIONLINE_H__
2 #define __CONSTRUCTIONLINE_H__
4 #include "atomicentity.h"
8 * Holds the data that defines a construction line (a line
9 * which is not limited to both directions).
11 class ConstructionLineData
15 * Default constructor. Leaves the data object uninitialized.
17 ConstructionLineData() {}
19 ConstructionLineData(const Vector & point1, const Vector & point2)
21 this->point1 = point1;
22 this->point2 = point2;
25 friend class ConstructionLine;
27 friend std::ostream & operator<<(std::ostream & os, const ConstructionLineData & ld)
29 os << "(" << ld.point1 <<
41 * Class for a construction line entity.
43 * @author Andrew Mustun
45 class ConstructionLine: public AtomicEntity
48 ConstructionLine(EntityContainer * parent, const ConstructionLineData & d);
49 virtual ~ConstructionLine();
51 virtual Entity * clone();
52 virtual RS2::EntityType rtti() const;
53 virtual Vector getStartpoint() const;
54 virtual Vector getEndpoint() const;
55 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, 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, 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*/, GraphicView * /*view*/,
72 double /*patternOffset*/);
74 friend std::ostream & operator<<(std::ostream & os, const ConstructionLine & l);
75 virtual void calculateBorders();
78 ConstructionLineData data;