QCAD
Open Source 2D CAD
RDimOrdinateEntity.h
Go to the documentation of this file.
1 
20 #ifndef RDIMORDINATEENTITY_H
21 #define RDIMORDINATEENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "RDimensionEntity.h"
26 #include "RDimOrdinateData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40  Q_DECLARE_TR_FUNCTIONS(RDimOrdinateEntity)
41 
42 public:
54 
63 
67 
69 
73 
77 
78 public:
79  RDimOrdinateEntity(RDocument* document, const RDimOrdinateData& data,
80  RObject::Id objectId = RObject::INVALID_ID);
81  virtual ~RDimOrdinateEntity();
82 
83  static void init();
84 
85  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
87  }
88 
89  virtual RDimOrdinateEntity* clone() const {
90  return new RDimOrdinateEntity(*this);
91  }
92 
93  virtual RS::EntityType getType() const {
94  return RS::EntityDimOrdinate;
95  }
96 
97  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
98  RTransaction* transaction=NULL);
99  QPair<QVariant, RPropertyAttributes> getProperty(
100  RPropertyTypeId& propertyTypeId,
101  bool humanReadable = false, bool noAttributes = false);
102 
104  return data;
105  }
106 
108  data = d;
109  }
110 
111  virtual const RDimOrdinateData& getData() const {
112  return data;
113  }
114 
115  void setLeaderEndPoint(const RVector& p) {
116  data.setLeaderEndPoint(p);
117  }
118 
120  return data.getLeaderEndPoint();
121  }
122 
123  void setDefiningPoint(const RVector& p) {
124  data.setDefiningPoint(p);
125  }
126 
128  return data.getDefiningPoint();
129  }
130 
132  data.setMeasuringXAxis();
133  }
134 
136  data.setMeasuringYAxis();
137  }
138 
139  bool isMeasuringXAxis() const {
140  return data.isMeasuringXAxis();
141  }
142 
143 protected:
144  virtual void print(QDebug dbg) const;
145 
146 protected:
148 };
149 
151 Q_DECLARE_METATYPE(QSharedPointer<RDimOrdinateEntity>)
152 Q_DECLARE_METATYPE(QSharedPointer<RDimOrdinateEntity>*)
153 
154 #endif
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:101
void setDefiningPoint(const RVector &p)
Definition: RDimOrdinateEntity.h:123
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Base class for dimension entity classes.
Definition: RDimensionEntity.h:38
virtual const RDimOrdinateData & getData() const
Definition: RDimOrdinateEntity.h:111
virtual RDimOrdinateEntity * clone() const
Definition: RDimOrdinateEntity.h:89
static RPropertyTypeId PropertyDefiningPointZ
Definition: RDimOrdinateEntity.h:76
void setMeasuringXAxis()
Definition: RDimOrdinateEntity.h:131
static RPropertyTypeId PropertyProtected
Definition: RDimOrdinateEntity.h:45
virtual RDimOrdinateData & getData()
Definition: RDimOrdinateEntity.h:103
RVector getLeaderEndPoint() const
Definition: RDimOrdinateEntity.h:119
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:75
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyOrdinate
Definition: RDimOrdinateEntity.h:68
static RPropertyTypeId PropertyDrawOrder
Definition: RDimOrdinateEntity.h:53
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPropertyTypeId.h:57
static RPropertyTypeId PropertyText
Definition: RDimOrdinateEntity.h:58
static RPropertyTypeId PropertyOriginX
Definition: RDimOrdinateEntity.h:64
static RPropertyTypeId PropertyLeaderEndPointX
Definition: RDimOrdinateEntity.h:70
bool isMeasuringXAxis() const
Definition: RDimOrdinateEntity.h:139
Ordinate Dimension.
Definition: RS.h:102
static RPropertyTypeId PropertyFontName
Definition: RDimOrdinateEntity.h:62
int Id
Definition: RObject.h:53
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RDimOrdinateEntity.h:43
Transaction implementation.
Definition: RTransaction.h:70
void setMeasuringYAxis()
Definition: RDimOrdinateEntity.h:135
static RPropertyTypeId PropertyDefiningPointY
Definition: RDimOrdinateEntity.h:75
Ordinate dimension entity class.
Definition: RDimOrdinateEntity.h:38
static RPropertyTypeId PropertyLineweight
Definition: RDimOrdinateEntity.h:51
static const Id INVALID_ID
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RObject.h:54
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimOrdinateEntity.h:56
static RPropertyTypeId PropertyHandle
Definition: RDimOrdinateEntity.h:44
static RPropertyTypeId PropertyOriginY
Definition: RDimOrdinateEntity.h:65
static RPropertyTypeId PropertyBlock
Definition: RDimOrdinateEntity.h:47
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:275
static RPropertyTypeId PropertyLeaderEndPointY
Definition: RDimOrdinateEntity.h:71
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
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimOrdinateEntity.h:50
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimOrdinateEntity.h:60
void setData(RDimOrdinateData &d)
Definition: RDimOrdinateEntity.h:107
virtual RS::EntityType getType() const
Definition: RDimOrdinateEntity.h:93
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimOrdinateEntity.h:57
static RPropertyTypeId PropertyLeaderEndPointZ
Definition: RDimOrdinateEntity.h:72
static RPropertyTypeId PropertyOriginZ
Definition: RDimOrdinateEntity.h:66
static RPropertyTypeId PropertyColor
Definition: RDimOrdinateEntity.h:52
RDimOrdinateData data
Definition: RDimOrdinateEntity.h:147
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimOrdinateEntity.h:55
RVector getDefiningPoint() const
Definition: RDimOrdinateEntity.h:127
Abstract base class for exporters.
Definition: RExporter.h:63
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimOrdinateEntity.h:85
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimOrdinateEntity.h:59
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimOrdinateEntity.h:61
void setLeaderEndPoint(const RVector &p)
Definition: RDimOrdinateEntity.h:115
static RPropertyTypeId PropertyLayer
Definition: RDimOrdinateEntity.h:48
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RDimOrdinateData.h:36
static void init()
Definition: RDimensionEntity.cpp:65
static RPropertyTypeId PropertyLinetype
Definition: RDimOrdinateEntity.h:49
static RPropertyTypeId PropertyType
Definition: RDimOrdinateEntity.h:46
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:148
static RPropertyTypeId PropertyDefiningPointX
Definition: RDimOrdinateEntity.h:74