30 #include "../../core/translator/Translator.h" 31 #include "../../common/StringUtils.h" 32 #include "../../dataaccess/dataset/DataSet.h" 33 #include "../../dataaccess/dataset/DataSetType.h" 34 #include "../../dataaccess/datasource/DataSource.h" 35 #include "../../dataaccess/query_h.h" 36 #include "../../datatype/AbstractData.h" 37 #include "../../geometry/Envelope.h" 38 #include "../../geometry/Point.h" 39 #include "../core/AbstractGraph.h" 40 #include "../core/Edge.h" 41 #include "../core/EdgeProperty.h" 42 #include "../core/GraphCache.h" 43 #include "../core/GraphData.h" 44 #include "../core/GraphMetadata.h" 45 #include "../core/Vertex.h" 46 #include "../core/VertexProperty.h" 47 #include "../Config.h" 48 #include "../Globals.h" 49 #include "../Exception.h" 94 std::string geometryAttrName;
126 from->push_back(fiEdge);
128 std::string vertexFrom =
"edge.";
131 std::string vertexTo =
"edge.";
134 std::string vId =
"vertex.";
149 std::string vEttr =
"vertex." + geometryAttrName;
168 int vertexProperties =
static_cast<int>(vertexDsType->getProperties().size());
177 while(dataset->moveNext())
179 int vId = dataset->getInt32(0);
180 int eId = dataset->getInt32(vertexProperties);
181 int vFrom = dataset->getInt32(vertexProperties + 1);
193 for(
int i = 1; i < vertexProperties; ++i)
278 std::string geometryAttrName;
310 from->push_back(fiEdge);
312 std::string vertexFrom =
"edge.";
315 std::string vertexTo =
"edge.";
318 std::string vId =
"vertex.";
333 std::string vEttr =
"vertex." + geometryAttrName;
353 int vertexProperties =
static_cast<int>(vertexDsType->getProperties().size());
354 int edgeProperties =
static_cast<int>(edgeDsType->getProperties().size());
361 while(dataset->moveNext())
363 int eId = dataset->getInt32(vertexProperties);
364 int vFrom = dataset->getInt32(vertexProperties + 1);
365 int vTo = dataset->getInt32(vertexProperties + 2);
376 for(
int i = 3; i < edgeProperties; ++i)
378 e->
addAttribute(i - 3, dataset->getValue(i + vertexProperties).release());
void setAttributeVecSize(int size)
This function is used to set the number of attributes associated with the vertex elements.
te::graph::GraphMetadata * getMetadata()
It returns a pointer to a class that describes the graph metadata.
void setAttributeVecSize(int size)
This function is used to set the number of attributes associated with the edge elements.
An abstract class that models a source of data in a query.
The Field class can be used to model an expression that takes part of the output items of a SELECT...
static const std::string sm_tableVertexModelAttrId
Attribute id.
Spatial intersects operator.
te::graph::GraphMetadata * m_graphMetadata
Graph metadata attribute.
A class that models the name of a dataset used in a From clause.
Base exception class for plugin module.
Expression * getExpression() const
It returns the expression set for an output select query.
std::set< int > & getPredecessors()
Returns the Predecessors vector.
double m_urx
Upper right corner x-coordinate.
double getWidth() const
It returns the envelope width.
BoxLoaderStrategy(te::graph::GraphMetadata *metadata)
Default constructor.
virtual void loadDataByEdgeId(int edgeId, te::graph::AbstractGraph *g, te::graph::GraphCache *gc=0)
Functio used to load a group of edges elements given a base element.
std::vector< te::dt::AbstractData * > & getAttributes()
It returns the vector of attributes associated with this element.
#define TE_TR(message)
It marks a string in order to get translated.
GraphData * checkCacheByVertexId(int id)
This functions check in cache if the vertex element with a given id was alredy in memory...
virtual void add(Vertex *v)=0
Add a new vertex element to a graph.
Boolean logic operator: AND.
This is an abstract class that models a query expression.
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
virtual std::unique_ptr< DataSet > query(const Select &q, te::common::TraverseType travType=te::common::FORWARDONLY, const te::common::AccessPolicy accessPolicy=te::common::RAccess)
It executes a query that may return some data using a generic query. This method always returns a dis...
te::gm::GeometryCollection * gc
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...
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.
const double & getY() const
It returns the Point y-coordinate value.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
This class implements the main functions necessary to save and load the graph data and metadata infor...
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
A class that can be used to model a filter expression that can be applied to a query.
Vertex * loadVertexAttrs(int id)
Function used to load one vertex given a ID.
Edge * loadEdgeAttrs(int id)
Function used to load one edge given a ID.
This class define the main functions necessary to save and load the graph data and metadata informati...
std::set< int > & getSuccessors()
Returns the Successors vector.
int getIdFrom()
It returns the vertex origin identification.
Edge * loadEdge(int id)
Function used to load one edge given a ID.
virtual std::unique_ptr< te::da::DataSetType > getDataSetType(const std::string &name)
It gets information about the given dataset.
A Select models a query to be used when retrieving data from a DataSource.
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
double m_lly
Lower left corner y-coordinate.
Class used to manager the graph data elements. This class uses a cache policy to control the elements...
virtual ~BoxLoaderStrategy()
Default destructor.
GraphData * checkCacheByEdgeId(int id)
This functions check in cache if the edge element with a given id was alredy in memory.
int getType() const
It returns the property data type.
#define TE_GRAPH_FACTORY_GRAPH_TYPE_BIDIRECTIONALGRAPH
double m_ury
Upper right corner y-coordinate.
It models the comparison operator.
A class that models a literal for Envelope values.
virtual void loadDataByVertexId(int vertexId, te::graph::AbstractGraph *g, te::graph::GraphCache *gc=0)
Functio used to load a group of vertex elements given a base element.
void addAttribute(int idx, te::dt::AbstractData *ad)
Add a new attribute to this element.
static const std::string sm_tableEdgeModelAttrVFrom
Attribute Vertex From.
Vertex * loadVertex(int id)
Function used to load one vertex given a ID.
void addAttribute(int idx, te::dt::AbstractData *ad)
Add a new attribute to this element.
te::gm::Envelope * calculateBox(te::gm::Point *p, std::string tableName)
Generate a box with p as center. The new box will have n% of the total graph height and n% of total g...
double getHeight() const
It returns the envelope height.
static const std::string sm_tableEdgeModelAttrVTo
Attribute Vertex To.
const double & getX() const
It returns the Point x-coordinate value.
const std::string & getName() const
It returns the property name.