QCAD
Open Source 2D CAD
RViewportEntity.h
Go to the documentation of this file.
1 
20 #ifndef RVIEWPORTENTITY_H
21 #define RVIEWPORTENTITY_H
22 
23 #include "core_global.h"
24 
25 #include "REntity.h"
26 #include "RViewportData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40 public:
52 
66 
68 
69 public:
70  RViewportEntity(RDocument* document, const RViewportData& data);
71  virtual ~RViewportEntity();
72 
73  static void init();
74 
75  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
77  }
78 
79  virtual RViewportEntity* clone() const {
80  return new RViewportEntity(*this);
81  }
82 
83  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
84  RTransaction* transaction=NULL);
85  QPair<QVariant, RPropertyAttributes> getProperty(
86  RPropertyTypeId& propertyTypeId,
87  bool humanReadable = false, bool noAttributes = false);
88 
89  virtual void exportEntity(RExporter& e, bool preview=false, bool forceSelected=false) const;
90 
91  virtual RViewportData& getData() {
92  return data;
93  }
94 
95  virtual const RViewportData& getData() const {
96  return data;
97  }
98 
99  void setData(RViewportData& d);
100 
101  int getViewportId() const {
102  return data.getViewportId();
103  }
104 
105  void setViewportId(int id) {
106  data.setViewportId(id);
107  }
108 
109  int getStatus() const {
110  return data.getStatus();
111  }
112 
113  void setStatus(int s) {
114  data.setStatus(s);
115  }
116 
117  RVector getCenter() const {
118  return data.getCenter();
119  }
120 
121  void setCenter(const RVector& c) {
122  data.setCenter(c);
123  }
124 
126  return data.getViewCenter();
127  }
128 
129  void setViewCenter(const RVector& c) {
130  data.setViewCenter(c);
131  }
132 
134  return data.getViewTarget();
135  }
136 
137  void setViewTarget(const RVector& t) {
138  data.setViewTarget(t);
139  }
140 
141  double getWidth() const {
142  return data.getWidth();
143  }
144 
145  void setWidth(double w) {
146  data.setWidth(w);
147  }
148 
149  double getHeight() const {
150  return data.getHeight();
151  }
152 
153  void setHeight(double h) {
154  data.setHeight(h);
155  }
156 
157  double getScale() const {
158  return data.getScale();
159  }
160 
161  void setScale(double s) {
162  data.setScale(s);
163  }
164 
165  double getRotation() const {
166  return data.getRotation();
167  }
168 
169  void setRotation(double r) {
170  data.setRotation(r);
171  }
172 
173  bool isOverall() const {
174  return data.isOverall();
175  }
176 
177  void setOverall(bool on) {
178  data.setOverall(on);
179  }
180 
181  bool isOff() const {
182  return data.isOff();
183  }
184 
185  void setOff(bool v) {
186  data.setOff(v);
187  }
188 
189 protected:
190  virtual void print(QDebug dbg) const;
191 
192 protected:
194 };
195 
197 Q_DECLARE_METATYPE(QSharedPointer<RViewportEntity>)
198 Q_DECLARE_METATYPE(QSharedPointer<RViewportEntity>*)
199 
200 #endif
bool isOverall() const
Definition: RViewportEntity.h:173
virtual const RViewportData & getData() const
Definition: RViewportEntity.h:95
Viewport entity.
Definition: RViewportEntity.h:38
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
double getWidth() const
Definition: RViewportEntity.h:141
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RViewportEntity.h:41
void setScale(double s)
Definition: RViewportEntity.h:161
static RPropertyTypeId PropertyRotation
Definition: RViewportEntity.h:59
void setCenter(const RVector &c)
Definition: RViewportEntity.h:121
void setWidth(double w)
Definition: RViewportEntity.h:145
RVector getViewCenter() const
Definition: RViewportEntity.h:125
static RPropertyTypeId PropertyCenterZ
Definition: RViewportEntity.h:55
static RPropertyTypeId PropertyLinetypeScale
Definition: RViewportEntity.h:47
static RPropertyTypeId PropertyDisplayedColor
Definition: RViewportEntity.h:50
void setRotation(double r)
Definition: RViewportEntity.h:169
static RPropertyTypeId PropertyType
Definition: RViewportEntity.h:43
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
int getViewportId() const
Definition: RViewportEntity.h:101
#define QCADCORE_EXPORT
Definition: core_global.h:10
static RPropertyTypeId PropertyWidth
Definition: RViewportEntity.h:56
static RPropertyTypeId PropertyViewCenterX
Definition: RViewportEntity.h:61
Transaction implementation.
Definition: RTransaction.h:74
double getRotation() const
Definition: RViewportEntity.h:165
bool isOff() const
Definition: RViewportEntity.h:181
static RPropertyTypeId PropertyDrawOrder
Definition: RViewportEntity.h:51
static RPropertyTypeId PropertyViewCenterY
Definition: RViewportEntity.h:62
static RPropertyTypeId PropertyViewTargetZ
Definition: RViewportEntity.h:65
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RViewportEntity.h:75
static RPropertyTypeId PropertyHandle
Definition: RViewportEntity.h:42
RVector getViewTarget() const
Definition: RViewportEntity.h:133
int getStatus() const
Definition: RViewportEntity.h:109
void setHeight(double h)
Definition: RViewportEntity.h:153
static RPropertyTypeId PropertyScale
Definition: RViewportEntity.h:58
static QSet< RPropertyTypeId > getPropertyTypeIds(const std::type_info &classInfo)
Gets all property type IDs that where registered for the given class.
Definition: RPropertyTypeId.cpp:229
void setOverall(bool on)
Definition: RViewportEntity.h:177
Base class for all entity classes.
Definition: REntity.h:64
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
static RPropertyTypeId PropertyBlock
Definition: RViewportEntity.h:44
Q_DECLARE_METATYPE(RMath *)
void setViewCenter(const RVector &c)
Definition: RViewportEntity.h:129
static RPropertyTypeId PropertyColor
Definition: RViewportEntity.h:49
void setOff(bool v)
Definition: RViewportEntity.h:185
static RPropertyTypeId PropertyLayer
Definition: RViewportEntity.h:45
static RPropertyTypeId PropertyOn
Definition: RViewportEntity.h:60
static RPropertyTypeId PropertyLineweight
Definition: RViewportEntity.h:48
static RPropertyTypeId PropertyViewTargetY
Definition: RViewportEntity.h:64
static RPropertyTypeId PropertyCenterY
Definition: RViewportEntity.h:54
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: REntity.cpp:228
static RPropertyTypeId PropertyOverall
Definition: RViewportEntity.h:67
RVector getCenter() const
Definition: RViewportEntity.h:117
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RViewportData.h:40
virtual RViewportEntity * clone() const
Definition: RViewportEntity.h:79
static RPropertyTypeId PropertyHeight
Definition: RViewportEntity.h:57
static void init()
Definition: REntity.cpp:82
void setStatus(int s)
Definition: RViewportEntity.h:113
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: REntity.cpp:321
Abstract base class for exporters.
Definition: RExporter.h:71
void setViewportId(int id)
Definition: RViewportEntity.h:105
double getHeight() const
Definition: RViewportEntity.h:149
double getScale() const
Definition: RViewportEntity.h:157
RViewportData data
Definition: RViewportEntity.h:193
static RPropertyTypeId PropertyCenterX
Definition: RViewportEntity.h:53
static RPropertyTypeId PropertyViewTargetX
Definition: RViewportEntity.h:63
virtual void exportEntity(RExporter &e, bool preview=false, bool forceSelected=false) const =0
Exports the entity to the given exporter.
static RPropertyTypeId PropertyLinetype
Definition: RViewportEntity.h:46
virtual RViewportData & getData()
Definition: RViewportEntity.h:91
void setViewTarget(const RVector &t)
Definition: RViewportEntity.h:137
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: REntity.cpp:468