ControlIntervalMapper.hxx

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2009 Fundacio Barcelona Media Universitat Pompeu Fabra.
00003  *
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  */
00020 
00021 #ifndef _ControlIntervalMapper_
00022 #define _ControlIntervalMapper_
00023 
00024 #include "DataTypes.hxx"
00025 #include "Processing.hxx"
00026 #include "ProcessingConfig.hxx"
00027 #include "InControl.hxx"
00028 #include "OutControl.hxx"
00029 
00030 namespace CLAM
00031 {
00032 
00033 class ControlIntervalMapperConfig : public ProcessingConfig
00034 {
00035         public:
00036                 DYNAMIC_TYPE_USING_INTERFACE (ControlIntervalMapperConfig, 4, ProcessingConfig);
00037                 DYN_ATTRIBUTE ( 0, public, float, InputMin);
00038                 DYN_ATTRIBUTE ( 1, public, float, InputMax);
00039                 DYN_ATTRIBUTE ( 2, public, float, OutputMin);
00040                 DYN_ATTRIBUTE ( 3, public, float, OutputMax);
00041 
00042         private:
00043                 void DefaultInit();
00044 };
00045 
00046 class ControlIntervalMapper : public Processing
00047 {
00048         ControlIntervalMapperConfig _config;
00049         FloatInControl _inControl;
00050         FloatOutControl _outControl;
00051         float _min;
00052         float _max;
00053         float _newmin;
00054         float _newmax;
00055 
00056         void InControlCallback(const TControlData & value);
00057 
00058         public:
00059 
00060                 const char *GetClassName() const { return "ControlIntervalMapper"; }
00061 
00062                 ControlIntervalMapper();
00063                 ControlIntervalMapper( const ControlIntervalMapperConfig& cfg );
00064 
00065                 bool ConcreteConfigure( const ProcessingConfig& cfg ); 
00066 
00067                 const ProcessingConfig& GetConfig() const { return _config; }
00068 
00069                 bool Do();
00070 };
00071 
00072 }
00073 
00074 #endif
00075 
Generated by  doxygen 1.6.3