QCAD
Open Source 2D CAD
RDimLinearEntity.h
Go to the documentation of this file.
1 
20 #ifndef RDIMLINEARENTITY_H
21 #define RDIMLINEARENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "RDimensionEntity.h"
26 #include "RDimLinearData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40  Q_DECLARE_TR_FUNCTIONS(RDimLinearEntity)
41 
42 public:
55 
63 
69 
73 
77 
81 
82 public:
83  RDimLinearEntity(RDocument* document);
84  virtual ~RDimLinearEntity();
85 
86  static void init();
87 
88  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
89  RTransaction* transaction=NULL);
90  QPair<QVariant, RPropertyAttributes> getProperty(
91  RPropertyTypeId& propertyTypeId,
92  bool humanReadable = false, bool noAttributes = false);
93 
94  virtual RDimLinearData& getData() = 0;
95  virtual const RDimLinearData& getData() const = 0;
96 
97  void setExtensionPoint1(const RVector& p) {
98  getData().setExtensionPoint1(p);
99  }
100 
102  return getData().getExtensionPoint1();
103  }
104 
105  void setExtensionPoint2(const RVector& p) {
106  getData().setExtensionPoint2(p);
107  }
108 
110  return getData().getExtensionPoint2();
111  }
112 
113 protected:
114  virtual void print(QDebug dbg) const;
115 };
116 
118 Q_DECLARE_METATYPE(QSharedPointer<RDimLinearEntity>)
119 Q_DECLARE_METATYPE(QSharedPointer<RDimLinearEntity>*)
120 
121 #endif
static RPropertyTypeId PropertyExtensionPoint2Y
Definition: RDimLinearEntity.h:79
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:105
static RPropertyTypeId PropertyColor
Definition: RDimLinearEntity.h:52
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Base class for dimension entity classes.
Definition: RDimensionEntity.h:38
virtual RDimensionData & getData()=0
static RPropertyTypeId PropertyDrawOrder
Definition: RDimLinearEntity.h:54
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimLinearEntity.h:60
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimLinearEntity.h:58
void setExtensionPoint1(const RVector &p)
Definition: RDimLinearEntity.h:97
static RPropertyTypeId PropertyDimensionLinePosY
Definition: RDimLinearEntity.h:71
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
void setExtensionPoint2(const RVector &p)
Definition: RDimLinearEntity.h:105
static RPropertyTypeId PropertyDimensionLinePosX
Definition: RDimLinearEntity.h:70
static RPropertyTypeId PropertyType
Definition: RDimLinearEntity.h:46
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
static RPropertyTypeId PropertyHandle
Definition: RDimLinearEntity.h:44
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimLinearEntity.h:62
static RPropertyTypeId PropertyExtensionPoint2Z
Definition: RDimLinearEntity.h:80
Transaction implementation.
Definition: RTransaction.h:74
static RPropertyTypeId PropertyBlock
Definition: RDimLinearEntity.h:47
static RPropertyTypeId PropertyDimBlockName
Definition: RDimLinearEntity.h:66
RVector getExtensionPoint2() const
Definition: RDimLinearEntity.h:109
static RPropertyTypeId PropertyText
Definition: RDimLinearEntity.h:59
static RPropertyTypeId PropertyDimScale
Definition: RDimLinearEntity.h:65
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:300
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimLinearEntity.h:43
static RPropertyTypeId PropertyExtensionPoint1X
Definition: RDimLinearEntity.h:74
Linear dimension entity base class.
Definition: RDimLinearEntity.h:38
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
static RPropertyTypeId PropertyLayer
Definition: RDimLinearEntity.h:48
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyAutoTextPos
Definition: RDimLinearEntity.h:67
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimLinearEntity.h:56
static RPropertyTypeId PropertyExtensionPoint1Z
Definition: RDimLinearEntity.h:76
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimLinearEntity.h:61
static RPropertyTypeId PropertyLineweight
Definition: RDimLinearEntity.h:51
static RPropertyTypeId PropertyFontName
Definition: RDimLinearEntity.h:68
static RPropertyTypeId PropertyDisplayedColor
Definition: RDimLinearEntity.h:53
Abstract base class for exporters.
Definition: RExporter.h:71
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimLinearEntity.h:50
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimLinearData.h:36
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimLinearEntity.h:57
static RPropertyTypeId PropertyExtensionPoint2X
Definition: RDimLinearEntity.h:78
static void init()
Definition: RDimensionEntity.cpp:67
static RPropertyTypeId PropertyLinetype
Definition: RDimLinearEntity.h:49
RVector getExtensionPoint1() const
Definition: RDimLinearEntity.h:101
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:153
static RPropertyTypeId PropertyLinearFactor
Definition: RDimLinearEntity.h:64
static RPropertyTypeId PropertyExtensionPoint1Y
Definition: RDimLinearEntity.h:75
static RPropertyTypeId PropertyDimensionLinePosZ
Definition: RDimLinearEntity.h:72
static RPropertyTypeId PropertyProtected
Definition: RDimLinearEntity.h:45