openvrml::scope Class Reference
Inherited by openvrml::Vrml97RootScope.
List of all members.
Detailed Description
The
scope class keeps track of defined nodes and prototypes.
PROTO definitions add node types to the namespace. PROTO implementations are a separate node type namespace, and require that any nested PROTOs NOT be available outside the PROTO implementation. PROTOs defined outside the current namespace are available.
Constructor & Destructor Documentation
openvrml::scope::~scope |
( |
|
) |
[virtual] |
Member Function Documentation
const std::string & openvrml::scope::id |
( |
|
) |
const throw () |
const boost::shared_ptr< scope > & openvrml::scope::parent |
( |
|
) |
const throw () |
bool openvrml::scope::add_type |
( |
const node_type_ptr & |
type |
) |
throw (std::bad_alloc) |
Add a node type.
Print an error message if the argument type is already defined.
- Parameters:
-
- Returns:
true
if type
is successfully added to the scope; false
otherwise (if a node_type with the same id is already defined for the scope).
- Exceptions:
-
| std::bad_alloc | if memory allocation fails. |
- Precondition:
type
is not null.
const node_type_ptr & openvrml::scope::find_type |
( |
const std::string & |
id |
) |
const |
Find a node type, given a type name. Returns 0 if type is not defined.
The first type in the scope.
- Returns:
- the first node_type in the scope, or a null node_type_ptr if the scope has no node_types.
node * openvrml::scope::find_node |
( |
const std::string & |
id |
) |
const |
Friends And Related Function Documentation
openvrml::scope::node [friend] |
node identifiers are stored in the scope, so node needs special privilege to access them.
Member Data Documentation
scope
identifier.
For internal use only.
The parent scope; null if the scope is a root scope.
For internal use only.