QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPoint.h
Go to the documentation of this file.
1 
20 #ifndef RPOINT_H
21 #define RPOINT_H
22 
23 #include "../core_global.h"
24 
25 #include "RShape.h"
26 #include "RVector.h"
27 #include "RBox.h"
28 
38 class QCADCORE_EXPORT RPoint: public RShape {
39 public:
40  RPoint();
41  RPoint(const RVector& position);
42  virtual ~RPoint();
43 
44  virtual RPoint* clone() const {
45  return new RPoint(*this);
46  }
47 
48  virtual void to2D();
49 
50  RVector getPosition() const {
51  return position;
52  }
53 
54  void setPosition(const RVector& p) {
55  position = p;
56  }
57 
58  virtual RBox getBoundingBox() const;
59  virtual double getLength() const;
60 
61  virtual QList<RVector> getEndPoints() const;
62  virtual QList<RVector> getMiddlePoints() const;
63  virtual QList<RVector> getCenterPoints() const;
64  virtual QList<RVector> getPointsWithDistanceToEnd(
65  double distance, RS::From from = RS::FromAny) const;
66 
67  virtual RVector getVectorTo(const RVector& point,
68  bool limited = true) const;
69 
70  virtual bool move(const RVector& offset);
71  virtual bool rotate(double rotation, const RVector& center = RDEFAULT_RVECTOR);
72  virtual bool scale(const RVector& scaleFactors, const RVector& center = RDEFAULT_RVECTOR);
73  virtual bool mirror(const RLine& axis);
74  virtual bool flipHorizontal();
75  virtual bool flipVertical();
76 
77  virtual QSharedPointer<RShape> getTransformed(const QTransform& transform) const;
78 
79 protected:
80  virtual void print(QDebug dbg) const;
81 
82 public:
88 };
89 
92 Q_DECLARE_METATYPE(QSharedPointer<RPoint>)
93 Q_DECLARE_METATYPE(QSharedPointer<RPoint>*)
94 
95 #endif