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

This strategy is based on Serio Rosim method, using this "mask" is possible extract a graph from a LDD image. More...

#include <LDDGraphBuilder.h>

Inheritance diagram for te::graph::LDDGraphBuilder:
te::graph::AbstractGraphBuilder

Public Member Functions

 LDDGraphBuilder ()
 Default constructor. More...
 
virtual ~LDDGraphBuilder ()
 Virtual destructor. More...
 
Methods

Methods used by this builder

bool build (te::rst::Raster *raster, const std::map< std::string, std::string > &dsInfo, const std::string &graphType, const std::map< std::string, std::string > &gInfo)
 Function used to build the output graph based on input parameters. 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 Member Functions

int getEdgeId ()
 Function used to generated the edge id. More...
 
bool getVertexId (int row, int col, int &id)
 Function used to generated the vertex id based on raster coordenate. 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...
 
te::rst::Rasterm_raster
 Input raster with LDD information. More...
 

Detailed Description

This strategy is based on Serio Rosim method, using this "mask" is possible extract a graph from a LDD image.


| 32 | 64 | 128 |

| 16 | * | 1 |

| 8 | 4 | 2 |

See also
AbstractGraphBuilder

Definition at line 75 of file LDDGraphBuilder.h.

Constructor & Destructor Documentation

te::graph::LDDGraphBuilder::LDDGraphBuilder ( )

Default constructor.

Definition at line 56 of file LDDGraphBuilder.cpp.

References m_edgeId.

te::graph::LDDGraphBuilder::~LDDGraphBuilder ( )
virtual

Virtual destructor.

Definition at line 61 of file LDDGraphBuilder.cpp.

Member Function Documentation

bool te::graph::LDDGraphBuilder::build ( te::rst::Raster raster,
const std::map< std::string, std::string > &  dsInfo,
const std::string &  graphType,
const std::map< std::string, std::string > &  gInfo 
)

Function used to build the output graph based on input parameters.

Parameters
raster
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 65 of file LDDGraphBuilder.cpp.

References te::graph::Vertex::addAttribute(), te::gm::GeometryProperty::getSRID(), te::rst::Raster::getSRID(), te::graph::AbstractGraphFactory::make(), te::gm::PointType, te::common::TaskProgress::pulse(), te::graph::Vertex::setAttributeVecSize(), te::gm::GeometryProperty::setGeometryType(), te::dt::Property::setId(), te::common::TaskProgress::setMessage(), te::gm::GeometryProperty::setSRID(), te::common::TaskProgress::setTotalSteps(), TE_TR, te::common::TaskProgress::useTimer(), te::gm::Coord2D::x, and te::gm::Coord2D::y.

int te::graph::LDDGraphBuilder::getEdgeId ( )
protected

Function used to generated the edge id.

Returns
Integer value as ID

Definition at line 274 of file LDDGraphBuilder.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::LDDGraphBuilder::getVertexId ( int  row,
int  col,
int &  id 
)
protected

Function used to generated the vertex id based on raster coordenate.

Parameters
rowRow position over the raster
colColumn position over the raster
idUsed to set the id generated
Returns
True if a valid id was generated and false in other case

Definition at line 252 of file LDDGraphBuilder.cpp.

Member Data Documentation

int te::graph::LDDGraphBuilder::m_edgeId
private

Attribute used as a index counter for edge objects.

Definition at line 134 of file LDDGraphBuilder.h.

Referenced by LDDGraphBuilder().

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().

te::rst::Raster* te::graph::LDDGraphBuilder::m_raster
private

Input raster with LDD information.

Definition at line 132 of file LDDGraphBuilder.h.


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