All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::graph::GPMGraphBuilder Class Reference

This class defines the GPM strategy to build a graph,. More...

#include <GPMGraphBuilder.h>

Inheritance diagram for te::graph::GPMGraphBuilder:
te::graph::AbstractGraphBuilder

Public Member Functions

 GPMGraphBuilder ()
 Default constructor. More...
 
virtual ~GPMGraphBuilder ()
 Virtual destructor. More...
 
Abstract Methods

Method common to each graph builder

std::string getErrorMessage ()
 Get error message. More...
 
boost::shared_ptr< AbstractGraphgetGraph ()
 Get generated graph. More...
 

Protected Attributes

std::string m_errorMessage
 Error message. More...
 
boost::shared_ptr< AbstractGraphm_graph
 Graph object. More...
 

Private Attributes

int m_edgeId
 Attribute used as a index counter for edge objects. More...
 

Methods

Methods used by this builder

bool setGraphInfo (const std::map< std::string, std::string > &dsInfo, const std::string &graphType, const std::map< std::string, std::string > &gInfo)
 Function used to create a empty graph. More...
 
bool buildAdjacency (std::auto_ptr< te::da::DataSource > ds, std::string dataSetName, std::string columnId, bool calcDist)
 Function used to generated a graph using the GPM Adjacency Strategy. More...
 
bool buildDistance (std::auto_ptr< te::da::DataSource > ds, std::string dataSetName, std::string columnId, double dist)
 Function used to generated a graph using the GPM Distance Strategy. More...
 
void createVertexObjects (te::da::DataSet *dataSet, std::string columnId, int srid)
 Function used to create all vertex object based on data set. More...
 
void createAdjacencyEdges (te::da::DataSet *dataSet, std::string columnId, bool calcDist)
 Function used to create all edges object based on data set, using the adjacency strategy. More...
 
void createDistanceEdges (te::da::DataSet *dataSet, std::string columnId, double distance)
 Function used to create all edges object based on data set, using the distance strategy. More...
 
int getEdgeId ()
 Function used to generated the edge id. More...
 

Detailed Description

This class defines the GPM strategy to build a graph,.

This is builder uses diferent strategies to build a graph based on a generalized proximity matrix.

See also
AbstractGraphBuilder

Definition at line 68 of file GPMGraphBuilder.h.

Constructor & Destructor Documentation

te::graph::GPMGraphBuilder::GPMGraphBuilder ( )

Default constructor.

Definition at line 55 of file GPMGraphBuilder.cpp.

References m_edgeId.

te::graph::GPMGraphBuilder::~GPMGraphBuilder ( )
virtual

Virtual destructor.

Definition at line 60 of file GPMGraphBuilder.cpp.

Member Function Documentation

bool te::graph::GPMGraphBuilder::buildAdjacency ( std::auto_ptr< te::da::DataSource ds,
std::string  dataSetName,
std::string  columnId,
bool  calcDist 
)

Function used to generated a graph using the GPM Adjacency Strategy.

Parameters
dsFile name wiht vectorial data
dataSetNameData Set name that contains the geometry information
columnIdColumn id from vectorial data used as link column
calcDistFlag used to indicate if has to create the distance attribute
Returns
True if the graph was correctly generated and false in other case.

Definition at line 74 of file GPMGraphBuilder.cpp.

References te::da::GetFirstGeomProperty(), and te::gm::GeometryProperty::getSRID().

bool te::graph::GPMGraphBuilder::buildDistance ( std::auto_ptr< te::da::DataSource ds,
std::string  dataSetName,
std::string  columnId,
double  dist 
)

Function used to generated a graph using the GPM Distance Strategy.

Parameters
dsFile name wiht vectorial data
dataSetNameData Set name that contains the geometry information
columnIdColumn id from vectorial data used as link column
distValue with distance information.
Returns
True if the graph was correctly generated and false in other case.

Definition at line 89 of file GPMGraphBuilder.cpp.

References te::da::GetFirstGeomProperty(), and te::gm::GeometryProperty::getSRID().

void te::graph::GPMGraphBuilder::createAdjacencyEdges ( te::da::DataSet dataSet,
std::string  columnId,
bool  calcDist 
)
protected
void te::graph::GPMGraphBuilder::createVertexObjects ( te::da::DataSet dataSet,
std::string  columnId,
int  srid 
)
protected
int te::graph::GPMGraphBuilder::getEdgeId ( )
protected

Function used to generated the edge id.

Returns
Integer value as ID

Definition at line 343 of file GPMGraphBuilder.cpp.

std::string te::graph::AbstractGraphBuilder::getErrorMessage ( )
inherited

Get error message.

Definition at line 43 of file AbstractGraphBuilder.cpp.

boost::shared_ptr< te::graph::AbstractGraph > te::graph::AbstractGraphBuilder::getGraph ( )
inherited

Get generated graph.

Definition at line 48 of file AbstractGraphBuilder.cpp.

bool te::graph::GPMGraphBuilder::setGraphInfo ( const std::map< std::string, std::string > &  dsInfo,
const std::string &  graphType,
const std::map< std::string, std::string > &  gInfo 
)

Function used to create a empty graph.

Parameters
dsInfoContainer with data source information
graphTypeAttribute used to define the output graph type
gInfoContainer with graph generation parameters
Returns
True if the graph was correctly generated and false in other case.

Definition at line 64 of file GPMGraphBuilder.cpp.

References te::graph::AbstractGraphFactory::make().

Member Data Documentation

int te::graph::GPMGraphBuilder::m_edgeId
private

Attribute used as a index counter for edge objects.

Definition at line 167 of file GPMGraphBuilder.h.

Referenced by GPMGraphBuilder().

std::string te::graph::AbstractGraphBuilder::m_errorMessage
protectedinherited

Error message.

Definition at line 84 of file AbstractGraphBuilder.h.

Referenced by te::graph::AbstractGraphBuilder::AbstractGraphBuilder().

boost::shared_ptr<AbstractGraph> te::graph::AbstractGraphBuilder::m_graph
protectedinherited

Graph object.

Definition at line 82 of file AbstractGraphBuilder.h.

Referenced by te::graph::AbstractGraphBuilder::AbstractGraphBuilder().


The documentation for this class was generated from the following files: