QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RImageEntity.h
Go to the documentation of this file.
1
20#ifndef RIMAGEENTITY_H
21#define RIMAGEENTITY_H
22
23#include "entity_global.h"
24
25#include "REntity.h"
26#include "RImageData.h"
27
28class RDocument;
29class RExporter;
30
39
40public:
54
59
64
68
71
73
74public:
75 RImageEntity(RDocument* document, const RImageData& data);
76 RImageEntity(const RImageEntity& other);
77 virtual ~RImageEntity();
78
79 static void init();
80
82 return RS::EntityImage;
83 }
84
85 static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
87 }
88
89 virtual QSharedPointer<RObject> clone() const {
90 return QSharedPointer<RObject>(new RImageEntity(*this));
91 }
92
93 QSharedPointer<RImageEntity> cloneToImageEntity() const {
94 return QSharedPointer<RImageEntity>(new RImageEntity(*this));
95 }
96
97 virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
98 RTransaction* transaction=NULL);
99 virtual QPair<QVariant, RPropertyAttributes> getProperty(
100 RPropertyTypeId& propertyTypeId,
101 bool humanReadable = false, bool noAttributes = false, bool showOnRequest = false);
102
103 virtual void exportEntity(RExporter& e, bool preview=false, bool forceSelected=false) const;
104
105 virtual RImageData& getData() {
106 return data;
107 }
108
109 virtual const RImageData& getData() const {
110 return data;
111 }
112
113 QString getFileName() const {
114 return data.getFileName();
115 }
116
117 void setFileName(const QString& fn) {
118 data.setFileName(fn);
119 }
120
122 return data.getInsertionPoint();
123 }
124
125 void setInsertionPoint(const RVector& ip) {
126 data.setInsertionPoint(ip);
127 }
128
130 return data.getUVector();
131 }
132
134 return data.getVVector();
135 }
136
137 int getBrightness() const {
138 return data.getBrightness();
139 }
140
141 int getContrast() const {
142 return data.getContrast();
143 }
144
145 int getFade() const {
146 return data.getFade();
147 }
148
149 void setWidth(double w, bool keepRatio=false) {
150 data.setWidth(w, keepRatio);
151 }
152
153 void setHeight(double h, bool keepRatio=false) {
154 data.setHeight(h, keepRatio);
155 }
156
157 void setAngle(double a) {
158 data.setAngle(a);
159 }
160
161 double getWidth() const {
162 return data.getWidth();
163 }
164
165 double getHeight() const {
166 return data.getHeight();
167 }
168
169 int getPixelWidth() const {
170 return data.getPixelWidth();
171 }
172
173 int getPixelHeight() const {
174 return data.getPixelHeight();
175 }
176
177protected:
178 virtual void print(QDebug dbg) const;
179
180protected:
182};
183
185Q_DECLARE_METATYPE(QSharedPointer<RImageEntity>)
186Q_DECLARE_METATYPE(QSharedPointer<RImageEntity>*)
187
188#endif
Q_DECLARE_METATYPE(RMath *)
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition RDocument.h:78
Base class for all entity classes.
Definition REntity.h:63
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)
Definition REntity.cpp:236
static void init()
Definition REntity.cpp:89
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition REntity.cpp:338
virtual void exportEntity(RExporter &e, bool preview=false, bool forceSelected=false) const =0
Exports the entity to the given exporter.
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition REntity.cpp:487
Abstract base class for exporters.
Definition RExporter.h:78
Stores and manages all data that defines the geometry and appearance of a raster image entity.
Definition RImageData.h:41
Point entity.
Definition RImageEntity.h:38
int getPixelHeight() const
Definition RImageEntity.h:173
static RPropertyTypeId PropertyUY
Definition RImageEntity.h:61
static RPropertyTypeId PropertyHandle
Definition RImageEntity.h:42
static RPropertyTypeId PropertyWidth
Definition RImageEntity.h:69
RVector getUVector() const
Definition RImageEntity.h:129
static RPropertyTypeId PropertyUX
Definition RImageEntity.h:60
static RPropertyTypeId PropertyInsertionPointZ
Definition RImageEntity.h:58
void setWidth(double w, bool keepRatio=false)
Definition RImageEntity.h:149
RImageData data
Definition RImageEntity.h:181
static RPropertyTypeId PropertyScaleFactorY
Definition RImageEntity.h:66
QSharedPointer< RImageEntity > cloneToImageEntity() const
Definition RImageEntity.h:93
static RPropertyTypeId PropertyColor
Definition RImageEntity.h:51
QString getFileName() const
Definition RImageEntity.h:113
static RS::EntityType getRtti()
Definition RImageEntity.h:81
static RPropertyTypeId PropertyDrawOrder
Definition RImageEntity.h:53
static RPropertyTypeId PropertyVX
Definition RImageEntity.h:62
int getContrast() const
Definition RImageEntity.h:141
static RPropertyTypeId PropertyLinetype
Definition RImageEntity.h:48
static RPropertyTypeId PropertyDisplayedColor
Definition RImageEntity.h:52
static RPropertyTypeId PropertyFade
Definition RImageEntity.h:72
static RPropertyTypeId PropertyBlock
Definition RImageEntity.h:46
int getPixelWidth() const
Definition RImageEntity.h:169
static RPropertyTypeId PropertyProtected
Definition RImageEntity.h:43
static RPropertyTypeId PropertyAngle
Definition RImageEntity.h:67
void setFileName(const QString &fn)
Definition RImageEntity.h:117
int getBrightness() const
Definition RImageEntity.h:137
void setInsertionPoint(const RVector &ip)
Definition RImageEntity.h:125
void setHeight(double h, bool keepRatio=false)
Definition RImageEntity.h:153
RVector getVVector() const
Definition RImageEntity.h:133
virtual const RImageData & getData() const
Definition RImageEntity.h:109
static RPropertyTypeId PropertyType
Definition RImageEntity.h:45
static RPropertyTypeId PropertyScaleFactorX
Definition RImageEntity.h:65
static RPropertyTypeId PropertyHeight
Definition RImageEntity.h:70
static RPropertyTypeId PropertyLinetypeScale
Definition RImageEntity.h:49
int getFade() const
Definition RImageEntity.h:145
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition RImageEntity.h:85
double getHeight() const
Definition RImageEntity.h:165
RVector getInsertionPoint() const
Definition RImageEntity.h:121
static RPropertyTypeId PropertyLayer
Definition RImageEntity.h:47
static RPropertyTypeId PropertyInsertionPointY
Definition RImageEntity.h:57
virtual RImageData & getData()
Definition RImageEntity.h:105
static RPropertyTypeId PropertyVY
Definition RImageEntity.h:63
static RPropertyTypeId PropertyFileName
Definition RImageEntity.h:55
double getWidth() const
Definition RImageEntity.h:161
void setAngle(double a)
Definition RImageEntity.h:157
virtual QSharedPointer< RObject > clone() const
Definition RImageEntity.h:89
static RPropertyTypeId PropertyLineweight
Definition RImageEntity.h:50
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RImageEntity.h:41
static RPropertyTypeId PropertyWorkingSet
Definition RImageEntity.h:44
static RPropertyTypeId PropertyInsertionPointX
Definition RImageEntity.h:56
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPropertyTypeId.h:54
static QSet< RPropertyTypeId > getPropertyTypeIds(RS::EntityType type, RPropertyAttributes::Option=RPropertyAttributes::NoOptions)
Gets all property type IDs that where registered for the given class.
Definition RPropertyTypeId.cpp:283
EntityType
Entity types used for property handling / filtering.
Definition RS.h:227
@ EntityImage
Image.
Definition RS.h:274
Transaction implementation.
Definition RTransaction.h:73
Represents a 3d vector (x/y/z).
Definition RVector.h:47
#define QCADENTITY_EXPORT
Definition entity_global.h:10
#define NULL
Definition opennurbs_system.h:256