37 #pragma warning(push, 0) // no warnings from includes 42 #pragma warning(disable: 4251) // dll interface warning 45 #ifdef DLL_CORE_EXPORT 46 #define DllCoreExport Q_DECL_EXPORT 48 #define DllCoreExport Q_DECL_IMPORT 66 void setDraw(
bool draw);
69 void setDrawPoly(
bool draw);
70 bool drawPoly()
const;
72 void setDrawBaseline(
bool draw);
73 bool drawBaseline()
const;
75 void setDrawBaselineLimits(
bool draw);
76 bool drawBaselineLimits()
const;
78 void setDrawText(
bool draw);
79 bool drawText()
const;
81 void setPen(
const QPen& pen);
84 void setBrush(
const QColor& col);
87 void load(QSettings& settings);
88 void save(QSettings& settings)
const;
97 bool mDrawPoly =
true;
98 bool mDrawBaseline =
false;
99 bool mDrawBaselineLimits =
true;
100 bool mDrawText =
true;
136 QString tag(
const XmlTags& tagId)
const;
142 QStringList createTags()
const;
153 QStringList typeNames()
const;
154 bool isValidTypeName(
const QString& typeName)
const;
156 QSharedPointer<Region> createRegion(
158 QSharedPointer<RegionTypeConfig> getConfig(
159 const QSharedPointer<Region>& r,
160 const QVector<QSharedPointer<RegionTypeConfig> >&
config = QVector<QSharedPointer<RegionTypeConfig> >())
const;
164 QSharedPointer<rdf::Region> region,
165 const QVector<QSharedPointer<RegionTypeConfig> >&
config = QVector<QSharedPointer<RegionTypeConfig> >(),
166 bool recursive =
true,
167 bool activeSelection =
false)
const;
169 QVector<QSharedPointer<rdf::Region> > regionsAt(
170 QSharedPointer<rdf::Region> root,
172 const QVector<QSharedPointer<RegionTypeConfig> >&
config = QVector<QSharedPointer<RegionTypeConfig> >())
const;
174 QVector<QSharedPointer<RegionTypeConfig> > regionTypeConfig()
const;
177 const QVector<QSharedPointer<Region>>& selRegions,
178 QSharedPointer<Region> rootRegion = QSharedPointer<Region>())
const;
180 template <
typename T>
181 static QVector<QSharedPointer<T> >
filter(
182 QSharedPointer<rdf::Region> root,
184 bool removeChildren =
true) {
187 QVector<QSharedPointer<T> > filteredRegions;
189 for (
auto r : regions) {
191 if (r->type() == type) {
195 r->removeAllChildren();
197 filteredRegions << r.dynamicCast<T>();
201 return filteredRegions;
208 QStringList createTypeNames()
const;
209 QVector<QSharedPointer<RegionTypeConfig> > createConfig()
const;
211 QStringList mTypeNames;
212 QVector<QSharedPointer<RegionTypeConfig> > mTypeConfig;
static QVector< QSharedPointer< Region > > allRegions(const Region *root)
Definition: Elements.cpp:336
Definition: ElementsHelper.h:124
#define DllCoreExport
Definition: BaseImageElement.h:43
Type
Definition: Elements.h:68
XmlTags
Definition: ElementsHelper.h:110
Definition: ElementsHelper.h:105
Definition: ElementsHelper.h:123
Definition: ElementsHelper.h:130
Definition: ElementsHelper.h:131
Definition: ElementsHelper.h:146
Definition: ElementsHelper.h:111
QPen mPen
Definition: ElementsHelper.h:93
Definition: ElementsHelper.h:129
Definition: ElementsHelper.h:115
Definition: ElementsHelper.h:122
Definition: ElementsHelper.h:119
Definition: ElementsHelper.h:112
Definition: ElementsHelper.h:116
Definition: ElementsHelper.h:128
config
Definition: DependencyCollector.py:271
QColor mBrush
Definition: ElementsHelper.h:94
Definition: ElementsHelper.h:125
Definition: ElementsHelper.h:121
DllCoreExport bool save(const QImage &img, const QString &savePath, int compression=-1)
Saves the specified QImage img.
Definition: Image.cpp:180
Definition: ElementsHelper.h:127
Definition: Elements.h:69
DllCoreExport QImage load(const QString &path, bool *ok=0)
Definition: Image.cpp:152
Definition: ElementsHelper.h:114
Definition: ElementsHelper.h:113
Definition: ElementsHelper.h:117
Definition: ElementsHelper.h:59
Definition: Algorithms.cpp:45
static QVector< QSharedPointer< T > > filter(QSharedPointer< rdf::Region > root, const Region::Type &type, bool removeChildren=true)
Definition: ElementsHelper.h:181
Definition: ElementsHelper.h:120
Definition: ElementsHelper.h:126