1 #ifndef RS_DIMANGULAR_H
2 #define RS_DIMANGULAR_H
4 #include "rs_dimension.h"
7 * Holds the data that defines a angular dimension entity.
9 class RS_DimAngularData
13 * Default constructor. Leaves the data object uninitialized.
15 RS_DimAngularData() {}
18 * Constructor with initialisation.
20 * @param definitionPoint Definition point of the angular dimension.
21 * @param leader Leader length.
23 RS_DimAngularData(const Vector& definitionPoint1, const Vector& definitionPoint2,
24 const Vector& definitionPoint3, const Vector& definitionPoint4)
26 this->definitionPoint1 = definitionPoint1;
27 this->definitionPoint2 = definitionPoint2;
28 this->definitionPoint3 = definitionPoint3;
29 this->definitionPoint4 = definitionPoint4;
32 friend std::ostream & operator<<(std::ostream& os, const RS_DimAngularData & dd)
34 os << "(" << dd.definitionPoint1 << "/" << dd.definitionPoint2 << "/"
35 << dd.definitionPoint3 << "/" << dd.definitionPoint3 << ")";
40 /** Definition point 1. */
41 Vector definitionPoint1;
42 /** Definition point 2. */
43 Vector definitionPoint2;
44 /** Definition point 3. */
45 Vector definitionPoint3;
46 /** Definition point 4. */
47 Vector definitionPoint4;
51 * Class for angular dimension entities.
53 * @author Andrew Mustun
55 class RS_DimAngular: public RS_Dimension
58 RS_DimAngular(RS_EntityContainer * parent, const RS_DimensionData & d, const RS_DimAngularData & ed);
59 virtual ~RS_DimAngular();
61 virtual RS_Entity * clone();
62 virtual RS2::EntityType rtti() const;
63 RS_DimAngularData getEData() const;
64 virtual QString getMeasuredLabel();
67 bool getAngles(double & ang1, double & ang2, bool & reversed, Vector & p1, Vector & p2);
69 virtual void update(bool autoText = false);
71 Vector getDefinitionPoint1();
72 Vector getDefinitionPoint2();
73 Vector getDefinitionPoint3();
74 Vector getDefinitionPoint4();
76 virtual void move(Vector offset);
77 virtual void rotate(Vector center, double angle);
78 virtual void scale(Vector center, Vector factor);
79 virtual void mirror(Vector axisPoint1, Vector axisPoint2);
81 friend std::ostream & operator<<(std::ostream & os, const RS_DimAngular & d);
85 RS_DimAngularData edata;