QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RImageEntity.h
Go to the documentation of this file.
1 #ifndef RIMAGEENTITY_H
2 #define RIMAGEENTITY_H
3 
4 #include "REntity.h"
5 #include "RImageData.h"
6 
7 class RDocument;
8 class RExporter;
9 
17 class RImageEntity: public REntity {
18 
19 public:
29 
37 
40 
41 public:
44  virtual ~RImageEntity();
45 
46  static void init();
47 
48  virtual RImageEntity* clone() const;
49 
50  virtual RS::EntityType getType() const {
51  return RS::EntityImage;
52  }
53 
54  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value);
55  QPair<QVariant, RPropertyAttributes> getProperty(
56  RPropertyTypeId propertyTypeId,
57  bool humanReadable = false, bool noAttributes = false);
58 
59  virtual void exportEntity(RExporter& e, bool preview=false) const;
60 
61  virtual RImageData& getData() {
62  return data;
63  }
64 
65  virtual const RImageData& getData() const {
66  return data;
67  }
68 
69  void setInsertionPoint(const RVector& ip) {
71  }
72 
73  void setWidth(double w, bool keepRatio=false) {
74  data.setWidth(w, keepRatio);
75  }
76 
77  void setHeight(double h, bool keepRatio=false) {
78  data.setHeight(h, keepRatio);
79  }
80 
81  void setAngle(double a) {
82  data.setAngle(a);
83  }
84 
85  double getWidth() const {
86  return data.getWidth();
87  }
88 
89  double getHeight() const {
90  return data.getHeight();
91  }
92 
93  int getPixelWidth() const {
94  return data.getPixelWidth();
95  }
96 
97  int getPixelHeight() const {
98  return data.getPixelHeight();
99  }
100 
101 protected:
102  virtual void print(QDebug dbg) const;
103 
104 protected:
106 };
107 
109 Q_DECLARE_METATYPE(QSharedPointer<RImageEntity>)
110 Q_DECLARE_METATYPE(QSharedPointer<RImageEntity>*)
111 
112 #endif