QCAD
Open Source 2D CAD
RDimRotatedData.h
Go to the documentation of this file.
1 
20 #ifndef RDIMROTATEDDATA_H
21 #define RDIMROTATEDDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RDocument.h"
26 #include "RDimLinearData.h"
27 #include "RVector.h"
28 
37  friend class RDimRotatedEntity;
38 
39 protected:
41 
42 public:
44  RDimRotatedData(const RDimensionData& dimData,
45  const RVector& extensionPoint1,
46  const RVector& extensionPoint2,
47  double rotation);
48 
49  virtual RBox getBoundingBox(bool ignoreEmpty=false) const;
50 
51  virtual bool isValid() const;
52 
53  void setRotation(double r) {
54  rotation = r;
55  }
56 
57  double getRotation() const {
58  return rotation;
59  }
60 
61  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
62 
63  virtual bool moveReferencePoint(const RVector& referencePoint, const RVector& targetPoint);
64 
65  virtual QList<RVector> getDimPoints() const;
66 
67  virtual void recomputeDefinitionPoint(
68  const RVector& oldExtPoint1, const RVector& oldExtPoint2,
69  const RVector& newExtPoint1, const RVector& newExtPoint2);
70 
71  //virtual void recomputeDefinitionPoint(const RVector& oldDimLineGrip, const RVector& newDimLineGrip);
72 
73  virtual bool rotate(double rotation, const RVector& center);
74  virtual bool mirror(const RLine& axis);
75 
76  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const;
77  virtual double getMeasuredValue() const;
78  virtual QString getAutoLabel() const;
79 
80 private:
82  double rotation;
83 };
84 
88 Q_DECLARE_METATYPE(QSharedPointer<RDimRotatedData>)
89 
90 #endif
virtual bool mirror(const RLine &axis)
Definition: RDimLinearData.cpp:118
Represents a box e.g.
Definition: RBox.h:43
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:179
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
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: RDimLinearData.cpp:56
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: RDimensionData.cpp:128
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimRotatedData.h:36
Linear dimension entity class.
Definition: RDimRotatedEntity.h:38
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:128
virtual double getMeasuredValue() const
Definition: RDimensionData.h:178
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
double getRotation() const
Definition: RDimRotatedData.h:57
virtual void recomputeDefinitionPoint(const RVector &oldExtPoint1, const RVector &oldExtPoint2, const RVector &newExtPoint1, const RVector &newExtPoint2)
Definition: RDimLinearData.h:72
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false) const
Definition: REntityData.h:89
void setRotation(double r)
Definition: RDimRotatedData.h:53
Low-level mathematical representation of a line.
Definition: RLine.h:42
Definition: RS.h:129
virtual bool rotate(double rotation, const RVector &center)
Definition: RDimLinearData.cpp:102
virtual RBox getBoundingBox(bool ignoreEmpty=false) const
Definition: RDimensionData.cpp:93
RDimRotatedData data
Definition: RDimRotatedEntity.h:148
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimLinearData.h:36
double rotation
Fixed angle of dimension line in rad.
Definition: RDimRotatedData.h:82
virtual bool isValid() const
Definition: RDimLinearData.cpp:50
RDocument * document
Definition: RObject.h:267