Loading...
Searching...
No Matches
GPMBuilder.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 GPMBuilder.h
22
23 \brief This class defines the GPM Builder class.
24*/
25
26#ifndef __TERRALIB_SA_INTERNAL_GPMBUILDER_H
27#define __TERRALIB_SA_INTERNAL_GPMBUILDER_H
28
29// Terralib Includes
30#include "../Config.h"
32
33// STL Includes
34#include <map>
35
36namespace te
37{
38 // Forward declarations
39 namespace da { class DataSource; }
40
41 namespace sa
42 {
43 // Forward declarations
44 class GPMConstructorAbstractStrategy;
45 class GPMWeightsAbstractStrategy;
46
47 /*!
48 \class GPMBuilder
49
50 \brief This class defines the GPM Builder class.
51
52 */
53
55 {
56 public:
57
58 /*! \brief Default constructor. */
60
61 /*! \brief Virtual destructor. */
62 virtual ~GPMBuilder();
63
64
65 /** @name Methods
66 * Methods used by the GPM builder
67 */
68 //@{
69
70 /*!
71 \brief Function used to create an empty gpm (using a MEMORY DIRECT graph)
72
73 \param ds Data source pointer
74 \param dataSetName Container with data source information
75 \param attributeName Attribute used to define the output graph type
76
77 \return True if the gmp was correctly generated and false in other case.
78
79 */
80 bool setGPMInfo(te::da::DataSourcePtr ds, const std::string& dataSetName, const std::string& attributeName);
81
82 void build();
83
84 //@}
85
86 /*!
87 \brief Function used to return the generated gpm
88
89 \note: The caller will be responsible for checking if it received a valid pointer;
90 \note: The caller will receive ownership of the returned pointer;
91
92 \return GeneralizedProximityMatrix A pointer to the matrix generated by the builder.
93
94 */
96
97 private:
98
99 GPMConstructorAbstractStrategy* m_constructor; //!< Strategy used to construct the gpm.
100
101 GPMWeightsAbstractStrategy* m_weights; //!< Strategy used to calculate the weight of a gpm.
102
103 std::unique_ptr<GeneralizedProximityMatrix> m_gpm; //!< GPM reference pointer.
104
105 te::da::DataSourcePtr m_ds; //!< Input Data Source.
106
107 };
108
109 } // end namespace sa
110} // end namespace te
111
112#endif //__TERRALIB_SA_INTERNAL_GPMBUILDER_H
This class defines the GPM class.
This class defines the GPM Builder class.
Definition: GPMBuilder.h:55
te::da::DataSourcePtr m_ds
Input Data Source.
Definition: GPMBuilder.h:105
GPMConstructorAbstractStrategy * m_constructor
Strategy used to construct the gpm.
Definition: GPMBuilder.h:99
std::unique_ptr< GeneralizedProximityMatrix > m_gpm
GPM reference pointer.
Definition: GPMBuilder.h:103
virtual ~GPMBuilder()
Virtual destructor.
GPMWeightsAbstractStrategy * m_weights
Strategy used to calculate the weight of a gpm.
Definition: GPMBuilder.h:101
GPMBuilder(GPMConstructorAbstractStrategy *constructor, GPMWeightsAbstractStrategy *weights)
Default constructor.
GeneralizedProximityMatrix * getGPM()
Function used to return the generated gpm.
bool setGPMInfo(te::da::DataSourcePtr ds, const std::string &dataSetName, const std::string &attributeName)
Function used to create an empty gpm (using a MEMORY DIRECT graph)
This class defines a an Abstract class for a GPM constructor.
This class defines a an Abstract class to calculates a weight for a GPM.
This class defines a Generalized Proximity Matrix.
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