ReadFramework
|
#include <Elements.h>
Public Member Functions | |
TableCell (const Type &type=Type::type_unknown) | |
rdf::Line | topBorder () const |
rdf::Line | bottomBorder () const |
rdf::Line | leftBorder () const |
rdf::Line | rightBorder () const |
rdf::Vector2D | upperLeft () const |
rdf::Vector2D | upperRight () const |
rdf::Vector2D | downLeft () const |
rdf::Vector2D | downRight () const |
double | width () const |
double | height () const |
virtual void | readAttributes (QXmlStreamReader &reader) override |
virtual bool | read (QXmlStreamReader &reader) override |
Adds Attributes to the current region. More... | |
virtual void | write (QXmlStreamWriter &writer) const override |
Writes the Region to the XML stream. More... | |
void | setRow (int r) |
int | row () const |
void | setCol (int c) |
int | col () const |
void | setRowSpan (int r) |
int | rowSpan () const |
void | setColSpan (int c) |
int | colSpan () const |
void | setLeftBorderVisible (bool b) |
bool | leftBorderVisible () const |
void | setRightBorderVisible (bool b) |
bool | rightBorderVisible () const |
void | setTopBorderVisible (bool b) |
bool | topBorderVisible () const |
void | setBottomBorderVisible (bool b) |
bool | bottomBorderVisible () const |
void | setHeader (bool b) |
bool | header () const |
void | setCornerPts (QVector< int > &cPts) |
QVector< int > | cornerPty () const |
bool | operator< (const TableCell &cell) const |
Public Member Functions inherited from rdf::Region | |
Region (const Type &type=Type::type_unknown, const QString &id="") | |
Initializes a new instance of the Region class. The Region is the base class for all Region elements that are contained in the extended PAGE XML. More... | |
bool | isEmpty () const |
void | setSelected (bool select) |
bool | selected () const |
void | setType (const Region::Type &type) |
Sets the Region type. More... | |
Region::Type | type () const |
The Region's type (e.g. type_text_region). More... | |
void | setId (const QString &id) |
Set a unique identifier to the region. More... | |
QString | id () const |
Returns the Region's unique identifier. More... | |
void | setCustom (const QString &c) |
QString | custom () const |
void | setPolygon (const Polygon &polygon) |
Set the polygon which enclosed the Region. The polygon's coordinates are w.r.t the image coordinates. More... | |
Polygon | polygon () const |
The Region's polygon. More... | |
void | scaleRegion (double scale) |
void | addChild (QSharedPointer< Region > child) |
Adds a child to the current Region. More... | |
bool | reassignChild (QSharedPointer< Region > child) |
Reassigns the child w.r.t its ID. This function is needed if an element was converted (e.g. table cell to text block) but needs to be updated. If the child ID is found, the children of the existing region are replaced by those of child and true is returned. More... | |
void | addUniqueChild (QSharedPointer< Region > child, bool update=false) |
Adds the child if it does not exist already. If update is true, the duplicate element is updated, otherwise nothing happens if the child exists already. More... | |
void | removeChild (QSharedPointer< Region > child) |
Removes the child specified. More... | |
void | removeAllChildren () |
void | setChildren (const QVector< QSharedPointer< Region > > &children) |
Sets the child regions. More... | |
QVector< QSharedPointer< Region > > | children () const |
Children of this instance. More... | |
virtual void | draw (QPainter &p, const RegionTypeConfig &config) const |
Draws the Region to the Painter. More... | |
virtual QString | toString (bool withChildren=false) const |
Returns a string discribing the Region. More... | |
virtual QString | childrenToString () const |
Returns a string with all attributes of the Region's children. More... | |
virtual void | writeChildren (QXmlStreamWriter &writer) const |
Writes the Region's children to the XML stream. More... | |
void | createElement (QXmlStreamWriter &writer) const |
Creates the element. After a call to this method, attributes can be appended to the element. More... | |
void | writePolygon (QXmlStreamWriter &writer) const |
Writes the polygon. This is a convenience function for derived classes. Typically writePolygon is called after all (additional) attributes of the current element are set. More... | |
virtual bool | operator== (const Region &r1) |
Compare operator. Returns true if both regions have the same type and polygon. More... | |
Static Public Member Functions | |
static bool | compareCells (const QSharedPointer< rdf::TableCell > l1, const QSharedPointer< rdf::TableCell > l2) |
Static Public Member Functions inherited from rdf::Region | |
static QVector< QSharedPointer< Region > > | selectedRegions (const Region *root) |
static QVector< QSharedPointer< Region > > | allRegions (const Region *root) |
static QVector< QSharedPointer< Region > > | filter (const Region *root, const Region::Type &type) |
Protected Attributes | |
int | mRow = -1 |
int | mCol = -1 |
int | mRowSpan = -1 |
int | mColSpan = -1 |
bool | mLeftBorderVisible = false |
bool | mRightBorderVisible = false |
bool | mTopBorderVisible = false |
bool | mBottomBorderVisible = false |
bool | mHeader = false |
QVector< int > | mCornerPts |
Protected Attributes inherited from rdf::Region | |
Type | mType = Type::type_unknown |
bool | mSelected = false |
QString | mId |
QString | mCustom |
Polygon | mPoly |
QVector< QSharedPointer< Region > > | mChildren |
Additional Inherited Members | |
Public Types inherited from rdf::Region | |
enum | Type { type_unknown = 0, type_root, type_table_region, type_table_cell, type_text_region, type_text_line, type_word, type_separator, type_image, type_graphic, type_chart, type_noise, type_end } |
Protected Member Functions inherited from rdf::Region | |
void | collectRegions (QVector< QSharedPointer< Region > > &allRegions, const Region::Type &type=type_unknown) const |
virtual bool | readPoints (QXmlStreamReader &reader) |
rdf::TableCell::TableCell | ( | const Type & | type = Type::type_unknown | ) |
rdf::Line rdf::TableCell::bottomBorder | ( | ) | const |
bool rdf::TableCell::bottomBorderVisible | ( | ) | const |
int rdf::TableCell::col | ( | ) | const |
int rdf::TableCell::colSpan | ( | ) | const |
|
static |
QVector< int > rdf::TableCell::cornerPty | ( | ) | const |
rdf::Vector2D rdf::TableCell::downLeft | ( | ) | const |
rdf::Vector2D rdf::TableCell::downRight | ( | ) | const |
bool rdf::TableCell::header | ( | ) | const |
double rdf::TableCell::height | ( | ) | const |
rdf::Line rdf::TableCell::leftBorder | ( | ) | const |
bool rdf::TableCell::leftBorderVisible | ( | ) | const |
bool rdf::TableCell::operator< | ( | const TableCell & | cell | ) | const |
|
overridevirtual |
Adds Attributes to the current region.
reader | XML reader set to the current line (inside a region type). |
Reimplemented from rdf::Region.
|
overridevirtual |
Reimplemented from rdf::Region.
rdf::Line rdf::TableCell::rightBorder | ( | ) | const |
bool rdf::TableCell::rightBorderVisible | ( | ) | const |
int rdf::TableCell::row | ( | ) | const |
int rdf::TableCell::rowSpan | ( | ) | const |
void rdf::TableCell::setBottomBorderVisible | ( | bool | b | ) |
void rdf::TableCell::setCol | ( | int | c | ) |
void rdf::TableCell::setColSpan | ( | int | c | ) |
void rdf::TableCell::setCornerPts | ( | QVector< int > & | cPts | ) |
void rdf::TableCell::setHeader | ( | bool | b | ) |
void rdf::TableCell::setLeftBorderVisible | ( | bool | b | ) |
void rdf::TableCell::setRightBorderVisible | ( | bool | b | ) |
void rdf::TableCell::setRow | ( | int | r | ) |
void rdf::TableCell::setRowSpan | ( | int | r | ) |
void rdf::TableCell::setTopBorderVisible | ( | bool | b | ) |
rdf::Line rdf::TableCell::topBorder | ( | ) | const |
bool rdf::TableCell::topBorderVisible | ( | ) | const |
rdf::Vector2D rdf::TableCell::upperLeft | ( | ) | const |
rdf::Vector2D rdf::TableCell::upperRight | ( | ) | const |
double rdf::TableCell::width | ( | ) | const |
|
overridevirtual |
Writes the Region to the XML stream.
writer | The XML stream at the position where the region should be written. |
withChildren | if set to true the Region's children are written too. |
close | if set to true the element's close tag is appended. |
Reimplemented from rdf::Region.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |