Home Hierarchy Members Alphabetical Related Pages

mfcolor.h

Go to the documentation of this file.
00001 #ifndef XDKWRL_MFCOLOR_H
00002 #define XDKWRL_MFCOLOR_H
00003 
00004 #include <xdkwrl/fieldtypes/sfcolor.h>
00005 #include <deque>
00006 #include <algorithm>
00007 #include <iterator>
00008 
00009 namespace wrl
00010 {
00011   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00012   // Interface of  MFColor
00013   //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00014   /*! \ingroup fieldtypes
00015    * 
00016    * A MFColor is a container of SFColor. 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    MFColor mf;
00021    mf.push_back(SFColor(1.0f,0.0f,0.0f));  // Red
00022    mf.push_front(SFColor(0.0f,1.0f,0.0f)); // Green
00023    mf[0].setRGB(0.0f,0.0f,1.0f);           // Blue
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 sfcolor.html
00031    */
00032   class MFColor : public std::deque<SFColor>
00033   {
00034   public:
00035     static inline const char* typeName();
00036     static inline FieldTypeId typeId();
00037     friend std::ostream& operator<<(std::ostream& s,const MFColor& f);
00038   };
00039   //************************************************************
00040   // Implementation of MFColor
00041   //************************************************************
00042   inline const char*
00043   MFColor::typeName()
00044   {
00045     return "MFColor";
00046   }
00047   inline FieldTypeId
00048   MFColor::typeId()
00049   {
00050     return mfColor;
00051   }
00052   inline std::ostream& operator<<(std::ostream& s,const MFColor& f)
00053   {
00054     s<<'[';
00055     std::copy(f.begin(),f.end(),std::ostream_iterator<SFColor>(s," "));
00056     return s<<']';
00057   }  
00058 };
00059 
00060 #endif // XDKWRL_MFCOLOR_H

Generated on 24 Feb 2005 with doxygen version 1.3.9.1. Valid HTML 4.0! Valid CSS!