Home | Hierarchy | Members | Alphabetical | Related Pages |
00001 #ifndef XDKWRL_SFFLOAT_H 00002 #define XDKWRL_SFFLOAT_H 00003 00004 #include <xdkwrl/fieldtypes.h> 00005 #include <iostream> 00006 00007 namespace wrl 00008 { 00009 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00010 // Interface of SFFloat 00011 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00012 /*! \ingroup fieldtypes 00013 * 00014 * Represents a float value. Below is included the documentation for this 00015 * field type from the ISO standard. 00016 * \htmlinclude sffloat.html 00017 */ 00018 class SFFloat 00019 { 00020 public: 00021 inline SFFloat(); 00022 inline SFFloat(const float b); 00023 inline SFFloat& operator=(const float b); 00024 inline SFFloat& operator=(const SFFloat b); 00025 inline operator float() const; 00026 inline float operator==(const SFFloat& b); 00027 static inline const char* typeName(); 00028 static inline FieldTypeId typeId(); 00029 friend std::ostream& operator<<(std::ostream& s,const SFFloat& f); 00030 protected: 00031 private: 00032 float value_; 00033 }; 00034 //************************************************************ 00035 // Implementation of SFFloat 00036 //************************************************************ 00037 /*! 00038 * Creates a SFFloat with default value 0.0f. 00039 */ 00040 inline 00041 SFFloat::SFFloat() 00042 : value_(0.0f) 00043 { 00044 } 00045 /*! 00046 * Creates a SFFloat with value \p b. 00047 */ 00048 inline 00049 SFFloat::SFFloat(const float b) 00050 : value_(b) 00051 { 00052 } 00053 inline SFFloat& 00054 SFFloat::operator=(const float b) 00055 { 00056 value_ = b; 00057 return *this; 00058 } 00059 inline SFFloat& 00060 SFFloat::operator=(const SFFloat b) 00061 { 00062 value_ = b.value_; 00063 return *this; 00064 } 00065 inline 00066 SFFloat::operator float() const 00067 { 00068 return value_; 00069 } 00070 inline float 00071 SFFloat::operator==(const SFFloat& b) 00072 { 00073 return value_ == b.value_; 00074 } 00075 inline const char* 00076 SFFloat::typeName() 00077 { 00078 return "SFFloat"; 00079 } 00080 inline FieldTypeId 00081 SFFloat::typeId() 00082 { 00083 return sfFloat; 00084 } 00085 inline std::ostream& operator<<(std::ostream& s,const SFFloat& f) 00086 { 00087 return s<<f.value_; 00088 } 00089 }; 00090 00091 #endif // XDKWRL_SFFLOAT_H
Generated on 28 Jun 2006 with
![]() |
|