GestureRecognition/stlfeatureinterface.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-  (for Emacs)
00002  *
00003  *  stlfeatureinterface.h
00004  *  Digest
00005  * 
00006  *  Created by Aidan Lane on Sun Apr 9 2006.
00007  *  Copyright (c) 2006 Optimisation and Constraint Solving Group,
00008  *  Monash University. All rights reserved.
00009  *
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU General Public License for more details.
00019  *
00020  *  You should have received a copy of the GNU General Public License
00021  *  along with this program; if not, write to the Free Software
00022  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00023  */
00024 
00025 #ifndef STLFEATUREINTERFACE_H
00026 #define STLFEATUREINTERFACE_H
00027 
00028 
00029 // TODO: remove what we don't need:
00030 #include <algorithm>
00031 #include <list>
00032 #include <map>
00033 #include <set>
00034 #include <sstream>
00035 #include <string>
00036 #include <vector>
00037 
00038 #include "stlrecognitioncommon.h"
00039 
00040 
00041 #ifndef DECLARE_STL_FEATURE_KEY(KEY)
00042 #define DECLARE_STL_FEATURE_KEY(KEY)                            \
00043   static const std::string& classKey() {                        \
00044     static const std::string str(KEY);                          \
00045     return str;                                                 \
00046   }                                                             \
00047   virtual const std::string& key() const { return classKey(); }
00048 #endif
00049 
00050 #ifndef DECLARE_STL_FEATURE_TITLE(TITLE)
00051 #define DECLARE_STL_FEATURE_TITLE(TITLE)                                \
00052   static const std::string& classTitle() {                              \
00053     static const std::string str(TITLE);                                \
00054     return str;                                                         \
00055   }                                                                     \
00056   virtual const std::string& title() const { return classTitle(); }
00057 #endif
00058 
00059 #ifndef DECLARE_STL_FEATURE_DESCRIPTION(DESCRIPTION)
00060 #define DECLARE_STL_FEATURE_DESCRIPTION(DESCRIPTION)                    \
00061   static const std::string& classDescription() {                        \
00062     static const std::string str(DESCRIPTION);                          \
00063     return str;                                                         \
00064   }                                                                     \
00065   virtual const std::string& description() const { return classDescription(); }
00066 #endif
00067 
00068 #ifndef DECLARE_STL_FEATURE_DESCRIPTION_METHODS
00069 #define DECLARE_STL_FEATURE_DESCRIPTION_METHODS                         \
00070   static const std::string& classDescription();                         \
00071   virtual const std::string& description() const { return classDescription(); }
00072 #endif
00073 
00074 
00084 class StlFeatureInterface {
00085 
00086 public:
00087   virtual ~StlFeatureInterface() {}
00088 
00089   virtual const std::string& key() const = 0;
00090   virtual const std::string& title() const = 0;
00091   virtual const std::string& description() const = 0;
00092 
00093   virtual StlFeatureResultT
00094   calcValue( const StlStroke& stroke, bool* ok = 0 ) const = 0;
00095 };
00096 
00097 
00098 #endif  // ! STLFEATUREINTERFACE_H

Generated on Mon Jul 30 09:46:50 2007 for Digest by  doxygen 1.5.2