Пример #1
0
void AddSFInt32(int	value)
{	
    switch (GetPrevNodeType()) {
    case VRML_NODETYPE_INDEXEDFACESET:
		{
			IndexedFaceSetNode *idxFaceSet = (IndexedFaceSetNode *)GetCurrentNodeObject();
			switch (GetCurrentNodeType()) {
			case VRML_NODETYPE_COLOR_INDEX:
				idxFaceSet->addColorIndex(value); break;
			case VRML_NODETYPE_COORDINATE_INDEX:
				idxFaceSet->addCoordIndex(value); break;
			case VRML_NODETYPE_NORMAL_INDEX:
				idxFaceSet->addNormalIndex(value); break;
			case VRML_NODETYPE_TEXTURECOODINATE_INDEX:
				idxFaceSet->addTexCoordIndex(value); break;
			}
		}
	    break;
    case VRML_NODETYPE_INDEXEDLINESET:
		{
			IndexedLineSetNode *idxLineSet = (IndexedLineSetNode *)GetCurrentNodeObject();
			switch (GetCurrentNodeType()) {
			case VRML_NODETYPE_COLOR_INDEX:
				idxLineSet->addColorIndex(value); break;
			case VRML_NODETYPE_COORDINATE_INDEX:
				idxLineSet->addCoordIndex(value); break;
			}
		}		
		break;
    case VRML_NODETYPE_PIXELTEXTURE:
		{
			PixelTextureNode *pixTexture = (PixelTextureNode *)GetCurrentNodeObject();
			switch (GetCurrentNodeType()) {
			case VRML_NODETYPE_PIXELTEXTURE_IMAGE:
				pixTexture->addImage(value); break;
			}
		}	
		break;
    }

}
void CyberX3D::AddSFInt32(int	value)
{	
    switch (ParserGetParentNodeType()) {
    case VRML97_INDEXEDFACESET:
		{
			IndexedFaceSetNode *idxFaceSet = (IndexedFaceSetNode *)ParserGetCurrentNode();
			switch (ParserGetCurrentNodeType()) {
			case VRML97_COLOR_INDEX:
				idxFaceSet->addColorIndex(value); break;
			case VRML97_COORDINATE_INDEX:
				idxFaceSet->addCoordIndex(value); break;
			case VRML97_NORMAL_INDEX:
				idxFaceSet->addNormalIndex(value); break;
			case VRML97_TEXTURECOODINATE_INDEX:
				idxFaceSet->addTexCoordIndex(value); break;
			}
		}
	    break;
    case VRML97_INDEXEDLINESET:
		{
			IndexedLineSetNode *idxLineSet = (IndexedLineSetNode *)ParserGetCurrentNode();
			switch (ParserGetCurrentNodeType()) {
			case VRML97_COLOR_INDEX:
				idxLineSet->addColorIndex(value); break;
			case VRML97_COORDINATE_INDEX:
				idxLineSet->addCoordIndex(value); break;
			}
		}		
		break;
    case VRML97_PIXELTEXTURE:
		{
			PixelTextureNode *pixTexture = (PixelTextureNode *)ParserGetCurrentNode();
			switch (ParserGetCurrentNodeType()) {
			case VRML97_PIXELTEXTURE_IMAGE:
				pixTexture->addImage(value); break;
			}
		}	
		break;
    }

}