This class implements the main functions necessary to save and load the graph data and metadata information using as strategy a bounding box to create a region that defines a group of elements. More...
#include <BoxLoaderStrategy.h>
  
 Public Member Functions | |
| BoxLoaderStrategy (te::graph::GraphMetadata *metadata) | |
| Default constructor.  More... | |
| virtual | ~BoxLoaderStrategy () | 
| Default destructor.  More... | |
Database Box Graph Loader Strategy Methods  | |
Method used to manager a graph data  | |
| 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.  More... | |
| 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.  More... | |
Protected Member Functions | |
| 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 graph width.  More... | |
Protected Attributes | |
| te::graph::GraphMetadata * | m_graphMetadata | 
| Graph metadata attribute.  More... | |
Abstract Graph Loader Strategy Methods | |
| virtual void | saveData (GraphData *data) | 
| Save the graph data structure in Data Source.  More... | |
| virtual void | removeEdge (int id) | 
| Function used to remove a edge saved in a data source.  More... | |
| virtual void | removeVertex (int id) | 
| Function used to remove a vertex saved in a data source.  More... | |
| te::graph::GraphMetadata * | getMetadata () | 
| It returns a pointer to a class that describes the graph metadata.  More... | |
| void | saveGraphEdgeList (GraphData *data) | 
| Used to save the edge elements from a graph data.  More... | |
| void | saveVertexAttributes (GraphData *data) | 
| Used to save the vertex elements attributes from a graph data.  More... | |
| void | saveGraphVertexList (GraphData *data) | 
| Used to save the vertex elements from a graph data.  More... | |
| void | saveEdgeAttributes (GraphData *data) | 
| Used to save the edges elements attributes from a graph data.  More... | |
| Vertex * | loadVertex (int id) | 
| Function used to load one vertex given a ID.  More... | |
| Vertex * | loadVertexAttrs (int id) | 
| Function used to load one vertex given a ID.  More... | |
| Edge * | loadEdge (int id) | 
| Function used to load one edge given a ID.  More... | |
| Edge * | loadEdgeAttrs (int id) | 
| Function used to load one edge given a ID.  More... | |
This class implements the main functions necessary to save and load the graph data and metadata information using as strategy a bounding box to create a region that defines a group of elements.
Definition at line 74 of file BoxLoaderStrategy.h.
| te::graph::BoxLoaderStrategy::BoxLoaderStrategy | ( | te::graph::GraphMetadata * | metadata | ) | 
Default constructor.
Definition at line 53 of file BoxLoaderStrategy.cpp.
      
  | 
  virtual | 
Default destructor.
Definition at line 57 of file BoxLoaderStrategy.cpp.
      
  | 
  protected | 
Generate a box with p as center. The new box will have n% of the total graph height and n% of total graph width.
| p | Terralib object that defines a geometric point. | 
| tableName | Attribute used to define the table name that contains the graph elements | 
Definition at line 396 of file BoxLoaderStrategy.cpp.
References te::gm::Envelope::getHeight(), te::gm::Envelope::getWidth(), te::gm::Point::getX(), te::gm::Point::getY(), te::gm::Envelope::m_llx, te::gm::Envelope::m_lly, te::gm::Envelope::m_urx, and te::gm::Envelope::m_ury.
      
  | 
  inherited | 
It returns a pointer to a class that describes the graph metadata.
Definition at line 62 of file AbstractGraphLoaderStrategy.cpp.
Referenced by te::graph::Graph::Graph(), and te::graph::GraphCache::GraphCache().
      
  | 
  virtual | 
Functio used to load a group of edges elements given a base element.
| edgeId | Attribute used to identify the base element | 
| g | Pointer to a graph, parent of this element | 
| gc | This is a optional attribute, if present the cache will be check if the already been loaded | 
Implements te::graph::AbstractGraphLoaderStrategy.
Definition at line 226 of file BoxLoaderStrategy.cpp.
References te::graph::AbstractGraph::add(), te::graph::Edge::addAttribute(), te::graph::GraphCache::checkCacheByEdgeId(), te::graph::Edge_List, te::dt::GEOMETRY_TYPE, te::graph::Vertex::getAttributes(), te::da::Field::getExpression(), te::graph::Edge::getIdFrom(), te::graph::AbstractGraph::getMetadata(), te::gm::Geometry::getSRID(), te::graph::GraphMetadata::getType(), te::graph::Edge::setAttributeVecSize(), te::graph::Globals::sm_tableEdgeModelAttrVFrom, te::graph::Globals::sm_tableEdgeModelAttrVTo, te::graph::Globals::sm_tableVertexModelAttrId, TE_TR, and te::graph::Vertex_List.
      
  | 
  virtual | 
Functio used to load a group of vertex elements given a base element.
| vertexId | Attribute used to identify the base element | 
| g | Pointer to a graph, parent of this element | 
| gc | This is a optional attribute, if present the cache will be check if the already been loaded | 
Implements te::graph::AbstractGraphLoaderStrategy.
Definition at line 62 of file BoxLoaderStrategy.cpp.
References te::graph::AbstractGraph::add(), te::graph::Vertex::addAttribute(), te::graph::GraphCache::checkCacheByVertexId(), te::graph::Edge_List, te::dt::GEOMETRY_TYPE, te::graph::Vertex::getAttributes(), te::da::Field::getExpression(), te::graph::AbstractGraph::getMetadata(), te::graph::Vertex::getPredecessors(), te::gm::Geometry::getSRID(), te::graph::Vertex::getSuccessors(), te::graph::GraphMetadata::getType(), te::graph::Vertex::setAttributeVecSize(), te::graph::Globals::sm_tableEdgeModelAttrVFrom, te::graph::Globals::sm_tableEdgeModelAttrVTo, te::graph::Globals::sm_tableVertexModelAttrId, TE_GRAPH_FACTORY_GRAPH_TYPE_BIDIRECTIONALGRAPH, TE_TR, and te::graph::Vertex_List.
      
  | 
  protectedinherited | 
Function used to load one edge given a ID.
| id | The edge identifier | 
Definition at line 365 of file AbstractGraphLoaderStrategy.cpp.
References te::graph::Edge::addAttribute(), te::common::Convert2String(), te::graph::Edge::setAttributeVecSize(), te::graph::Globals::sm_tableEdgeModelAttrId, te::graph::Globals::sm_tableEdgeModelAttrVFrom, and te::graph::Globals::sm_tableEdgeModelAttrVTo.
      
  | 
  protectedinherited | 
Function used to load one edge given a ID.
| id | The edge identifier | 
Definition at line 413 of file AbstractGraphLoaderStrategy.cpp.
References TE_TR.
      
  | 
  protectedinherited | 
Function used to load one vertex given a ID.
| id | The vertex identifier | 
Definition at line 314 of file AbstractGraphLoaderStrategy.cpp.
References TE_TR.
      
  | 
  protectedinherited | 
Function used to load one vertex given a ID.
| id | The vertex identifier | 
Definition at line 319 of file AbstractGraphLoaderStrategy.cpp.
References te::graph::Vertex::addAttribute(), te::common::Convert2String(), te::graph::Vertex::setAttributeVecSize(), and te::graph::Globals::sm_tableVertexModelAttrId.
      
  | 
  virtualinherited | 
Function used to remove a edge saved in a data source.
| id | The edge identifier | 
Reimplemented in te::graph::BottomUpLoaderStrategy, and te::graph::TopDownLoaderStrategy.
Definition at line 82 of file AbstractGraphLoaderStrategy.cpp.
References TE_TR.
      
  | 
  virtualinherited | 
Function used to remove a vertex saved in a data source.
| id | The vertex identifier | 
Reimplemented in te::graph::BottomUpLoaderStrategy, and te::graph::TopDownLoaderStrategy.
Definition at line 91 of file AbstractGraphLoaderStrategy.cpp.
References TE_TR.
      
  | 
  virtualinherited | 
Save the graph data structure in Data Source.
| data | Pointer to a valid graph data | 
Reimplemented in te::graph::BottomUpLoaderStrategy, and te::graph::TopDownLoaderStrategy.
Definition at line 67 of file AbstractGraphLoaderStrategy.cpp.
References te::graph::Edge_List, and TE_TR.
      
  | 
  protectedinherited | 
Used to save the edges elements attributes from a graph data.
| data | Pointer to a valid graph data | 
Definition at line 309 of file AbstractGraphLoaderStrategy.cpp.
References TE_TR.
      
  | 
  protectedinherited | 
Used to save the edge elements from a graph data.
| data | Pointer to a valid graph data | 
Definition at line 100 of file AbstractGraphLoaderStrategy.cpp.
References te::graph::GraphData::getEdgeMap(), te::graph::GraphData::isDirty(), te::mem::DataSetItem::setInt32(), and te::mem::DataSetItem::setValue().
      
  | 
  protectedinherited | 
Used to save the vertex elements from a graph data.
| data | Pointer to a valid graph data | 
Definition at line 304 of file AbstractGraphLoaderStrategy.cpp.
References TE_TR.
      
  | 
  protectedinherited | 
Used to save the vertex elements attributes from a graph data.
| data | Pointer to a valid graph data | 
Definition at line 207 of file AbstractGraphLoaderStrategy.cpp.
References te::graph::GraphData::getVertexMap(), te::graph::GraphData::isDirty(), te::mem::DataSetItem::setInt32(), and te::mem::DataSetItem::setValue().
      
  | 
  protectedinherited | 
Graph metadata attribute.
Definition at line 203 of file AbstractGraphLoaderStrategy.h.