internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="groundAngle") GroundAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="groundColor") GroundColor.AddRange(parser.ParseSFColorOrMFColorValue());
			else if(id=="backUrl") BackUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="bottomUrl") BottomUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="frontUrl") FrontUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="leftUrl") LeftUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="rightUrl") RightUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="topUrl") TopUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="skyAngle") SkyAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="skyColor")
			{
				if(wasSkyColor) SkyColor.AddRange(parser.ParseSFColorOrMFColorValue());
				else SkyColor=parser.ParseSFColorOrMFColorValue();
				wasSkyColor=true;
			}
			else if(id=="transparency")
			{
				// since X3D Node Spec and VRML Classic Coding Spec disagree on the fieldType
				List<double> values=parser.ParseSFFloatOrMFFloatValue();
				if(values.Count!=0) Transparency=values[0];
			}
			else return false;
			return true;
		}
Example #2
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "color")
     {
         Color.AddRange(parser.ParseSFColorOrMFColorValue());
     }
     else
     {
         return(false);
     }
     return(true);
 }
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "key")
     {
         Key.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     else if (id == "keyValue")
     {
         KeyValue.AddRange(parser.ParseSFColorOrMFColorValue());
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="color") Color.AddRange(parser.ParseSFColorOrMFColorValue());
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "groundAngle")
     {
         GroundAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     else if (id == "groundColor")
     {
         GroundColor.AddRange(parser.ParseSFColorOrMFColorValue());
     }
     else if (id == "backUrl")
     {
         BackUrl.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "bottomUrl")
     {
         BottomUrl.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "frontUrl")
     {
         FrontUrl.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "leftUrl")
     {
         LeftUrl.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "rightUrl")
     {
         RightUrl.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "topUrl")
     {
         TopUrl.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "skyAngle")
     {
         SkyAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     else if (id == "skyColor")
     {
         if (wasSkyColor)
         {
             SkyColor.AddRange(parser.ParseSFColorOrMFColorValue());
         }
         else
         {
             SkyColor = parser.ParseSFColorOrMFColorValue();
         }
         wasSkyColor = true;
     }
     else if (id == "transparency")
     {
         // since X3D Node Spec and VRML Classic Coding Spec disagree on the fieldType
         List <double> values = parser.ParseSFFloatOrMFFloatValue();
         if (values.Count != 0)
         {
             Transparency = values[0];
         }
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="groundAngle") GroundAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="groundColor") GroundColor.AddRange(parser.ParseSFColorOrMFColorValue());
			else if(id=="backTexture")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					BackTexture=node as X3DTextureNode;
					if(BackTexture==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="bottomTexture")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					BottomTexture=node as X3DTextureNode;
					if(BottomTexture==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="frontTexture")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					FrontTexture=node as X3DTextureNode;
					if(FrontTexture==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="leftTexture")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					LeftTexture=node as X3DTextureNode;
					if(LeftTexture==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="rightTexture")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					RightTexture=node as X3DTextureNode;
					if(RightTexture==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="topTexture")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TopTexture=node as X3DTextureNode;
					if(TopTexture==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="skyAngle") SkyAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="skyColor")
			{
				if(wasSkyColor) SkyColor.AddRange(parser.ParseSFColorOrMFColorValue());
				else SkyColor=parser.ParseSFColorOrMFColorValue();
				wasSkyColor=true;
			}
			else if(id=="transparency")
			{
				// since X3D Node Spec and VRML Classic Coding Spec disagree on the fieldType
				List<double> values=parser.ParseSFFloatOrMFFloatValue();
				if(values.Count!=0) Transparency=values[0];
			}
			else return false;
			return true;
		}
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "groundAngle")
            {
                GroundAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "groundColor")
            {
                GroundColor.AddRange(parser.ParseSFColorOrMFColorValue());
            }
            else if (id == "backTexture")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    BackTexture = node as X3DTextureNode;
                    if (BackTexture == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "bottomTexture")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    BottomTexture = node as X3DTextureNode;
                    if (BottomTexture == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "frontTexture")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    FrontTexture = node as X3DTextureNode;
                    if (FrontTexture == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "leftTexture")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    LeftTexture = node as X3DTextureNode;
                    if (LeftTexture == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "rightTexture")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    RightTexture = node as X3DTextureNode;
                    if (RightTexture == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "topTexture")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TopTexture = node as X3DTextureNode;
                    if (TopTexture == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "skyAngle")
            {
                SkyAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "skyColor")
            {
                if (wasSkyColor)
                {
                    SkyColor.AddRange(parser.ParseSFColorOrMFColorValue());
                }
                else
                {
                    SkyColor = parser.ParseSFColorOrMFColorValue();
                }
                wasSkyColor = true;
            }
            else if (id == "transparency")
            {
                // since X3D Node Spec and VRML Classic Coding Spec disagree on the fieldType
                List <double> values = parser.ParseSFFloatOrMFFloatValue();
                if (values.Count != 0)
                {
                    Transparency = values[0];
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }