QCAD
Open Source 2D CAD
RPointData.h
Go to the documentation of this file.
1 
20 #ifndef RPOINTDATA_H
21 #define RPOINTDATA_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 "RLine.h"
31 
40 class QCADENTITY_EXPORT RPointData: public REntityData, protected RPoint {
41 
42  friend class RPointEntity;
43 
44 protected:
46 
47 public:
48  RPointData();
49  RPointData(const RVector& point);
50 
51  RVector getPosition() const {
52  return RPoint::getPosition();
53  }
54 
55  virtual QList<RVector> getReferencePoints(
57 
58  virtual bool moveReferencePoint(const RVector& referencePoint,
59  const RVector& targetPoint);
60 
61  virtual RShape* castToShape() {
62  return this;
63  }
64 
65  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
66  Q_UNUSED(ignoreComplex)
67  Q_UNUSED(queryBox)
68 
69  return QList<QSharedPointer<RShape> >() <<
70  QSharedPointer<RShape>(new RPoint(*this));
71  }
72 
73 };
74 
78 Q_DECLARE_METATYPE(QSharedPointer<RPointData>)
79 
80 #endif
Represents a box e.g.
Definition: RBox.h:43
Base class for all entity data classes.
Definition: REntityData.h:64
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
RVector getPosition() const
Definition: RPoint.h:51
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
Point entity.
Definition: RPointEntity.h:38
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:118
RVector getPosition() const
Definition: RPointData.h:51
virtual QList< RVector > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const =0
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:63
virtual bool moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint)=0
Moves the given reference point to the given target point or does nothing if this entity has no refer...
Q_DECLARE_METATYPE(RMath *)
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPointData.h:40
RPoint()
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPoint.cpp:29
virtual RShape * castToShape()
Definition: RPointData.h:61
RPointData data
Definition: RPointEntity.h:100
Definition: RS.h:119
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPoint.h:38
Interface for geometrical shape classes.
Definition: RShape.h:52
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false) const
Definition: RPointData.h:65
RDocument * document
Definition: RObject.h:251