1 #ifndef RS_DIMALIGNED_H
2 #define RS_DIMALIGNED_H
4 #include "rs_dimension.h"
7 * Holds the data that defines an aligned dimension entity.
9 class RS_DimAlignedData
13 * Default constructor. Leaves the data object uninitialized.
15 RS_DimAlignedData() {}
18 * Constructor with initialisation.
20 * @para extensionPoint1 Definition point. Startpoint of the
21 * first extension line.
22 * @para extensionPoint2 Definition point. Startpoint of the
23 * second extension line.
25 RS_DimAlignedData(const Vector & extensionPoint1, const Vector & extensionPoint2)
27 this->extensionPoint1 = extensionPoint1;
28 this->extensionPoint2 = extensionPoint2;
31 friend class RS_DimAligned;
32 friend class RS_ActionDimAligned;
34 friend std::ostream & operator<<(std::ostream & os, const RS_DimAlignedData & dd)
36 os << "(" << dd.extensionPoint1 << "/" << dd.extensionPoint1 << ")";
41 /** Definition point. Startpoint of the first extension line. */
42 Vector extensionPoint1;
43 /** Definition point. Startpoint of the second extension line. */
44 Vector extensionPoint2;
48 * Class for aligned dimension entities.
50 * @author Andrew Mustun
52 class RS_DimAligned: public RS_Dimension
55 RS_DimAligned(RS_EntityContainer * parent, const RS_DimensionData & d, const RS_DimAlignedData & ed);
56 virtual ~RS_DimAligned();
58 virtual RS_Entity * clone();
59 virtual RS2::EntityType rtti() const;
60 RS_DimAlignedData getEData() const;
61 virtual VectorSolutions getRefPoints();
62 virtual QString getMeasuredLabel();
63 virtual void update(bool autoText = false);
65 Vector getExtensionPoint1();
66 Vector getExtensionPoint2();
67 virtual bool hasEndpointsWithinWindow(Vector v1, Vector v2);
69 virtual void move(Vector offset);
70 virtual void rotate(Vector center, double angle);
71 virtual void scale(Vector center, Vector factor);
72 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
73 virtual void stretch(Vector firstCorner, Vector secondCorner, Vector offset);
74 virtual void moveRef(const Vector & ref, const Vector & offset);
76 friend std::ostream & operator<<(std::ostream & os, const RS_DimAligned & d);
80 RS_DimAlignedData edata;