|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.web3d.vrml.renderer.CRProtoCreator
org.web3d.vrml.renderer.norender.NRProtoCreator
public class NRProtoCreator
A class that is used to create real instances of protos from their definitions for null renderer nodes.
The creator strips the definition apart and builds a runtime node based on the details and the node factory provided. The creator can handle one instance at a time, athough it will correctly parse and build nested proto declarations without extra effort.
We have a small conundrum to deal with - if the proto definition contains SF/MFNode fields, we don't know whether the values should be also generated as real runtime nodes too. Maybe the usage of this node will provide values that are dealt with after this class has finished. Other times, these defaul values must be used. For this implementation, we have gone with the safety-first approach: Always parse the definition of any SF or MFNode field and turn those into runtime instances. Although this may create extra garbage, there seems to be no nice way of dealing with this issue without a completely different architecture for the library.
Note: Under the current implementation, EXTERNPROTOs are not yet catered for.
| Field Summary |
|---|
| Fields inherited from class org.web3d.vrml.renderer.CRProtoCreator |
|---|
currentObserver, errorReporter, factory, importMap, isVRML97, majorVersion, minorVersion, nodeCopier, nodeMap, protoCopier, protoInstance, rootSpace, scene, stateManager, traverser, worldURL |
| Constructor Summary | |
|---|---|
NRProtoCreator(VRMLNodeFactory fac,
java.lang.String worldURL,
int major,
int minor)
The class constructor |
|
| Method Summary | |
|---|---|
VRMLNode |
newInstance(VRMLNodeTemplate template,
VRMLExecutionSpace root,
int major,
int minor,
boolean staticNode)
Build an instance of the node template from the given description. |
protected void |
protoNode(VRMLNodeType parent,
VRMLProtoInstance proto,
int field,
boolean used)
Notification of a proto instance. |
| Methods inherited from class org.web3d.vrml.renderer.CRProtoCreator |
|---|
fillinInstance, finishCreate, observedNode, setErrorReporter, setFrameStateManager, setProtoField |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NRProtoCreator(VRMLNodeFactory fac,
java.lang.String worldURL,
int major,
int minor)
fac - The factory to use (Must generate VRMLNodeType instances)worldURL - the current world's root URLmajor - The major version number of this sceneminor - The minor version number of this scene| Method Detail |
|---|
public VRMLNode newInstance(VRMLNodeTemplate template,
VRMLExecutionSpace root,
int major,
int minor,
boolean staticNode)
template - The source template to build nodes fromroot - The execution space this node belongs inmajor - The major version number of this sceneminor - The minor version number of this scenestaticNode - Whether this node is will be modified
protected void protoNode(VRMLNodeType parent,
VRMLProtoInstance proto,
int field,
boolean used)
protoNode in class CRProtoCreatorparent - The parent node of this nodeproto - The proto node that has been foundfield - The index of the child field in its parent nodeused - true if the node reference is actually a USE
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||