Loading...
Searching...
No Matches
Renderer.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib 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 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18*/
19
20/*!
21\file terralib/edit/qt/Renderer.h
22
23\brief This is a singleton for rendering geometries and features.
24*/
25
26#ifndef __TERRALIB_EDIT_QT_INTERNAL_RENDERER_H
27#define __TERRALIB_EDIT_QT_INTERNAL_RENDERER_H
28
29// TerraLib
30#include "../../common/Singleton.h"
31#include "../../geometry/Enums.h"
32#include "../Utils.h"
33#include "Config.h"
34
35// Qt
36#include <QApplication>
37#include <QColor>
38#include <QPaintDevice>
39#include <QSettings>
40#include <QString>
41
42// STL
43#include <string>
44#include <vector>
45
46namespace te
47{
48 namespace gm
49 {
50 class Envelope;
51 class Geometry;
52 class LineString;
53 }
54
55 namespace qt
56 {
57 namespace widgets
58 {
59 class Canvas;
60 }
61 }
62
63 namespace edit
64 {
65 /*!
66 \class Renderer
67
68 \brief This is a singleton for rendering geometries and features.
69 */
71 {
72 friend class te::common::Singleton<Renderer>;
73
74 public:
75
76 void begin(QPaintDevice* device, const te::gm::Envelope& e, int srid);
77
78 void drawRepositories(const te::gm::Envelope& e, int srid);
79
80 void drawRepository(const std::string& source, const te::gm::Envelope& e, int srid);
81
83
84 void prepare(te::edit::Feature* feature);
85
86 void draw(te::gm::Geometry* geom, bool showVertexes = false);
87
88 void draw(te::edit::Feature* feature, bool showVertexes = false);
89
91
92 void drawVertexes(const std::vector<te::gm::LineString*>& lines);
93
95
96 void drawText(const std::string& text, te::gm::Point* p);
97
98 void end();
99
100 void setPolygonStyle(const QColor& fillColor, const QColor& contourColor, const std::size_t& contourWidth);
101
102 void setPointStyle(const QString& mark, const QColor& fillColor, const QColor& contourColor,
103 const std::size_t& contourWidth, const std::size_t& size);
104
105 void setLineStyle(const QColor& lineColor, const std::size_t& lineWidth);
106
107 void setTextStyle(const QColor& textColor, const std::size_t& textPointSize);
108
109 protected:
110
111 /*! \brief It initializes the singleton instance of the renderer. */
113
114 /*! \brief Singleton destructor. */
116
117 private:
118
120
121 private:
122
125
129
131 std::size_t m_lineWidth;
132
133 QString m_pointMark;
137 std::size_t m_pointSize;
138
140 std::size_t m_textPointSize;
141
144
146
147 };
148
149 } // end namespace edit
150} // end namespace te
151
152#endif // __TERRALIB_EDIT_QT_INTERNAL_RENDERER_H
Template support for singleton pattern.
Definition: Singleton.h:101
This is a singleton for rendering geometries and features.
Definition: Renderer.h:71
te::qt::widgets::Canvas * m_canvas
Definition: Renderer.h:123
std::size_t m_polygonContourWidth
Definition: Renderer.h:128
void prepare(te::edit::Feature *feature)
void prepare(te::gm::GeomType type)
QColor m_polygonContourColor
Definition: Renderer.h:127
std::size_t m_pointContourWidth
Definition: Renderer.h:136
QColor m_polygonFillColor
Definition: Renderer.h:126
te::map::LineDashStyle m_lineDashStyle
Definition: Renderer.h:145
QColor m_textFillColor
Definition: Renderer.h:139
void begin(QPaintDevice *device, const te::gm::Envelope &e, int srid)
std::size_t m_textPointSize
Definition: Renderer.h:140
std::size_t m_lineWidth
Definition: Renderer.h:131
void drawVertexes(te::gm::LineString *line)
QColor m_pointContourColor
Definition: Renderer.h:135
void drawText(const std::string &text, te::gm::Point *p)
QString m_pointMark
Definition: Renderer.h:133
void drawRepository(const std::string &source, const te::gm::Envelope &e, int srid)
QColor m_pointFillColor
Definition: Renderer.h:134
void setLineStyle(const QColor &lineColor, const std::size_t &lineWidth)
~Renderer()
Singleton destructor.
QColor m_lineColor
Definition: Renderer.h:130
Renderer()
It initializes the singleton instance of the renderer.
void setPointStyle(const QString &mark, const QColor &fillColor, const QColor &contourColor, const std::size_t &contourWidth, const std::size_t &size)
void setTextStyle(const QColor &textColor, const std::size_t &textPointSize)
void drawRepositories(const te::gm::Envelope &e, int srid)
std::size_t m_pointSize
Definition: Renderer.h:137
void draw(te::edit::Feature *feature, bool showVertexes=false)
void draw(te::gm::Geometry *geom, bool showVertexes=false)
te::gm::GeomType m_currentGeomType
Definition: Renderer.h:142
void setPolygonStyle(const QColor &fillColor, const QColor &contourColor, const std::size_t &contourWidth)
void drawVertexes(const std::vector< te::gm::LineString * > &lines)
void drawVertexes(te::gm::Geometry *geom)
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:78
LineString is a curve with linear interpolation between points.
Definition: LineString.h:65
A point with x and y coordinate values.
Definition: Point.h:51
A canvas built on top of Qt.
Definition: Canvas.h:55
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:42
LineDashStyle
This enum encodes enumerated values telling how lines should be drawn. e.g. as a plain line or dash l...
Definition: Enums.h:57
TerraLib.
#define TEEDITQTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
Proxy configuration file for TerraView (see terraview_config.h).