root/juggler/branches/2.2/modules/gadgeteer/gadget/Filter/Position/PositionXformFilter.h
| Revision 19729, 2.9 kB (checked in by patrick, 2 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | /*************** <auto-copyright.pl BEGIN do not edit this line> ************** |
| 2 | * |
| 3 | * VR Juggler is (C) Copyright 1998-2007 by Iowa State University |
| 4 | * |
| 5 | * Original Authors: |
| 6 | * Allen Bierbaum, Christopher Just, |
| 7 | * Patrick Hartling, Kevin Meinert, |
| 8 | * Carolina Cruz-Neira, Albert Baker |
| 9 | * |
| 10 | * This library is free software; you can redistribute it and/or |
| 11 | * modify it under the terms of the GNU Library General Public |
| 12 | * License as published by the Free Software Foundation; either |
| 13 | * version 2 of the License, or (at your option) any later version. |
| 14 | * |
| 15 | * This library is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 18 | * Library General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU Library General Public |
| 21 | * License along with this library; if not, write to the |
| 22 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 23 | * Boston, MA 02111-1307, USA. |
| 24 | * |
| 25 | *************** <auto-copyright.pl END do not edit this line> ***************/ |
| 26 | #ifndef _GADGET_POSITION_XFORM_FILTER_H_ |
| 27 | #define _GADGET_POSITION_XFORM_FILTER_H_ |
| 28 | |
| 29 | #include <gadget/gadgetConfig.h> |
| 30 | #include <typeinfo> |
| 31 | #include <vector> |
| 32 | |
| 33 | #include <jccl/Config/ConfigElementPtr.h> |
| 34 | #include <gadget/Filter/Position/PositionFilter.h> |
| 35 | #include <gadget/Type/PositionData.h> |
| 36 | |
| 37 | #include <gmtl/Matrix.h> |
| 38 | #include <vpr/Util/Debug.h> |
| 39 | |
| 40 | |
| 41 | namespace gadget |
| 42 | { |
| 43 | |
| 44 | /** \class PositionXformFilter PositionXformFilter.h gadget/Filter/Position/PositionXformFilter.h |
| 45 | * |
| 46 | * Position transformation filter. |
| 47 | */ |
| 48 | class GADGET_CLASS_API PositionXformFilter : public PositionFilter |
| 49 | { |
| 50 | public: |
| 51 | /** Constructor. */ |
| 52 | PositionXformFilter() |
| 53 | : mScaleValue(0.0f) |
| 54 | {;} |
| 55 | |
| 56 | /** Destructor. */ |
| 57 | virtual ~PositionXformFilter() |
| 58 | {;} |
| 59 | |
| 60 | /** |
| 61 | * Configuration for the filter. |
| 62 | * @return Returns truee if configured correctly. |
| 63 | */ |
| 64 | virtual bool config(jccl::ConfigElementPtr e); |
| 65 | |
| 66 | /** |
| 67 | * Applies the position filter to the given sample in place. |
| 68 | * @post posSample is updated with a modified version. |
| 69 | * @param posSample The sample to modify in place. |
| 70 | */ |
| 71 | virtual void apply(std::vector< PositionData >& posSample); |
| 72 | |
| 73 | static std::string getElementType(); |
| 74 | |
| 75 | protected: |
| 76 | /** |
| 77 | * Given Sensor position transform in sensor coordinate system: Sensor |
| 78 | * world - world coordindate system that the transformed sensor "ends up in" |
| 79 | * Sensor' - Modified sensor coordinate system. |
| 80 | * |
| 81 | * preXform is the transform from world to sensor (world_M_sensor). |
| 82 | * postXform is the transform from sensor to sensor' (sensor_M_newsensor). |
| 83 | * |
| 84 | * compute Sensor = preTrans*preRot*(Scale*Sensor)*postTrans*postRot |
| 85 | */ |
| 86 | gmtl::Matrix44f mPreXform; /**< pre transformation */ |
| 87 | gmtl::Matrix44f mPostXform; /**< post transformation */ |
| 88 | float mScaleValue; /**< The value to use for scaling */ |
| 89 | }; |
| 90 | |
| 91 | |
| 92 | } // End of gadget namespace |
| 93 | |
| 94 | #endif |
Note: See TracBrowser for help on using the browser.
