QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RPoint.h
Go to the documentation of this file.
1 #ifndef RPOINT_H
2 #define RPOINT_H
3 
4 #include "RShape.h"
5 #include "RVector.h"
6 #include "RBox.h"
7 
17 class RPoint: public RShape {
18 public:
19  RPoint();
20  RPoint(const RVector& position);
21  virtual ~RPoint();
22 
23  virtual RPoint* clone() const {
24  return new RPoint(*this);
25  }
26 
27  virtual void to2D();
28 
29  RVector getPosition() const {
30  return position;
31  }
32 
33  void setPosition(const RVector& p) {
34  position = p;
35  }
36 
37  virtual RBox getBoundingBox() const;
38  virtual double getLength() const;
39 
40  virtual QList<RVector> getEndPoints() const;
41  virtual QList<RVector> getMiddlePoints() const;
42  virtual QList<RVector> getCenterPoints() const;
43  virtual QList<RVector> getPointsWithDistanceToEnd(
44  double distance, RS::From from = RS::FromAny) const;
45 
46  virtual RVector getVectorTo(const RVector& point,
47  bool limited = true) const;
48 
49  virtual bool move(const RVector& offset);
50  virtual bool rotate(double rotation, const RVector& center = RDEFAULT_RVECTOR);
51  virtual bool scale(const RVector& scaleFactors, const RVector& center = RDEFAULT_RVECTOR);
52  virtual bool mirror(const RLine& axis);
53  virtual bool flipHorizontal();
54  virtual bool flipVertical();
55 
56 protected:
57  virtual void print(QDebug dbg) const;
58 
59 public:
61 };
62 
65 Q_DECLARE_METATYPE(QSharedPointer<RPoint>)
66 Q_DECLARE_METATYPE(QSharedPointer<RPoint>*)
67 
68 #endif