QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RHatchEntity.h
Go to the documentation of this file.
1 #ifndef RHATCHENTITY_H
2 #define RHATCHENTITY_H
3 
4 #include "REntity.h"
5 #include "RHatchData.h"
6 
7 class RDocument;
8 class RExporter;
9 
17 class RHatchEntity: public REntity {
18 
19 public:
29 
31 
35 
39 
40 public:
43  virtual ~RHatchEntity();
44 
45  static void init();
46 
47  virtual RHatchEntity* clone() const;
48 
49  virtual RS::EntityType getType() const {
50  return RS::EntityHatch;
51  }
52 
53  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value);
54  bool setBoundaryVector(RObject::XYZ xyz, const QVariant& value, bool condition);
55  RVector setComponent(const RVector& p, double v, RObject::XYZ xyz);
56 
57  QPair<QVariant, RPropertyAttributes> getProperty(
58  RPropertyTypeId propertyTypeId,
59  bool humanReadable = false, bool noAttributes = false);
60 
61  virtual void exportEntity(RExporter& e, bool preview=false) const;
62 
63  virtual RHatchData& getData() {
64  return data;
65  }
66 
67  virtual const RHatchData& getData() const {
68  return data;
69  }
70 
71  RPainterPath getPainterPath(bool draft = false) const {
72  return data.getPainterPath(draft);
73  }
74 
75  virtual int getComplexity() const {
76  return data.getPainterPath(false).getElementCount();
77  }
78 
79  void newLoop() {
80  data.newLoop();
81  }
82 
83  void addBoundary(QSharedPointer<RShape> shape) {
84  data.addBoundary(shape);
85  }
86 
87  bool isSolid() const {
88  return data.isSolid();
89  }
90 
91  int getLoopCount() const {
92  return data.getLoopCount();
93  }
94 
95  QList<QSharedPointer<RShape> > getLoopBoundary(int index) const {
96  return data.getLoopBoundary(index);
97  }
98 
99  virtual QList<QSharedPointer<RShape> > getShapes(const RBox& queryBox = RDEFAULT_RBOX) const {
100  return data.getShapes(queryBox);
101  }
102 
103  virtual QList<QSharedPointer<RShape> > getExploded() const {
104  return data.getExploded();
105  }
106 
107 protected:
108  virtual void print(QDebug dbg) const;
109 
110 protected:
112 };
113 
115 Q_DECLARE_METATYPE(QSharedPointer<RHatchEntity>)
116 Q_DECLARE_METATYPE(QSharedPointer<RHatchEntity>*)
117 
118 #endif