XdkWrl: MFNode Class Reference

Home | Hierarchy | Members | Alphabetical | Related Pages

# MFNode Class Reference
[Field Types]

`#include <mfnode.h>`

Inherits deque.

List of all members.

## Static Public Member Functions
static const char * | typeName ()
static FieldTypeId | typeId ()
## Friends
std::ostream & | operator<< (std::ostream &s, const MFNode &f)

## Detailed Description

A MFNode is a container of SFNode. It is implemented using a STL's deque so you can benefit from its interface. Most common functionnalities you would use are:

       Transform* t = new Transform();
       // Transform has a field children of type MFNode
       Shape* s1 = new Shape();
       Shape* s2 = new Shape();
       t->children.push_back(SFNode(s1)); // push_back(s1); would fail since
       t->children.push_back(SFNode(s2)); // constructor SFNode(Node*) is explicit

       cout<<t->children[0]->typeName()<<endl; // echoes "Shape"

but since it uses STL principles, you have all useful concepts such as iterator, algorithms, etc...

Below is included the documentation for this field type from the ISO standard.

## 5.7 SFNode and MFNode

The SFNode field and event specifies a VRML node. The MFNode field and event specifies zero or more nodes. The following example illustrates valid syntax for an MFNode field, fooNode, defining four nodes:

        fooNode [ Transform { translation 1 0 0 }
                  DEF CUBE Box { }
                  USE CUBE
                  USE SOME_OTHER_NODE  ]

The SFNode field and event may contain the keyword NULL to indicate that it is empty.

The initial value of an SFNode eventOut is NULL. The initial value of an MFNode eventOut is [ ].

## Member Function Documentation

const char * typeName | ( |  | ) | `[inline, static]`

FieldTypeId typeId | ( |  | ) | `[inline, static]`

## Friends And Related Function Documentation

std::ostream& operator<< | ( | std::ostream & | s,
|  | const MFNode & | f |
| ) |  |  | `[friend]`

Generated on 5 Jan 2007 with version 1.5.1. |