Beispiel #1
0
AudioClipNode *SceneGraph::findAudioClipNode(char *name) {
	if (!name || strlen(name) <= 0)
		return NULL;
	for (AudioClipNode *node = findAudioClipNode(); node; node = node->nextTraversal()) {
		const char *nodeName = node->getName();
		if (nodeName && strlen(nodeName)) {
			if (!strcmp(name, nodeName))
				return node;
		}
	}
	return NULL;
}
void SoundNode::outputContext(std::ostream &printStream, const char *indentString) const
{
	SFBool *spatialize = getSpatializeField();
	SFVec3f *direction = getDirectionField();
	SFVec3f *location = getLocationField();

	printStream << indentString << "\t" << "direction " << direction << std::endl;
	printStream << indentString << "\t" << "location " << location << std::endl;
	printStream << indentString << "\t" << "maxFront " << getMaxFront() << std::endl;
	printStream << indentString << "\t" << "minFront " << getMinFront() << std::endl;
	printStream << indentString << "\t" << "maxBack " << getMaxBack() << std::endl;
	printStream << indentString << "\t" << "minBack " << getMinBack() << std::endl;
	printStream << indentString << "\t" << "intensity " << getIntensity() << std::endl;
	printStream << indentString << "\t" << "priority " << getPriority() << std::endl;
	printStream << indentString << "\t" << "spatialize " << spatialize << std::endl;

	AudioClipNode *aclip = getAudioClipNodes();
	if (aclip != NULL) {
		if (aclip->isInstanceNode() == false) {
			if (aclip->getName() != NULL && strlen(aclip->getName()))
				printStream << indentString << "\t" << "source " << "DEF " << aclip->getName() << " AudioClip {" << std::endl;
			else
				printStream << indentString << "\t" << "source AudioClip {" << std::endl;
			aclip->Node::outputContext(printStream, indentString, "\t");
			printStream << indentString << "\t" << "}" << std::endl;
		}
		else 
			printStream << indentString << "\t" << "source USE " << aclip->getName() << std::endl;
	}

	MovieTextureNode *mtexture = getMovieTextureNodes();
	if (mtexture != NULL) {
		if (mtexture->isInstanceNode() == false) {
			if (mtexture->getName() != NULL && strlen(mtexture->getName()))
				printStream << indentString << "\t" << "source " << "DEF " << mtexture->getName() << " MovieTexture {" << std::endl;
			else
				printStream << indentString << "\t" << "source MovieTexture {" << std::endl;
			mtexture->Node::outputContext(printStream, indentString, "\t");
			printStream << indentString << "\t" << "}" << std::endl;
		}
		else 
			printStream << indentString << "\t" << "source USE " << mtexture->getName() << std::endl;
	}
}
Beispiel #3
0
void AddSFString(char *string)
{	
	switch (GetCurrentNodeType()) {
	case VRML_NODETYPE_ANCHOR_PARAMETER:
		{
			((AnchorNode *)GetCurrentNodeObject())->addParameter(string);
		}
		break;
	case VRML_NODETYPE_ANCHOR_URL:
		{
			((AnchorNode *)GetCurrentNodeObject())->addUrl(string);
		}
		break;
	case VRML_NODETYPE_INLINE_URL:
		{
			((InlineNode *)GetCurrentNodeObject())->addUrl(string);
		}
		break;
	case VRML_NODETYPE_AUDIOCLIP_URL:
		{
			AudioClipNode *aclip = (AudioClipNode *)GetCurrentNodeObject();
			aclip->addUrl(string);
		}
		break;
	case VRML_NODETYPE_BACKGROUND_BACKURL:
		{
			BackgroundNode *bg = (BackgroundNode *)GetCurrentNodeObject();
			bg->addBackUrl(string);
		}
		break;
	case VRML_NODETYPE_BACKGROUND_BOTTOMURL:
		{
			BackgroundNode *bg = (BackgroundNode *)GetCurrentNodeObject();
			bg->addBottomUrl(string);
		}
		break;
	case VRML_NODETYPE_BACKGROUND_FRONTURL:
		{
			BackgroundNode *bg = (BackgroundNode *)GetCurrentNodeObject();
			bg->addFrontUrl(string);
		}
		break;
	case VRML_NODETYPE_BACKGROUND_LEFTURL:
		{
			BackgroundNode *bg = (BackgroundNode *)GetCurrentNodeObject();
			bg->addLeftUrl(string);
		}
		break;
	case VRML_NODETYPE_BACKGROUND_RIGHTURL:
		{
			BackgroundNode *bg = (BackgroundNode *)GetCurrentNodeObject();
			bg->addRightUrl(string);
		}
		break;
	case VRML_NODETYPE_BACKGROUND_TOPURL:
		{
			BackgroundNode *bg = (BackgroundNode *)GetCurrentNodeObject();
			bg->addTopUrl(string);
		}
		break;
	case VRML_NODETYPE_FONTSTYLE_JUSTIFY:
		{
			FontStyleNode *fs = (FontStyleNode *)GetCurrentNodeObject();
			fs->addJustify(string);
		}
		break;
	case VRML_NODETYPE_IMAGETEXTURE_URL:
		{
			ImageTextureNode *image = (ImageTextureNode *)GetCurrentNodeObject();
			image->addUrl(string);
		}
		break;
	case VRML_NODETYPE_MOVIETEXTURE_URL:
		{
			MovieTextureNode *image = (MovieTextureNode *)GetCurrentNodeObject();
			image->addUrl(string);
		}
		break;
	case VRML_NODETYPE_NAVIGATIONINFO_TYPE:
		{
			NavigationInfoNode *navInfo = (NavigationInfoNode *)GetCurrentNodeObject();
			navInfo->addType(string);
		}
		break;
	case VRML_NODETYPE_SCRIPT_URL:
		{
			ScriptNode *script = (ScriptNode *)GetCurrentNodeObject();
			script->addUrl(string);
		}
		break;
	case VRML_NODETYPE_TEXT_STRING:
		{
			TextNode *text = (TextNode *)GetCurrentNodeObject();
			text->addString(string);
		}
		break;
	case VRML_NODETYPE_WORLDINFO_INFO:
		{
			WorldInfoNode *worldInfo = (WorldInfoNode *)GetCurrentNodeObject();
			worldInfo->addInfo(string);
		}
		break;
	}
}