GraphExamples.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file GraphExamples.h
22 
23  \brief These routines show how to use the Graph module.
24  */
25 
26 #ifndef __TERRALIB_EXAMPLES_INTERNAL_GRAPH_EXAMPLES_H
27 #define __TERRALIB_EXAMPLES_INTERNAL_GRAPH_EXAMPLES_H
28 
29 //TerraLib
33 #include <terralib/raster/Raster.h>
34 #include "../Config.h"
35 
36 //STL
37 #include <map>
38 #include <memory>
39 #include <string>
40 
41 /*! \brief It loads the data source drivers. */
42 void LoadModules();
43 
44 /*! \brief Creates a LDD GRAPH. */
45 void CreateLDDGraph(bool draw);
46 
47 /*! \brief Creates a MST GRAPH. */
48 void CreateMSTGraph(bool draw);
49 
50 /*! \brief Auxiliar functions for load a raster. */
51 std::unique_ptr<te::rst::Raster> OpenRaster(const std::string& pathName, const int& srid);
52 
53 /*! \brief Auxiliar functions for load a org data source. */
54 std::unique_ptr<te::da::DataSource> OpenOGRDataSource(const std::string& pathName);
55 
56 /*! \brief Auxiliar functions used to get a dataset extent. */
57 std::unique_ptr<te::gm::Envelope> getDataSetExtent(te::da::DataSource* ds, std::string dataSetName);
58 
59 /*! \brief Auxiliar functions used to create a vertex attribute in a graph and get the value from a dataset, return the property idx. */
60 int AssociateGraphVertexAttribute(te::da::DataSource* ds, std::string dataSetName, int idIdx, int attrIdx, boost::shared_ptr<te::graph::AbstractGraph> graph, int dataType, std::string attrName);
61 
62 /*! \brief Auxiliar functions used to create a vertex attribute in a graph, return the property idx. */
63 int AddGraphVertexAttribute(boost::shared_ptr<te::graph::AbstractGraph> graph, std::string attrName, int dataType);
64 
65 /*! \brief Auxiliar functions used to create a edge attribute in a graph, return the property idx. */
66 int AddGraphEdgeAttribute(boost::shared_ptr<te::graph::AbstractGraph> graph, std::string attrName, int dataType);
67 
68 #endif
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
std::unique_ptr< te::da::DataSource > OpenOGRDataSource(const std::string &pathName)
Auxiliar functions for load a org data source.
int AssociateGraphVertexAttribute(te::da::DataSource *ds, std::string dataSetName, int idIdx, int attrIdx, boost::shared_ptr< te::graph::AbstractGraph > graph, int dataType, std::string attrName)
Auxiliar functions used to create a vertex attribute in a graph and get the value from a dataset...
int AddGraphVertexAttribute(boost::shared_ptr< te::graph::AbstractGraph > graph, std::string attrName, int dataType)
Auxiliar functions used to create a vertex attribute in a graph, return the property idx...
An abstract class for raster data strucutures.
int AddGraphEdgeAttribute(boost::shared_ptr< te::graph::AbstractGraph > graph, std::string attrName, int dataType)
Auxiliar functions used to create a edge attribute in a graph, return the property idx...
static te::dt::Date ds(2010, 01, 01)
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
void CreateMSTGraph(bool draw)
Creates a MST GRAPH.
std::unique_ptr< te::rst::Raster > OpenRaster(const std::string &pathName, const int &srid)
Auxiliar functions for load a raster.
Abstract class used to define the main functions of graph struct. All graph implementations must used...
void LoadModules()
It loads the data source drivers.
An Envelope defines a 2D rectangular region.
void CreateLDDGraph(bool draw)
Creates a LDD GRAPH.
std::unique_ptr< te::gm::Envelope > getDataSetExtent(te::da::DataSource *ds, std::string dataSetName)
Auxiliar functions used to get a dataset extent.