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:
54 
62 
67 
71 
75 
79 
81 
82 public:
83  RDimRotatedEntity(RDocument* document, const RDimRotatedData& data,
84  RObject::Id objectId = RObject::INVALID_ID);
85  virtual ~RDimRotatedEntity();
86 
87  static void init();
88 
89  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
91  }
92 
93  virtual RDimRotatedEntity* clone() const {
94  return new RDimRotatedEntity(*this);
95  }
96 
97  virtual RS::EntityType getType() const {
98  return RS::EntityDimRotated;
99  }
100 
101  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
102  RTransaction* transaction=NULL);
103  QPair<QVariant, RPropertyAttributes> getProperty(
104  RPropertyTypeId& propertyTypeId,
105  bool humanReadable = false, bool noAttributes = false);
106 
108  return data;
109  }
110 
112  data = d;
113  }
114 
115  virtual const RDimRotatedData& getData() const {
116  return data;
117  }
118 
119  void setExtensionPoint1(const RVector& p) {
120  data.setExtensionPoint1(p);
121  }
122 
124  return data.getExtensionPoint1();
125  }
126 
127  void setExtensionPoint2(const RVector& p) {
128  data.setExtensionPoint2(p);
129  }
130 
132  return data.getExtensionPoint2();
133  }
134 
135  void setRotation(double a) {
136  data.setRotation(a);
137  }
138 
139  double getRotation() const {
140  return data.getRotation();
141  }
142 
143 protected:
144  virtual void print(QDebug dbg) const;
145 
146 protected:
148 };
149 
151 Q_DECLARE_METATYPE(QSharedPointer<RDimRotatedEntity>)
152 Q_DECLARE_METATYPE(QSharedPointer<RDimRotatedEntity>*)
153 
154 #endif
double getRotation() const
Definition: RDimRotatedEntity.h:139
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:101
static RPropertyTypeId PropertyAngle
Definition: RDimRotatedEntity.h:80
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:127
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimRotatedEntity.h:89
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:75
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimRotatedEntity.h:56
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimRotatedEntity.h:57
static RPropertyTypeId PropertyExtensionPoint1Z
Definition: RDimRotatedEntity.h:74
virtual const RDimRotatedData & getData() const
Definition: RDimRotatedEntity.h:115
static RPropertyTypeId PropertyText
Definition: RDimRotatedEntity.h:58
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPropertyTypeId.h:57
static RPropertyTypeId PropertyAutoTextPos
Definition: RDimRotatedEntity.h:65
Copyright (c) 2011-2015 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:68
int Id
Definition: RObject.h:53
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimRotatedEntity.h:55
Transaction implementation.
Definition: RTransaction.h:70
static RPropertyTypeId PropertyDrawOrder
Definition: RDimRotatedEntity.h:53
static RPropertyTypeId PropertyExtensionPoint1X
Definition: RDimRotatedEntity.h:72
static RPropertyTypeId PropertyType
Definition: RDimRotatedEntity.h:46
static RPropertyTypeId PropertyExtensionPoint2Z
Definition: RDimRotatedEntity.h:78
static const Id INVALID_ID
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RObject.h:54
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimRotatedEntity.h:59
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimRotatedEntity.h:61
RVector getExtensionPoint2() const
Definition: RDimRotatedEntity.h:131
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:275
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:69
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:63
static RPropertyTypeId PropertyDimScale
Definition: RDimRotatedEntity.h:64
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RDimRotatedEntity.h:43
static RPropertyTypeId PropertyProtected
Definition: RDimRotatedEntity.h:45
virtual RDimRotatedEntity * clone() const
Definition: RDimRotatedEntity.h:93
static RPropertyTypeId PropertyLineweight
Definition: RDimRotatedEntity.h:51
static RPropertyTypeId PropertyExtensionPoint2X
Definition: RDimRotatedEntity.h:76
RDimRotatedData data
Definition: RDimRotatedEntity.h:147
Abstract base class for exporters.
Definition: RExporter.h:63
void setRotation(double a)
Definition: RDimRotatedEntity.h:135
static RPropertyTypeId PropertyBlock
Definition: RDimRotatedEntity.h:47
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimRotatedEntity.h:50
static RPropertyTypeId PropertyLinearFactor
Definition: RDimRotatedEntity.h:63
void setExtensionPoint1(const RVector &p)
Definition: RDimRotatedEntity.h:119
void setData(RDimRotatedData &d)
Definition: RDimRotatedEntity.h:111
static RPropertyTypeId PropertyExtensionPoint1Y
Definition: RDimRotatedEntity.h:73
static RPropertyTypeId PropertyDimensionLinePosZ
Definition: RDimRotatedEntity.h:70
virtual RS::EntityType getType() const
Definition: RDimRotatedEntity.h:97
virtual RDimRotatedData & getData()
Definition: RDimRotatedEntity.h:107
static RPropertyTypeId PropertyExtensionPoint2Y
Definition: RDimRotatedEntity.h:77
static void init()
Definition: RDimensionEntity.cpp:65
RVector getExtensionPoint1() const
Definition: RDimRotatedEntity.h:123
static RPropertyTypeId PropertyFontName
Definition: RDimRotatedEntity.h:66
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimRotatedEntity.h:60
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:148
Linear rotated Dimension.
Definition: RS.h:98