1 #ifndef __DIMALIGNED_H__
2 #define __DIMALIGNED_H__
7 * Holds the data that defines an aligned dimension entity.
13 * Default constructor. Leaves the data object uninitialized.
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 DimAlignedData(const Vector & extensionPoint1, const Vector & extensionPoint2)
27 this->extensionPoint1 = extensionPoint1;
28 this->extensionPoint2 = extensionPoint2;
31 friend class DimAligned;
32 friend class ActionDimAligned;
34 friend std::ostream & operator<<(std::ostream & os, const 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 DimAligned: public Dimension
55 DimAligned(EntityContainer * parent, const DimensionData & d, const DimAlignedData & ed);
56 virtual ~DimAligned();
58 virtual Entity * clone();
59 virtual RS2::EntityType rtti() const;
60 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 DimAligned & d);