コード例 #1
0
ファイル: QvNode.cpp プロジェクト: OpenParsec/openparsec
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;
}
コード例 #2
0
ファイル: gvscene.cpp プロジェクト: deepmatrix/blaxxun-cc3d
// 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);
}