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 bool isValid() const;
49 
50  void setLeaderEndPoint(const RVector& p) {
51  leaderEndPoint = p;
52  }
53 
55  return leaderEndPoint;
56  }
57 
58  void setOrigin(const RVector& p) {
60  }
61 
62  RVector getOrigin() const {
63  return getDefinitionPoint();
64  }
65 
66  void setDefiningPoint(const RVector& p) {
67  definingPoint = p;
68  }
69 
71  return definingPoint;
72  }
73 
75  xType = true;
76  }
77 
79  xType = false;
80  }
81 
82  bool isMeasuringXAxis() const {
83  return xType;
84  }
85 
86  virtual QList<RVector> getReferencePoints(
88 
89  virtual bool moveReferencePoint(const RVector& referencePoint,
90  const RVector& targetPoint);
91 
92  virtual bool move(const RVector& offset);
93  virtual bool rotate(double rotation, const RVector& center);
94  virtual bool scale(const RVector& scaleFactors, const RVector& center);
95  virtual bool mirror(const RLine& axis);
96  virtual bool stretch(const RPolyline& area, const RVector& offset);
97 
98  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const;
99  virtual double getMeasuredValue() const;
100  virtual QString getAutoLabel() const;
101 
102 private:
105 
108 
110  bool xType;
111 };
112 
116 Q_DECLARE_METATYPE(QSharedPointer<RDimOrdinateData>)
117 
118 #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:201
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:170
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
RVector getOrigin() const
Definition: RDimOrdinateData.h:62
RVector getDefinitionPoint() const
Definition: RDimensionData.h:65
virtual void setDefinitionPoint(const RVector &p)
Definition: RDimensionData.h:60
virtual bool move(const RVector &offset)
Moves this entity by the given offset.
Definition: RDimensionData.cpp:180
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:141
bool xType
True: measures x-value, false: y-value.
Definition: RDimOrdinateData.h:110
Ordinate dimension entity class.
Definition: RDimOrdinateEntity.h:38
virtual bool rotate(double rotation, const RVector &center)
Definition: RDimensionData.cpp:190
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:118
RVector leaderEndPoint
End point of leader.
Definition: RDimOrdinateData.h:107
void setDefiningPoint(const RVector &p)
Definition: RDimOrdinateData.h:66
RVector definingPoint
Defining point (feature location)
Definition: RDimOrdinateData.h:104
void setMeasuringXAxis()
Definition: RDimOrdinateData.h:74
virtual double getMeasuredValue() const
Definition: RDimensionData.h:169
void setLeaderEndPoint(const RVector &p)
Definition: RDimOrdinateData.h:50
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
Q_DECLARE_METATYPE(RMath *)
virtual QList< RVector > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: RDimensionData.cpp:128
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RDimensionData.h:38
void setMeasuringYAxis()
Definition: RDimOrdinateData.h:78
void setOrigin(const RVector &p)
Definition: RDimOrdinateData.h:58
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:502
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false) const
Definition: REntityData.h:88
virtual bool mirror(const RLine &axis)
Definition: RDimensionData.cpp:211
RDimOrdinateData data
Definition: RDimOrdinateEntity.h:147
RVector getLeaderEndPoint() const
Definition: RDimOrdinateData.h:54
Low-level mathematical representation of a line.
Definition: RLine.h:42
Definition: RS.h:119
Low-level mathematical representation of an open polyline or closed polyline (= polygon).
Definition: RPolyline.h:49
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RDimOrdinateData.h:36
bool isMeasuringXAxis() const
Definition: RDimOrdinateData.h:82
RVector getDefiningPoint() const
Definition: RDimOrdinateData.h:70
RDocument * document
Definition: RObject.h:251