QCAD
Open Source 2D CAD
RDimOrdinateData.h
Go to the documentation of this file.
1 
20 #ifndef RDIMORDINATEDATA_H
21 #define RDIMORDINATEDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RDocument.h"
26 #include "RDimLinearData.h"
27 #include "RVector.h"
28 
37  friend class RDimOrdinateEntity;
38 
39 protected:
41 
42 public:
44  RDimOrdinateData(const RDimensionData& dimData,
45  const RVector& leaderEndPoint,
46  const RVector& definingPoint);
47 
48  virtual RS::EntityType getType() const {
49  return RS::EntityDimOrdinate;
50  }
51  virtual bool isValid() const;
52  virtual bool isSane() const;
53 
54  void setLeaderEndPoint(const RVector& p) {
55  leaderEndPoint = p;
56  }
57 
59  return leaderEndPoint;
60  }
61 
62  void setOrigin(const RVector& p) {
64  }
65 
66  RVector getOrigin() const {
67  return getDefinitionPoint();
68  }
69 
70  void setDefiningPoint(const RVector& p) {
71  definingPoint = p;
72  }
73 
75  return definingPoint;
76  }
77 
79  xType = true;
80  }
81 
83  xType = false;
84  }
85 
86  bool isMeasuringXAxis() const {
87  return xType;
88  }
89 
90  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
91 
92  virtual bool moveReferencePoint(const RVector& referencePoint, const RVector& targetPoint);
93 
94  virtual bool move(const RVector& offset);
95  virtual bool rotate(double rotation, const RVector& center);
96  virtual bool scale(const RVector& scaleFactors, const RVector& center);
97  virtual bool mirror(const RLine& axis);
98  virtual bool stretch(const RPolyline& area, const RVector& offset);
99 
100  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const;
101  virtual double getMeasuredValue() const;
102  virtual QString getAutoLabel() const;
103 
104 private:
107 
110 
112  bool xType;
113 };
114 
118 Q_DECLARE_METATYPE(QSharedPointer<RDimOrdinateData>)
119 
120 #endif
Represents a box e.g.
Definition: RBox.h:43
virtual bool isValid() const
Definition: RDimensionData.cpp:103
virtual bool scale(const RVector &scaleFactors, const RVector &center)
Definition: RDimensionData.cpp:192
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
virtual QString getAutoLabel() const
Definition: RDimensionData.h:184
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
RVector getOrigin() const
Definition: RDimOrdinateData.h:66
RVector getDefinitionPoint() const
Definition: RDimensionData.h:69
virtual void setDefinitionPoint(const RVector &p)
Definition: RDimensionData.h:64
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false) const
Definition: REntityData.h:104
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: RDimensionData.cpp:132
virtual bool move(const RVector &offset)
Moves this entity by the given offset.
Definition: RDimensionData.cpp:171
Ordinate Dimension.
Definition: RS.h:115
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint)
Moves the given reference point to the given target point or does nothing if this entity has no refer...
Definition: RDimensionData.cpp:143
bool xType
True: measures x-value, false: y-value.
Definition: RDimOrdinateData.h:112
Ordinate dimension entity class.
Definition: RDimOrdinateEntity.h:38
virtual bool rotate(double rotation, const RVector &center)
Definition: RDimensionData.cpp:181
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:131
RVector leaderEndPoint
End point of leader.
Definition: RDimOrdinateData.h:109
void setDefiningPoint(const RVector &p)
Definition: RDimOrdinateData.h:70
RVector definingPoint
Defining point (feature location)
Definition: RDimOrdinateData.h:106
void setMeasuringXAxis()
Definition: RDimOrdinateData.h:78
virtual double getMeasuredValue() const
Definition: RDimensionData.h:183
virtual bool isSane() const
Definition: RDimensionData.cpp:107
void setLeaderEndPoint(const RVector &p)
Definition: RDimOrdinateData.h:54
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
Q_DECLARE_METATYPE(RMath *)
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RDimensionData.h:38
virtual RS::EntityType getType() const
Definition: RDimOrdinateData.h:48
void setMeasuringYAxis()
Definition: RDimOrdinateData.h:82
void setOrigin(const RVector &p)
Definition: RDimOrdinateData.h:62
virtual bool stretch(const RPolyline &area, const RVector &offset)
Stretches the end points of this entity that are inside area by offset.
Definition: REntityData.cpp:572
virtual bool mirror(const RLine &axis)
Definition: RDimensionData.cpp:209
RDimOrdinateData data
Definition: RDimOrdinateEntity.h:147
RVector getLeaderEndPoint() const
Definition: RDimOrdinateData.h:58
Low-level mathematical representation of a line.
Definition: RLine.h:41
Definition: RS.h:132
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RDimOrdinateData.h:36
bool isMeasuringXAxis() const
Definition: RDimOrdinateData.h:86
RVector getDefiningPoint() const
Definition: RDimOrdinateData.h:74
RDocument * document
Definition: RObject.h:271