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:
55 
59 
64 
70 
74 
78 
79 public:
80  RDimDiametricEntity(RDocument* document, const RDimDiametricData& data);
81  virtual ~RDimDiametricEntity();
82 
83  static void init();
84 
85  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
87  }
88 
89  virtual RDimDiametricEntity* clone() const {
90  return new RDimDiametricEntity(*this);
91  }
92 
93  virtual RS::EntityType getType() const {
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 RDimDiametricData& getData() const {
112  return data;
113  }
114 
115  void setChordPoint(const RVector& p) {
116  data.setChordPoint(p);
117  }
118 
120  return data.getChordPoint();
121  }
122 
123  void setFarChordPoint(const RVector& p) {
124  data.setFarChordPoint(p);
125  }
126 
128  return data.getFarChordPoint();
129  }
130 
131 protected:
132  virtual void print(QDebug dbg) const;
133 
134 protected:
136 };
137 
140 Q_DECLARE_METATYPE(QSharedPointer<RDimDiametricEntity>*)
141 
142 #endif
static RPropertyTypeId PropertyLinearFactor
Definition: RDimDiametricEntity.h:65
static RPropertyTypeId PropertyLayer
Definition: RDimDiametricEntity.h:48
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimDiametricEntity.h:58
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:105
void setChordPoint(const RVector &p)
Definition: RDimDiametricEntity.h:115
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:123
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#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:56
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
RVector getFarChordPoint() const
Definition: RDimDiametricEntity.h:127
static RPropertyTypeId PropertyDisplayedColor
Definition: RDimDiametricEntity.h:53
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimDiametricEntity.h:63
static RPropertyTypeId PropertyLinetype
Definition: RDimDiametricEntity.h:49
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimDiametricEntity.h:43
static RPropertyTypeId PropertyHandle
Definition: RDimDiametricEntity.h:44
static RPropertyTypeId PropertyColor
Definition: RDimDiametricEntity.h:52
static RPropertyTypeId PropertyAutoTextPos
Definition: RDimDiametricEntity.h:68
Transaction implementation.
Definition: RTransaction.h:70
static RPropertyTypeId PropertyFarChordPointX
Definition: RDimDiametricEntity.h:75
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimDiametricEntity.h:61
static RPropertyTypeId PropertyChordPointX
Definition: RDimDiametricEntity.h:71
static RPropertyTypeId PropertyChordPointZ
Definition: RDimDiametricEntity.h:73
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimDiametricEntity.h:50
static RPropertyTypeId PropertyFarChordPointZ
Definition: RDimDiametricEntity.h:77
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimDiametricEntity.h:62
static RPropertyTypeId PropertyFontName
Definition: RDimDiametricEntity.h:69
RDimDiametricData data
Definition: RDimDiametricEntity.h:135
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:300
static RPropertyTypeId PropertyDrawOrder
Definition: RDimDiametricEntity.h:54
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-2016 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:67
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyDimBlockName
Definition: RDimDiametricEntity.h:67
virtual RS::EntityType getType() const
Definition: RDimDiametricEntity.h:93
static RPropertyTypeId PropertyBlock
Definition: RDimDiametricEntity.h:47
virtual const RDimDiametricData & getData() const
Definition: RDimDiametricEntity.h:111
virtual RDimDiametricEntity * clone() const
Definition: RDimDiametricEntity.h:89
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimDiametricEntity.h:85
static RPropertyTypeId PropertyDimScale
Definition: RDimDiametricEntity.h:66
Abstract base class for exporters.
Definition: RExporter.h:71
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimDiametricEntity.h:57
static RPropertyTypeId PropertyChordPointY
Definition: RDimDiametricEntity.h:72
static RPropertyTypeId PropertyFarChordPointY
Definition: RDimDiametricEntity.h:76
Diametric Dimension.
Definition: RS.h:110
static RPropertyTypeId PropertyLineweight
Definition: RDimDiametricEntity.h:51
static void init()
Definition: RDimensionEntity.cpp:67
static RPropertyTypeId PropertyText
Definition: RDimDiametricEntity.h:60
Aligned dimension entity class.
Definition: RDimDiametricEntity.h:38
void setData(RDimDiametricData &d)
Definition: RDimDiametricEntity.h:107
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:153
virtual RDimDiametricData & getData()
Definition: RDimDiametricEntity.h:103
RVector getChordPoint() const
Definition: RDimDiametricEntity.h:119