27 #include "../../geometry/Envelope.h"
28 #include "../../geometry/Geometry.h"
29 #include "../../geometry/LineString.h"
30 #include "../../qt/widgets/canvas/Canvas.h"
31 #include "../../qt/widgets/Utils.h"
32 #include "../../srs/Config.h"
33 #include "../Feature.h"
34 #include "../Repository.h"
35 #include "../RepositoryManager.h"
68 std::map<std::string, Repository*>::const_iterator it;
69 for(it = repositories.begin(); it != repositories.end(); ++it)
70 drawRepository(it->first, e, srid);
80 std::vector<Feature*> features = repository->
getFeatures(e, srid);
82 for(std::size_t i = 0; i < features.size(); ++i)
83 draw(features[i]->getGeometry());
90 if(m_currentGeomType == type && m_styleChanged ==
false)
93 m_currentGeomType = type;
151 m_canvas->draw(geom);
161 std::vector<te::gm::LineString*> lines;
171 for(std::size_t i = 0; i < lines.size(); ++i)
172 drawVertexes(lines[i]);
183 for(std::size_t j = 0; j < line->
getNPoints(); ++j)
185 std::auto_ptr<te::gm::Point> point(line->
getPointN(j));
186 m_canvas->draw(point.get());
204 m_polygonFillColor = fillColor;
205 m_polygonContourColor = contourColor;
206 m_polygonContourWidth = contourWidth;
208 m_styleChanged =
true;
212 const std::size_t& contourWidth,
const std::size_t& size)
215 m_pointFillColor = fillColor;
216 m_pointContourColor = contourColor;
217 m_pointContourWidth = contourWidth;
220 m_styleChanged =
true;
225 m_polygonFillColor = QColor(0, 255, 0, 80);
226 m_polygonContourColor = Qt::black;
227 m_polygonContourWidth = 2;
229 m_lineColor = QColor(0, 0, 0, 80);
232 m_pointMark =
"circle";
233 m_pointFillColor = Qt::red;
234 m_pointContourColor = Qt::black;
235 m_pointContourWidth = 1;
238 m_styleChanged =
false;
int getSRID() const
It returns the Spatial Reference System ID associated to this geometric object.
~Renderer()
Singleton destructor.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
void setPointStyle(const QString &mark, const QColor &fillColor, const QColor &contourColor, const std::size_t &contourWidth, const std::size_t &size)
Point * getPointN(std::size_t i) const
It returns the specified point in this LineString.
double m_urx
Upper right corner x-coordinate.
void drawRepositories(const te::gm::Envelope &e, int srid)
virtual void transform(int srid)=0
It converts the coordinate values of the geometry to the new spatial reference system.
const std::map< std::string, Repository * > & getRepositories() const
double m_llx
Lower left corner x-coordinate.
LineString is a curve with linear interpolation between points.
static RepositoryManager & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
void draw(te::gm::Geometry *geom, bool showVertexes=false)
std::size_t getNPoints() const
It returns the number of points (vertexes) in the linestring.
GeomType getGeomTypeId() const
It returns the geometry subclass type identifier.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
double m_lly
Lower left corner y-coordinate.
void prepare(te::gm::GeomType type)
Renderer()
It initializes the singleton instance of the renderer.
std::vector< Feature * > getFeatures(const te::gm::Envelope &e, int srid) const
double m_ury
Upper right corner y-coordinate.
void drawVertexes(te::gm::Geometry *geom)
void begin(QPaintDevice *device, const te::gm::Envelope &e, int srid)
TEEDITEXPORT void GetLines(te::gm::Geometry *geom, std::vector< te::gm::LineString * > &lines)
void drawRepository(const std::string &source, const te::gm::Envelope &e, int srid)
Repository * getRepository(const std::string &source) const
This class represents a repository of geometries and features.
This is a singleton for rendering geometries and features.
void setPolygonStyle(const QColor &fillColor, const QColor &contourColor, const std::size_t &contourWidth)
void transform(int srid)
It converts the coordinate values of the linestring to the new spatial reference system.