QCAD
Open Source 2D CAD
RCircleData.h
Go to the documentation of this file.
1 
20 #ifndef RCIRCLEDATA_H
21 #define RCIRCLEDATA_H
22 
23 #include "entity_global.h"
24 
25 #include "RBox.h"
26 #include "RDocument.h"
27 #include "REntity.h"
28 #include "RPoint.h"
29 #include "RVector.h"
30 #include "RCircle.h"
31 
41 
42  friend class RCircleEntity;
43 
44 protected:
46 
47 public:
48  RCircleData();
49  RCircleData(const RCircle& circle);
50  RCircleData(const RVector& center, double radius);
51 
53  return *this;
54  }
55 
56  RVector getCenter() const {
57  return RCircle::getCenter();
58  }
59  double getRadius() const {
60  return RCircle::getRadius();
61  }
62 
63  virtual QList<RVector> getReferencePoints(
65  virtual bool moveReferencePoint(const RVector& referencePoint,
66  const RVector& targetPoint);
67 
68  virtual RShape* castToShape() {
69  return this;
70  }
71 
72  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
73  Q_UNUSED(queryBox)
74 
75  return QList<QSharedPointer<RShape> >() <<
76  QSharedPointer<RShape>(new RCircle(*this));
77  }
78 
79 };
80 
84 Q_DECLARE_METATYPE(QSharedPointer<RCircleData>)
85 
86 #endif
Represents a box e.g.
Definition: RBox.h:43
Base class for all entity data classes.
Definition: REntityData.h:64
virtual RShape * castToShape()
Definition: RCircleData.h:68
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
RVector getCenter() const
Definition: RCircleData.h:56
#define RDEFAULT_RBOX
Definition: RBox.h:32
#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: REntity.h:470
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RCircleData.h:40
Circle entity.
Definition: RCircleEntity.h:38
RCircle()
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RCircle.cpp:28
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:118
double getRadius() const
Definition: RCircleData.h:59
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false) const
Definition: RCircleData.h:72
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
Q_DECLARE_METATYPE(RMath *)
RCircle getCircle()
Definition: RCircleData.h:52
Definition: RS.h:119
virtual QList< RVector > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: REntity.h:398
Low-level mathematical representation of a circle.
Definition: RCircle.h:39
Interface for geometrical shape classes.
Definition: RShape.h:52
RVector getCenter() const
Definition: RCircle.cpp:88
double getRadius() const
Definition: RCircle.cpp:96
RCircleData data
Definition: RCircleEntity.h:117
RDocument * document
Definition: RObject.h:251