QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RView.h
Go to the documentation of this file.
1 #ifndef RVIEW_H
2 #define RVIEW_H
3 
4 #include <QString>
5 #include <QColor>
6 #include <QDebug>
7 
8 #include "RGlobal.h"
9 #include "RObject.h"
10 #include "RBox.h"
11 
12 class RDocument;
13 
21 class RView: public RObject {
22 public:
27 
28 public:
29  RView();
30 
31  RView(RDocument* document, const QString& name, RVector centerPoint,
32  double width, double height);
33 
34  virtual ~RView();
35 
36  static void init();
37 
38  virtual RView* clone() const;
39 
40  QString getName() const {
41  return name;
42  }
43 
44  void setName(const QString& n) {
45  name = n;
46  }
47 
49  return centerPoint;
50  }
51 
52  void setCenterPoint(const RVector& cPoint) {
53  centerPoint = cPoint;
54  }
55 
56  double getWidth() const {
57  return width;
58  }
59 
60  void setWidth(double w) {
61  width = w;
62  }
63 
64  double getHeight() const {
65  return height;
66  }
67 
68  void setHeight(double h) {
69  height = h;
70  }
71 
74  + RVector(width, height) / 2);
75  }
76 
77  virtual QPair<QVariant, RPropertyAttributes> getProperty(
78  RPropertyTypeId propertyTypeId,
79  bool humanReadable = false, bool noAttributes = false);
80  virtual bool setProperty(RPropertyTypeId propertyTypeId,
81  const QVariant& value);
82 
83  virtual bool isSelectedForPropertyEditing();
84 
85 private:
86  QString name;
88  double width;
89  double height;
90 };
91 
92 QDebug operator<<(QDebug dbg, const RView& v);
93 
94 Q_DECLARE_METATYPE(QSharedPointer<RView>)
95 Q_DECLARE_METATYPE(QSharedPointer<RView>*)
98 
99 #endif