00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2011 by the OpenStructure authors 00005 // Copyright (C) 2003-2010 by the IPLT authors 00006 // 00007 // This library is free software; you can redistribute it and/or modify it under 00008 // the terms of the GNU Lesser General Public License as published by the Free 00009 // Software Foundation; either version 3.0 of the License, or (at your option) 00010 // any later version. 00011 // This library is distributed in the hope that it will be useful, but WITHOUT 00012 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00014 // details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public License 00017 // along with this library; if not, write to the Free Software Foundation, Inc., 00018 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 //------------------------------------------------------------------------------ 00020 00021 /* 00022 Data algorithm abstract base classes 00023 00024 Author: Ansgar Philippsen 00025 */ 00026 00027 #ifndef IMG_DATA_ALG_H 00028 #define IMG_DATA_ALG_H 00029 00030 #include <ost/img/module_config.hh> 00031 #include "image_fw.hh" 00032 00033 /* 00034 TODO: 00035 00036 add info object as parameter in base class, this guarantees that every 00037 algorithm has access to an info object for logging 00038 */ 00039 00040 namespace ost { namespace img { 00041 00043 00047 class DLLEXPORT_OST_IMG_BASE AlgorithmBase { 00048 public: 00050 const String& GetName() const; 00051 00052 virtual ~AlgorithmBase(); 00053 00054 protected: 00056 AlgorithmBase(const String& n); 00057 00058 AlgorithmBase(const AlgorithmBase& a); 00059 AlgorithmBase& operator=(const AlgorithmBase& b); 00060 00061 private: 00062 String name_; 00063 }; 00064 00066 class DLLEXPORT_OST_IMG_BASE NonModAlgorithm: public AlgorithmBase 00067 { 00068 public: 00070 virtual void Visit(const ConstImageHandle& i) = 0; 00071 00072 protected: 00074 NonModAlgorithm(const String& name); 00076 NonModAlgorithm(const NonModAlgorithm& a); 00078 NonModAlgorithm& operator=(const NonModAlgorithm& a); 00079 }; 00080 00081 00083 00089 class DLLEXPORT_OST_IMG_BASE ModIPAlgorithm: public AlgorithmBase 00090 { 00091 public: 00092 virtual void Visit(ImageHandle& ih) = 0; 00093 protected: 00094 ModIPAlgorithm(const String& name); 00095 ModIPAlgorithm(const ModIPAlgorithm& a); 00096 ModIPAlgorithm& operator=(const ModIPAlgorithm& a); 00097 }; 00098 00099 00101 00107 class DLLEXPORT_OST_IMG_BASE ConstModIPAlgorithm: public AlgorithmBase 00108 { 00109 public: 00110 virtual void Visit(ImageHandle& ih) const = 0; 00111 protected: 00112 ConstModIPAlgorithm(const String& name); 00113 ConstModIPAlgorithm(const ConstModIPAlgorithm& a); 00114 ConstModIPAlgorithm& operator=(const ConstModIPAlgorithm& a); 00115 }; 00116 00117 00119 00125 class DLLEXPORT_OST_IMG_BASE ModOPAlgorithm: public AlgorithmBase 00126 { 00127 public: 00128 virtual ImageHandle Visit(const ConstImageHandle& ih) = 0; 00129 00130 protected: 00131 ModOPAlgorithm(const String& name); 00132 ModOPAlgorithm(const ModOPAlgorithm& a); 00133 ModOPAlgorithm& operator=(const ModOPAlgorithm& a); 00134 }; 00135 00137 00143 class DLLEXPORT_OST_IMG_BASE ConstModOPAlgorithm: public AlgorithmBase 00144 { 00145 public: 00146 virtual ImageHandle Visit(const ConstImageHandle& ih) const= 0; 00147 00148 protected: 00149 ConstModOPAlgorithm(const String& name); 00150 ConstModOPAlgorithm(const ConstModOPAlgorithm& a); 00151 ConstModOPAlgorithm& operator=(const ConstModOPAlgorithm& a); 00152 }; 00153 00154 }} // namespace 00155 00156 #endif