QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RLineEntity.h
Go to the documentation of this file.
1 #ifndef RLINEENTITY_H
2 #define RLINEENTITY_H
3 
4 #include "REntity.h"
5 #include "RLineData.h"
6 
7 class RDocument;
8 class RExporter;
9 
17 class RLineEntity: public REntity {
18 
19 public:
29 
36 
39 
40 public:
43  virtual ~RLineEntity();
44 
45  static void init();
46 
47  virtual RLineEntity* clone() const {
48  return new RLineEntity(*this);
49  }
50 
51  virtual RS::EntityType getType() const {
52  return RS::EntityLine;
53  }
54 
55  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value);
56  QPair<QVariant, RPropertyAttributes> getProperty(
57  RPropertyTypeId propertyTypeId,
58  bool humanReadable = false, bool noAttributes = false);
59 
60  virtual void exportEntity(RExporter& e, bool preview=false) const;
61 
62  virtual RLineData& getData() {
63  return data;
64  }
65 
66  virtual const RLineData& getData() const {
67  return data;
68  }
69 
70  void setShape(const RLine& l);
71 
72  void setStartPoint(const RVector& p) {
74  }
75 
77  return data.getStartPoint();
78  }
79 
80  void setEndPoint(const RVector& p) {
81  data.setEndPoint(p);
82  }
83 
84  RVector getEndPoint() const {
85  return data.getEndPoint();
86  }
87 
88  double getAngle() const {
89  return data.getAngle();
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 
104  RS::Side getSideOfPoint(const RVector& point) const {
105  return data.getSideOfPoint(point);
106  }
107 
109  const RVector& trimPoint) {
110  return data.getTrimEnd(coord, trimPoint);
111  }
112 
113  void trimStartPoint(const RVector& p) {
114  return data.trimStartPoint(p);
115  }
116  void trimEndPoint(const RVector& p) {
117  return data.trimEndPoint(p);
118  }
119 
120  double getLength() const {
121  return data.getLength();
122  }
123 
124 protected:
125  virtual void print(QDebug dbg) const;
126 
127 protected:
129 };
130 
132 Q_DECLARE_METATYPE(QSharedPointer<RLineEntity>)
133 Q_DECLARE_METATYPE(QSharedPointer<RLineEntity>*)
134 
135 #endif