QElectroTech  0.70
Public Slots | Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
BorderTitleBlock Class Reference

#include <bordertitleblock.h>

Public Slots

void titleBlockTemplateChanged (const QString &)
 
void titleBlockTemplateRemoved (const QString &, const TitleBlockTemplate *=nullptr)
 
void displayTitleBlock (bool)
 
void displayColumns (bool)
 
void displayRows (bool)
 
void displayBorder (bool)
 
void slot_setAutoPageNum (QString)
 BorderTitleBlock::slot_setAutoPageNum. More...
 

Signals

void borderChanged (QRectF old_border, QRectF new_border)
 
void displayChanged ()
 
void diagramTitleChanged (const QString &)
 
void titleBlockFolioChanged (const QString &)
 titleBlockFolioChanged Signal emitted after Folio has changed More...
 
void needFolioData ()
 
void needTitleBlockTemplate (const QString &)
 

Public Member Functions

 BorderTitleBlock (QObject *=nullptr)
 
 ~BorderTitleBlock () override
 
void draw (QPainter *painter)
 BorderTitleBlock::draw Draw the border and the titleblock. More...
 
void drawDxf (int, int, bool, QString &, int)
 
int columnsCount () const
 
qreal columnsWidth () const
 
qreal columnsTotalWidth () const
 
qreal columnsHeaderHeight () const
 
int rowsCount () const
 
qreal rowsHeight () const
 
qreal rowsTotalHeight () const
 
qreal rowsHeaderWidth () const
 
qreal diagramWidth () const
 
qreal diagramHeight () const
 
QRectF titleBlockRect () const
 BorderTitleBlock::titleBlockRect. More...
 
QRectF borderAndTitleBlockRect () const
 BorderTitleBlock::borderAndTitleBlockRect. More...
 
QRectF columnsRect () const
 BorderTitleBlock::columnsRect. More...
 
QRectF rowsRect () const
 BorderTitleBlock::rowsRect. More...
 
QRectF outsideBorderRect () const
 BorderTitleBlock::outsideBorderRect. More...
 
QRectF insideBorderRect () const
 BorderTitleBlock::insideBorderRect. More...
 
QString author () const
 
QDate date () const
 
QString title () const
 
QString folio () const
 
QString finalfolio () const
 
QString plant () const
 
QString locmach () const
 
QString indexrev () const
 
QString fileName () const
 
QString version () const
 
DiagramContext additionalFields () const
 
QString autoPageNum () const
 
int folioTotal () const
 
bool titleBlockIsDisplayed () const
 
bool columnsAreDisplayed () const
 
bool rowsAreDisplayed () const
 
bool borderIsDisplayed () const
 
void setColumnsCount (int)
 
void setRowsCount (int)
 
void setColumnsWidth (const qreal &)
 
void setRowsHeight (const qreal &)
 
void setColumnsHeaderHeight (const qreal &)
 
void setRowsHeaderWidth (const qreal &)
 
void setDiagramHeight (const qreal &)
 
DiagramPosition convertPosition (const QPointF &)
 BorderTitleBlock::convertPosition Convert a Point in cartesian coordinate (x : 12.5, 56.9) to a point in grid coordinate (ex : B2) More...
 
void setAuthor (const QString &author)
 BorderTitleBlock::setAuthor. More...
 
void setDate (const QDate &date)
 BorderTitleBlock::setDate. More...
 
void setTitle (const QString &title)
 BorderTitleBlock::setTitle. More...
 
void setFolio (const QString &folio)
 BorderTitleBlock::setFolio. More...
 
void setFolioData (int, int, const QString &=nullptr, const DiagramContext &=DiagramContext())
 
void setPlant (const QString &plant)
 BorderTitleBlock::setPlant. More...
 
void setLocMach (const QString &locmach)
 BorderTitleBlock::setLocMach. More...
 
void setIndicerev (const QString &indexrev)
 BorderTitleBlock::setIndicerev. More...
 
void setFileName (const QString &filename)
 BorderTitleBlock::setFileName. More...
 
void setVersion (const QString &version)
 BorderTitleBlock::setVersion. More...
 
void setAutoPageNum (const QString &auto_page_num)
 BorderTitleBlock::setAutoPageNum. More...
 
void setPreviousFolioNum (const QString &previous)
 BorderTitleBlock::setPreviousFolioNum. More...
 
void setNextFolioNum (const QString &next)
 BorderTitleBlock::setNextFolioNum. More...
 
void titleBlockToXml (QDomElement &)
 
void titleBlockFromXml (const QDomElement &)
 
void borderToXml (QDomElement &)
 
void borderFromXml (const QDomElement &)
 
TitleBlockProperties exportTitleBlock ()
 
void importTitleBlock (const TitleBlockProperties &)
 BorderTitleBlock::importTitleBlock. More...
 
BorderProperties exportBorder ()
 
void importBorder (const BorderProperties &)
 
const TitleBlockTemplatetitleBlockTemplate ()
 
void setTitleBlockTemplate (const TitleBlockTemplate *)
 
QString titleBlockTemplateName () const
 

Private Member Functions

 BorderTitleBlock (const BorderTitleBlock &)
 
QRectF titleBlockRectForQPainter () const
 BorderTitleBlock::titleBlockRectForQPainter. More...
 
void updateRectangles ()
 BorderTitleBlock::updateRectangles This method update the diagram rect according to the value of rows and columns (number and size) More...
 
void updateDiagramContextForTitleBlock (const DiagramContext &=DiagramContext())
 
QString incrementLetters (const QString &)
 

Private Attributes

QString btb_author_
 
QDate btb_date_
 
QString btb_title_
 
QString btb_folio_
 
QString btb_plant_
 
QString btb_locmach_
 
QString btb_indexrev_
 
QString btb_final_folio_
 
QString btb_auto_page_num_
 
int folio_index_
 
int folio_total_
 
QString btb_filename_
 
QString btb_version_
 
DiagramContext additional_fields_
 
Qt::Edge m_edge
 
QString m_next_folio_num
 
QString m_previous_folio_num
 
int columns_count_
 
qreal columns_width_
 
qreal columns_header_height_
 
int rows_count_
 
qreal rows_height_
 
qreal rows_header_width_
 
qreal titleblock_height_
 
QRectF diagram_rect_
 
bool display_titleblock_
 
bool display_columns_
 
bool display_rows_
 
bool display_border_
 
TitleBlockTemplateRenderertitleblock_template_renderer_
 

Detailed Description

This class represents the border and the titleblock which frame a particular electric diagram.

Definition at line 35 of file bordertitleblock.h.

Constructor & Destructor Documentation

◆ BorderTitleBlock() [1/2]

BorderTitleBlock::BorderTitleBlock ( QObject *  parent = nullptr)

Constructeur simple : construit une bordure en recuperant les dimensions dans la configuration de l'application.

Parameters
parentQObject parent de ce BorderTitleBlock

Definition at line 39 of file bordertitleblock.cpp.

References QETApp::defaultTitleBlockTemplate(), display_border_, display_titleblock_, importBorder(), importTitleBlock(), setFolioData(), setTitleBlockTemplate(), titleblock_template_renderer_, and updateRectangles().

◆ ~BorderTitleBlock()

BorderTitleBlock::~BorderTitleBlock ( )
override

Destructeur - ne fait rien

Definition at line 66 of file bordertitleblock.cpp.

◆ BorderTitleBlock() [2/2]

BorderTitleBlock::BorderTitleBlock ( const BorderTitleBlock )
private

Member Function Documentation

◆ additionalFields()

DiagramContext BorderTitleBlock::additionalFields ( ) const
inline
Returns
the value of the title block Additional Fields

Definition at line 111 of file bordertitleblock.h.

References additional_fields_.

Referenced by autonum::AssignVariables::assignTitleBlockVar().

◆ author()

QString BorderTitleBlock::author ( ) const
inline
Returns
the value of the title block "Author" field

Definition at line 91 of file bordertitleblock.h.

References btb_author_.

Referenced by DiagramFolioList::drawBackground(), exportTitleBlock(), and setAuthor().

◆ autoPageNum()

QString BorderTitleBlock::autoPageNum ( ) const
inline
Returns
the value of the title block

Definition at line 113 of file bordertitleblock.h.

References btb_auto_page_num_.

Referenced by exportTitleBlock().

◆ borderAndTitleBlockRect()

QRectF BorderTitleBlock::borderAndTitleBlockRect ( ) const

BorderTitleBlock::borderAndTitleBlockRect.

Returns
the bounding rectangle of diagram and titleblock. It's like unite outsideBorderRect and titleBlockRect. The rect is in scene coordinate

Definition at line 106 of file bordertitleblock.cpp.

References diagram_rect_, and titleBlockRect().

Referenced by Diagram::adjustSceneRect(), Diagram::imageSize(), and Diagram::toPaintDevice().

◆ borderChanged

void BorderTitleBlock::borderChanged ( QRectF  old_border,
QRectF  new_border 
)
signal

Signal emitted after the border has changed

Parameters
old_borderFormer border
new_borderNew border

Referenced by updateRectangles().

◆ borderFromXml()

void BorderTitleBlock::borderFromXml ( const QDomElement &  xml_elmt)

Reads the border settings from XML.

Parameters
xml_elmtthe XML element values will be read from

Definition at line 202 of file bordertitleblock.cpp.

References displayColumns(), displayRows(), setColumnsCount(), setColumnsWidth(), setDiagramHeight(), setRowsCount(), setRowsHeight(), and updateRectangles().

Referenced by Diagram::fromXml().

◆ borderIsDisplayed()

bool BorderTitleBlock::borderIsDisplayed ( ) const
inline
Returns
true si la bordure est affichee, false sinon

Definition at line 125 of file bordertitleblock.h.

References display_border_.

Referenced by Diagram::applyProperties().

◆ borderToXml()

void BorderTitleBlock::borderToXml ( QDomElement &  xml_elmt)

Exports the border current settings to XML.

Parameters
xml_elmtthe XML element attributes will be added to

Definition at line 185 of file bordertitleblock.cpp.

References columnsAreDisplayed(), columnsCount(), columnsWidth(), diagramHeight(), rowsAreDisplayed(), rowsCount(), and rowsHeight().

Referenced by Diagram::toXml().

◆ columnsAreDisplayed()

bool BorderTitleBlock::columnsAreDisplayed ( ) const
inline
Returns
true si les entetes des colonnes sont affiches, false sinon

Definition at line 121 of file bordertitleblock.h.

References display_columns_.

Referenced by Diagram::borderOptions(), borderToXml(), and exportBorder().

◆ columnsCount()

int BorderTitleBlock::columnsCount ( ) const
inline
Returns
the number of columns

Definition at line 54 of file bordertitleblock.h.

References columns_count_.

Referenced by borderToXml(), exportBorder(), and setColumnsCount().

◆ columnsHeaderHeight()

qreal BorderTitleBlock::columnsHeaderHeight ( ) const
inline
Returns
the column headers height, in pixels

Definition at line 60 of file bordertitleblock.h.

References columns_header_height_.

Referenced by diagramHeight(), DiagramFolioList::drawBackground(), and exportBorder().

◆ columnsRect()

QRectF BorderTitleBlock::columnsRect ( ) const

BorderTitleBlock::columnsRect.

Returns
The columns rect in scene coordinate. If column is not displayed, return a null QRectF

Definition at line 115 of file bordertitleblock.cpp.

References columns_count_, columns_header_height_, columns_width_, display_columns_, Diagram::margin, and rows_header_width_.

Referenced by DiagramView::mouseDoubleClickEvent().

◆ columnsTotalWidth()

qreal BorderTitleBlock::columnsTotalWidth ( ) const
inline
Returns
the total width of all columns, headers excluded

Definition at line 58 of file bordertitleblock.h.

References columns_count_, and columns_width_.

Referenced by diagramWidth(), and DiagramFolioList::drawBackground().

◆ columnsWidth()

qreal BorderTitleBlock::columnsWidth ( ) const
inline
Returns
the columns width, in pixels

Definition at line 56 of file bordertitleblock.h.

References columns_width_.

Referenced by borderToXml(), convertPosition(), exportBorder(), and setColumnsWidth().

◆ convertPosition()

DiagramPosition BorderTitleBlock::convertPosition ( const QPointF &  pos)

BorderTitleBlock::convertPosition Convert a Point in cartesian coordinate (x : 12.5, 56.9) to a point in grid coordinate (ex : B2)

Parameters
pos: position to convert
Returns
the converted point in grid coordinate.

Definition at line 683 of file bordertitleblock.cpp.

References columnsWidth(), incrementLetters(), insideBorderRect(), and rowsHeight().

Referenced by Diagram::convertPosition().

◆ date()

QDate BorderTitleBlock::date ( ) const
inline
Returns
the value of the title block "Date" field

Definition at line 93 of file bordertitleblock.h.

References btb_date_.

Referenced by DiagramFolioList::drawBackground(), exportTitleBlock(), and setDate().

◆ diagramHeight()

qreal BorderTitleBlock::diagramHeight ( ) const
inline
Returns
the diagram height, i.e. the height of the border without title block

Definition at line 76 of file bordertitleblock.h.

References columnsHeaderHeight(), and rowsTotalHeight().

Referenced by borderToXml(), and updateRectangles().

◆ diagramTitleChanged

void BorderTitleBlock::diagramTitleChanged ( const QString &  )
signal

Signal emitted after the title has changed

Referenced by setTitle().

◆ diagramWidth()

qreal BorderTitleBlock::diagramWidth ( ) const
inline
Returns
the diagram width, i.e. the width of the border without title block

Definition at line 74 of file bordertitleblock.h.

References columnsTotalWidth(), and rowsHeaderWidth().

Referenced by updateRectangles().

◆ displayBorder

void BorderTitleBlock::displayBorder ( bool  db)
slot
Parameters
dbtrue pour afficher la bordure du schema, false sinon Note : si l'affichage de la bordure est ainsi desactivee, les lignes et colonnes ne seront pas dessinees.

Definition at line 400 of file bordertitleblock.cpp.

References display_border_, and displayChanged().

Referenced by Diagram::applyProperties(), and Diagram::setBorderOptions().

◆ displayChanged

void BorderTitleBlock::displayChanged ( )
signal

Signal emitted after display options have changed

Referenced by displayBorder(), displayColumns(), displayRows(), displayTitleBlock(), and importTitleBlock().

◆ displayColumns

void BorderTitleBlock::displayColumns ( bool  dc)
slot
Parameters
dctrue pour afficher les entetes des colonnes, false sinon

Definition at line 380 of file bordertitleblock.cpp.

References display_columns_, and displayChanged().

Referenced by borderFromXml(), importBorder(), and Diagram::setBorderOptions().

◆ displayRows

void BorderTitleBlock::displayRows ( bool  dr)
slot
Parameters
drtrue pour afficher les entetes des lignes, false sinon

Definition at line 389 of file bordertitleblock.cpp.

References display_rows_, and displayChanged().

Referenced by borderFromXml(), and importBorder().

◆ displayTitleBlock

void BorderTitleBlock::displayTitleBlock ( bool  di)
slot
Parameters
ditrue pour afficher le cartouche, false sinon

Definition at line 371 of file bordertitleblock.cpp.

References display_titleblock_, and displayChanged().

Referenced by Diagram::applyProperties(), and Diagram::setBorderOptions().

◆ draw()

void BorderTitleBlock::draw ( QPainter *  painter)

◆ drawDxf()

void BorderTitleBlock::drawDxf ( int  width,
int  height,
bool  keep_aspect_ratio,
QString &  file_path,
int  color 
)

◆ exportBorder()

BorderProperties BorderTitleBlock::exportBorder ( )

◆ exportTitleBlock()

TitleBlockProperties BorderTitleBlock::exportTitleBlock ( )

◆ fileName()

QString BorderTitleBlock::fileName ( ) const
inline
Returns
the value of the title block "File" field

Definition at line 107 of file bordertitleblock.h.

References btb_filename_.

Referenced by exportTitleBlock().

◆ finalfolio()

QString BorderTitleBlock::finalfolio ( ) const
inline
Returns
the value of the title block "Folio" field as displayed

Definition at line 99 of file bordertitleblock.h.

References btb_final_folio_.

Referenced by DiagramFolioList::drawBackground(), and GenericPanel::updateDiagramItem().

◆ folio()

QString BorderTitleBlock::folio ( ) const
inline

◆ folioTotal()

int BorderTitleBlock::folioTotal ( ) const
inline
Returns
the value of the total number of folios

Definition at line 115 of file bordertitleblock.h.

References folio_total_.

Referenced by autonum::AssignVariables::AssignVariables().

◆ importBorder()

void BorderTitleBlock::importBorder ( const BorderProperties bp)

◆ importTitleBlock()

void BorderTitleBlock::importTitleBlock ( const TitleBlockProperties ip)

◆ incrementLetters()

QString BorderTitleBlock::incrementLetters ( const QString &  string)
private

Definition at line 771 of file bordertitleblock.cpp.

Referenced by convertPosition(), draw(), and drawDxf().

◆ indexrev()

QString BorderTitleBlock::indexrev ( ) const
inline
Returns
the value of the revision index block "Folio" field

Definition at line 105 of file bordertitleblock.h.

References btb_indexrev_.

Referenced by DiagramFolioList::drawBackground(), exportTitleBlock(), and setIndicerev().

◆ insideBorderRect()

QRectF BorderTitleBlock::insideBorderRect ( ) const

BorderTitleBlock::insideBorderRect.

Returns
The rect of the inside border, in other word, the drawing area. This method take care about if rows or columns are displayed or not. The rect is in scene coordinate

Definition at line 150 of file bordertitleblock.cpp.

References columns_count_, columns_header_height_, columns_width_, display_columns_, display_rows_, Diagram::margin, rows_count_, rows_header_width_, and rows_height_.

Referenced by convertPosition(), Diagram::drawBackground(), and DiagramEventAddShape::updateHelpCross().

◆ locmach()

QString BorderTitleBlock::locmach ( ) const
inline
Returns
the value of the title block "Locmach" field

Definition at line 103 of file bordertitleblock.h.

References btb_locmach_.

Referenced by DiagramFolioList::drawBackground(), exportTitleBlock(), and setLocMach().

◆ needFolioData

void BorderTitleBlock::needFolioData ( )
signal

Signal emitted when the title block requires its data to be updated in order to generate the folio field.

Referenced by importTitleBlock().

◆ needTitleBlockTemplate

void BorderTitleBlock::needTitleBlockTemplate ( const QString &  )
signal

Signal emitted when this object needs to set a specific title block template. This object cannot handle the job since it does not know of its parent project.

Referenced by importTitleBlock().

◆ outsideBorderRect()

QRectF BorderTitleBlock::outsideBorderRect ( ) const

BorderTitleBlock::outsideBorderRect.

Returns
The rect of outside border (diagram with columns and rows) The rect is in scene coordinate

Definition at line 137 of file bordertitleblock.cpp.

References columns_count_, columns_header_height_, columns_width_, Diagram::margin, rows_count_, rows_header_width_, and rows_height_.

◆ plant()

QString BorderTitleBlock::plant ( ) const
inline
Returns
the value of the title block "Plant" field

Definition at line 101 of file bordertitleblock.h.

References btb_plant_.

Referenced by DiagramFolioList::drawBackground(), exportTitleBlock(), and setPlant().

◆ rowsAreDisplayed()

bool BorderTitleBlock::rowsAreDisplayed ( ) const
inline
Returns
true si les entetes des lignes sont affiches, false sinon

Definition at line 123 of file bordertitleblock.h.

References display_rows_.

Referenced by borderToXml(), and exportBorder().

◆ rowsCount()

int BorderTitleBlock::rowsCount ( ) const
inline
Returns
the number of rows

Definition at line 64 of file bordertitleblock.h.

References rows_count_.

Referenced by borderToXml(), exportBorder(), and setRowsCount().

◆ rowsHeaderWidth()

qreal BorderTitleBlock::rowsHeaderWidth ( ) const
inline
Returns
la rows header width, in pixels

Definition at line 70 of file bordertitleblock.h.

References rows_header_width_.

Referenced by diagramWidth(), DiagramFolioList::drawBackground(), and exportBorder().

◆ rowsHeight()

qreal BorderTitleBlock::rowsHeight ( ) const
inline
Returns
the rows height, in pixels

Definition at line 66 of file bordertitleblock.h.

References rows_height_.

Referenced by borderToXml(), convertPosition(), exportBorder(), and setRowsHeight().

◆ rowsRect()

QRectF BorderTitleBlock::rowsRect ( ) const

BorderTitleBlock::rowsRect.

Returns
The rows rect in scene coordinate. If row is not displayed, return a null QRectF

Definition at line 126 of file bordertitleblock.cpp.

References columns_header_height_, display_rows_, Diagram::margin, rows_count_, rows_header_width_, and rows_height_.

Referenced by DiagramView::mouseDoubleClickEvent().

◆ rowsTotalHeight()

qreal BorderTitleBlock::rowsTotalHeight ( ) const
inline
Returns
the total height of all rows, headers excluded

Definition at line 68 of file bordertitleblock.h.

References rows_count_, and rows_height_.

Referenced by diagramHeight(), and DiagramFolioList::drawBackground().

◆ setAuthor()

void BorderTitleBlock::setAuthor ( const QString &  author)

BorderTitleBlock::setAuthor.

Parameters
authorthe new value of the "Author" field

Definition at line 703 of file bordertitleblock.cpp.

References author(), and btb_author_.

Referenced by importTitleBlock().

◆ setAutoPageNum()

void BorderTitleBlock::setAutoPageNum ( const QString &  auto_page_num)

BorderTitleBlock::setAutoPageNum.

Parameters
auto_page_numthe new value of the "auto_page_num" field

Definition at line 858 of file bordertitleblock.cpp.

References btb_auto_page_num_.

Referenced by importTitleBlock().

◆ setColumnsCount()

void BorderTitleBlock::setColumnsCount ( int  nb_c)

Permet de changer le nombre de colonnes. Si ce nombre de colonnes est inferieur au minimum requis, c'est ce minimum qui est utilise.

Parameters
nb_cnouveau nombre de colonnes
See also
minNbColumns()

Definition at line 603 of file bordertitleblock.cpp.

References columns_count_, columnsCount(), MIN_COLUMN_COUNT, and updateRectangles().

Referenced by borderFromXml(), and importBorder().

◆ setColumnsHeaderHeight()

void BorderTitleBlock::setColumnsHeaderHeight ( const qreal &  new_chh)

Change la hauteur des en-tetes contenant les numeros de colonnes. Celle-ci doit rester comprise entre 5 et 50 px.

Parameters
new_chhnouvelle hauteur des en-tetes de colonnes

Definition at line 627 of file bordertitleblock.cpp.

References columns_header_height_, and updateRectangles().

Referenced by importBorder().

◆ setColumnsWidth()

void BorderTitleBlock::setColumnsWidth ( const qreal &  new_cw)

Change la largeur des colonnes. Si la largeur indiquee est inferieure au minimum requis, c'est ce minimum qui est utilise.

Parameters
new_cwnouvelle largeur des colonnes
See also
minColumnsWidth()

Definition at line 616 of file bordertitleblock.cpp.

References columns_width_, columnsWidth(), MIN_COLUMN_WIDTH, and updateRectangles().

Referenced by borderFromXml(), and importBorder().

◆ setDate()

void BorderTitleBlock::setDate ( const QDate &  date)

BorderTitleBlock::setDate.

Parameters
datethe new value of the "Date" field

Definition at line 711 of file bordertitleblock.cpp.

References btb_date_, and date().

Referenced by importTitleBlock().

◆ setDiagramHeight()

void BorderTitleBlock::setDiagramHeight ( const qreal &  height)

Cette methode essaye de se rapprocher le plus possible de la hauteur donnee en parametre en modifiant le nombre de lignes en cours.

Definition at line 672 of file bordertitleblock.cpp.

References rows_height_, and setRowsCount().

Referenced by borderFromXml().

◆ setFileName()

void BorderTitleBlock::setFileName ( const QString &  filename)

BorderTitleBlock::setFileName.

Parameters
filenamethe new value of the "filename" field

Definition at line 842 of file bordertitleblock.cpp.

References btb_filename_.

Referenced by importTitleBlock().

◆ setFolio()

void BorderTitleBlock::setFolio ( const QString &  folio)

BorderTitleBlock::setFolio.

Parameters
foliothe new value of the "Folio" field

Definition at line 732 of file bordertitleblock.cpp.

References btb_folio_, folio(), and titleBlockFolioChanged().

Referenced by importTitleBlock().

◆ setFolioData()

void BorderTitleBlock::setFolioData ( int  index,
int  total,
const QString &  autonum = nullptr,
const DiagramContext project_properties = DiagramContext() 
)
Parameters
indexnumero du schema (de 1 a total)
totalnombre total de schemas dans le projet
project_propertiesProject-wide properties, to be merged with diagram-wide ones.

Definition at line 793 of file bordertitleblock.cpp.

References btb_final_folio_, btb_folio_, folio_index_, folio_total_, and updateDiagramContextForTitleBlock().

Referenced by BorderTitleBlock().

◆ setIndicerev()

void BorderTitleBlock::setIndicerev ( const QString &  indexrev)

BorderTitleBlock::setIndicerev.

Parameters
indexrevthe new value of the "indexrev" field

Definition at line 834 of file bordertitleblock.cpp.

References btb_indexrev_, and indexrev().

Referenced by importTitleBlock().

◆ setLocMach()

void BorderTitleBlock::setLocMach ( const QString &  locmach)

BorderTitleBlock::setLocMach.

Parameters
locmachthe new value of the "locmach" field

Definition at line 826 of file bordertitleblock.cpp.

References btb_locmach_, and locmach().

Referenced by importTitleBlock().

◆ setNextFolioNum()

void BorderTitleBlock::setNextFolioNum ( const QString &  next)

◆ setPlant()

void BorderTitleBlock::setPlant ( const QString &  plant)

BorderTitleBlock::setPlant.

Parameters
plantthe new value of the "plant" field

Definition at line 818 of file bordertitleblock.cpp.

References btb_plant_, and plant().

Referenced by importTitleBlock().

◆ setPreviousFolioNum()

void BorderTitleBlock::setPreviousFolioNum ( const QString &  previous)

◆ setRowsCount()

void BorderTitleBlock::setRowsCount ( int  nb_r)

Permet de changer le nombre de lignes. Si ce nombre de lignes est inferieur au minimum requis, cette fonction ne fait rien

Parameters
nb_rnouveau nombre de lignes
See also
minNbRows()

Definition at line 639 of file bordertitleblock.cpp.

References MIN_ROW_COUNT, rows_count_, rowsCount(), and updateRectangles().

Referenced by borderFromXml(), importBorder(), and setDiagramHeight().

◆ setRowsHeaderWidth()

void BorderTitleBlock::setRowsHeaderWidth ( const qreal &  new_rhw)

Change la largeur des en-tetes contenant les numeros de lignes. Celle-ci doit rester comprise entre 5 et 50 px.

Parameters
new_rhwnouvelle largeur des en-tetes des lignes

Definition at line 663 of file bordertitleblock.cpp.

References rows_header_width_, and updateRectangles().

Referenced by importBorder().

◆ setRowsHeight()

void BorderTitleBlock::setRowsHeight ( const qreal &  new_rh)

Change la hauteur des lignes. Si la hauteur indiquee est inferieure au minimum requis, c'est ce minimum qui est utilise.

Parameters
new_rhnouvelle hauteur des lignes
See also
minRowsHeight()

Definition at line 652 of file bordertitleblock.cpp.

References MIN_ROW_HEIGHT, rows_height_, rowsHeight(), and updateRectangles().

Referenced by borderFromXml(), and importBorder().

◆ setTitle()

void BorderTitleBlock::setTitle ( const QString &  title)

BorderTitleBlock::setTitle.

Parameters
titlethe new value of the "Title" field

Definition at line 719 of file bordertitleblock.cpp.

References btb_title_, diagramTitleChanged(), and title().

Referenced by importTitleBlock().

◆ setTitleBlockTemplate()

void BorderTitleBlock::setTitleBlockTemplate ( const TitleBlockTemplate titleblock_template)
Parameters
titleblock_templateThe new titleblock template to use to render the titleblock
See also
TitleBlockTemplateRenderer::setTitleBlockTemplate()

Definition at line 327 of file bordertitleblock.cpp.

References titleblock_template_renderer_.

Referenced by BorderTitleBlock(), and titleBlockTemplateRemoved().

◆ setVersion()

void BorderTitleBlock::setVersion ( const QString &  version)

BorderTitleBlock::setVersion.

Parameters
versionthe new value of the "version" field

Definition at line 850 of file bordertitleblock.cpp.

References btb_version_, and version().

Referenced by importTitleBlock().

◆ slot_setAutoPageNum

void BorderTitleBlock::slot_setAutoPageNum ( QString  pageAutoNum)
slot

BorderTitleBlock::slot_setAutoPageNum.

Parameters
pageAutoNumSet Page (Folio) Auto Num

Definition at line 411 of file bordertitleblock.cpp.

References btb_auto_page_num_.

◆ title()

QString BorderTitleBlock::title ( ) const
inline
Returns
the value of the title block "Title" field

Definition at line 95 of file bordertitleblock.h.

References btb_title_.

Referenced by exportTitleBlock(), setTitle(), and Diagram::title().

◆ titleBlockFolioChanged

void BorderTitleBlock::titleBlockFolioChanged ( const QString &  )
signal

◆ titleBlockFromXml()

void BorderTitleBlock::titleBlockFromXml ( const QDomElement &  xml_elmt)

Reads the title block values from XML.

Parameters
xml_elmtthe XML element values will be read from

Definition at line 175 of file bordertitleblock.cpp.

References TitleBlockProperties::fromXml(), and importTitleBlock().

Referenced by Diagram::fromXml().

◆ titleBlockIsDisplayed()

bool BorderTitleBlock::titleBlockIsDisplayed ( ) const
inline
Returns
true si le cartouche est affiche, false sinon

Definition at line 119 of file bordertitleblock.h.

References display_titleblock_.

Referenced by Diagram::applyProperties(), and Diagram::borderOptions().

◆ titleBlockRect()

QRectF BorderTitleBlock::titleBlockRect ( ) const

BorderTitleBlock::titleBlockRect.

Returns
the rectangle of the titleblock in scene coordinate.

Definition at line 73 of file bordertitleblock.cpp.

References diagram_rect_, m_edge, and titleblock_template_renderer_.

Referenced by borderAndTitleBlockRect(), drawDxf(), DiagramView::mouseDoubleClickEvent(), and titleBlockRectForQPainter().

◆ titleBlockRectForQPainter()

QRectF BorderTitleBlock::titleBlockRectForQPainter ( ) const
private

BorderTitleBlock::titleBlockRectForQPainter.

Returns
The title block rect to use with the QPainter in the method draw. The returned rect is alway horizontal (like displayed at the bottom of rect) only the top left change of pos according to the edge where the title block need to be displayed. Rect according to edge: Bottom : top left is at the bottom left edge of the diagram rect. Right : top left is at the bottom right of diagram rect. Befor use this rect you need to rotate the QPainter by -90° for snap the rect at the right edge of diagram.

Definition at line 91 of file bordertitleblock.cpp.

References diagram_rect_, m_edge, titleblock_template_renderer_, and titleBlockRect().

Referenced by draw().

◆ titleBlockTemplate()

const TitleBlockTemplate * BorderTitleBlock::titleBlockTemplate ( )
Returns
the titleblock template used to render the titleblock
See also
TitleBlockTemplateRenderer::titleBlockTemplate()

Definition at line 319 of file bordertitleblock.cpp.

References titleblock_template_renderer_.

Referenced by titleBlockTemplateName().

◆ titleBlockTemplateChanged

void BorderTitleBlock::titleBlockTemplateChanged ( const QString &  template_name)
slot

This slot may be used to inform this class that the given title block template has changed. The title block-dedicated rendering cache will thus be flushed.

Parameters
template_nameName of the title block template that has changed

Definition at line 345 of file bordertitleblock.cpp.

References titleblock_template_renderer_, and titleBlockTemplateName().

Referenced by Diagram::titleBlockTemplateChanged().

◆ titleBlockTemplateName()

QString BorderTitleBlock::titleBlockTemplateName ( ) const

◆ titleBlockTemplateRemoved

void BorderTitleBlock::titleBlockTemplateRemoved ( const QString &  removed_template_name,
const TitleBlockTemplate new_template = nullptr 
)
slot

This slot has to be used to inform this class that the given title block template is about to be removed and is no longer accessible. This class will either use the provided optional TitleBlockTemplate or the default title block provided by QETApp::defaultTitleBlockTemplate()

Parameters
template_nameName of the title block template that has changed
new_template(Optional) title block template to use instead

Definition at line 358 of file bordertitleblock.cpp.

References QETApp::defaultTitleBlockTemplate(), setTitleBlockTemplate(), and titleBlockTemplateName().

Referenced by Diagram::setTitleBlockTemplate(), and Diagram::titleBlockTemplateRemoved().

◆ titleBlockToXml()

void BorderTitleBlock::titleBlockToXml ( QDomElement &  xml_elmt)

Exports the title block current values to XML.

Parameters
xml_elmtthe XML element attributes will be added to

Definition at line 167 of file bordertitleblock.cpp.

References exportTitleBlock(), and TitleBlockProperties::toXml().

Referenced by Diagram::toXml().

◆ updateDiagramContextForTitleBlock()

void BorderTitleBlock::updateDiagramContextForTitleBlock ( const DiagramContext initial_context = DiagramContext())
private

Update the informations given to the titleblock template by regenerating a DiagramContext object.

Parameters
initial_contextBase diagram context that will be overridden by diagram-wide values

Definition at line 744 of file bordertitleblock.cpp.

References additional_fields_, DiagramContext::addValue(), btb_author_, btb_auto_page_num_, btb_date_, btb_filename_, btb_final_folio_, btb_indexrev_, btb_locmach_, btb_plant_, btb_title_, btb_version_, folio_index_, folio_total_, DiagramContext::keys(), m_next_folio_num, m_previous_folio_num, and titleblock_template_renderer_.

Referenced by setFolioData().

◆ updateRectangles()

void BorderTitleBlock::updateRectangles ( )
private

BorderTitleBlock::updateRectangles This method update the diagram rect according to the value of rows and columns (number and size)

Definition at line 419 of file bordertitleblock.cpp.

References borderChanged(), diagram_rect_, diagramHeight(), diagramWidth(), and Diagram::margin.

Referenced by borderFromXml(), BorderTitleBlock(), setColumnsCount(), setColumnsHeaderHeight(), setColumnsWidth(), setRowsCount(), setRowsHeaderWidth(), and setRowsHeight().

◆ version()

QString BorderTitleBlock::version ( ) const
inline
Returns
the value of the title block Additional Fields

Definition at line 109 of file bordertitleblock.h.

References btb_version_.

Referenced by exportTitleBlock(), and setVersion().

Member Data Documentation

◆ additional_fields_

DiagramContext BorderTitleBlock::additional_fields_
private

◆ btb_author_

QString BorderTitleBlock::btb_author_
private

Definition at line 218 of file bordertitleblock.h.

Referenced by author(), setAuthor(), and updateDiagramContextForTitleBlock().

◆ btb_auto_page_num_

QString BorderTitleBlock::btb_auto_page_num_
private

◆ btb_date_

QDate BorderTitleBlock::btb_date_
private

Definition at line 219 of file bordertitleblock.h.

Referenced by date(), setDate(), and updateDiagramContextForTitleBlock().

◆ btb_filename_

QString BorderTitleBlock::btb_filename_
private

Definition at line 229 of file bordertitleblock.h.

Referenced by fileName(), setFileName(), and updateDiagramContextForTitleBlock().

◆ btb_final_folio_

QString BorderTitleBlock::btb_final_folio_
private

Definition at line 225 of file bordertitleblock.h.

Referenced by finalfolio(), setFolioData(), and updateDiagramContextForTitleBlock().

◆ btb_folio_

QString BorderTitleBlock::btb_folio_
private

Definition at line 221 of file bordertitleblock.h.

Referenced by folio(), setFolio(), and setFolioData().

◆ btb_indexrev_

QString BorderTitleBlock::btb_indexrev_
private

Definition at line 224 of file bordertitleblock.h.

Referenced by indexrev(), setIndicerev(), and updateDiagramContextForTitleBlock().

◆ btb_locmach_

QString BorderTitleBlock::btb_locmach_
private

Definition at line 223 of file bordertitleblock.h.

Referenced by locmach(), setLocMach(), and updateDiagramContextForTitleBlock().

◆ btb_plant_

QString BorderTitleBlock::btb_plant_
private

Definition at line 222 of file bordertitleblock.h.

Referenced by plant(), setPlant(), and updateDiagramContextForTitleBlock().

◆ btb_title_

QString BorderTitleBlock::btb_title_
private

Definition at line 220 of file bordertitleblock.h.

Referenced by setTitle(), title(), and updateDiagramContextForTitleBlock().

◆ btb_version_

QString BorderTitleBlock::btb_version_
private

Definition at line 230 of file bordertitleblock.h.

Referenced by setVersion(), updateDiagramContextForTitleBlock(), and version().

◆ columns_count_

int BorderTitleBlock::columns_count_
private

◆ columns_header_height_

qreal BorderTitleBlock::columns_header_height_
private

◆ columns_width_

qreal BorderTitleBlock::columns_width_
private

◆ diagram_rect_

QRectF BorderTitleBlock::diagram_rect_
private

◆ display_border_

bool BorderTitleBlock::display_border_
private

Definition at line 257 of file bordertitleblock.h.

Referenced by borderIsDisplayed(), BorderTitleBlock(), displayBorder(), draw(), and drawDxf().

◆ display_columns_

bool BorderTitleBlock::display_columns_
private

◆ display_rows_

bool BorderTitleBlock::display_rows_
private

◆ display_titleblock_

bool BorderTitleBlock::display_titleblock_
private

◆ folio_index_

int BorderTitleBlock::folio_index_
private

Definition at line 227 of file bordertitleblock.h.

Referenced by setFolioData(), and updateDiagramContextForTitleBlock().

◆ folio_total_

int BorderTitleBlock::folio_total_
private

Definition at line 228 of file bordertitleblock.h.

Referenced by folioTotal(), setFolioData(), and updateDiagramContextForTitleBlock().

◆ m_edge

Qt::Edge BorderTitleBlock::m_edge
private

◆ m_next_folio_num

QString BorderTitleBlock::m_next_folio_num
private

Definition at line 233 of file bordertitleblock.h.

Referenced by setNextFolioNum(), and updateDiagramContextForTitleBlock().

◆ m_previous_folio_num

QString BorderTitleBlock::m_previous_folio_num
private

Definition at line 233 of file bordertitleblock.h.

Referenced by setPreviousFolioNum(), and updateDiagramContextForTitleBlock().

◆ rows_count_

int BorderTitleBlock::rows_count_
private

◆ rows_header_width_

qreal BorderTitleBlock::rows_header_width_
private

◆ rows_height_

qreal BorderTitleBlock::rows_height_
private

◆ titleblock_height_

qreal BorderTitleBlock::titleblock_height_
private

Definition at line 248 of file bordertitleblock.h.

◆ titleblock_template_renderer_

TitleBlockTemplateRenderer* BorderTitleBlock::titleblock_template_renderer_
private

The documentation for this class was generated from the following files: