*/
class RS_ConstructionLineData
{
-public:
- /**
- * Default constructor. Leaves the data object uninitialized.
- */
- RS_ConstructionLineData() {}
-
- RS_ConstructionLineData(const Vector& point1,
- const Vector& point2) {
-
- this->point1 = point1;
- this->point2 = point2;
- }
-
- friend class RS_ConstructionLine;
-
- friend std::ostream& operator << (std::ostream& os,
- const RS_ConstructionLineData& ld) {
-
- os << "(" << ld.point1 <<
- "/" << ld.point2 <<
- ")";
- return os;
- }
-
-private:
- Vector point1;
- Vector point2;
+ public:
+ /**
+ * Default constructor. Leaves the data object uninitialized.
+ */
+ RS_ConstructionLineData() {}
+
+ RS_ConstructionLineData(const Vector & point1, const Vector & point2)
+ {
+ this->point1 = point1;
+ this->point2 = point2;
+ }
+
+ friend class RS_ConstructionLine;
+
+ friend std::ostream & operator<<(std::ostream & os, const RS_ConstructionLineData & ld)
+ {
+ os << "(" << ld.point1 <<
+ "/" << ld.point2 <<
+ ")";
+ return os;
+ }
+
+ private:
+ Vector point1;
+ Vector point2;
};
-
/**
* Class for a construction line entity.
*
* @author Andrew Mustun
*/
-class RS_ConstructionLine : public RS_AtomicEntity {
-public:
- RS_ConstructionLine(RS_EntityContainer* parent,
- const RS_ConstructionLineData& d);
-
- virtual RS_Entity* clone();
-
- virtual ~RS_ConstructionLine();
-
- /** @return RS2::EntityConstructionLine */
- virtual RS2::EntityType rtti() const {
- return RS2::EntityConstructionLine;
- }
-
- /**
- * @todo
- * @return Start point of the entity.
- */
- virtual Vector getStartpoint() const {
- return Vector(false);
- }
- /**
- * @todo
- * @return End point of the entity.
- */
- virtual Vector getEndpoint() const {
- return Vector(false);
- }
-
- /** @return Copy of data that defines the line. */
- RS_ConstructionLineData getData() const {
- return data;
- }
-
- /** @return First definition point. */
- Vector getPoint1() const {
- return data.point1;
- }
- /** @return Second definition point. */
- Vector getPoint2() const {
- return data.point2;
- }
-
- virtual Vector getNearestEndpoint(const Vector& coord,
- double* dist = NULL);
- virtual Vector getNearestPointOnEntity(const Vector& coord,
- bool onEntity = true, double* dist = NULL, RS_Entity** entity=NULL);
- virtual Vector getNearestCenter(const Vector& coord,
- double* dist = NULL);
- virtual Vector getNearestMiddle(const Vector& coord,
- double* dist = NULL);
- virtual Vector getNearestDist(double distance,
- const Vector& coord,
- double* dist = NULL);
- virtual double getDistanceToPoint(const Vector& coord,
- RS_Entity** entity=NULL,
- RS2::ResolveLevel level=RS2::ResolveNone,
- double solidDist = RS_MAXDOUBLE);
-
- virtual void move(Vector offset);
- virtual void rotate(Vector center, double angle);
- virtual void scale(Vector center, Vector factor);
- virtual void mirror(Vector axisPoint1, Vector axisPoint2);
-
-// virtual void draw(RS_Painter* /*painter*/, RS_GraphicView* /*view*/,
- virtual void draw(PaintInterface * /*painter*/, RS_GraphicView* /*view*/,
- double /*patternOffset*/) {}
-
- friend std::ostream& operator << (std::ostream& os,
- const RS_ConstructionLine& l);
-
- virtual void calculateBorders();
-
-protected:
- RS_ConstructionLineData data;
+class RS_ConstructionLine: public RS_AtomicEntity
+{
+ public:
+ RS_ConstructionLine(RS_EntityContainer * parent, const RS_ConstructionLineData & d);
+ virtual ~RS_ConstructionLine();
+
+ virtual RS_Entity * clone();
+ virtual RS2::EntityType rtti() const;
+ virtual Vector getStartpoint() const;
+ virtual Vector getEndpoint() const;
+ RS_ConstructionLineData getData() const;
+ Vector getPoint1() const;
+ Vector getPoint2() const;
+ virtual Vector getNearestEndpoint(const Vector & coord, double * dist = NULL);
+ virtual Vector getNearestPointOnEntity(const Vector & coord,
+ bool onEntity = true, double * dist = NULL, RS_Entity ** entity = NULL);
+ virtual Vector getNearestCenter(const Vector & coord, double * dist = NULL);
+ virtual Vector getNearestMiddle(const Vector & coord, double * dist = NULL);
+ virtual Vector getNearestDist(double distance, const Vector & coord,
+ double * dist = NULL);
+ virtual double getDistanceToPoint(const Vector & coord, RS_Entity ** entity = NULL,
+ RS2::ResolveLevel level = RS2::ResolveNone, double solidDist = RS_MAXDOUBLE);
+ virtual void move(Vector offset);
+ virtual void rotate(Vector center, double angle);
+ virtual void scale(Vector center, Vector factor);
+ virtual void mirror(Vector axisPoint1, Vector axisPoint2);
+ virtual void draw(PaintInterface * /*painter*/, GraphicView * /*view*/,
+ double /*patternOffset*/);
+
+ friend std::ostream & operator<<(std::ostream & os, const RS_ConstructionLine & l);
+ virtual void calculateBorders();
+
+ protected:
+ RS_ConstructionLineData data;
};
#endif