| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
|
|
| #ifndef RS_CONSTRUCTIONLINE_H |
| #define RS_CONSTRUCTIONLINE_H |
|
|
| #include "rs_atomicentity.h" |
|
|
| |
| |
| |
| |
| struct RS_ConstructionLineData { |
| |
| |
| |
| RS_ConstructionLineData() = default; |
|
|
| RS_ConstructionLineData(const RS_Vector& point1, |
| const RS_Vector& point2); |
|
|
| RS_Vector point1; |
| RS_Vector point2; |
| }; |
|
|
|
|
| |
| |
| |
| |
| |
| class RS_ConstructionLine : public RS_AtomicEntity { |
| public: |
| RS_ConstructionLine() = default; |
| RS_ConstructionLine(RS_EntityContainer* parent, const RS_ConstructionLineData& d); |
|
|
| RS_ConstructionLine(const RS_Vector& point1, const RS_Vector& point2); |
|
|
| RS_Entity* clone() const override; |
|
|
| virtual ~RS_ConstructionLine()=default; |
|
|
| |
| RS2::EntityType rtti() const override{ |
| return RS2::EntityConstructionLine; |
| } |
|
|
| |
| RS_ConstructionLineData const& getData() const; |
|
|
| |
| RS_Vector const& getPoint1() const; |
| |
| RS_Vector const& getPoint2() const; |
|
|
| |
| RS_Vector getStartpoint() const override; |
| |
| RS_Vector getEndpoint() const override; |
| double getDirection1(void) const override; |
| double getDirection2(void) const override; |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| LC_Quadratic getQuadratic() const override; |
| RS_Vector getMiddlePoint(void) const override; |
| RS_Vector getNearestEndpoint(const RS_Vector& coord, |
| double* dist = nullptr) const override; |
| RS_Vector getNearestPointOnEntity(const RS_Vector& coord, |
| bool onEntity = true, double* dist = nullptr, RS_Entity** entity=nullptr)const override; |
| RS_Vector getNearestCenter(const RS_Vector& coord, |
| double* dist = nullptr) const override; |
| RS_Vector getNearestMiddle(const RS_Vector& coord, |
| double* dist = nullptr, |
| int middlePoints = 1)const override; |
| RS_Vector getNearestDist(double distance, |
| const RS_Vector& coord, |
| double* dist = nullptr)const override; |
| double getDistanceToPoint(const RS_Vector& coord, |
| RS_Entity** entity=nullptr, |
| RS2::ResolveLevel level=RS2::ResolveNone, |
| double solidDist = RS_MAXDOUBLE) const override; |
|
|
| void move(const RS_Vector& offset) override; |
| void rotate(const RS_Vector& center, double angle) override; |
| void rotate(const RS_Vector& center, const RS_Vector& angleVector) override; |
| void scale(const RS_Vector& center, const RS_Vector& factor) override; |
| void mirror(const RS_Vector& axisPoint1, const RS_Vector& axisPoint2) override; |
| RS_Entity& shear(double k) override; |
|
|
| void draw(RS_Painter* painter) override; |
|
|
| friend std::ostream& operator << (std::ostream& os, |
| const RS_ConstructionLine& l); |
|
|
| void calculateBorders() override; |
|
|
|
|
|
|
| private: |
| RS_ConstructionLineData data{}; |
| }; |
|
|
| #endif |
|
|