4 #include "rs_dimension.h"
7 * Holds the data that defines a linear dimension entity.
13 * Default constructor. Leaves the data object uninitialized.
18 * Constructor with initialisation.
20 * @para extensionPoint1 Startpoint of the first extension line.
21 * @para extensionPoint2 Startpoint of the second extension line.
22 * @param angle Rotation angle in rad.
23 * @param oblique Oblique angle in rad.
25 RS_DimLinearData(const Vector & extensionPoint1,
26 const Vector & extensionPoint2,
27 double angle, double oblique)
29 this->extensionPoint1 = extensionPoint1;
30 this->extensionPoint2 = extensionPoint2;
32 this->oblique = oblique;
35 friend class RS_DimLinear;
36 friend class RS_ActionDimLinear;
38 friend std::ostream & operator<<(std::ostream & os, const RS_DimLinearData & dd)
40 os << "(" << dd.extensionPoint1 << "/" << dd.extensionPoint1 << ")";
45 /** Definition point. Startpoint of the first definition line. */
46 Vector extensionPoint1;
47 /** Definition point. Startpoint of the second definition line. */
48 Vector extensionPoint2;
49 /** Rotation angle in rad. */
51 /** Oblique angle in rad. */
56 * Class for aligned dimension entities.
58 * @author Andrew Mustun
60 class RS_DimLinear: public RS_Dimension
63 RS_DimLinear(RS_EntityContainer * parent, const RS_DimensionData & d, const RS_DimLinearData & ed);
64 virtual ~RS_DimLinear();
66 virtual RS_Entity * clone();
67 virtual RS2::EntityType rtti() const;
68 RS_DimLinearData getEData() const;
69 virtual VectorSolutions getRefPoints();
70 virtual QString getMeasuredLabel();
71 virtual void update(bool autoText = false);
72 Vector getExtensionPoint1();
73 Vector getExtensionPoint2();
75 void setAngle(double a);
77 virtual bool hasEndpointsWithinWindow(Vector v1, Vector v2);
78 virtual void move(Vector offset);
79 virtual void rotate(Vector center, double angle);
80 virtual void scale(Vector center, Vector factor);
81 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
82 virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset);
83 virtual void moveRef(const Vector & ref, const Vector & offset);
85 friend std::ostream & operator<<(std::ostream & os, const RS_DimLinear & d);
89 RS_DimLinearData edata;