00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef STLFEATUREINTERFACE_H
00026 #define STLFEATUREINTERFACE_H
00027
00028
00029
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