QElectroTech
0.70
|
#include <titleblocktemplate.h>
Public Member Functions | |
TitleBlockTemplate (QObject *=nullptr) | |
~TitleBlockTemplate () override | |
TitleBlockCell * | createCell (const TitleBlockCell *=nullptr) |
bool | loadFromXmlFile (const QString &) |
bool | loadFromXmlElement (const QDomElement &) |
bool | saveToXmlFile (const QString &) |
bool | saveToXmlElement (QDomElement &) const |
void | exportCellToXml (TitleBlockCell *, QDomElement &) const |
TitleBlockTemplate * | clone () const |
QString | name () const |
QString | information () const |
void | setInformation (const QString &) |
int | rowDimension (int) |
void | setRowDimension (int, const TitleBlockDimension &) |
TitleBlockDimension | columnDimension (int) |
void | setColumnDimension (int, const TitleBlockDimension &) |
int | columnsCount () const |
int | rowsCount () const |
QList< int > | columnsWidth (int) const |
QList< int > | rowsHeights () const |
int | columnTypeCount (QET::TitleBlockColumnLength) |
int | columnTypeTotal (QET::TitleBlockColumnLength) |
int | minimumWidth () |
int | maximumWidth () |
int | width (int) |
int | height () const |
bool | moveRow (int, int) |
void | addRow (int=-1) |
bool | insertRow (int, const QList< TitleBlockCell *> &, int=-1) |
QList< TitleBlockCell * > | takeRow (int) |
QList< TitleBlockCell * > | createRow () |
bool | moveColumn (int, int) |
void | addColumn (int=-1) |
bool | insertColumn (const TitleBlockDimension &, const QList< TitleBlockCell *> &, int=-1) |
QList< TitleBlockCell * > | takeColumn (int) |
QList< TitleBlockCell * > | createColumn () |
TitleBlockCell * | cell (int, int) const |
QSet< TitleBlockCell * > | spannedCells (const TitleBlockCell *, bool=false) const |
QHash< TitleBlockCell *, QPair< int, int > > | getAllSpans () const |
void | setAllSpans (const QHash< TitleBlockCell *, QPair< int, int > > &) |
bool | addLogo (const QString &, QByteArray *, const QString &="svg", const QString &="xml") |
bool | addLogoFromFile (const QString &, const QString &=QString()) |
bool | saveLogoToFile (const QString &, const QString &) |
bool | removeLogo (const QString &) |
bool | renameLogo (const QString &, const QString &) |
void | setLogoStorage (const QString &, const QString &) |
QList< QString > | logos () const |
QString | logoType (const QString &) const |
QSvgRenderer * | vectorLogo (const QString &) const |
QPixmap | bitmapLogo (const QString &) const |
void | render (QPainter &, const DiagramContext &, int) const |
void | renderDxf (QRectF &, const DiagramContext &, int, QString &, int) const |
void | renderCell (QPainter &, const TitleBlockCell &, const DiagramContext &, const QRect &) const |
void | applyCellSpans () |
void | forgetSpanning () |
void | forgetSpanning (TitleBlockCell *, bool=true) |
bool | checkCellSpan (TitleBlockCell *) |
void | applyCellSpan (TitleBlockCell *) |
void | applyRowColNums () |
void | rowColsChanged () |
QStringList | listOfVariables () |
Get list of variables. More... | |
Static Public Member Functions | |
static QFont | fontForCell (const TitleBlockCell &) |
Protected Member Functions | |
void | loadInformation (const QDomElement &) |
bool | loadLogos (const QDomElement &, bool=false) |
bool | loadLogo (const QDomElement &) |
bool | loadGrid (const QDomElement &) |
bool | loadCells (const QDomElement &) |
void | loadCell (const QDomElement &) |
void | saveInformation (QDomElement &) const |
void | saveLogos (QDomElement &) const |
void | saveLogo (const QString &, QDomElement &) const |
void | saveGrid (QDomElement &) const |
void | saveCells (QDomElement &) const |
void | saveCell (TitleBlockCell *, QDomElement &, bool=false) const |
QList< TitleBlockCell * > | createCellsList (int) |
Private Member Functions | |
TitleBlockTemplate (const TitleBlockTemplate &) | |
void | parseRows (const QString &) |
void | parseColumns (const QString &) |
bool | checkCell (const QDomElement &, TitleBlockCell **=nullptr) |
void | flushCells () |
void | initCells () |
int | lengthRange (int, int, const QList< int > &) const |
QString | finalTextForCell (const TitleBlockCell &, const DiagramContext &) const |
QString | interpreteVariables (const QString &, const DiagramContext &) const |
void | renderTextCell (QPainter &, const QString &, const TitleBlockCell &, const QRectF &) const |
void | renderTextCellDxf (QString &, const QString &, const TitleBlockCell &, qreal, qreal, qreal, qreal, int) const |
Private Attributes | |
QString | name_ |
name identifying the Title Block Template within its parent collection More... | |
QString | information_ |
QHash< QString, QByteArray > | data_logos_ |
Logos raw data. More... | |
QHash< QString, QString > | storage_logos_ |
Logos applied storage type (e.g. "xml" or "base64") More... | |
QHash< QString, QString > | type_logos_ |
Logos types (e.g. "png", "jpeg", "svg") More... | |
QHash< QString, QSvgRenderer * > | vector_logos_ |
Rendered objects for vector logos. More... | |
QHash< QString, QPixmap > | bitmap_logos_ |
Pixmaps for bitmap logos. More... | |
QList< int > | rows_heights_ |
rows heights – simple integers More... | |
QList< TitleBlockDimension > | columns_width_ |
columns widths – More... | |
QList< TitleBlockCell * > | registered_cells_ |
Cells objects created rattached to this template, but not mandatorily used. More... | |
QList< QList< TitleBlockCell * > > | cells_ |
Cells grid. More... | |
This class represents an title block template for an electric diagram. It can read from an XML document the layout of the table that graphically represents the title block, and can produce a graphical rendering of it from a diagram context (object embedding the informations of the diagram we want to represent the title block.
Definition at line 34 of file titleblocktemplate.h.
TitleBlockTemplate::TitleBlockTemplate | ( | QObject * | parent = nullptr | ) |
Constructor
parent | parent QObject |
Definition at line 30 of file titleblocktemplate.cpp.
Referenced by clone().
|
override |
Destructor
Definition at line 38 of file titleblocktemplate.cpp.
References loadLogos(), and registered_cells_.
|
private |
void TitleBlockTemplate::addColumn | ( | int | i = -1 | ) |
Add a new 50px-wide column at the provided index.
i | Index of the added column, -1 meaning "last position" |
Definition at line 912 of file titleblocktemplate.cpp.
References QET::Absolute, createColumn(), and insertColumn().
bool TitleBlockTemplate::addLogo | ( | const QString & | logo_name, |
QByteArray * | logo_data, | ||
const QString & | logo_type = "svg" , |
||
const QString & | logo_storage = "xml" |
||
) |
logo_name | Logo name to be added / replaced |
logo_data | Logo data |
Definition at line 1024 of file titleblocktemplate.cpp.
References bitmap_logos_, data_logos_, removeLogo(), storage_logos_, type_logos_, and vector_logos_.
Referenced by addLogoFromFile(), and loadLogo().
bool TitleBlockTemplate::addLogoFromFile | ( | const QString & | filepath, |
const QString & | name = QString() |
||
) |
filepath | Path of the image file to add as a logo |
name | Name used to store the logo; if none is provided, the basename of the first argument is used. |
Definition at line 1072 of file titleblocktemplate.cpp.
void TitleBlockTemplate::addRow | ( | int | i = -1 | ) |
Add a new 25px-wide row at the provided index.
i | Index of the added row, -1 meaning "last position" |
Definition at line 848 of file titleblocktemplate.cpp.
References createRow(), and insertRow().
void TitleBlockTemplate::applyCellSpan | ( | TitleBlockCell * | cell | ) |
Ensure the spans of the provided cell are applied within the grid structure. Note: this function does not check whether the spans of the provided cell make sense.
cell | Potentially spanning cell |
Definition at line 1584 of file titleblocktemplate.cpp.
References cell(), cells_, and TitleBlockCell::Disabled.
Referenced by applyCellSpans().
void TitleBlockTemplate::applyCellSpans | ( | ) |
Forget any previously applied span, then apply again all spans defined by existing cells.
Definition at line 1524 of file titleblocktemplate.cpp.
References applyCellSpan(), cells_, checkCellSpan(), columns_width_, forgetSpanning(), and rows_heights_.
Referenced by loadGrid(), and rowColsChanged().
void TitleBlockTemplate::applyRowColNums | ( | ) |
Ensure all cells have the right col+row numbers.
Definition at line 1605 of file titleblocktemplate.cpp.
References cells_, columns_width_, and rows_heights_.
Referenced by loadGrid(), and rowColsChanged().
QPixmap TitleBlockTemplate::bitmapLogo | ( | const QString & | logo_name | ) | const |
logo_name | Name of a logo embedded within this title block template. |
Definition at line 1199 of file titleblocktemplate.cpp.
References bitmap_logos_.
TitleBlockCell * TitleBlockTemplate::cell | ( | int | row, |
int | col | ||
) | const |
row | A row number (starting from 0) |
col | A column number (starting from 0) |
Definition at line 957 of file titleblocktemplate.cpp.
References cells_, columns_width_, and rows_heights_.
Referenced by applyCellSpan(), checkCellSpan(), exportCellToXml(), finalTextForCell(), fontForCell(), renderCell(), renderTextCell(), renderTextCellDxf(), saveCell(), setAllSpans(), and spannedCells().
|
private |
Load the essential attributes of a cell: row and column indices and spans.
xml_element | XML element representing a cell, i.e. either an titleblock logo or an titleblock field. |
titleblock_cell_ptr | Pointer to a TitleBlockCell object pointer - if non-zero and if this method returns true, will be filled with the created TitleBlockCell |
Definition at line 522 of file titleblocktemplate.cpp.
References QET::attributeIsAnInteger(), cells_, columns_width_, TitleBlockCell::EmptyCell, and rows_heights_.
Referenced by loadCell().
bool TitleBlockTemplate::checkCellSpan | ( | TitleBlockCell * | cell | ) |
Check whether a given cell can be spanned according to its row_span and col_span attributes. the following attributes of cell are updated according to what is really possible: applied_col_span applied_row_span span_state
cell | Cell we want to check |
Definition at line 1544 of file titleblocktemplate.cpp.
References cell(), cells_, columnsCount(), TitleBlockCell::Disabled, TitleBlockCell::EmptyCell, TitleBlockCell::Enabled, TitleBlockCell::Restricted, and rowsCount().
Referenced by applyCellSpans().
TitleBlockTemplate * TitleBlockTemplate::clone | ( | ) | const |
Definition at line 169 of file titleblocktemplate.cpp.
References bitmap_logos_, cells_, columns_width_, createCell(), data_logos_, information_, name_, rows_heights_, storage_logos_, TitleBlockTemplate(), type_logos_, and vector_logos_.
TitleBlockDimension TitleBlockTemplate::columnDimension | ( | int | i | ) |
i | column index |
Definition at line 635 of file titleblocktemplate.cpp.
References columns_width_.
int TitleBlockTemplate::columnsCount | ( | ) | const |
Definition at line 658 of file titleblocktemplate.cpp.
References columns_width_.
Referenced by checkCellSpan().
QList< int > TitleBlockTemplate::columnsWidth | ( | int | total_width | ) | const |
total_width | The total width of the titleblock to render |
Definition at line 673 of file titleblocktemplate.cpp.
References QET::Absolute, columns_width_, QET::RelativeToRemainingLength, QET::RelativeToTotalLength, TitleBlockDimension::type, and TitleBlockDimension::value.
Referenced by render(), renderDxf(), and width().
int TitleBlockTemplate::columnTypeCount | ( | QET::TitleBlockColumnLength | type | ) |
a | column type |
Definition at line 745 of file titleblocktemplate.cpp.
References columns_width_.
Referenced by maximumWidth().
int TitleBlockTemplate::columnTypeTotal | ( | QET::TitleBlockColumnLength | type | ) |
a | column type |
Definition at line 759 of file titleblocktemplate.cpp.
References columns_width_.
Referenced by maximumWidth(), and minimumWidth().
TitleBlockCell * TitleBlockTemplate::createCell | ( | const TitleBlockCell * | existing_cell = nullptr | ) |
Create a new cell and associate it with this template, which means that it will be deleted when this template is destroyed.
existing_cell | (optional) An existing cell that will be copied |
Definition at line 49 of file titleblocktemplate.cpp.
References registered_cells_.
Referenced by clone(), and createCellsList().
|
protected |
count | Number of cells expected in the list |
Definition at line 60 of file titleblocktemplate.cpp.
References createCell().
Referenced by createColumn(), and createRow().
QList< TitleBlockCell * > TitleBlockTemplate::createColumn | ( | ) |
Definition at line 948 of file titleblocktemplate.cpp.
References createCellsList(), and rows_heights_.
Referenced by addColumn(), and initCells().
QList< TitleBlockCell * > TitleBlockTemplate::createRow | ( | ) |
Definition at line 888 of file titleblocktemplate.cpp.
References columns_width_, and createCellsList().
Referenced by addRow().
void TitleBlockTemplate::exportCellToXml | ( | TitleBlockCell * | cell, |
QDomElement & | xml_element | ||
) | const |
xml_element | Parent XML element to be used when exporting cell |
cell | Cell to export |
Definition at line 161 of file titleblocktemplate.cpp.
References cell(), and saveCell().
|
private |
cell | A cell from this template |
diagram_context | Diagram context to use to generate the final text for the given cell |
Definition at line 1343 of file titleblocktemplate.cpp.
References cell(), TitleBlockCell::display_label, interpreteVariables(), NamesList::isEmpty(), TitleBlockCell::label, NamesList::name(), QET::Icons::tr, and TitleBlockCell::value.
Referenced by renderCell(), and renderDxf().
|
private |
|
static |
cell | An existing cell |
Definition at line 70 of file titleblocktemplate.cpp.
References cell(), QETApp::diagramTextsFont(), and TitleBlockCell::font_size.
Referenced by TitleBlockCell::attribute(), TitleBlockTemplateCellWidget::edit(), renderTextCell(), and renderTextCellDxf().
void TitleBlockTemplate::forgetSpanning | ( | ) |
Set the spanner_cell attribute of every cell to 0.
Definition at line 1494 of file titleblocktemplate.cpp.
References cells_, columns_width_, and rows_heights_.
Referenced by applyCellSpans().
void TitleBlockTemplate::forgetSpanning | ( | TitleBlockCell * | spanning_cell, |
bool | modify_cell = true |
||
) |
Set the spanner_cell attribute of every cell spanned by spanning_cell to 0.
modify_cell | (Optional, defaults to true) Whether to set row_span and col_span of spanning_cell to 0. |
Definition at line 1506 of file titleblocktemplate.cpp.
References TitleBlockCell::Enabled, and spannedCells().
QHash< TitleBlockCell *, QPair< int, int > > TitleBlockTemplate::getAllSpans | ( | ) | const |
Export the span parameters of all cell in the current grid.
Definition at line 994 of file titleblocktemplate.cpp.
References cells_, columns_width_, and rows_heights_.
int TitleBlockTemplate::height | ( | ) | const |
Definition at line 819 of file titleblocktemplate.cpp.
References rows_heights_.
Referenced by render().
QString TitleBlockTemplate::information | ( | ) | const |
Definition at line 596 of file titleblocktemplate.cpp.
References information_.
Referenced by saveInformation().
|
private |
Initialize the internal cells grid with the row and column counts. Note that this method does nothing if one of the internal lists columns_width_ and rows_heights_ is empty.
Definition at line 572 of file titleblocktemplate.cpp.
References cells_, columns_width_, createColumn(), registered_cells_, and rows_heights_.
Referenced by loadGrid().
bool TitleBlockTemplate::insertColumn | ( | const TitleBlockDimension & | dimension, |
const QList< TitleBlockCell *> & | column, | ||
int | i = -1 |
||
) |
dimension | Size of the column to be added |
column | Column to be added |
i | Index of the column after insertion, -1 meaning "last position" |
Definition at line 921 of file titleblocktemplate.cpp.
References cells_, columns_width_, and rowColsChanged().
Referenced by addColumn().
bool TitleBlockTemplate::insertRow | ( | int | dimension, |
const QList< TitleBlockCell *> & | row, | ||
int | i = -1 |
||
) |
dimension | Size of the row to be added (always absolute, in pixels) |
column | Row to be added |
i | Index of the column after insertion, -1 meaning "last position" |
Definition at line 857 of file titleblocktemplate.cpp.
References cells_, columns_width_, rowColsChanged(), and rows_heights_.
Referenced by addRow().
|
private |
string | A text containing 0 to n variables, e.g. "%var" or "%{var}" |
diagram_context | Diagram context to use to interprete variables |
Definition at line 1363 of file titleblocktemplate.cpp.
References DiagramContext::DecreasingLength, and DiagramContext::keys().
Referenced by finalTextForCell().
|
private |
start | start border number |
end | end border number |
Definition at line 1628 of file titleblocktemplate.cpp.
Referenced by render(), and renderDxf().
QStringList TitleBlockTemplate::listOfVariables | ( | ) |
Get list of variables.
Definition at line 1376 of file titleblocktemplate.cpp.
References cells_, columns_width_, TitleBlockCell::EmptyCell, and rows_heights_.
|
protected |
Load a cell into this template.
cell_element | XML element describing a cell within a title block template |
Definition at line 402 of file titleblocktemplate.cpp.
References checkCell().
Referenced by loadCells().
|
protected |
Analyze an XML element, looking for grid cells. The grid cells are checked and stored in this object.
xml_element | XML element to analyze |
Definition at line 385 of file titleblocktemplate.cpp.
References loadCell().
Referenced by loadGrid().
bool TitleBlockTemplate::loadFromXmlElement | ( | const QDomElement & | xml_element | ) |
xml_element | An XML document to read the template from. |
Definition at line 105 of file titleblocktemplate.cpp.
References loadGrid(), loadInformation(), loadLogos(), and name_.
Referenced by loadFromXmlFile().
bool TitleBlockTemplate::loadFromXmlFile | ( | const QString & | filepath | ) |
Load a titleblock template from an XML file.
filepath | A file path to read the template from. |
Definition at line 79 of file titleblocktemplate.cpp.
References loadFromXmlElement().
|
protected |
Import the grid from a given XML titleblock template.
xml_element | An XML element representing an titleblock template. |
Definition at line 305 of file titleblocktemplate.cpp.
References applyCellSpans(), applyRowColNums(), initCells(), loadCells(), parseColumns(), and parseRows().
Referenced by loadFromXmlElement().
|
protected |
Import text informations from a given XML title block template.
Definition at line 220 of file titleblocktemplate.cpp.
References setInformation().
Referenced by loadFromXmlElement().
|
protected |
Import the logo from a given XML logo description.
xml_element | An XML element representing a logo within an titleblock template. |
Definition at line 267 of file titleblocktemplate.cpp.
References addLogo().
Referenced by loadLogos().
|
protected |
Import the logos from a given XML titleblock template.
xml_element | An XML element representing an titleblock template. |
reset | true to delete all previously known logos before, false otherwise. |
Definition at line 235 of file titleblocktemplate.cpp.
References bitmap_logos_, data_logos_, loadLogo(), storage_logos_, and vector_logos_.
Referenced by loadFromXmlElement(), and ~TitleBlockTemplate().
QList< QString > TitleBlockTemplate::logos | ( | ) | const |
Definition at line 1166 of file titleblocktemplate.cpp.
References data_logos_.
QString TitleBlockTemplate::logoType | ( | const QString & | logo_name | ) | const |
logo_name | Name of a logo embedded within this title block template. |
Definition at line 1175 of file titleblocktemplate.cpp.
References type_logos_.
int TitleBlockTemplate::maximumWidth | ( | ) |
Definition at line 795 of file titleblocktemplate.cpp.
References QET::Absolute, columns_width_, columnTypeCount(), and columnTypeTotal().
int TitleBlockTemplate::minimumWidth | ( | ) |
Definition at line 774 of file titleblocktemplate.cpp.
References QET::Absolute, columnTypeTotal(), and QET::RelativeToTotalLength.
bool TitleBlockTemplate::moveColumn | ( | int | from, |
int | to | ||
) |
Move the column at index "from" to index "to".
from | Source index of the moved column |
to | Target index of the moved column |
Definition at line 898 of file titleblocktemplate.cpp.
References cells_, columns_width_, and rowColsChanged().
bool TitleBlockTemplate::moveRow | ( | int | from, |
int | to | ||
) |
Move a row within this template.
from | Index of the moved row |
to | Arrival index of the moved row |
Definition at line 832 of file titleblocktemplate.cpp.
References cells_, columns_width_, rowColsChanged(), and rows_heights_.
QString TitleBlockTemplate::name | ( | ) | const |
Definition at line 589 of file titleblocktemplate.cpp.
References name_.
Referenced by addLogoFromFile().
|
private |
Parse the columns widths
cols_string | A string describing the columns widths of the titleblock |
Definition at line 354 of file titleblocktemplate.cpp.
References QET::Absolute, columns_width_, QET::RelativeToRemainingLength, and QET::RelativeToTotalLength.
Referenced by loadGrid().
|
private |
Parse the rows heights
rows_string | A string describing the rows heights of the titleblock |
Definition at line 332 of file titleblocktemplate.cpp.
References rows_heights_.
Referenced by loadGrid().
bool TitleBlockTemplate::removeLogo | ( | const QString & | logo_name | ) |
logo_name | Name of the logo to remove |
TODO check existing cells using this logo.
Definition at line 1113 of file titleblocktemplate.cpp.
References bitmap_logos_, data_logos_, storage_logos_, and vector_logos_.
Referenced by addLogo().
bool TitleBlockTemplate::renameLogo | ( | const QString & | logo_name, |
const QString & | new_name | ||
) |
Rename the logo_name logo to new_name
logo_name | Name of the logo to be renamed |
new_name | New name of the renamed logo |
TODO check existing cells using this logo.
Definition at line 1135 of file titleblocktemplate.cpp.
References bitmap_logos_, data_logos_, storage_logos_, and vector_logos_.
void TitleBlockTemplate::render | ( | QPainter & | painter, |
const DiagramContext & | diagram_context, | ||
int | titleblock_width | ||
) | const |
Render the titleblock.
painter | Painter to use to render the titleblock |
diagram_context | Diagram context to use to generate the titleblock strings |
titleblock_width | Width of the titleblock to render |
Definition at line 1212 of file titleblocktemplate.cpp.
References cells_, columns_width_, columnsWidth(), TitleBlockCell::Disabled, TitleBlockCell::EmptyCell, height(), lengthRange(), renderCell(), and rows_heights_.
Referenced by renderCell().
void TitleBlockTemplate::renderCell | ( | QPainter & | painter, |
const TitleBlockCell & | cell, | ||
const DiagramContext & | diagram_context, | ||
const QRect & | cell_rect | ||
) | const |
Render a titleblock cell.
painter | Painter to use to render the titleblock |
diagram_context | Diagram context to use to generate the titleblock strings |
rect | Rectangle the cell must be rendered into. |
Definition at line 1304 of file titleblocktemplate.cpp.
References bitmap_logos_, cell(), finalTextForCell(), TitleBlockCell::logo_reference, TitleBlockCell::LogoCell, render(), renderTextCell(), TitleBlockCell::TextCell, TitleBlockCell::type(), and vector_logos_.
Referenced by render().
void TitleBlockTemplate::renderDxf | ( | QRectF & | title_block_rect, |
const DiagramContext & | diagram_context, | ||
int | titleblock_width, | ||
QString & | file_path, | ||
int | color | ||
) | const |
Render the titleblock in DXF.
diagram_context | Diagram context to use to generate the titleblock strings |
titleblock_width | Width of the titleblock to render |
Definition at line 1254 of file titleblocktemplate.cpp.
References cells_, columns_width_, columnsWidth(), TitleBlockCell::Disabled, Createdxf::drawRectangle(), TitleBlockCell::EmptyCell, finalTextForCell(), lengthRange(), renderTextCellDxf(), rows_heights_, Createdxf::sheetHeight, TitleBlockCell::TextCell, Createdxf::xScale, and Createdxf::yScale.
|
private |
This method uses a painter to render the text of a cell into the cell_rect rectangle. The alignment, font_size and other cell parameters are taken into account when rendering.
painter | QPainter used to render the text |
text | Text to render |
cell | Cell the rendered text is rattached to |
cell_rect | Rectangle delimiting the cell area |
Definition at line 1400 of file titleblocktemplate.cpp.
References TitleBlockCell::alignment, cell(), fontForCell(), and TitleBlockCell::hadjust.
Referenced by renderCell().
|
private |
Definition at line 1433 of file titleblocktemplate.cpp.
References TitleBlockCell::alignment, cell(), Createdxf::drawTextAligned(), fontForCell(), TitleBlockCell::hadjust, Createdxf::xScale, and Createdxf::yScale.
Referenced by renderDxf().
void TitleBlockTemplate::rowColsChanged | ( | ) |
Take care of consistency and span-related problematics when adding/moving/deleting rows and columns.
Definition at line 1618 of file titleblocktemplate.cpp.
References applyCellSpans(), and applyRowColNums().
Referenced by insertColumn(), insertRow(), moveColumn(), moveRow(), takeColumn(), and takeRow().
int TitleBlockTemplate::rowDimension | ( | int | i | ) |
i | row index |
Definition at line 611 of file titleblocktemplate.cpp.
References rows_heights_.
int TitleBlockTemplate::rowsCount | ( | ) | const |
Definition at line 665 of file titleblocktemplate.cpp.
References rows_heights_.
Referenced by checkCellSpan().
QList< int > TitleBlockTemplate::rowsHeights | ( | ) | const |
Definition at line 737 of file titleblocktemplate.cpp.
References rows_heights_.
|
protected |
Export a specific cell as XML
cell | Cell to be exported as XML |
xml_element | XML element under which the <cell> element will be attached |
save_empty | If true, the cell will be saved even if it is an empty one |
Definition at line 495 of file titleblocktemplate.cpp.
References cell(), and TitleBlockCell::EmptyCell.
Referenced by exportCellToXml(), and saveCells().
|
protected |
Export this template's cells as XML (without the grid-related information, usch as rows and cols)
xml_element | XML element under which the <cell> elements will be attached |
Definition at line 479 of file titleblocktemplate.cpp.
References cells_, columns_width_, TitleBlockCell::EmptyCell, rows_heights_, and saveCell().
Referenced by saveGrid().
|
protected |
Export this template's cells grid as XML
xml_element | XML element under which the <grid> element will be attached |
Definition at line 461 of file titleblocktemplate.cpp.
References columns_width_, rows_heights_, saveCells(), and TitleBlockDimension::toShortString().
Referenced by saveToXmlElement().
|
protected |
Export this template's extra information.
xml_element | XML element under which extra informations will be attached |
Definition at line 412 of file titleblocktemplate.cpp.
References information().
Referenced by saveToXmlElement().
|
protected |
Export a specific logo as XML
logo_name | Name of the logo to be exported |
xml_element | XML element in which the logo will be exported |
Definition at line 439 of file titleblocktemplate.cpp.
References data_logos_, storage_logos_, and type_logos_.
Referenced by saveLogos().
|
protected |
Export this template's logos as XML
xml_element | XML Element under which the <logos> element will be attached |
Definition at line 424 of file titleblocktemplate.cpp.
References saveLogo(), and type_logos_.
Referenced by saveToXmlElement().
bool TitleBlockTemplate::saveLogoToFile | ( | const QString & | logo_name, |
const QString & | filepath | ||
) |
Definition at line 1094 of file titleblocktemplate.cpp.
References data_logos_.
bool TitleBlockTemplate::saveToXmlElement | ( | QDomElement & | xml_element | ) | const |
Save the title block template as XML.
xml_element | The XML element this title block template should be saved to. |
Definition at line 145 of file titleblocktemplate.cpp.
References name_, saveGrid(), saveInformation(), and saveLogos().
Referenced by saveToXmlFile().
bool TitleBlockTemplate::saveToXmlFile | ( | const QString & | filepath | ) |
Save the title block template into an XML file.
filepath | The file path this title block template should be saved to. |
Definition at line 127 of file titleblocktemplate.cpp.
References saveToXmlElement(), and QET::writeXmlFile().
void TitleBlockTemplate::setAllSpans | ( | const QHash< TitleBlockCell *, QPair< int, int > > & | spans | ) |
Restore a set of span parameters.
Definition at line 1013 of file titleblocktemplate.cpp.
References cell().
void TitleBlockTemplate::setColumnDimension | ( | int | i, |
const TitleBlockDimension & | dimension | ||
) |
Set the width of a column
i | column index |
dimension | New width of the column at index i |
Definition at line 648 of file titleblocktemplate.cpp.
References columns_width_.
void TitleBlockTemplate::setInformation | ( | const QString & | info | ) |
info | information to be attached to this template |
Definition at line 603 of file titleblocktemplate.cpp.
References information_.
Referenced by loadInformation().
void TitleBlockTemplate::setLogoStorage | ( | const QString & | logo_name, |
const QString & | storage | ||
) |
Set the kind of storage for the logo_name logo.
logo_name | Name of the logo which kind of storage is to be changed |
storage | The kind of storage to use for the logo, e.g. "xml" or "base64". |
Definition at line 1157 of file titleblocktemplate.cpp.
References storage_logos_.
void TitleBlockTemplate::setRowDimension | ( | int | i, |
const TitleBlockDimension & | dimension | ||
) |
Set the height of a row
i | row index |
dimension | New height of the row at index i |
Definition at line 624 of file titleblocktemplate.cpp.
References rows_heights_, and TitleBlockDimension::value.
QSet< TitleBlockCell * > TitleBlockTemplate::spannedCells | ( | const TitleBlockCell * | given_cell, |
bool | ignore_span_state = false |
||
) | const |
cell | A cell belonging to this title block template |
ignore_span_state | (Optional, defaults to false) If true, will consider cells theoretically spanned (i.e. row_span and col_span attributes). Otherwise, will take span_state attribute into account. |
Definition at line 972 of file titleblocktemplate.cpp.
References cell(), and TitleBlockCell::Disabled.
Referenced by forgetSpanning().
QList< TitleBlockCell * > TitleBlockTemplate::takeColumn | ( | int | i | ) |
Removes the column at index i
i | Index of the column to be removed |
Definition at line 934 of file titleblocktemplate.cpp.
References cells_, columns_width_, and rowColsChanged().
QList< TitleBlockCell * > TitleBlockTemplate::takeRow | ( | int | i | ) |
Removes the row at index i
i | Index of the column to be removed |
Definition at line 873 of file titleblocktemplate.cpp.
References cells_, columns_width_, rowColsChanged(), and rows_heights_.
QSvgRenderer * TitleBlockTemplate::vectorLogo | ( | const QString & | logo_name | ) | const |
logo_name | Name of a vector logo embedded within this title block template. |
Definition at line 1187 of file titleblocktemplate.cpp.
References vector_logos_.
int TitleBlockTemplate::width | ( | int | total_width | ) |
total_width | The total width initially planned for the rendering |
Definition at line 808 of file titleblocktemplate.cpp.
References columnsWidth().
|
private |
Pixmaps for bitmap logos.
Definition at line 147 of file titleblocktemplate.h.
Referenced by addLogo(), bitmapLogo(), clone(), loadLogos(), removeLogo(), renameLogo(), and renderCell().
|
private |
Cells grid.
Definition at line 152 of file titleblocktemplate.h.
Referenced by applyCellSpan(), applyCellSpans(), applyRowColNums(), cell(), checkCell(), checkCellSpan(), clone(), forgetSpanning(), getAllSpans(), initCells(), insertColumn(), insertRow(), listOfVariables(), moveColumn(), moveRow(), render(), renderDxf(), saveCells(), takeColumn(), and takeRow().
|
private |
columns widths –
Definition at line 150 of file titleblocktemplate.h.
Referenced by applyCellSpans(), applyRowColNums(), cell(), checkCell(), clone(), columnDimension(), columnsCount(), columnsWidth(), columnTypeCount(), columnTypeTotal(), createRow(), forgetSpanning(), getAllSpans(), initCells(), insertColumn(), insertRow(), listOfVariables(), maximumWidth(), moveColumn(), moveRow(), parseColumns(), render(), renderDxf(), saveCells(), saveGrid(), setColumnDimension(), takeColumn(), and takeRow().
|
private |
Logos raw data.
Definition at line 143 of file titleblocktemplate.h.
Referenced by addLogo(), clone(), loadLogos(), logos(), removeLogo(), renameLogo(), saveLogo(), and saveLogoToFile().
|
private |
Definition at line 141 of file titleblocktemplate.h.
Referenced by clone(), information(), and setInformation().
|
private |
name identifying the Title Block Template within its parent collection
Definition at line 140 of file titleblocktemplate.h.
Referenced by clone(), loadFromXmlElement(), name(), and saveToXmlElement().
|
private |
Cells objects created rattached to this template, but not mandatorily used.
Definition at line 151 of file titleblocktemplate.h.
Referenced by createCell(), initCells(), and ~TitleBlockTemplate().
|
private |
rows heights – simple integers
Definition at line 149 of file titleblocktemplate.h.
Referenced by applyCellSpans(), applyRowColNums(), cell(), checkCell(), clone(), createColumn(), forgetSpanning(), getAllSpans(), height(), initCells(), insertRow(), listOfVariables(), moveRow(), parseRows(), render(), renderDxf(), rowDimension(), rowsCount(), rowsHeights(), saveCells(), saveGrid(), setRowDimension(), and takeRow().
|
private |
Logos applied storage type (e.g. "xml" or "base64")
Definition at line 144 of file titleblocktemplate.h.
Referenced by addLogo(), clone(), loadLogos(), removeLogo(), renameLogo(), saveLogo(), and setLogoStorage().
|
private |
Logos types (e.g. "png", "jpeg", "svg")
Definition at line 145 of file titleblocktemplate.h.
Referenced by addLogo(), clone(), logoType(), saveLogo(), and saveLogos().
|
private |
Rendered objects for vector logos.
Definition at line 146 of file titleblocktemplate.h.
Referenced by addLogo(), clone(), loadLogos(), removeLogo(), renameLogo(), renderCell(), and vectorLogo().