X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fbase%2Frs_constructionline.h;h=c5d797e6ae5a0a263b6270b7bce5b86bbb2b89aa;hb=27d4a138d23453e93a833e9347444b828a971cb4;hp=0a91f6c13bcd7440a636a5e1af858aa3c345a1c9;hpb=16ce54abf01ca3032e42a5bb11a4afcf9014dcca;p=architektonas diff --git a/src/base/rs_constructionline.h b/src/base/rs_constructionline.h index 0a91f6c..c5d797e 100644 --- a/src/base/rs_constructionline.h +++ b/src/base/rs_constructionline.h @@ -10,116 +10,72 @@ */ 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