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 RS::EntityType getType() const {
53  return RS::EntityDimAngular;
54  }
55  virtual bool isValid() const;
56  virtual bool isSane() const;
57 
59  extensionLine1Start = p;
60  }
61 
63  return extensionLine1Start;
64  }
65 
66  void setExtensionLine1End(const RVector& p) {
67  extensionLine1End = p;
68  }
69 
71  return extensionLine1End;
72  }
73 
75  extensionLine2Start = p;
76  }
77 
79  return extensionLine2Start;
80  }
81 
82  void setExtensionLine2End(const RVector& p) {
84  }
85 
87  return getDefinitionPoint();
88  }
89 
90  void setDimArcPosition(const RVector& p) {
91  dimArcPosition = p;
92  }
93 
95  return dimArcPosition;
96  }
97 
98  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
99 
100  virtual bool moveReferencePoint(const RVector& referencePoint,
101  const RVector& targetPoint);
102 
103  virtual bool move(const RVector& offset);
104  virtual bool rotate(double rotation, const RVector& center);
105  virtual bool scale(const RVector& scaleFactors, const RVector& center);
106  virtual bool mirror(const RLine& axis);
107 
108  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const;
109  double getAngle() const;
110  bool getAngles(double& ang1, double& ang2,
111  bool& reversed,
112  RVector& p1, RVector& p2) const;
113  RVector getCenter() const;
114  virtual double getMeasuredValue() const;
115  virtual QString getAutoLabel() const;
116 
117 private:
126 };
127 
131 Q_DECLARE_METATYPE(QSharedPointer<RDimAngularData>)
132 
133 #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:66
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
RDimAngularData data
Definition: RDimAngularEntity.h:161
RVector getExtensionLine2End() const
Definition: RDimAngularData.h:86
virtual QString getAutoLabel() const
Definition: RDimensionData.h:185
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
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
void setExtensionLine2End(const RVector &p)
Definition: RDimAngularData.h:82
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
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
void setExtensionLine2Start(const RVector &p)
Definition: RDimAngularData.h:74
virtual bool rotate(double rotation, const RVector &center)
Definition: RDimensionData.cpp:181
Angular Dimension.
Definition: RS.h:114
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:131
RVector extensionLine2Start
Start point of second extension line.
Definition: RDimAngularData.h:123
void setExtensionLine1Start(const RVector &p)
Definition: RDimAngularData.h:58
virtual double getMeasuredValue() const
Definition: RDimensionData.h:184
RVector getExtensionLine2Start() const
Definition: RDimAngularData.h:78
virtual bool isSane() const
Definition: RDimensionData.cpp:107
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
RVector extensionLine1Start
Start point of first extension line.
Definition: RDimAngularData.h:119
RVector getDimArcPosition() const
Definition: RDimAngularData.h:94
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RDimAngularData.h:38
virtual bool mirror(const RLine &axis)
Definition: RDimensionData.cpp:209
Low-level mathematical representation of a line.
Definition: RLine.h:41
Definition: RS.h:132
RVector getExtensionLine1End() const
Definition: RDimAngularData.h:70
RVector dimArcPosition
Arc position.
Definition: RDimAngularData.h:125
virtual RS::EntityType getType() const
Definition: RDimAngularData.h:52
RVector extensionLine1End
End point of first extension line.
Definition: RDimAngularData.h:121
RVector getExtensionLine1Start() const
Definition: RDimAngularData.h:62
void setDimArcPosition(const RVector &p)
Definition: RDimAngularData.h:90
RDocument * document
Definition: RObject.h:271