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