Home | Hierarchy | Members | Alphabetical | Related Pages |
00001 #ifndef XDKWRL_MFFLOAT_H 00002 #define XDKWRL_MFFLOAT_H 00003 00004 #include <xdkwrl/fieldtypes/sffloat.h> 00005 #include <deque> 00006 #include <algorithm> 00007 #include <iterator> 00008 00009 namespace wrl 00010 { 00011 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00012 // Interface of MFFloat 00013 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00014 /*! \ingroup fieldtypes 00015 * 00016 * A MFFloat is a container of SFFloat. It is implemented using a STL's 00017 * deque so you can benefit from its interface. Most common 00018 * functionnalities you would use are: 00019 \code 00020 MFFloat mf; 00021 mf.push_back(SFFloat(1.0f)); // push_back (1.0f); would fail since 00022 mf.push_front(SFFloat(2.0f)); // constructor SFFloat(float) is explicit 00023 mf[0] = 3.0f; // Valid since SFFloat has operator=(float) 00024 \endcode 00025 * but since it uses STL principles, you have all useful concepts such as 00026 * iterator, algorithms, etc... 00027 * 00028 * Below is included the documentation for this field type from the ISO 00029 * standard. 00030 * \htmlinclude sffloat.html 00031 */ 00032 class MFFloat : public std::deque<SFFloat> 00033 { 00034 public: 00035 static inline const char* typeName(); 00036 static inline FieldTypeId typeId(); 00037 friend std::ostream& operator<<(std::ostream& s,const MFFloat& f); 00038 }; 00039 //************************************************************ 00040 // Implementation of MFFloat 00041 //************************************************************ 00042 inline const char* 00043 MFFloat::typeName() 00044 { 00045 return "MFFloat"; 00046 } 00047 inline FieldTypeId 00048 MFFloat::typeId() 00049 { 00050 return mfFloat; 00051 } 00052 inline std::ostream& operator<<(std::ostream& s,const MFFloat& f) 00053 { 00054 s<<'['; 00055 std::copy(f.begin(),f.end(),std::ostream_iterator<SFFloat>(s," ")); 00056 return s<<']'; 00057 } 00058 } 00059 00060 #endif // XDKWRL_MFFLOAT_H
Generated on 24 Feb 2005 with version 1.3.9.1. |