QCAD
Open Source 2D CAD
RDimRotatedEntity.h
Go to the documentation of this file.
1 
20 #ifndef RDIMROTATEDENTITY_H
21 #define RDIMROTATEDENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "RDimensionEntity.h"
26 #include "RDimRotatedData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40  Q_DECLARE_TR_FUNCTIONS(RDimRotatedEntity)
41 
42 public:
55 
63 
69 
73 
77 
81 
83 
84 public:
85  RDimRotatedEntity(RDocument* document, const RDimRotatedData& data);
86  virtual ~RDimRotatedEntity();
87 
88  static void init();
89 
90  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
92  }
93 
94  virtual RDimRotatedEntity* clone() const {
95  return new RDimRotatedEntity(*this);
96  }
97 
98  virtual RS::EntityType getType() const {
99  return RS::EntityDimRotated;
100  }
101 
102  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
103  RTransaction* transaction=NULL);
104  QPair<QVariant, RPropertyAttributes> getProperty(
105  RPropertyTypeId& propertyTypeId,
106  bool humanReadable = false, bool noAttributes = false);
107 
109  return data;
110  }
111 
113  data = d;
114  }
115 
116  virtual const RDimRotatedData& getData() const {
117  return data;
118  }
119 
120  void setExtensionPoint1(const RVector& p) {
121  data.setExtensionPoint1(p);
122  }
123 
125  return data.getExtensionPoint1();
126  }
127 
128  void setExtensionPoint2(const RVector& p) {
129  data.setExtensionPoint2(p);
130  }
131 
133  return data.getExtensionPoint2();
134  }
135 
136  void setRotation(double a) {
137  data.setRotation(a);
138  }
139 
140  double getRotation() const {
141  return data.getRotation();
142  }
143 
144 protected:
145  virtual void print(QDebug dbg) const;
146 
147 protected:
149 };
150 
152 Q_DECLARE_METATYPE(QSharedPointer<RDimRotatedEntity>)
153 Q_DECLARE_METATYPE(QSharedPointer<RDimRotatedEntity>*)
154 
155 #endif
double getRotation() const
Definition: RDimRotatedEntity.h:140
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:105
static RPropertyTypeId PropertyAngle
Definition: RDimRotatedEntity.h:82
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Base class for dimension entity classes.
Definition: RDimensionEntity.h:38
void setExtensionPoint2(const RVector &p)
Definition: RDimRotatedEntity.h:128
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimRotatedEntity.h:90
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimRotatedEntity.h:57
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimRotatedEntity.h:58
static RPropertyTypeId PropertyExtensionPoint1Z
Definition: RDimRotatedEntity.h:76
virtual const RDimRotatedData & getData() const
Definition: RDimRotatedEntity.h:116
static RPropertyTypeId PropertyText
Definition: RDimRotatedEntity.h:59
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
static RPropertyTypeId PropertyAutoTextPos
Definition: RDimRotatedEntity.h:67
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimRotatedData.h:36
static RPropertyTypeId PropertyLayer
Definition: RDimRotatedEntity.h:48
Linear dimension entity class.
Definition: RDimRotatedEntity.h:38
static RPropertyTypeId PropertyHandle
Definition: RDimRotatedEntity.h:44
static RPropertyTypeId PropertyDimensionLinePosX
Definition: RDimRotatedEntity.h:70
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimRotatedEntity.h:56
Transaction implementation.
Definition: RTransaction.h:70
static RPropertyTypeId PropertyDrawOrder
Definition: RDimRotatedEntity.h:54
static RPropertyTypeId PropertyDimBlockName
Definition: RDimRotatedEntity.h:66
static RPropertyTypeId PropertyExtensionPoint1X
Definition: RDimRotatedEntity.h:74
static RPropertyTypeId PropertyType
Definition: RDimRotatedEntity.h:46
static RPropertyTypeId PropertyExtensionPoint2Z
Definition: RDimRotatedEntity.h:80
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimRotatedEntity.h:60
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimRotatedEntity.h:62
RVector getExtensionPoint2() const
Definition: RDimRotatedEntity.h:132
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:300
static QSet< RPropertyTypeId > getPropertyTypeIds(const std::type_info &classInfo)
Gets all property type IDs that where registered for the given class.
Definition: RPropertyTypeId.cpp:229
static RPropertyTypeId PropertyDimensionLinePosY
Definition: RDimRotatedEntity.h:71
static RPropertyTypeId PropertyLinetype
Definition: RDimRotatedEntity.h:49
static RPropertyTypeId PropertyColor
Definition: RDimRotatedEntity.h:52
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
static RPropertyTypeId PropertyDimScale
Definition: RDimRotatedEntity.h:65
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimRotatedEntity.h:43
static RPropertyTypeId PropertyProtected
Definition: RDimRotatedEntity.h:45
virtual RDimRotatedEntity * clone() const
Definition: RDimRotatedEntity.h:94
static RPropertyTypeId PropertyLineweight
Definition: RDimRotatedEntity.h:51
static RPropertyTypeId PropertyExtensionPoint2X
Definition: RDimRotatedEntity.h:78
RDimRotatedData data
Definition: RDimRotatedEntity.h:148
Abstract base class for exporters.
Definition: RExporter.h:71
void setRotation(double a)
Definition: RDimRotatedEntity.h:136
static RPropertyTypeId PropertyBlock
Definition: RDimRotatedEntity.h:47
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimRotatedEntity.h:50
static RPropertyTypeId PropertyLinearFactor
Definition: RDimRotatedEntity.h:64
void setExtensionPoint1(const RVector &p)
Definition: RDimRotatedEntity.h:120
static RPropertyTypeId PropertyDisplayedColor
Definition: RDimRotatedEntity.h:53
void setData(RDimRotatedData &d)
Definition: RDimRotatedEntity.h:112
static RPropertyTypeId PropertyExtensionPoint1Y
Definition: RDimRotatedEntity.h:75
static RPropertyTypeId PropertyDimensionLinePosZ
Definition: RDimRotatedEntity.h:72
virtual RS::EntityType getType() const
Definition: RDimRotatedEntity.h:98
virtual RDimRotatedData & getData()
Definition: RDimRotatedEntity.h:108
static RPropertyTypeId PropertyExtensionPoint2Y
Definition: RDimRotatedEntity.h:79
static void init()
Definition: RDimensionEntity.cpp:67
RVector getExtensionPoint1() const
Definition: RDimRotatedEntity.h:124
static RPropertyTypeId PropertyFontName
Definition: RDimRotatedEntity.h:68
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimRotatedEntity.h:61
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:153
Linear rotated Dimension.
Definition: RS.h:108