QElectroTech  0.8-dev
titleblocktemplaterenderer.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef TITLEBLOCK_TEMPLATE_RENDERER_H
19 #define TITLEBLOCK_TEMPLATE_RENDERER_H
20 #include <QPicture>
21 #include "diagramcontext.h"
22 
23 class TitleBlockTemplate;
27 class TitleBlockTemplateRenderer : public QObject
28 {
29  Q_OBJECT
30 
31  public:
32  TitleBlockTemplateRenderer(QObject * = nullptr);
33  ~TitleBlockTemplateRenderer() override;
34 
37 
38  void setContext(const DiagramContext &context);
39  DiagramContext context()const;
40 
41  int height() const;
42  void render(QPainter *, int);
43  void renderDxf(QRectF &, int, QString &, int);
45  void setUseCache(bool);
46  bool useCache() const;
47 
48  private:
49  void renderToQPicture(int);
50 
51  private:
57 };
58 #endif
TitleBlockTemplateRenderer::setTitleBlockTemplate
void setTitleBlockTemplate(const TitleBlockTemplate *)
TitleBlockTemplateRenderer::setTitleBlockTemplate.
Definition: titleblocktemplaterenderer.cpp:36
TitleBlockTemplateRenderer::setContext
void setContext(const DiagramContext &context)
TitleBlockTemplateRenderer::setContext.
Definition: titleblocktemplaterenderer.cpp:48
TitleBlockTemplateRenderer::TitleBlockTemplateRenderer
TitleBlockTemplateRenderer(QObject *=nullptr)
TitleBlockTemplateRenderer::TitleBlockTemplateRenderer Constructor.
Definition: titleblocktemplaterenderer.cpp:9
TitleBlockTemplate
The TitleBlockTemplate class This class represents an title block template for an electric diagram....
Definition: titleblocktemplate.h:36
TitleBlockTemplateRenderer::render
void render(QPainter *, int)
TitleBlockTemplateRenderer::render Render the titleblock.
Definition: titleblocktemplaterenderer.cpp:79
TitleBlockTemplateRenderer::renderToQPicture
void renderToQPicture(int)
TitleBlockTemplateRenderer::renderToQPicture Renders the titleblock to the internal QPicture.
Definition: titleblocktemplaterenderer.cpp:123
TitleBlockTemplateRenderer::context
DiagramContext context() const
TitleBlockTemplateRenderer::context.
Definition: titleblocktemplaterenderer.cpp:57
TitleBlockTemplateRenderer::invalidateRenderedTemplate
void invalidateRenderedTemplate()
TitleBlockTemplateRenderer::invalidateRenderedTemplate Invalidates the previous rendering of the temp...
Definition: titleblocktemplaterenderer.cpp:140
TitleBlockTemplateRenderer::renderDxf
void renderDxf(QRectF &, int, QString &, int)
TitleBlockTemplateRenderer::renderDxf.
Definition: titleblocktemplaterenderer.cpp:107
TitleBlockTemplateRenderer::m_titleblock_template
const TitleBlockTemplate * m_titleblock_template
Definition: titleblocktemplaterenderer.h:52
TitleBlockTemplateRenderer::height
int height() const
TitleBlockTemplateRenderer::height.
Definition: titleblocktemplaterenderer.cpp:68
diagramcontext.h
TitleBlockTemplateRenderer::m_last_known_titleblock_width
int m_last_known_titleblock_width
Definition: titleblocktemplaterenderer.h:56
TitleBlockTemplateRenderer::setUseCache
void setUseCache(bool)
TitleBlockTemplateRenderer::setUseCache.
Definition: titleblocktemplaterenderer.cpp:149
TitleBlockTemplateRenderer::useCache
bool useCache() const
TitleBlockTemplateRenderer::useCache.
Definition: titleblocktemplaterenderer.cpp:158
titleblocktemplate.h
TitleBlockTemplateRenderer::titleBlockTemplate
const TitleBlockTemplate * titleBlockTemplate() const
TitleBlockTemplateRenderer::titleBlockTemplate.
Definition: titleblocktemplaterenderer.cpp:28
TitleBlockTemplateRenderer
The TitleBlockTemplateRenderer class.
Definition: titleblocktemplaterenderer.h:28
TitleBlockTemplateRenderer::m_rendered_template
QPicture m_rendered_template
Definition: titleblocktemplaterenderer.h:54
DiagramContext
Definition: diagramcontext.h:56
titleblocktemplaterenderer.h
TitleBlockTemplateRenderer::~TitleBlockTemplateRenderer
~TitleBlockTemplateRenderer() override
TitleBlockTemplateRenderer::~TitleBlockTemplateRenderer Destructor.
Definition: titleblocktemplaterenderer.cpp:21
TitleBlockTemplateRenderer::m_use_cache
bool m_use_cache
Definition: titleblocktemplaterenderer.h:53
TitleBlockTemplateRenderer::m_context
DiagramContext m_context
Definition: titleblocktemplaterenderer.h:55