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  virtual RS::EntityType getType() const {
52  return RS::EntityPoint;
53  }
54  RVector getPosition() const {
55  return RPoint::getPosition();
56  }
57 
58  virtual QList<RRefPoint> getReferencePoints(RS::ProjectionRenderingHint hint = RS::RenderTop) const;
59 
60  virtual bool moveReferencePoint(const RVector& referencePoint,
61  const RVector& targetPoint);
62 
63  virtual RShape* castToShape() {
64  return this;
65  }
66 
67  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX, bool ignoreComplex = false, bool segment = false) const {
68  Q_UNUSED(ignoreComplex)
69  Q_UNUSED(queryBox)
70  Q_UNUSED(segment)
71 
72  return QList<QSharedPointer<RShape> >() <<
73  QSharedPointer<RShape>(new RPoint(*this));
74  }
75 
76 };
77 
81 Q_DECLARE_METATYPE(QSharedPointer<RPointData>)
82 
83 #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
virtual QList< QSharedPointer< RShape > > getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false) const
Definition: RPointData.h:67
#define RDEFAULT_RBOX
Definition: RBox.h:32
RVector getPosition() const
Definition: RPoint.h:57
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
Point.
Definition: RS.h:94
Point entity.
Definition: RPointEntity.h:38
ProjectionRenderingHint
Sets the current rendering hint for exports.
Definition: RS.h:131
RVector getPosition() const
Definition: RPointData.h:54
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-2017 by Andrew Mustun.
Definition: RPointData.h:40
RPoint()
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPoint.cpp:29
virtual RShape * castToShape()
Definition: RPointData.h:63
RPointData data
Definition: RPointEntity.h:96
virtual QList< RRefPoint > getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const =0
Definition: RS.h:132
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPoint.h:38
Interface for geometrical shape classes.
Definition: RShape.h:52
virtual RS::EntityType getType() const
Definition: RPointData.h:51
RDocument * document
Definition: RObject.h:271