QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RUcs.h
Go to the documentation of this file.
1 #ifndef RUCS_H
2 #define RUCS_H
3 
4 #include "RObject.h"
5 #include "RVector.h"
6 #include "RPropertyTypeId.h"
7 
8 class RDocument;
9 
10 
20 class RUcs : public RObject {
21 public:
32 
33 public:
34  RUcs() : RObject(), origin(0,0,0), xAxisDirection(1,0,0), yAxisDirection(0,1,0) {
35  }
36 
39  const QString& name,
40  const RVector& origin,
41  const RVector& xAxisDirection,
42  const RVector& yAxisDirection
43  ) : RObject(document),
44  name(name),
45  origin(origin),
46  xAxisDirection(xAxisDirection),
47  yAxisDirection(yAxisDirection) {
48  }
49 
50  virtual ~RUcs() {
51  }
52 
53  static void init();
54 
55  virtual RUcs* clone() const {
56  return new RUcs(*this);
57  }
58 
60  return false;
61  }
62 
63  virtual QPair<QVariant, RPropertyAttributes> getProperty(
64  RPropertyTypeId propertyTypeId,
65  bool humanReadable = false, bool noAttributes = false);
66  virtual bool setProperty(RPropertyTypeId propertyTypeId,
67  const QVariant& value);
68 
69  void setOrigin(const RVector& o) {
70  origin = o;
71  }
72 
73  void setXAxisDirection(const RVector& x) {
74  xAxisDirection = x;
75  }
76 
77  void setYAxisDirection(const RVector& y) {
78  yAxisDirection = y;
79  }
80 
82 
83  RVector mapFromUcs(const RVector& positionUcs);
84  RVector mapToUcs(const RVector& positionWcs);
85 
86 public:
87  QString name;
91 };
92 
95 Q_DECLARE_METATYPE(QSharedPointer<RUcs>)
96 Q_DECLARE_METATYPE(QSharedPointer<RUcs>*)
97 
98 #endif