+++ /dev/null
-#ifndef __CONSTRUCTIONLINE_H__
-#define __CONSTRUCTIONLINE_H__
-
-#include "atomicentity.h"
-#include "vector.h"
-
-/**
- * Holds the data that defines a construction line (a line
- * which is not limited to both directions).
- */
-class ConstructionLineData
-{
- public:
- /**
- * Default constructor. Leaves the data object uninitialized.
- */
- ConstructionLineData() {}
-
- ConstructionLineData(const Vector & point1, const Vector & point2)
- {
- this->point1 = point1;
- this->point2 = point2;
- }
-
- friend class ConstructionLine;
-
- friend std::ostream & operator<<(std::ostream & os, const ConstructionLineData & ld)
- {
- os << "(" << ld.point1 <<
- "/" << ld.point2 <<
- ")";
- return os;
- }
-
- private:
- Vector point1;
- Vector point2;
-};
-
-/**
- * Class for a construction line entity.
- *
- * @author Andrew Mustun
- */
-class ConstructionLine: public AtomicEntity
-{
- public:
- ConstructionLine(EntityContainer * parent, const ConstructionLineData & d);
- virtual ~ConstructionLine();
-
- virtual Entity * clone();
- virtual RS2::EntityType rtti() const;
- virtual Vector getStartpoint() const;
- virtual Vector getEndpoint() const;
- 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, 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, 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 ConstructionLine & l);
- virtual void calculateBorders();
-
- protected:
- ConstructionLineData data;
-};
-
-#endif