Home | Hierarchy | Members | Alphabetical | Related Pages |
00001 #ifndef XDKWRL_MFNODE_H 00002 #define XDKWRL_MFNODE_H 00003 00004 #include <xdkwrl/config.h> 00005 #include <xdkwrl/fieldtypes/sfnode.h> 00006 #include <deque> 00007 #include <algorithm> 00008 #include <iterator> 00009 00010 namespace wrl 00011 { 00012 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00013 // Interface of MFNode 00014 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00015 /*! \ingroup fieldtypes 00016 * 00017 * A MFNode is a container of SFNode. It is implemented using a STL's 00018 * deque so you can benefit from its interface. Most common 00019 * functionnalities you would use are: 00020 \code 00021 Transform* t = new Transform(); 00022 // Transform has a field children of type MFNode 00023 Shape* s1 = new Shape(); 00024 Shape* s2 = new Shape(); 00025 t->children.push_back(SFNode(s1)); // push_back(s1); would fail since 00026 t->children.push_back(SFNode(s2)); // constructor SFNode(Node*) is explicit 00027 00028 cout<<t->children[0]->typeName()<<endl; // echoes "Shape" 00029 \endcode 00030 * but since it uses STL principles, you have all useful concepts such as 00031 * iterator, algorithms, etc... 00032 * 00033 * Below is included the documentation for this field type from the ISO 00034 * standard. 00035 * \htmlinclude sfnode.html 00036 */ 00037 class XDKWRL_EXPORT MFNode : public std::deque<SFNode> 00038 { 00039 public: 00040 static inline const char* typeName(); 00041 static inline FieldTypeId typeId(); 00042 friend std::ostream& operator<<(std::ostream& s,const MFNode& f); 00043 }; 00044 //************************************************************ 00045 // Implementation of MFNode 00046 //************************************************************ 00047 inline const char* 00048 MFNode::typeName() 00049 { 00050 return "MFNode"; 00051 } 00052 inline FieldTypeId 00053 MFNode::typeId() 00054 { 00055 return mfNode; 00056 } 00057 } 00058 00059 #endif // XDKWRL_MFNODE_H 00060 00061 // Local variables section. 00062 // This is only used by emacs! 00063 // Local Variables: 00064 // ff-search-directories: ("../../" "../../../src/xdkwrl/fieldtypes") 00065 // End:
Generated on 5 Jan 2007 with
![]() |
|