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:
55 
59 
65 
67 
71 
73 
77 
81 
82 public:
83  RDimOrdinateEntity(RDocument* document, const RDimOrdinateData& data);
84  virtual ~RDimOrdinateEntity();
85 
86  static void init();
87 
88  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
90  }
91 
92  virtual RDimOrdinateEntity* clone() const {
93  return new RDimOrdinateEntity(*this);
94  }
95 
96  virtual RS::EntityType getType() const {
97  return RS::EntityDimOrdinate;
98  }
99 
100  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
101  RTransaction* transaction=NULL);
102  QPair<QVariant, RPropertyAttributes> getProperty(
103  RPropertyTypeId& propertyTypeId,
104  bool humanReadable = false, bool noAttributes = false);
105 
107  return data;
108  }
109 
111  data = d;
112  }
113 
114  virtual const RDimOrdinateData& getData() const {
115  return data;
116  }
117 
118  void setLeaderEndPoint(const RVector& p) {
119  data.setLeaderEndPoint(p);
120  }
121 
123  return data.getLeaderEndPoint();
124  }
125 
126  void setDefiningPoint(const RVector& p) {
127  data.setDefiningPoint(p);
128  }
129 
131  return data.getDefiningPoint();
132  }
133 
135  data.setMeasuringXAxis();
136  }
137 
139  data.setMeasuringYAxis();
140  }
141 
142  bool isMeasuringXAxis() const {
143  return data.isMeasuringXAxis();
144  }
145 
146 protected:
147  virtual void print(QDebug dbg) const;
148 
149 protected:
151 };
152 
154 Q_DECLARE_METATYPE(QSharedPointer<RDimOrdinateEntity>)
155 Q_DECLARE_METATYPE(QSharedPointer<RDimOrdinateEntity>*)
156 
157 #endif
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:105
void setDefiningPoint(const RVector &p)
Definition: RDimOrdinateEntity.h:126
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:114
virtual RDimOrdinateEntity * clone() const
Definition: RDimOrdinateEntity.h:92
static RPropertyTypeId PropertyDefiningPointZ
Definition: RDimOrdinateEntity.h:80
void setMeasuringXAxis()
Definition: RDimOrdinateEntity.h:134
static RPropertyTypeId PropertyProtected
Definition: RDimOrdinateEntity.h:45
virtual RDimOrdinateData & getData()
Definition: RDimOrdinateEntity.h:106
RVector getLeaderEndPoint() const
Definition: RDimOrdinateEntity.h:122
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyOrdinate
Definition: RDimOrdinateEntity.h:72
static RPropertyTypeId PropertyDrawOrder
Definition: RDimOrdinateEntity.h:54
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
static RPropertyTypeId PropertyText
Definition: RDimOrdinateEntity.h:60
static RPropertyTypeId PropertyOriginX
Definition: RDimOrdinateEntity.h:68
static RPropertyTypeId PropertyLeaderEndPointX
Definition: RDimOrdinateEntity.h:74
bool isMeasuringXAxis() const
Definition: RDimOrdinateEntity.h:142
Ordinate Dimension.
Definition: RS.h:113
static RPropertyTypeId PropertyFontName
Definition: RDimOrdinateEntity.h:64
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimOrdinateEntity.h:43
Transaction implementation.
Definition: RTransaction.h:74
void setMeasuringYAxis()
Definition: RDimOrdinateEntity.h:138
static RPropertyTypeId PropertyDefiningPointY
Definition: RDimOrdinateEntity.h:79
Ordinate dimension entity class.
Definition: RDimOrdinateEntity.h:38
static RPropertyTypeId PropertyLineweight
Definition: RDimOrdinateEntity.h:51
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimOrdinateEntity.h:57
static RPropertyTypeId PropertyDisplayedColor
Definition: RDimOrdinateEntity.h:53
static RPropertyTypeId PropertyHandle
Definition: RDimOrdinateEntity.h:44
static RPropertyTypeId PropertyOriginY
Definition: RDimOrdinateEntity.h:69
static RPropertyTypeId PropertyBlock
Definition: RDimOrdinateEntity.h:47
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:300
static RPropertyTypeId PropertyLeaderEndPointY
Definition: RDimOrdinateEntity.h:75
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:67
static RPropertyTypeId PropertyDimBlockName
Definition: RDimOrdinateEntity.h:66
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimOrdinateEntity.h:50
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimOrdinateEntity.h:62
void setData(RDimOrdinateData &d)
Definition: RDimOrdinateEntity.h:110
virtual RS::EntityType getType() const
Definition: RDimOrdinateEntity.h:96
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimOrdinateEntity.h:58
static RPropertyTypeId PropertyLeaderEndPointZ
Definition: RDimOrdinateEntity.h:76
static RPropertyTypeId PropertyOriginZ
Definition: RDimOrdinateEntity.h:70
static RPropertyTypeId PropertyColor
Definition: RDimOrdinateEntity.h:52
RDimOrdinateData data
Definition: RDimOrdinateEntity.h:150
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimOrdinateEntity.h:56
RVector getDefiningPoint() const
Definition: RDimOrdinateEntity.h:130
Abstract base class for exporters.
Definition: RExporter.h:71
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimOrdinateEntity.h:88
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimOrdinateEntity.h:61
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimOrdinateEntity.h:63
void setLeaderEndPoint(const RVector &p)
Definition: RDimOrdinateEntity.h:118
static RPropertyTypeId PropertyLayer
Definition: RDimOrdinateEntity.h:48
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimOrdinateData.h:36
static void init()
Definition: RDimensionEntity.cpp:67
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:153
static RPropertyTypeId PropertyDefiningPointX
Definition: RDimOrdinateEntity.h:78