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.
RangeTracker.h
Go to the documentation of this file.
1 
10 /*
11  GRT MIT License
12  Copyright (c) <2012> <Nicholas Gillian, Media Lab, MIT>
13 
14  Permission is hereby granted, free of charge, to any person obtaining a copy of this software
15  and associated documentation files (the "Software"), to deal in the Software without restriction,
16  including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
18  subject to the following conditions:
19 
20  The above copyright notice and this permission notice shall be included in all copies or substantial
21  portions of the Software.
22 
23  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24  LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28  */
29 
30 #ifndef GRT_RANGE_TRACKER_HEADER
31 #define GRT_RANGE_TRACKER_HEADER
32 
33 #include "GRTCommon.h"
34 
35 GRT_BEGIN_NAMESPACE
36 
37 #define BIG_POSITIVE_VALUE 99e+99
38 #define BIG_NEGATIVE_VALUE -99e+99
39 
40 class GRT_API RangeTracker{
41 public:
42 
46  RangeTracker();
47 
53  RangeTracker(UINT numDimensions);
54 
60  RangeTracker(const RangeTracker &rhs);
61 
65  ~RangeTracker();
66 
73  RangeTracker& operator= (const RangeTracker &rhs){
74  if( this != &rhs){
75  this->trackData = rhs.trackData;
76  this->numDimensions = rhs.numDimensions;
77  this->totalNumSamplesViewed = rhs.totalNumSamplesViewed;
78  this->ranges = rhs.ranges;
79  }
80  return *this;
81  }
82 
86  void clear();
87 
96  bool setNumDimensions(UINT numDimensions);
97 
104  bool enableTracking(bool trackData){ return this->trackData = trackData; }
105 
114  bool update(VectorFloat sample);
115 
121  bool trackingData(){ return trackData; }
122 
123 
129  bool saveRangeDataToFile(std::string filename);
130 
136  bool loadRangeDataFromFile(std::string filename);
137 
143  UINT inline getNumDimensions(){ return numDimensions; }
144 
150  ULONG inline getNumSamplesViewed(){ return totalNumSamplesViewed; }
151 
157  Vector<MinMax> getRanges();
158 
159 private:
160  bool trackData;
161  UINT numDimensions;
162  ULONG totalNumSamplesViewed;
163  Vector< MinMax > ranges;
164 
165 };
166 
167 GRT_END_NAMESPACE
168 
169 #endif //GRT_RANGE_TRACKER_HEADER
ULONG getNumSamplesViewed()
Definition: RangeTracker.h:150
bool trackingData()
Definition: RangeTracker.h:121
UINT getNumDimensions()
Definition: RangeTracker.h:143
bool enableTracking(bool trackData)
Definition: RangeTracker.h:104