GestureRecognitionToolkit  Version: 0.2.5
The Gesture Recognition Toolkit (GRT) is a cross-platform, open-source, c++ machine learning library for real-time gesture recognition.
GRTBase.h
Go to the documentation of this file.
1 
29 #ifndef GRT_GRT_BASE_HEADER
30 #define GRT_GRT_BASE_HEADER
31 
32 #include <iostream>
33 #include <vector>
34 #include <algorithm>
35 #include <fstream>
36 #include <sstream>
37 #include <string>
38 #include <float.h>
39 #include <cmath>
40 #include <time.h>
41 #include <map>
42 #include <limits>
43 #include <stdlib.h>
44 #include <stdio.h>
45 #include <stddef.h>
46 #include <cstddef>
47 
48 #include "../Util/GRTCommon.h"
49 
50 GRT_BEGIN_NAMESPACE
51 
52 class GRT_API GRTBase
53 {
54 public:
59  GRTBase(const std::string &id="");
60 
64  virtual ~GRTBase(void);
65 
72  bool copyGRTBaseVariables(const GRTBase *GRTBase);
73 
81  GRT_DEPRECATED_MSG( "getClassType is deprecated, use getId() instead!", std::string getClassType() const );
82 
88  std::string getId() const;
89 
95  std::string getLastWarningMessage() const;
96 
102  std::string getLastErrorMessage() const;
103 
109  std::string getLastInfoMessage() const;
110 
117  bool setInfoLoggingEnabled(const bool loggingEnabled);
118 
125  bool setWarningLoggingEnabled(const bool loggingEnabled);
126 
133  bool setErrorLoggingEnabled(const bool loggingEnabled);
134 
141  bool setDebugLoggingEnabled(const bool loggingEnabled);
142 
150  static std::string getGRTVersion(bool returnRevision = true);
151 
157  static std::string getGRTRevison();
158 
164  GRTBase* getGRTBasePointer();
165 
171  const GRTBase* getGRTBasePointer() const;
172 
184  Float inline scale(const Float &x,const Float &minSource,const Float &maxSource,const Float &minTarget,const Float &maxTarget,const bool constrain=false){
185  if( constrain ){
186  if( x <= minSource ) return minTarget;
187  if( x >= maxSource ) return maxTarget;
188  }
189  if( minSource == maxSource ) return minTarget;
190  return (((x-minSource)*(maxTarget-minTarget))/(maxSource-minSource))+minTarget;
191  }
192 
193  inline Float SQR(const Float &x) const{ return x*x; }
194 
195 protected:
196 
197  std::string classId;
198  DebugLog debugLog;
199  ErrorLog errorLog;
200  InfoLog infoLog;
201  WarningLog warningLog;
202 };
203 
204 GRT_END_NAMESPACE
205 
206 #endif //GRT_GRT_BASE_HEADER
207 
std::string classId
Stores the name of the class (e.g., MinDist)
Definition: GRTBase.h:197
Float scale(const Float &x, const Float &minSource, const Float &maxSource, const Float &minTarget, const Float &maxTarget, const bool constrain=false)
Definition: GRTBase.h:184