QElectroTech
0.70
|
#include <titleblocktemplaterenderer.h>
Public Member Functions | |
TitleBlockTemplateRenderer (QObject *=nullptr) | |
~TitleBlockTemplateRenderer () override | |
const TitleBlockTemplate * | titleBlockTemplate () const |
void | setTitleBlockTemplate (const TitleBlockTemplate *) |
void | setContext (const DiagramContext &context) |
TitleBlockTemplateRenderer::setContext. More... | |
DiagramContext | context () const |
TitleBlockTemplateRenderer::context. More... | |
int | height () const |
void | render (QPainter *, int) |
void | renderDxf (QRectF &, int, QString &, int) |
void | invalidateRenderedTemplate () |
void | setUseCache (bool) |
bool | useCache () const |
Private Member Functions | |
void | renderToQPicture (int) |
Private Attributes | |
const TitleBlockTemplate * | m_titleblock_template |
bool | m_use_cache |
QPicture | m_rendered_template |
DiagramContext | m_context |
int | m_last_known_titleblock_width |
Definition at line 25 of file titleblocktemplaterenderer.h.
TitleBlockTemplateRenderer::TitleBlockTemplateRenderer | ( | QObject * | parent = nullptr | ) |
Constructor
parnet | Parent QObject of this renderer |
Definition at line 8 of file titleblocktemplaterenderer.cpp.
|
override |
Destructor
Definition at line 19 of file titleblocktemplaterenderer.cpp.
DiagramContext TitleBlockTemplateRenderer::context | ( | ) | const |
TitleBlockTemplateRenderer::context.
Definition at line 52 of file titleblocktemplaterenderer.cpp.
References m_context.
Referenced by setContext(), BorderTitleBlock::setNextFolioNum(), and BorderTitleBlock::setPreviousFolioNum().
int TitleBlockTemplateRenderer::height | ( | ) | const |
Definition at line 61 of file titleblocktemplaterenderer.cpp.
References m_titleblock_template.
void TitleBlockTemplateRenderer::invalidateRenderedTemplate | ( | ) |
Invalidates the previous rendering of the template by resetting the internal QPicture.
Definition at line 114 of file titleblocktemplaterenderer.cpp.
References m_rendered_template.
Referenced by setContext(), and setTitleBlockTemplate().
void TitleBlockTemplateRenderer::render | ( | QPainter * | provided_painter, |
int | titleblock_width | ||
) |
Render the titleblock.
provided_painter | QPainter to use to render the titleblock. |
titleblock_width | The total width of the titleblock to render |
Definition at line 71 of file titleblocktemplaterenderer.cpp.
References m_context, m_last_known_titleblock_width, m_rendered_template, m_titleblock_template, m_use_cache, and renderToQPicture().
Referenced by renderToQPicture().
void TitleBlockTemplateRenderer::renderDxf | ( | QRectF & | title_block_rect, |
int | titleblock_width, | ||
QString & | file_path, | ||
int | color | ||
) |
Definition at line 89 of file titleblocktemplaterenderer.cpp.
References m_context, and m_titleblock_template.
|
private |
Renders the titleblock to the internal QPicture
titleblock_width | Width of the titleblock to render |
Definition at line 98 of file titleblocktemplaterenderer.cpp.
References m_context, m_last_known_titleblock_width, m_rendered_template, m_titleblock_template, and render().
Referenced by render().
void TitleBlockTemplateRenderer::setContext | ( | const DiagramContext & | context | ) |
TitleBlockTemplateRenderer::setContext.
context | : Context to use when rendering the titleblock |
Definition at line 43 of file titleblocktemplaterenderer.cpp.
References context(), invalidateRenderedTemplate(), and m_context.
Referenced by BorderTitleBlock::setNextFolioNum(), and BorderTitleBlock::setPreviousFolioNum().
void TitleBlockTemplateRenderer::setTitleBlockTemplate | ( | const TitleBlockTemplate * | titleblock_template | ) |
titleblock_template | TitleBlock template to render. |
Definition at line 32 of file titleblocktemplaterenderer.cpp.
References invalidateRenderedTemplate(), and m_titleblock_template.
void TitleBlockTemplateRenderer::setUseCache | ( | bool | use_cache | ) |
use_cache | true for this renderer to use its QPicture-based cache, false otherwise. |
Definition at line 122 of file titleblocktemplaterenderer.cpp.
References m_use_cache.
const TitleBlockTemplate * TitleBlockTemplateRenderer::titleBlockTemplate | ( | ) | const |
Definition at line 25 of file titleblocktemplaterenderer.cpp.
References m_titleblock_template.
bool TitleBlockTemplateRenderer::useCache | ( | ) | const |
Definition at line 130 of file titleblocktemplaterenderer.cpp.
References m_use_cache.
|
private |
Definition at line 53 of file titleblocktemplaterenderer.h.
Referenced by context(), render(), renderDxf(), renderToQPicture(), and setContext().
|
private |
Definition at line 54 of file titleblocktemplaterenderer.h.
Referenced by render(), and renderToQPicture().
|
private |
Definition at line 52 of file titleblocktemplaterenderer.h.
Referenced by invalidateRenderedTemplate(), render(), and renderToQPicture().
|
private |
Definition at line 50 of file titleblocktemplaterenderer.h.
Referenced by height(), render(), renderDxf(), renderToQPicture(), setTitleBlockTemplate(), and titleBlockTemplate().
|
private |
Definition at line 51 of file titleblocktemplaterenderer.h.
Referenced by render(), setUseCache(), and useCache().