00001 /*************** <auto-copyright.pl BEGIN do not edit this line> ************** 00002 * 00003 * VR Juggler is (C) Copyright 1998-2005 by Iowa State University 00004 * 00005 * Original Authors: 00006 * Allen Bierbaum, Christopher Just, 00007 * Patrick Hartling, Kevin Meinert, 00008 * Carolina Cruz-Neira, Albert Baker 00009 * 00010 * This library is free software; you can redistribute it and/or 00011 * modify it under the terms of the GNU Library General Public 00012 * License as published by the Free Software Foundation; either 00013 * version 2 of the License, or (at your option) any later version. 00014 * 00015 * This library is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * Library General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU Library General Public 00021 * License along with this library; if not, write to the 00022 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00023 * Boston, MA 02111-1307, USA. 00024 * 00025 * ----------------------------------------------------------------- 00026 * File: $RCSfile$ 00027 * Date modified: $Date: 2005-01-15 18:00:37 -0600 (Sat, 15 Jan 2005) $ 00028 * Version: $Revision: 16622 $ 00029 * ----------------------------------------------------------------- 00030 * 00031 *************** <auto-copyright.pl END do not edit this line> ***************/ 00032 00033 #ifndef _GADGET_ANALOG_DATA_H_ 00034 #define _GADGET_ANALOG_DATA_H_ 00035 00036 #include <gadget/Type/InputData.h> 00037 00038 namespace gadget 00039 { 00040 00045 class AnalogData : public InputData 00046 { 00047 // Hack around a GCC 3.3 bug on Mac OS X 10.3 that shows up with 00048 // boost::is_polymorphic. 00049 #if defined(__MACH__) && defined(__APPLE_CC__) && defined(__GNUC__) && \ 00050 __GNUC__ == 3 && __GNUC_MINOR__ == 3 00051 bool dummy_; 00052 #endif 00053 00054 public: 00056 AnalogData () 00057 : InputData() 00058 , mAnalogData(0.0f) 00059 { 00060 ; 00061 } 00062 00063 AnalogData(float f) 00064 : InputData() 00065 , mAnalogData(f) 00066 { 00067 ; 00068 } 00069 00070 float getAnalog() const 00071 { 00072 return mAnalogData; 00073 } 00074 00075 void setAnalog(const float f) 00076 { 00077 mAnalogData = f; 00078 } 00079 00080 AnalogData& operator= (const AnalogData& pd) 00081 { 00082 InputData::copy (pd); 00083 mAnalogData = pd.mAnalogData; 00084 return *this; 00085 } 00086 00087 AnalogData& operator= (const float f) 00088 { 00089 mAnalogData = f; 00090 return *this; 00091 } 00092 00093 bool operator== (const AnalogData& o) const 00094 { 00095 return mAnalogData == o.mAnalogData && mTimeStamp == o.mTimeStamp; 00096 } 00097 00098 bool operator!= (const AnalogData& o) const 00099 { 00100 return ! (*this == o); 00101 } 00102 00103 /* 00104 operator float() const 00105 { 00106 return mAnalogData; 00107 } 00108 */ 00109 00110 protected: 00111 float mAnalogData; 00112 }; // class AnalogData 00113 00114 } // namespace gadget 00115 00116 00117 #endif /* _GADGET_ANALOG_DATA_H_ */
1.5.1