- Main Page
- Classes
- Files

- Search for |

# VecFilter.h

Go to the documentation of this file.

    00001 /*****************************
    00002 File:      VecFilter.h
    00003 Language:   C++ (header)
    00004 Project:    H3DNetworkingUtils
    00005 The contents of this file are subject to the Mozilla Public License
    00006 Version 1.1 (the "License"); you may not use this file except in
    00007 compliance with the License. You may obtain a copy of the License at
    00008 http://www.mozilla.org/MPL/
    00009
    00010 Software distributed under the License is distributed on an "AS IS"
    00011 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    00012 License for the specific language governing rights and limitations
    00013 under the License.
    00014
    00015 The Original Code is H3DNetworkingUtils v1.0.
    00016
    00017 The Initial Developer of the Original Code is CSIRO.
    00018 Portions created by the Initial Developer are Copyright (C) 1009 CSIRO. All Rights Reserved.
    00019 Contributor(s):
    00020     Chris Gunn  <Chris.Gunn@csiro.au> <ChrisJGunn@gmail.com>
    00021 ***************************/
    00022
    00025
    00026 #ifndef VecFilter_H
    00027 #define VecFilter_H
    00028
    00029 #include "H3DNetworkingUtils/Config.h"
    00030 #include <deque>
    00031 #include <H3DUtil/H3DMath.h>
    00032 #include <H3DUtil/Vec3f.h>
    00033
    00034
    00035 namespace H3DNetworkingUtils {
    00036
    00042
    00043 class H3D_NETWORKING_UTILS_DLL_SPEC VecFilter {
    00044 public:
    00046   VecFilter(int sample_sz);
    00047
    00052   H3DUtil::ArithmeticTypes::Vec3f filter(H3DUtil::ArithmeticTypes::Vec3f const & raw_value, double time);
    00053
    00055   virtual void resetValue(int sample_sz);
    00056
    00058   int sampleSize() const { return sample_size;}
    00059
    00060 private:
    00061   std::deque<H3DUtil::ArithmeticTypes::Vec3f> sample_vals;
    00062   std::deque<double> sample_times;
    00063   int sample_size; // This number of values to average over.
    00064   int num_samples;
    00065   bool filling_samples;
    00066 };
    00067
    00068 }
    00069
    00070 #endif