openModeller  Version 1.5.0
PreAlgorithm.hh
Go to the documentation of this file.
1 
27 #ifndef PRE_ALGORITHM_HH
28  #define PRE_ALGORITHM_HH
29 
30  #include <openmodeller/om.hh>
31  #include "PreParameters.hh"
32  #include <map>
33 
34  // adapted from Terralib PDI (Digital Image Processing) to OM Pre-analysis (Missae & Emiliano - DPI/INPE)
35  class dllexp PreAlgorithm
36  {
37  public :
38 
39  //Default Destructor
40  virtual ~PreAlgorithm();
41 
42  //return a default object.
43  static PreAlgorithm* DefaultObject( const PreParameters& params )
44  {throw;};
45 
51  virtual string getDescription() const = 0;
52 
59  bool apply();
60 
67  bool reset( const PreParameters& params );
68 
74  void resetState( PreParameters& params );
75 
85  virtual bool checkParameters( const PreParameters& parameters ) const = 0;
86 
87  //Returns a reference to the current internal parameters.
88  const PreParameters& getParameters() const;
89 
90  //get input information
91  typedef std::map<string, string> stringMap;
92  virtual void getAcceptedParameters( stringMap& info) = 0;
93 
94  //get output information
95  virtual void getLayersetResultSpec ( stringMap& info) = 0;
96 
97  //get output information for each layer
98  virtual void getLayerResultSpec ( stringMap& info) = 0;
99 
107  void getLayerResult( const string layer_id, PreParameters& result );
108 
109  protected :
110 
111  //Internal parameters reference
113 
114  // Layer id => PreParams obj whose keys can be discovered by calling getLayerResultSpec
115  mutable std::map<string, PreParameters> result_by_layer_;
116 
117  //Default Constructor
118  PreAlgorithm();
119 
125  virtual bool runImplementation() = 0;
126 
135  bool checkInternalParameters() const;
136 
137  private :
138 
144  PreAlgorithm( const PreAlgorithm& );
145 
154  const PreAlgorithm& operator=( const PreAlgorithm& external );
155  };
156 
157 #endif //PREALGORITHM_HPP
static PreAlgorithm * DefaultObject(const PreParameters &params)
Definition: PreAlgorithm.hh:43
std::map< string, string > stringMap
Definition: PreAlgorithm.hh:91
std::map< string, PreParameters > result_by_layer_
PreParameters params_
AlgParamMetadata parameters[NUM_PARAM]
Definition: garp.cpp:55