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<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
56 
57  virtual bool moveReferencePoint(const RVector& referencePoint,
58  const RVector& targetPoint);
59 
60  virtual RShape* castToShape() {
61  return this;
62  }
63 
64  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false) const {
65  Q_UNUSED(ignoreComplex)
66  Q_UNUSED(queryBox)
67 
68  return QList<QSharedPointer<RShape> >() <<
69  QSharedPointer<RShape>(new RPoint(*this));
70  }
71 
72 };
73 
77 Q_DECLARE_METATYPE(QSharedPointer<RPointData>)
78 
79 #endif
Represents a box e.g.
Definition: RBox.h:43
Base class for all entity data classes.
Definition: REntityData.h:65
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
#define RDEFAULT_RBOX
Definition: RBox.h:32
RVector getPosition() const
Definition: RPoint.h:55
#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:129
RVector getPosition() const
Definition: RPointData.h:51
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
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-2016 by Andrew Mustun.
Definition: RPointData.h:40
RPoint()
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPoint.cpp:29
virtual RShape * castToShape()
Definition: RPointData.h:60
RPointData data
Definition: RPointEntity.h:100
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const =0
Definition: RS.h:130
Copyright (c) 2011-2016 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:64
RDocument * document
Definition: RObject.h:267