27 #include "../../common/STLUtils.h" 28 #include "../../dataaccess/dataset/ObjectId.h" 29 #include "../../geometry/Envelope.h" 30 #include "../../geometry/Geometry.h" 31 #include "../../geometry/LineString.h" 32 #include "../../maptools/MarkRendererManager.h" 33 #include "../../se/Mark.h" 34 #include "../../se/Utils.h" 35 #include "../../qt/widgets/canvas/Canvas.h" 36 #include "../../qt/widgets/Utils.h" 37 #include "../../srs/Config.h" 38 #include "../Feature.h" 39 #include "../Repository.h" 40 #include "../RepositoryManager.h" 73 std::map<std::string, Repository*>::const_iterator it;
74 for(it = repositories.begin(); it != repositories.end(); ++it)
82 if(repository ==
nullptr)
85 std::vector<Feature*> features = repository->
getFeatures(e, srid);
87 for (std::size_t i = 0; i < features.size(); ++i)
89 if (features[i]->getOperationTypeId() ==
DELETE || features[i]->hasColorChanged())
96 for (std::size_t i = 0; i < features.size(); ++i)
97 draw(features[i],
false);
137 f.setColor(Qt::black);
138 f.setStyle(Qt::DiagCrossPattern);
181 std::size_t size = 24;
296 std::vector<te::gm::LineString*> lines;
306 for(std::size_t i = 0; i < lines.size(); ++i)
318 for(std::size_t j = 0; j < line->
getNPoints(); ++j)
320 std::unique_ptr<te::gm::Point> point(line->
getPointN(j));
362 const std::size_t& contourWidth,
const std::size_t& size)
389 QSettings sett(QSettings::IniFormat, QSettings::UserScope, qApp->organizationName(), qApp->applicationName());
391 QString fillColor = sett.value(
"edit_config/defaultFillColor").toString();
392 QColor fColor(fillColor);
394 if (!fColor.isValid())
405 QString lineColor = sett.value(
"edit_config/defaultLineColor").toString();
406 QColor lColor(lineColor);
408 if (!lColor.isValid())
421 int width = sett.value(
"edit_config/defaultWidth").toInt();
435 QString fillTextColor = sett.value(
"edit_config/defaultTextFillColor").toString();
436 QColor fTxtColor(fillTextColor);
438 if (!fTxtColor.isValid())
443 int textPointSize = sett.value(
"edit_config/defaultTextPointSize").toInt();
444 if (textPointSize < 8)
452 int lineDashStyle = sett.value(
"edit_config/defaultLineDashStyle",
te::map::SolidLine).toInt();
te::gm::GeomType m_currentGeomType
~Renderer()
Singleton destructor.
#define TE_EDIT_FEATURE_FILL_COLOR
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
#define TE_EDIT_FEATURE_CONTOUR_WIDTH
A Mark specifies a geometric shape and applies coloring to it.
void setLineStyle(const QColor &lineColor, const std::size_t &lineWidth)
void setPointStyle(const QString &mark, const QColor &fillColor, const QColor &contourColor, const std::size_t &contourWidth, const std::size_t &size)
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
te::color::RGBAColor getFillColor() const
GeomType getGeomTypeId() const _NOEXCEPT_OP(true)
It returns the geometry subclass type identifier.
double m_urx
Upper right corner x-coordinate.
std::unique_ptr< Point > getPointN(std::size_t i) const
It returns the specified point in this LineString.
void drawRepositories(const te::gm::Envelope &e, int srid)
te::gm::Geometry * getGeometry() const
te::qt::widgets::Canvas * m_canvas
te::edit::OperationType getOperationTypeId() const
std::size_t m_polygonContourWidth
void Free(std::vector< T * > *v)
This function can be applied to a pointer to a vector of pointers.
te::color::RGBAColor getContourColor() const
int getSRID() const _NOEXCEPT_OP(true)
It returns the Spatial Reference System ID associated to this geometric object.
double m_llx
Lower left corner x-coordinate.
LineString is a curve with linear interpolation between points.
std::size_t m_pointContourWidth
static RepositoryManager & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
void setTextStyle(const QColor &textColor, const std::size_t &textPointSize)
void draw(te::gm::Geometry *geom, bool showVertexes=false)
std::size_t getNPoints() const
It returns the number of points (vertexes) in the linestring.
A Fill specifies the pattern for filling an area geometry.
void drawText(const std::string &text, te::gm::Point *p)
TESEEXPORT Mark * CreateMark(const std::string &wellKnownName, Stroke *stroke, Fill *fill)
Creates a mark.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
std::size_t m_textPointSize
#define TE_EDIT_FEATURE_CONTOUR_COLOR
double m_lly
Lower left corner y-coordinate.
void prepare(te::gm::GeomType type)
TESEEXPORT Stroke * CreateStroke(const std::string &color, const std::string &width)
Creates a stroke.
Renderer()
It initializes the singleton instance of the renderer.
std::vector< Feature * > getFeatures(const te::gm::Envelope &e, int srid) const
LineDashStyle
This enum encodes enumerated values telling how lines should be drawn. e.g. as a plain line or dash l...
double m_ury
Upper right corner y-coordinate.
A Stroke specifies the appearance of a linear geometry.
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)
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
void drawRepository(const std::string &source, const te::gm::Envelope &e, int srid)
This class represents a repository of geometries and features.
QColor m_polygonContourColor
This is a singleton for rendering geometries and features.
QColor m_pointContourColor
QColor m_polygonFillColor
void setPolygonStyle(const QColor &fillColor, const QColor &contourColor, const std::size_t &contourWidth)
virtual void transform(int srid) _NOEXCEPT_OP(false)=0
It converts the coordinate values of the geometry to the new spatial reference system.
#define TE_TRANSPARENT
For an RGBA color this is the value of the alpha-channel for totally transparent. ...
te::map::LineDashStyle m_lineDashStyle
void transform(int srid)
It converts the coordinate values of the linestring to the new spatial reference system.
TESEEXPORT Fill * CreateFill(const std::string &color, const std::string &opacity)
Creates a fill.