Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

IntParameter.hpp

00001 #ifndef __IntParameter__
00002 #define __IntParameter__
00003 
00004 
00005 
00024 #include <stdio.h>
00025 
00026 #include "AbsParameter.hpp"
00027 
00028 
00029 class IntParameter : public AbsParameter
00030 {
00031 private:
00032 
00033 int                     currentValue;
00034 int                     defaultValue;
00035 
00036 int                     currentCardinality;
00037 int*            setValues;
00038 
00039 int                     minValue;
00040 int                     maxValue;
00041 
00042 public:
00043         
00044 IntParameter(char* aname,  int avalue, int acardinality=1, bool arangeFlag=false )
00045         :AbsParameter(aname, Integer, acardinality, arangeFlag )
00046         {
00047         currentValue= avalue;
00048         defaultValue= avalue;
00049 
00050         setValues= new int[acardinality];
00051         
00052         minValue= avalue;
00053         maxValue= avalue;
00054 
00055         currentCardinality= 0;
00056         }
00057 
00058 virtual ~IntParameter(){delete[] setValues;}
00059 
00060 virtual int                             getCurrentCardinality(){ return currentCardinality; }
00061 
00062 // as integer
00063 virtual void                    addInteger(int value);
00064 
00065 virtual int                             getInteger(){ return currentValue; }
00066 virtual int                             getDefaultInteger(){ return defaultValue; }
00067 virtual int                             getMinInteger(){ return minValue; }
00068 virtual int                             getMaxInteger(){ return maxValue; }
00069 virtual int                             getInteger(int index){ return setValues[index]; }
00070 
00071 virtual void                    setInteger(int val){ currentValue= val; }
00072 virtual void                    setDefaultInteger(int val){ defaultValue= val; }
00073 virtual void                    setRangeInteger(int low, int high){ minValue= low; maxValue= high;}
00074 virtual void                    setInteger(int index, int val){ setValues[index]= val; }
00075 
00076 // as bool
00077 virtual bool                    getBool(){return false;}
00078 virtual bool                    getDefaultBool(){return false;}
00079 
00080 virtual void                    setBool(bool val){}
00081 virtual void                    setDefaultBool(bool val){}
00082 
00083 // as real
00084 virtual double                  getReal(){return -1.0;}
00085 virtual double                  getDefaultReal(){return -1.0;}
00086 virtual double                  getMinReal(){return -1.0;}
00087 virtual double                  getMaxReal(){return -1.0;}
00088 virtual double                  getReal(int index){return -1.0;}
00089 
00090 virtual void                    setReal(double val){}
00091 virtual void                    setDefaultReal(double val){}
00092 virtual void                    setRangeReal(int low, double high){}
00093 virtual void                    setReal(int index, double val){}
00094 
00095 // as real
00096 virtual char*                   getString(){return 0;}
00097 virtual char*                   getDefaultString(){return 0;}
00098 virtual char*                   getString(int index){return 0;}
00099 
00100 virtual void                    setString(char* val){}
00101 virtual void                    setDefaultString(char* val){}
00102 virtual void                    setString(int index, char* val){}
00103 
00104 virtual char*                   shortDescription();
00105 virtual char*                   description();
00106 
00107 virtual void                    report(FILE* file){}
00108 };
00109 
00110 
00111 #endif
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com