QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RSolidEntity.h
Go to the documentation of this file.
1 #ifndef RSOLIDENTITY_H
2 #define RSOLIDENTITY_H
3 
4 #include "REntity.h"
5 #include "RSolidData.h"
6 
7 class RDocument;
8 class RExporter;
9 
17 class RSolidEntity: public REntity {
18 
19 public:
29 
42 
45 
46 public:
49  virtual ~RSolidEntity();
50 
51  static void init();
52 
53  virtual RSolidEntity* clone() const {
54  return new RSolidEntity(*this);
55  }
56 
57  virtual RS::EntityType getType() const {
58  return RS::EntitySolid;
59  }
60 
61  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value);
62  QPair<QVariant, RPropertyAttributes> getProperty(
63  RPropertyTypeId propertyTypeId,
64  bool humanReadable = false, bool noAttributes = false);
65 
66  virtual void exportEntity(RExporter& e, bool preview=false) const;
67 
68  virtual RSolidData& getData() {
69  return data;
70  }
71 
72  virtual const RSolidData& getData() const {
73  return data;
74  }
75 
76  RVector getVertexAt(int i) const {
77  return data.getVertexAt(i);
78  }
79 
80  int countVertices() const {
81  return data.countVertices();
82  }
83 
85  return data.getStartPoint();
86  }
87 
88  RVector getEndPoint() const {
89  return data.getEndPoint();
90  }
91 
92  double getDirection1() const {
93  return data.getDirection1();
94  }
95 
96  double getDirection2() const {
97  return data.getDirection2();
98  }
99 
100  bool reverse() {
101  return data.reverse();
102  }
103 
105  const RVector& trimPoint) {
106  return data.getTrimEnd(coord, trimPoint);
107  }
108 
109  void trimStartPoint(const RVector& p) {
110  return data.trimStartPoint(p);
111  }
112  void trimEndPoint(const RVector& p) {
113  return data.trimEndPoint(p);
114  }
115 
116  double getLength() const {
117  return data.getLength();
118  }
119 
120 protected:
121  virtual void print(QDebug dbg) const;
122 
123 protected:
125 };
126 
128 Q_DECLARE_METATYPE(QSharedPointer<RSolidEntity>)
129 Q_DECLARE_METATYPE(QSharedPointer<RSolidEntity>*)
130 
131 #endif