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 
52  virtual RS::EntityType getType() const {
53  return RS::EntityCircle;
54  }
56  return *this;
57  }
58 
59  RVector getCenter() const {
60  return RCircle::getCenter();
61  }
62  double getRadius() const {
63  return RCircle::getRadius();
64  }
65 
66  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
67 
68  virtual bool moveReferencePoint(const RVector& referencePoint, const RVector& targetPoint);
69 
70  virtual RShape* castToShape() {
71  return this;
72  }
73 
74  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const {
75  Q_UNUSED(queryBox)
76  Q_UNUSED(ignoreComplex)
77  Q_UNUSED(segment)
78 
79  return QList<QSharedPointer<RShape> >() <<
80  QSharedPointer<RShape>(new RCircle(*this));
81  }
82 
83 };
84 
88 Q_DECLARE_METATYPE(QSharedPointer<RCircleData>)
89 
90 #endif
Circle.
Definition: RS.h:100
Represents a box e.g.
Definition: RBox.h:43
Base class for all entity data classes.
Definition: REntityData.h:65
virtual RShape * castToShape()
Definition: RCircleData.h:70
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false) const
Definition: RCircleData.h:74
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
virtual RS::EntityType getType() const
Definition: RCircleData.h:52
RVector getCenter() const
Definition: RCircleData.h:59
#define RDEFAULT_RBOX
Definition: RBox.h:32
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#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:498
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RCircleData.h:40
Circle entity.
Definition: RCircleEntity.h:38
RCircle()
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RCircle.cpp:29
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:131
double getRadius() const
Definition: RCircleData.h:62
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
Q_DECLARE_METATYPE(RMath *)
RCircle getCircle()
Definition: RCircleData.h:55
Definition: RS.h:132
Low-level mathematical representation of a circle.
Definition: RCircle.h:39
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const
Definition: REntity.h:426
Interface for geometrical shape classes.
Definition: RShape.h:52
RVector getCenter() const
Definition: RCircle.cpp:97
double getRadius() const
Definition: RCircle.cpp:105
RCircleData data
Definition: RCircleEntity.h:113
RDocument * document
Definition: RObject.h:271