QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RUcs.h
Go to the documentation of this file.
1 
20 #ifndef RUCS_H
21 #define RUCS_H
22 
23 #include "core_global.h"
24 
25 #include "RObject.h"
26 #include "RVector.h"
27 #include "RPropertyTypeId.h"
28 
29 class RDocument;
30 
31 
41 class QCADCORE_EXPORT RUcs : public RObject {
42 public:
53 
54 public:
55  RUcs() : RObject(), origin(0,0,0), xAxisDirection(1,0,0), yAxisDirection(0,1,0) {
56  }
57 
59  RDocument* document,
60  const QString& name,
61  const RVector& origin,
62  const RVector& xAxisDirection,
63  const RVector& yAxisDirection
64  ) : RObject(document),
65  name(name),
66  origin(origin),
67  xAxisDirection(xAxisDirection),
68  yAxisDirection(yAxisDirection) {
69  }
70 
71  virtual ~RUcs() {
72  }
73 
74  static void init();
75 
76  virtual RUcs* clone() const {
77  return new RUcs(*this);
78  }
79 
81  return false;
82  }
83 
84  virtual QPair<QVariant, RPropertyAttributes> getProperty(
85  RPropertyTypeId& propertyTypeId,
86  bool humanReadable = false, bool noAttributes = false);
87  virtual bool setProperty(RPropertyTypeId propertyTypeId,
88  const QVariant& value, RTransaction* transaction=NULL);
89 
90  void setOrigin(const RVector& o) {
91  origin = o;
92  }
93 
94  void setXAxisDirection(const RVector& x) {
95  xAxisDirection = x;
96  }
97 
98  void setYAxisDirection(const RVector& y) {
99  yAxisDirection = y;
100  }
101 
102  RVector getZAxisDirection();
103 
104  RVector mapFromUcs(const RVector& positionUcs);
105  RVector mapToUcs(const RVector& positionWcs);
106 
107 public:
108  QString name;
112 };
113 
114 QCADCORE_EXPORT QDebug operator<<(QDebug dbg, const RUcs& u);
115 
118 Q_DECLARE_METATYPE(QSharedPointer<RUcs>)
119 Q_DECLARE_METATYPE(QSharedPointer<RUcs>*)
120 
121 #endif