Loading...
Searching...
No Matches
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
39namespace 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
A class that models the description of a dataset.
Definition: DataSetType.h:73
Abstract class used to define the main functions of graph struct. All graph implementations must used...
Definition: AbstractGraph.h:56
This class defines a Generalized Proximity Matrix.
std::unique_ptr< te::mem::DataSet > createDataSet(te::da::DataSetType *dsType)
std::unique_ptr< te::da::DataSetType > createDataSetType(std::string dataSetName)
std::map< int, std::string > getGPMPropertyMap()
void setGraph(te::graph::AbstractGraph *graph)
void toDataSource(te::da::DataSourcePtr ds, std::string dataSetName)
Function used to export the all vertex attributes from gpm graph to a datasource.
te::graph::AbstractGraph * getGraph()
std::string m_attributeName
Attribute used to identify the attr from dataset associated to this gmp.
std::string m_dataSetName
Attribute used to identify the dataset associated to this gpm.
void setDataSetName(const std::string &dataSetName)
GeneralizedProximityMatrix()
Default constructor.
void setAttributeName(const std::string &attrName)
virtual ~GeneralizedProximityMatrix()
Virtual destructor.
std::unique_ptr< te::graph::AbstractGraph > m_graph
Graph that represents the gpm.
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1449
TerraLib.
#define TESAEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:133