h o m e d o c u m e n t a t i o n c l a s s h i e r a r c h y

AdvancedPredicates1D.h

00001 //
00002 //  Filename         : AdvancedPredicates1D.h
00003 //  Author(s)        : Stephane Grabli
00004 //  Purpose          : Class gathering stroke creation algorithms
00005 //  Date of creation : 01/07/2003
00006 //
00008 
00009 
00010 //
00011 //  Copyright (C) : Please refer to the COPYRIGHT file distributed 
00012 //   with this source distribution. 
00013 //
00014 //  This program is free software; you can redistribute it and/or
00015 //  modify it under the terms of the GNU General Public License
00016 //  as published by the Free Software Foundation; either version 2
00017 //  of the License, or (at your option) any later version.
00018 //
00019 //  This program is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with this program; if not, write to the Free Software
00026 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00027 //
00029 
00030 #ifndef  ADVANCED_PREDICATES1D_H
00031 # define ADVANCED_PREDICATES1D_H
00032 
00033 # include <string>
00034 # include "../view_map/Interface1D.h"
00035 # include "AdvancedFunctions1D.h"
00036 # include "Predicates1D.h"
00037 
00038 //
00039 // Predicates definitions
00040 //
00042 
00043 namespace Predicates1D {
00044 
00045   // DensityLowerThanUP1D
00049   class DensityLowerThanUP1D : public UnaryPredicate1D
00050   {
00051   public:
00061     DensityLowerThanUP1D(double threshold, double sigma = 2) {
00062       _threshold = threshold;
00063       _sigma = sigma;
00064     }
00066     string getName() const {
00067       return "DensityLowerThanUP1D";
00068     }
00070     bool operator()(Interface1D& inter) {
00071       Functions1D::DensityF1D fun(_sigma);
00072       return (fun(inter) < _threshold);
00073     }
00074   private:
00075     double _sigma;
00076     double _threshold;
00077   };
00078 
00079 } // end of namespace Predicates1D
00080 
00081 #endif // ADVANCED_PREDICATES1D_H