| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef LC_TOLERANCE_H |
| #define LC_TOLERANCE_H |
|
|
| #include "rs_color.h" |
| #include "rs_entitycontainer.h" |
|
|
| struct RS_TextData; |
|
|
| struct LC_ToleranceData { |
| LC_ToleranceData(const RS_Vector& m_insertion_point, const RS_Vector& m_direction_vector, |
| const QString& m_text_code, const QString& m_dim_style_name) |
| : m_insertionPoint{m_insertion_point}, |
| m_directionVector{m_direction_vector}, |
| m_textCode{m_text_code}, |
| m_dimStyleName{m_dim_style_name} { |
| } |
|
|
| ~LC_ToleranceData(); |
|
|
| RS_Vector m_insertionPoint; |
| RS_Vector m_directionVector; |
| QString m_textCode; |
| QString m_dimStyleName; |
| }; |
|
|
| std::ostream& operator <<(std::ostream& os, const LC_ToleranceData& dd); |
|
|
| class LC_Tolerance:public RS_EntityContainer{ |
| public: |
| LC_Tolerance(RS_EntityContainer* parent, |
| const LC_ToleranceData& d); |
|
|
| ~LC_Tolerance() override = default; |
|
|
| RS_Entity* clone() const override; |
|
|
| RS2::EntityType rtti() const override { |
| return RS2::EntityTolerance; |
| } |
|
|
| void update() override; |
| void doUpdateDim(); |
|
|
| LC_ToleranceData getData() const {return m_toleranceData;} |
|
|
| QString getTextCode() const {return m_toleranceData.m_textCode;} |
| RS_Vector getInsertPoint() const {return m_toleranceData.m_insertionPoint;} |
|
|
| RS_VectorSolutions getRefPoints() 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; |
| void moveRef(const RS_Vector& ref, const RS_Vector& offset) override; |
|
|
| friend std::ostream& operator <<(std::ostream& os, const LC_Tolerance& d); |
| void setTextCode(const QString& textCode) {m_toleranceData.m_textCode = textCode;}; |
| protected: |
| void doUpdate(); |
| QList<QStringList> getFields() const; |
| double getTextHeight(); |
| double getGraphicVariable(const QString& key, double defMM, int code); |
| double getDimtxt(bool scale = true); |
| void setDimtxt(double f); |
| double getGeneralScale(); |
| double getDimscale(); |
| QString getTextStyle(); |
| RS_Color getTextColor(); |
| RS_Pen getPenForText(); |
| RS_Color getDimensionLineColor(); |
| RS_Pen getPenForLines(); |
| void createTextLabels(QList<QList<double>>& divisions); |
| void createFrameLines(QList<QList<double>>& divisions); |
| RS_Line* addDimComponentLine(RS_Vector start, RS_Vector end, const RS_Pen& pen); |
| void addDimComponentEntity(RS_Entity* en, const RS_Pen& pen); |
| mutable bool joinFirstField; |
| private: |
| LC_ToleranceData m_toleranceData; |
| double dimscale = 1.0; |
| double dimtxt; |
| }; |
|
|
| #endif |
|
|