37 #pragma warning(push, 0) // no warnings from includes 39 #include <QSharedPointer> 44 #pragma warning(disable: 4251) // dll interface warning 47 #ifdef DLL_CORE_EXPORT 48 #define DllCoreExport Q_DECL_EXPORT 50 #define DllCoreExport Q_DECL_IMPORT 55 class QXmlStreamReader;
56 class QXmlStreamWriter;
62 class RegionTypeConfig;
85 Region(
const Type& type = Type::type_unknown,
const QString&
id =
"");
92 void setSelected(
bool select);
93 bool selected()
const;
98 void setId(
const QString&
id);
101 void setCustom(
const QString& c);
102 QString custom()
const;
104 void setPolygon(
const Polygon& polygon);
107 void scaleRegion(
double scale);
109 void addChild(QSharedPointer<Region> child);
110 bool reassignChild(QSharedPointer<Region> child);
111 void addUniqueChild(QSharedPointer<Region> child,
bool update =
false);
112 void removeChild(QSharedPointer<Region> child);
113 void removeAllChildren();
114 void setChildren(
const QVector<QSharedPointer<Region> >& children);
115 QVector<QSharedPointer<Region> > children()
const;
117 static QVector<QSharedPointer<Region> > selectedRegions(
const Region* root);
118 static QVector<QSharedPointer<Region> > allRegions(
const Region* root);
119 static QVector<QSharedPointer<Region> > filter(
const Region* root,
const Region::Type& type);
123 virtual QString toString(
bool withChildren =
false)
const;
124 virtual QString childrenToString()
const;
126 virtual bool read(QXmlStreamReader& reader);
127 virtual void readAttributes(QXmlStreamReader& reader);
128 virtual void write(QXmlStreamWriter& writer)
const;
129 virtual void writeChildren(QXmlStreamWriter& writer)
const;
130 void createElement(QXmlStreamWriter& writer)
const;
131 void writePolygon(QXmlStreamWriter& writer)
const;
136 Type mType = Type::type_unknown;
137 bool mSelected =
false;
143 void collectRegions(QVector<QSharedPointer<Region> >& allRegions,
const Region::Type& type = type_unknown)
const;
144 virtual bool readPoints(QXmlStreamReader& reader);
152 QVector<QSharedPointer<Region> > selectedRegions()
const;
153 QVector<QSharedPointer<Region> > allRegions()
const;
154 QVector<QSharedPointer<Region> > filter(
const Region::Type& type)
const;
164 virtual void readAttributes(QXmlStreamReader& reader)
override;
172 QPointF leftUpper()
const;
173 QPointF rightDown()
const;
175 QPointF leftUpperCorner()
const;
176 QPointF rightDownCorner()
const;
207 double width()
const;
208 double height()
const;
210 virtual void readAttributes(QXmlStreamReader& reader)
override;
211 virtual bool read(QXmlStreamReader& reader)
override;
212 virtual void write(QXmlStreamWriter& writer)
const override;
219 void setRowSpan(
int r);
221 void setColSpan(
int c);
224 void setLeftBorderVisible(
bool b);
225 bool leftBorderVisible()
const;
227 void setRightBorderVisible(
bool b);
228 bool rightBorderVisible()
const;
230 void setTopBorderVisible(
bool b);
231 bool topBorderVisible()
const;
233 void setBottomBorderVisible(
bool b);
234 bool bottomBorderVisible()
const;
236 void setHeader(
bool b);
239 void setCornerPts(QVector<int> &cPts);
240 QVector<int> cornerPty()
const;
244 static bool compareCells(
const QSharedPointer<rdf::TableCell> l1,
const QSharedPointer<rdf::TableCell> l2);
253 bool mLeftBorderVisible =
false;
254 bool mRightBorderVisible =
false;
255 bool mTopBorderVisible =
false;
256 bool mBottomBorderVisible =
false;
258 bool mHeader =
false;
275 static TextEquiv read(QXmlStreamReader& reader);
277 void write(QXmlStreamWriter& writer)
const;
279 QString text()
const;
284 bool mIsNull =
false;
292 void setBaseLine(
const BaseLine& baseLine);
295 void setText(
const QString& text);
296 QString text()
const;
298 virtual bool read(QXmlStreamReader& reader)
override;
299 virtual void write(QXmlStreamWriter& writer)
const override;
301 virtual QString toString(
bool withChildren =
false)
const override;
315 void setText(
const QString& text);
316 QString text()
const;
318 virtual bool read(QXmlStreamReader& reader)
override;
319 virtual void write(QXmlStreamWriter& writer)
const override;
321 virtual QString toString(
bool withChildren =
false)
const override;
334 void setLine(
const Line& line);
358 bool readAttributes(QXmlStreamReader& reader);
359 void readChildren(QXmlStreamReader& reader);
360 void write(QXmlStreamWriter& writer)
const;
362 void setId(
const QString&
id);
365 void setZIndex(
int zIndex);
368 void setCaption(
const QString& caption);
369 QString caption()
const;
371 void setRegionRefIds(
const QVector<QString>& regionRefIds);
372 QVector<QString> regionRefIds()
const;
374 void setRegions(
const QVector<QSharedPointer<Region>>& regions);
375 QVector<QSharedPointer<Region>> regions()
const;
378 bool mChanged =
false;
381 QString mCaption =
"";
394 void setXmlPath(
const QString& xmlPath);
395 QString xmlPath()
const;
397 void setImageFileName(
const QString& name);
398 QString imageFileName()
const;
400 void setImageSize(
const QSize& size);
401 QSize imageSize()
const;
403 void setRootRegion(QSharedPointer<RootRegion> region);
404 QSharedPointer<RootRegion> rootRegion()
const;
406 void setCreator(
const QString& creator);
407 QString creator()
const;
409 void setDateCreated(
const QDateTime& date);
410 QDateTime dateCreated()
const;
412 void setDateModified(
const QDateTime& date);
413 QDateTime dateModified()
const;
415 void setLayers(
const QVector<QSharedPointer<LayerElement>>& layers);
416 QVector<QSharedPointer<LayerElement>> layers()
const;
418 void setDefaultLayer(
const QSharedPointer<LayerElement>& defaultLayer);
419 QSharedPointer<LayerElement> defaultLayer()
const;
421 void redefineLayersByType(
const QVector<Region::Type>& layerTypeAssignment);
423 void sortLayers(
bool checkIfSorted =
false);
427 virtual QString toString()
const;
440 QVector<QSharedPointer<LayerElement>>
mLayers;
443 static bool layerZIndexGt(
const QSharedPointer<LayerElement>& l1,
const QSharedPointer<LayerElement>& l2);
Definition: Elements.h:77
Definition: Elements.h:269
Definition: Elements.h:75
Definition: Elements.h:74
Definition: Elements.h:158
BaseLine mBaseLine
Definition: Elements.h:306
QString mCustom
Definition: Elements.h:139
QString mXmlPath
Definition: Elements.h:430
#define DllCoreExport
Definition: BaseImageElement.h:43
Type
Definition: Elements.h:68
QString mCreator
Definition: Elements.h:435
Definition: Elements.h:287
QString mText
Definition: Elements.h:283
QDataStream & operator<<(QDataStream &s, const BaseElement &e)
Definition: BaseImageElement.cpp:81
Definition: Elements.h:78
Definition: Elements.h:71
Definition: Elements.h:76
Definition: Elements.h:310
TextEquiv mTextEquiv
Definition: Elements.h:307
TextEquiv mTextEquiv
Definition: Elements.h:326
Definition: Elements.h:79
QString mId
Definition: Elements.h:138
Definition: Elements.h:329
QVector< int > mCornerPts
Definition: Elements.h:266
QSize mImageSize
Definition: Elements.h:432
Definition: Elements.h:352
Definition: Elements.h:70
Polygon mPoly
Definition: Elements.h:140
bool operator<(const PixelEdge &pe1, const PixelEdge &pe2)
Definition: Pixel.cpp:537
config
Definition: DependencyCollector.py:271
QVector< QSharedPointer< LayerElement > > mLayers
Definition: Elements.h:440
bool operator==(const BaseElement &l, const QString &id)
Definition: BaseImageElement.cpp:57
QDateTime mDateModified
Definition: Elements.h:437
Definition: Elements.h:72
A basic line class including stroke width (thickness).
Definition: Shapes.h:68
Line mLine
Definition: Elements.h:349
Definition: Elements.h:65
QDateTime mDateCreated
Definition: Elements.h:436
QVector< QSharedPointer< Region > > mRegions
Definition: Elements.h:383
Definition: Elements.h:192
Definition: Elements.h:73
QString mImageFileName
Definition: Elements.h:431
Definition: Elements.h:80
Definition: Elements.h:387
Definition: ElementsHelper.h:59
Definition: Algorithms.cpp:45
QVector< QSharedPointer< Region > > mChildren
Definition: Elements.h:141
Definition: Elements.h:147
QVector< QString > mRegionRefIds
Definition: Elements.h:382
QSharedPointer< RootRegion > mRoot
Definition: Elements.h:439
QSharedPointer< LayerElement > mDefaultLayer
Definition: Elements.h:441