QCAD
Open Source 2D CAD
RDimAngularData.h
Go to the documentation of this file.
1 
20 #ifndef RDimAngularDataDATA_H
21 #define RDimAngularDataDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RArc.h"
26 #include "RDocument.h"
27 #include "RDimensionData.h"
28 #include "RLine.h"
29 #include "RVector.h"
30 
39  friend class RDimAngularEntity;
40 
41 protected:
43 
44 public:
46  RDimAngularData(const RDimensionData& dimData,
47  const RVector& extensionLine1Start,
48  const RVector& extensionLine1End,
49  const RVector& extensionLine2Start,
50  const RVector& dimArcPosition);
51 
52  virtual bool isValid() const;
53 
55  extensionLine1Start = p;
56  }
57 
59  return extensionLine1Start;
60  }
61 
62  void setExtensionLine1End(const RVector& p) {
63  extensionLine1End = p;
64  }
65 
67  return extensionLine1End;
68  }
69 
71  extensionLine2Start = p;
72  }
73 
75  return extensionLine2Start;
76  }
77 
78  void setExtensionLine2End(const RVector& p) {
80  }
81 
83  return getDefinitionPoint();
84  }
85 
86  void setDimArcPosition(const RVector& p) {
87  dimArcPosition = p;
88  }
89 
91  return dimArcPosition;
92  }
93 
94  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
95 
96  virtual bool moveReferencePoint(const RVector& referencePoint,
97  const RVector& targetPoint);
98 
99  virtual bool move(const RVector& offset);
100  virtual bool rotate(double rotation, const RVector& center);
101  virtual bool scale(const RVector& scaleFactors, const RVector& center);
102  virtual bool mirror(const RLine& axis);
103 
104  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const;
105  double getAngle() const;
106  bool getAngles(double& ang1, double& ang2,
107  bool& reversed,
108  RVector& p1, RVector& p2) const;
109  RVector getCenter() const;
110  virtual double getMeasuredValue() const;
111  virtual QString getAutoLabel() const;
112 
113 private:
122 };
123 
127 Q_DECLARE_METATYPE(QSharedPointer<RDimAngularData>)
128 
129 #endif
Aligned dimension entity class.
Definition: RDimAngularEntity.h:38
Represents a box e.g.
Definition: RBox.h:43
virtual bool isValid() const
Definition: RDimensionData.cpp:103
void setExtensionLine1End(const RVector &p)
Definition: RDimAngularData.h:62
virtual bool scale(const RVector &scaleFactors, const RVector &center)
Definition: RDimensionData.cpp:188
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
RDimAngularData data
Definition: RDimAngularEntity.h:165
RVector getExtensionLine2End() const
Definition: RDimAngularData.h:82
virtual QString getAutoLabel() const
Definition: RDimensionData.h:179
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
RVector getDefinitionPoint() const
Definition: RDimensionData.h:65
virtual void setDefinitionPoint(const RVector &p)
Definition: RDimensionData.h:60
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false) const
Definition: REntityData.h:93
void setExtensionLine2End(const RVector &p)
Definition: RDimAngularData.h:78
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: RDimensionData.cpp:128
virtual bool move(const RVector &offset)
Moves this entity by the given offset.
Definition: RDimensionData.cpp:167
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:139
void setExtensionLine2Start(const RVector &p)
Definition: RDimAngularData.h:70
virtual bool rotate(double rotation, const RVector &center)
Definition: RDimensionData.cpp:177
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:131
RVector extensionLine2Start
Start point of second extension line.
Definition: RDimAngularData.h:119
void setExtensionLine1Start(const RVector &p)
Definition: RDimAngularData.h:54
virtual double getMeasuredValue() const
Definition: RDimensionData.h:178
RVector getExtensionLine2Start() const
Definition: RDimAngularData.h:74
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-2016 by Andrew Mustun.
Definition: RDimensionData.h:38
RVector extensionLine1Start
Start point of first extension line.
Definition: RDimAngularData.h:115
RVector getDimArcPosition() const
Definition: RDimAngularData.h:90
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimAngularData.h:38
virtual bool mirror(const RLine &axis)
Definition: RDimensionData.cpp:205
Low-level mathematical representation of a line.
Definition: RLine.h:41
Definition: RS.h:132
RVector getExtensionLine1End() const
Definition: RDimAngularData.h:66
RVector dimArcPosition
Arc position.
Definition: RDimAngularData.h:121
RVector extensionLine1End
End point of first extension line.
Definition: RDimAngularData.h:117
RVector getExtensionLine1Start() const
Definition: RDimAngularData.h:58
void setDimArcPosition(const RVector &p)
Definition: RDimAngularData.h:86
RDocument * document
Definition: RObject.h:271