QvNode * QvNode::createInstance(QvInput *in, const QvName &className) { QvNode *instance; QvString unknownString; instance = createInstanceFromName(className); if (instance == NULL) { if (! in->read(unknownString) || unknownString != "fields") { QvReadError::post(in, "Unknown class \"%s\"", className.getString()); return NULL; } else if (unknownString == "fields") { QvUnknownNode *tmpNode = new QvUnknownNode; tmpNode->setClassName(className.getString()); instance = tmpNode; in->putBack(unknownString.getString()); } } return instance; }
// create a NodeInstace given classname and using protos classes GvNode* GvScene:: createNodeInstance(const GvName &className) { GvNode* instance; // is there a proto defined for this name ? instance = createProtoInstance(className); if (instance) return(instance); instance = createInstanceFromName(className,isVrml2()); if (instance) instance->setBrowser(getBrowser()); return(instance); }