openModeller
Version 1.4.0
|
00001 00027 #ifndef PRE_ALGORITHM_HH 00028 #define PRE_ALGORITHM_HH 00029 00030 #include <openmodeller/om.hh> 00031 #include "PreParameters.hh" 00032 #include <map> 00033 00034 // adapted from Terralib PDI (Digital Image Processing) to OM Pre-analysis (Missae & Emiliano - DPI/INPE) 00035 class dllexp PreAlgorithm 00036 { 00037 public : 00038 00039 //Default Destructor 00040 virtual ~PreAlgorithm(); 00041 00042 //return a default object. 00043 static PreAlgorithm* DefaultObject( const PreParameters& params ) 00044 {throw;}; 00045 00051 virtual string getDescription() const = 0; 00052 00059 bool apply(); 00060 00067 bool reset( const PreParameters& params ); 00068 00074 void resetState( PreParameters& params ); 00075 00085 virtual bool checkParameters( const PreParameters& parameters ) const = 0; 00086 00087 //Returns a reference to the current internal parameters. 00088 const PreParameters& getParameters() const; 00089 00090 //get input information 00091 typedef std::map<string, string> stringMap; 00092 virtual void getAcceptedParameters( stringMap& info) = 0; 00093 00094 //get output information 00095 virtual void getLayersetResultSpec ( stringMap& info) = 0; 00096 00097 //get output information for each layer 00098 virtual void getLayerResultSpec ( stringMap& info) = 0; 00099 00107 void getLayerResult( const string layer_id, PreParameters& result ); 00108 00109 protected : 00110 00111 //Internal parameters reference 00112 mutable PreParameters params_; 00113 00114 // Layer id => PreParams obj whose keys can be discovered by calling getLayerResultSpec 00115 mutable std::map<string, PreParameters> result_by_layer_; 00116 00117 //Default Constructor 00118 PreAlgorithm(); 00119 00125 virtual bool runImplementation() = 0; 00126 00135 bool checkInternalParameters() const; 00136 00137 private : 00138 00144 PreAlgorithm( const PreAlgorithm& ); 00145 00154 const PreAlgorithm& operator=( const PreAlgorithm& external ); 00155 }; 00156 00157 #endif //PREALGORITHM_HPP