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 RS::EntityType getType() const {
50  return RS::EntityDimRotated;
51  }
52  virtual RBox getBoundingBox(bool ignoreEmpty=false) const;
53 
54  virtual bool isValid() const;
55  virtual bool isSane() const;
56 
57  void setRotation(double r) {
58  rotation = r;
59  }
60 
61  double getRotation() const {
62  return rotation;
63  }
64 
65  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
66 
67  virtual bool moveReferencePoint(const RVector& referencePoint, const RVector& targetPoint);
68 
69  virtual QList<RVector> getDimPoints() const;
70 
71  virtual void recomputeDefinitionPoint(
72  const RVector& oldExtPoint1, const RVector& oldExtPoint2,
73  const RVector& newExtPoint1, const RVector& newExtPoint2);
74 
75  //virtual void recomputeDefinitionPoint(const RVector& oldDimLineGrip, const RVector& newDimLineGrip);
76 
77  virtual bool rotate(double rotation, const RVector& center);
78  virtual bool mirror(const RLine& axis);
79 
80  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const;
81  virtual double getMeasuredValue() const;
82  virtual QString getAutoLabel() const;
83 
84 private:
86  double rotation;
87 };
88 
92 Q_DECLARE_METATYPE(QSharedPointer<RDimRotatedData>)
93 
94 #endif
virtual bool mirror(const RLine &axis)
Definition: RDimLinearData.cpp:124
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:184
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
virtual bool isSane() const
Definition: RDimLinearData.cpp:56
#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:62
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
Copyright (c) 2011-2017 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:131
virtual double getMeasuredValue() const
Definition: RDimensionData.h:183
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
double getRotation() const
Definition: RDimRotatedData.h:61
virtual RS::EntityType getType() const
Definition: RDimRotatedData.h:49
virtual void recomputeDefinitionPoint(const RVector &oldExtPoint1, const RVector &oldExtPoint2, const RVector &newExtPoint1, const RVector &newExtPoint2)
Definition: RDimLinearData.h:76
void setRotation(double r)
Definition: RDimRotatedData.h:57
Low-level mathematical representation of a line.
Definition: RLine.h:41
Definition: RS.h:132
virtual bool rotate(double rotation, const RVector &center)
Definition: RDimLinearData.cpp:108
virtual RBox getBoundingBox(bool ignoreEmpty=false) const
Definition: RDimensionData.cpp:93
RDimRotatedData data
Definition: RDimRotatedEntity.h:144
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RDimLinearData.h:36
double rotation
Fixed angle of dimension line in rad.
Definition: RDimRotatedData.h:86
virtual bool isValid() const
Definition: RDimLinearData.cpp:50
Linear rotated Dimension.
Definition: RS.h:111
RDocument * document
Definition: RObject.h:271