GeneralizedProximityMatrix.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 GeneralizedProximityMatrix.h
22 
23  \brief This class defines the GPM class.
24 */
25 
26 #ifndef __TERRALIB_SA_INTERNAL_GENERALIZEDPROXIMITYMATRIX_H
27 #define __TERRALIB_SA_INTERNAL_GENERALIZEDPROXIMITYMATRIX_H
28 
29 // Terralib Includes
30 #include "../../dataaccess/datasource/DataSource.h"
31 #include "../../graph/core/AbstractGraph.h"
32 #include "../Config.h"
33 
34 // STL Includes
35 #include <map>
36 #include <memory>
37 #include <string>
38 
39 namespace te
40 {
41  // Forward declarations
42  namespace da { class DataSetType; }
43  namespace mem { class DataSet; }
44 
45  namespace sa
46  {
47 
48  /*!
49  \class GeneralizedProximityMatrix
50 
51  \brief This class defines a Generalized Proximity Matrix.
52 
53  \sa GPMBuilder
54  */
55 
57  {
58  public:
59 
60  /*! \brief Default constructor. */
62 
63  /*! \brief Virtual destructor. */
65 
66 
67  /** @name Methods
68  * Methods used by the GPM
69  */
70  //@{
71 
72  void setDataSetName(const std::string& dataSetName);
73 
74  std::string getDataSetName();
75 
76  void setAttributeName( const std::string& attrName);
77 
78  std::string getAttributeName();
79 
81 
83 
84  /*!
85  \brief Function used to export the all vertex attributes from gpm graph to a datasource
86 
87  \param ds Pointer to the output datasource
88  \param dataSetName The name of the new dataset that will be created into the datasource
89 
90  */
91  void toDataSource(te::da::DataSourcePtr ds, std::string dataSetName);
92 
93  protected:
94 
95  std::unique_ptr<te::da::DataSetType> createDataSetType(std::string dataSetName);
96 
97  std::unique_ptr<te::mem::DataSet> createDataSet(te::da::DataSetType* dsType);
98 
99  std::map<int, std::string> getGPMPropertyMap();
100 
101  //@}
102 
103  private:
104 
105  std::string m_dataSetName; //!< Attribute used to identify the dataset associated to this gpm.
106  std::string m_attributeName; //!< Attribute used to identify the attr from dataset associated to this gmp.
107 
108  std::unique_ptr<te::graph::AbstractGraph> m_graph; //!< Graph that represents the gpm.
109 
110  };
111 
112  } // end namespace sa
113 } // end namespace te
114 
115 #endif //__TERRALIB_SA_INTERNAL_GENERALIZEDPROXIMITYMATRIX_H
te::sa::GeneralizedProximityMatrix::setGraph
void setGraph(te::graph::AbstractGraph *graph)
te
TerraLib.
Definition: AddressGeocodingOp.h:52
te::sa::GeneralizedProximityMatrix::~GeneralizedProximityMatrix
virtual ~GeneralizedProximityMatrix()
Virtual destructor.
te::sa::GeneralizedProximityMatrix::setAttributeName
void setAttributeName(const std::string &attrName)
te::sa::GeneralizedProximityMatrix::toDataSource
void toDataSource(te::da::DataSourcePtr ds, std::string dataSetName)
Function used to export the all vertex attributes from gpm graph to a datasource.
te::sa::GeneralizedProximityMatrix::createDataSet
std::unique_ptr< te::mem::DataSet > createDataSet(te::da::DataSetType *dsType)
te::sa::GeneralizedProximityMatrix::m_dataSetName
std::string m_dataSetName
Attribute used to identify the dataset associated to this gpm.
Definition: GeneralizedProximityMatrix.h:105
te::sa::GeneralizedProximityMatrix::GeneralizedProximityMatrix
GeneralizedProximityMatrix()
Default constructor.
TESAEXPORT
#define TESAEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:133
te::sa::GeneralizedProximityMatrix::createDataSetType
std::unique_ptr< te::da::DataSetType > createDataSetType(std::string dataSetName)
te::sa::GeneralizedProximityMatrix
This class defines a Generalized Proximity Matrix.
Definition: GeneralizedProximityMatrix.h:57
te::sa::GeneralizedProximityMatrix::m_graph
std::unique_ptr< te::graph::AbstractGraph > m_graph
Graph that represents the gpm.
Definition: GeneralizedProximityMatrix.h:108
te::sa::GeneralizedProximityMatrix::getAttributeName
std::string getAttributeName()
te::sa::GeneralizedProximityMatrix::getDataSetName
std::string getDataSetName()
te::sa::GeneralizedProximityMatrix::setDataSetName
void setDataSetName(const std::string &dataSetName)
te::graph::AbstractGraph
Abstract class used to define the main functions of graph struct. All graph implementations must used...
Definition: AbstractGraph.h:56
te::sa::GeneralizedProximityMatrix::getGraph
te::graph::AbstractGraph * getGraph()
te::da::DataSourcePtr
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
te::sa::GeneralizedProximityMatrix::m_attributeName
std::string m_attributeName
Attribute used to identify the attr from dataset associated to this gmp.
Definition: GeneralizedProximityMatrix.h:106
te::da::DataSetType
A class that models the description of a dataset.
Definition: DataSetType.h:73
te::sa::GeneralizedProximityMatrix::getGPMPropertyMap
std::map< int, std::string > getGPMPropertyMap()