27 #include "../../common/STLUtils.h"
28 #include "../../datatype/Enums.h"
29 #include "../../geometry/LineString.h"
30 #include "../../geometry/Point.h"
31 #include "../../geometry/Utils.h"
32 #include "../../maptools/AbstractLayer.h"
33 #include "../../maptools/Canvas.h"
34 #include "../../maptools/CanvasConfigurer.h"
35 #include "../../maptools/MarkRendererManager.h"
36 #include "../../se/Mark.h"
37 #include "../../se/Style.h"
38 #include "../../se/Rule.h"
39 #include "../../se/Utils.h"
40 #include "../core/AbstractGraph.h"
41 #include "../core/Edge.h"
42 #include "../core/GraphMetadata.h"
43 #include "../core/Vertex.h"
44 #include "../iterator/BoxIterator.h"
45 #include "../iterator/MemoryIterator.h"
46 #include "../iterator/SequenceIterator.h"
73 configDefaultLine(canvas);
74 configDefaultPoint(canvas);
84 const std::vector<te::se::Symbolizer*> symbolizers = rule->
getSymbolizers();
86 for(
size_t t= 0; t < symbolizers.size(); ++t)
97 drawDataSourceGraph(g, canvas, bbox);
99 drawMemoryGraph(g, canvas, bbox, srid);
148 std::size_t size = 12;
160 std::size_t size = 12;
178 int vertexGeomPropIdx = checkVertexGeometryProperty(g);
179 int edgeGeomPropIdx = checkEdgeGeometryProperty(g);
181 if(vertexGeomPropIdx == -1 && edgeGeomPropIdx == -1)
198 if(edgeGeomPropIdx != -1)
202 canvas->
draw(geomEdge);
206 canvas->
draw(geomVFrom);
210 canvas->
draw(geomVFrom);
211 canvas->
draw(geomVTo);
218 canvas->
draw(geomVFrom);
237 canvas->
draw(geomVFrom);
238 canvas->
draw(geomVTo);
256 int vertexGeomPropIdx = checkVertexGeometryProperty(g);
257 int edgeGeomPropIdx = checkEdgeGeometryProperty(g);
259 if(vertexGeomPropIdx == -1 && edgeGeomPropIdx == -1)
278 if(geomVFrom->
within(geomBox) && geomVTo->
within(geomBox))
281 if(edgeGeomPropIdx != -1)
285 canvas->
draw(geomEdge);
289 canvas->
draw(geomVFrom);
293 canvas->
draw(geomVFrom);
294 canvas->
draw(geomVTo);
301 canvas->
draw(geomVFrom);
320 canvas->
draw(geomVFrom);
321 canvas->
draw(geomVTo);
virtual te::graph::Edge * getNextEdge()
It returns a pointer to the next edge element of a graph.
virtual void setLineCapStyle(LineCapStyle style)=0
It sets the line cap style.
void drawMemoryGraph(te::graph::AbstractGraph *g, te::map::Canvas *canvas, const te::gm::Envelope &bbox, int srid)
#define TE_SE_DEFAULT_STROKE_BASIC_WIDTH
It specifies the default width used by stroke basic (solid colors).
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
A Mark specifies a geometric shape and applies coloring to it.
This is the base class for layers.
void configDefaultLine(te::map::Canvas *canvas)
Configs the canvas with default values for line styles.
te::graph::AbstractGraph * getGraph() const
It returns the graph associated to the layer.
void configLoopPoint(te::map::Canvas *canvas)
Configs the canvas with default values for point styles.
A Symbolizer describes how a feature is to appear on a map.
virtual void setPointPattern(te::color::RGBAColor **pattern, int ncols, int nrows)=0
It sets the point pattern.
virtual void setLineWidth(int w)=0
It sets the line width.
virtual te::graph::Edge * getNextEdge()
It returns a pointer to the next edge element of a graph.
std::vector< te::dt::AbstractData * > & getAttributes()
It returns the vector of attributes associated with this element.
int checkVertexGeometryProperty(te::graph::AbstractGraph *g)
Verify if the graph layer has a geometry to define the vertexs elements.
virtual te::dt::Property * getVertexProperty(int idx)=0
Get a vertex property given a index.
It models a property definition.
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
virtual void setLineJoinStyle(LineJoinStyle style)=0
It sets the line join style.
It renders the objects associated to a Layer.
Rule * getRule(std::size_t i) const
const std::vector< Rule * > & getRules() const
virtual te::graph::GraphMetadata * getMetadata()=0
Function used to access the graph metadata.
Class used to define the edge struct of a graph. Its compose with a identifier, the vertex origin and...
void Free(std::vector< T * > *v)
This function can be applied to a pointer to a vector of pointers.
LineString is a curve with linear interpolation between points.
const double & getY() const
It returns the Point y-coordinate value.
static MarkRendererManager & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point.
An Envelope defines a 2D rectangular region.
This class defines a commun interface to represents a graph iterator class. The main diferency to ano...
#define TE_SE_DEFAULT_STROKE_BASIC_COLOR
It specifies the default color used by stroke basic (solid colors).
#define TE_OPAQUE
For an RGBA color this is the value of the alpha-channel for totally opaque.
virtual void draw(te::map::AbstractLayer *layer, te::map::Canvas *canvas, const te::gm::Envelope &bbox, int srid)
It draws the layer geographic objects in the given canvas using the informed SRS. ...
Abstract class used to define the main functions of graph struct. All graph implementations must used...
virtual bool isEdgeIteratorAfterEnd()
Used to check the iterator position.
virtual te::se::Style * getStyle() const
It returns the Style associated to the layer.
virtual void setLineDashStyle(LineDashStyle style)=0
It sets the line dash style.
void drawDataSourceGraph(te::graph::AbstractGraph *g, te::map::Canvas *canvas, const te::gm::Envelope &bbox)
~LayerRenderer()
Destructor.
int getIdFrom()
It returns the vertex origin identification.
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.
const std::vector< Symbolizer * > & getSymbolizers() const
virtual te::graph::Edge * getFirstEdge()
It returns a pointer to the first edge element of a graph.
virtual int getEdgePropertySize()=0
Used to verify the number of properties associated to edge elements.
TESEEXPORT Stroke * CreateStroke(const std::string &color, const std::string &width)
Creates a stroke.
virtual te::graph::Edge * getFirstEdge()
It returns a pointer to the first edge element of a graph.
virtual int getVertexPropertySize()=0
Used to verify the number of properties associated to vertex elements.
int getType() const
It returns the property data type.
A canvas is an abstraction of a drawing area.
virtual void setPointColor(const te::color::RGBAColor &color)=0
It sets the point drawing color.
A Rule is used to attach property/scale conditions to and group the individual symbols used for rende...
virtual te::dt::Property * getEdgeProperty(int idx)=0
Get a edge property given a index.
#define TE_TRANSPARENT
For an RGBA color this is the value of the alpha-channel for totally transparent. ...
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
void configDefaultPoint(te::map::Canvas *canvas)
Configs the canvas with default values for point styles.
virtual void setLineColor(const te::color::RGBAColor &color)=0
It sets the pen color used to draw line geometries.
int getId()
It returns the vertex id.
int checkEdgeGeometryProperty(te::graph::AbstractGraph *g)
Verify if the graph layer has a geometry to define the edges elements.
virtual te::graph::Vertex * getVertex(int id)=0
It returns the vertex element if it's exist.
virtual void draw(const te::gm::Geometry *geom)=0
It draws the geometry on canvas.
std::vector< te::dt::AbstractData * > & getAttributes()
It returns the vector of attributes associated with this element.
A Layer is a reference to a virtual dataset with/without geometric attributes.
const double & getX() const
It returns the Point x-coordinate value.
bool isValid() const
It tells if the rectangle is valid or not.
TEGEOMEXPORT Geometry * GetGeomFromEnvelope(const Envelope *const e, int srid)
It creates a Geometry (a polygon) from the given envelope.
TESEEXPORT Fill * CreateFill(const std::string &color, const std::string &opacity)
Creates a fill.
int getIdTo()
It returns the vertex destiny identification.
virtual bool isEdgeIteratorAfterEnd()
Used to check the iterator position.
virtual bool within(const Geometry *const rhs) const
It returns true if the geometry object is spatially within rhs geometry.