internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "geoCoords")
     {
         GeoCoords = parser.ParseSFVec3fStringValue();
     }
     else if (id == "geoSystem")
     {
         if (wasGeoSystem)
         {
             GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             GeoSystem = parser.ParseSFStringOrMFStringValue();
         }
         wasGeoSystem = true;
     }
     else if (id == "rotateYUp")
     {
         RotateYUp = parser.ParseBoolValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="geoCenter") GeoCenter=parser.ParseSFVec3fValue();
			else if(id=="size") Size=parser.ParseSFVec3fValue();
			else if(id=="geoOrigin")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					GeoOrigin=node as IX3DGeoOriginNode;
					if(GeoOrigin==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="geoSystem")
			{
				if(wasGeoSystem) GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
				else GeoSystem=parser.ParseSFStringOrMFStringValue();
				wasGeoSystem=true;
			}
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="anchorPoint") AnchorPoint=parser.ParseSFVec3fValue();
			else if(id=="body1")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body1=node as IX3DRigidBodyNode;
					if(Body1==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="body2")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body2=node as IX3DRigidBodyNode;
					if(Body2==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="forceOutput"||id=="mustOutput")
			{
				if(wasForceOutput) ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
				else ForceOutput=parser.ParseSFStringOrMFStringValue();
				wasForceOutput=true;
			}
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="children")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DChildNode child=node as X3DChildNode;
					if(child==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Children.Add(child);
				}
			}
			else if(id=="objectType")
			{
				if(wasObjectType) ObjectType.AddRange(parser.ParseSFStringOrMFStringValue());
				else ObjectType=parser.ParseSFStringOrMFStringValue();
				wasObjectType=true;
			}
			else if(id=="pickable") Pickable=parser.ParseBoolValue();
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="children")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DChildNode child=node as X3DChildNode;
					if(child==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Children.Add(child);
				}
			}
			else if(id=="geoCoords") GeoCoords=parser.ParseSFVec3fStringValue();
			else if(id=="geoOrigin")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					GeoOrigin=node as IX3DGeoOriginNode;
					if(GeoOrigin==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="geoSystem")
			{
				if(wasGeoSystem) GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
				else GeoSystem=parser.ParseSFStringOrMFStringValue();
				wasGeoSystem=true;
			}
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="objectType")
			{
				if(wasObjectType) ObjectType.AddRange(parser.ParseSFStringOrMFStringValue());
				else ObjectType=parser.ParseSFStringOrMFStringValue();
				wasObjectType=true;
			}
			else if(id=="pickingGeometry")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					PickingGeometry=node as IX3DLinePickSensorPickingGeometry;
					if(PickingGeometry==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="pickTarget")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DPickSensorNodePickTarget pt=node as IX3DPickSensorNodePickTarget;
					if(pt==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else PickTarget.Add(pt);
				}
			}
			else if(id=="intersectionType") IntersectionType=parser.ParseStringValue();
			else if(id=="sortOrder") SortOrder=parser.ParseStringValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "align")
     {
         Align = parser.ParseSFStringOrMFStringValue();
     }
     else if (id == "offset")
     {
         Offset = parser.ParseSFFloatOrMFFloatValue();
     }
     else if (id == "offsetUnits")
     {
         OffsetUnits = parser.ParseSFStringOrMFStringValue();
     }
     else if (id == "scaleMode")
     {
         ScaleMode = parser.ParseSFStringOrMFStringValue();
     }
     else if (id == "size")
     {
         Size = parser.ParseSFFloatOrMFFloatValue();
     }
     else if (id == "sizeUnits")
     {
         SizeUnits = parser.ParseSFStringOrMFStringValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 8
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "family")
     {
         if (wasFamily)
         {
             Family.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             Family = parser.ParseSFStringOrMFStringValue();
         }
         wasFamily = true;
     }
     else if (id == "horizontal")
     {
         Horizontal = parser.ParseBoolValue();
     }
     else if (id == "justify")
     {
         if (wasJustify)
         {
             Justify.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             Justify = parser.ParseSFStringOrMFStringValue();
         }
         wasJustify = true;
     }
     else if (id == "language")
     {
         Language = parser.ParseStringValue();
     }
     else if (id == "leftToRight")
     {
         LeftToRight = parser.ParseBoolValue();
     }
     else if (id == "pointSize")
     {
         PointSize = parser.ParseDoubleValue();
     }
     else if (id == "spacing")
     {
         Spacing = parser.ParseDoubleValue();
     }
     else if (id == "style")
     {
         Style = parser.ParseStringValue();
     }
     else if (id == "topToBottom")
     {
         TopToBottom = parser.ParseBoolValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "avatarSize")
     {
         if (wasAvatarSize)
         {
             AvatarSize.AddRange(parser.ParseSFFloatOrMFFloatValue());
         }
         else
         {
             AvatarSize = parser.ParseSFFloatOrMFFloatValue();
         }
         wasAvatarSize = true;
     }
     else if (id == "headlight")
     {
         Headlight = parser.ParseBoolValue();
     }
     else if (id == "speed")
     {
         Speed = parser.ParseDoubleValue();
     }
     else if (id == "transitionTime")
     {
         TransitionTime = parser.ParseDoubleValue();
     }
     else if (id == "transitionType")
     {
         if (wasTransitionType)
         {
             TransitionType.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             TransitionType = parser.ParseSFStringOrMFStringValue();
         }
         wasTransitionType = true;
     }
     else if (id == "type")
     {
         if (wasType)
         {
             Type.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             Type = parser.ParseSFStringOrMFStringValue();
         }
         wasType = true;
     }
     else if (id == "visibilityLimit")
     {
         VisibilityLimit = parser.ParseDoubleValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="data") Data.AddRange(parser.ParseSFNodeOrMFNodeValue());
			else if(id=="summary") Summary.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else return false;
			return true;
		}
Exemplo n.º 11
0
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="align") Align=parser.ParseSFStringOrMFStringValue();
			else if(id=="offset") Offset=parser.ParseSFFloatOrMFFloatValue();
			else if(id=="offsetUnits") OffsetUnits=parser.ParseSFStringOrMFStringValue();
			else if(id=="scaleMode") ScaleMode=parser.ParseSFStringOrMFStringValue();
			else if(id=="size") Size=parser.ParseSFFloatOrMFFloatValue();
			else if(id=="sizeUnits") SizeUnits=parser.ParseSFStringOrMFStringValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="geoCoords") GeoCoords=parser.ParseSFVec3fStringValue();
			else if(id=="geoSystem")
			{
				if(wasGeoSystem) GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
				else GeoSystem=parser.ParseSFStringOrMFStringValue();
				wasGeoSystem=true;
			}
			else if(id=="rotateYUp") RotateYUp=parser.ParseBoolValue();
			else return false;
			return true;
		}
Exemplo n.º 13
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "anchorPoint")
            {
                AnchorPoint = parser.ParseSFVec3fValue();
            }
            else if (id == "body1")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body1 = node as IX3DRigidBodyNode;
                    if (Body1 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "body2")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body2 = node as IX3DRigidBodyNode;
                    if (Body2 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "forceOutput" || id == "mustOutput")
            {
                if (wasForceOutput)
                {
                    ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    ForceOutput = parser.ParseSFStringOrMFStringValue();
                }
                wasForceOutput = true;
            }
            else
            {
                return(false);
            }
            return(true);
        }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "children")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DChildNode child = node as X3DChildNode;
                    if (child == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Children.Add(child);
                    }
                }
            }
            else if (id == "objectType")
            {
                if (wasObjectType)
                {
                    ObjectType.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    ObjectType = parser.ParseSFStringOrMFStringValue();
                }
                wasObjectType = true;
            }
            else if (id == "pickable")
            {
                Pickable = parser.ParseBoolValue();
            }
            else if (id == "bboxCenter")
            {
                BBoxCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "bboxSize")
            {
                BBoxSize = parser.ParseSFVec3fValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="info") Info.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="title") Title=parser.ParseStringValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "description")
     {
         Description = parser.ParseStringValue();
     }
     else if (id == "loop")
     {
         Loop = parser.ParseBoolValue();
     }
     else if (id == "pitch")
     {
         Pitch = parser.ParseDoubleValue();
     }
     else if (id == "startTime")
     {
         StartTime = parser.ParseDoubleValue();
     }
     else if (id == "stopTime")
     {
         StopTime = parser.ParseDoubleValue();
     }
     else if (id == "url")
     {
         URL.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="description") Description=parser.ParseStringValue();
			else if(id=="loop") Loop=parser.ParseBoolValue();
			else if(id=="pauseTime") PauseTime=parser.ParseDoubleValue();
			else if(id=="resumeTime") ResumeTime=parser.ParseDoubleValue();
			else if(id=="speed"||id=="pitch") Pitch=parser.ParseDoubleValue();
			else if(id=="startTime") StartTime=parser.ParseDoubleValue();
			else if(id=="stopTime") StopTime=parser.ParseDoubleValue();
			else if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="repeatS") RepeatS=parser.ParseBoolValue();
			else if(id=="repeatT") RepeatT=parser.ParseBoolValue();
			else if(id=="textureProperties")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TextureProperties=node as IX3DTexturePropertiesNode;
					if(TextureProperties==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else return false;
			return true;
		}
Exemplo n.º 18
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "url")
            {
                URL.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "repeatS")
            {
                RepeatS = parser.ParseBoolValue();
            }
            else if (id == "repeatT")
            {
                RepeatT = parser.ParseBoolValue();
            }
            else if (id == "textureProperties")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TextureProperties = node as IX3DTexturePropertiesNode;
                    if (TextureProperties == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="type") Type=parser.ParseStringValue();
			else return false;
			return true;
		}
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "alpha")
            {
                Alpha = parser.ParseDoubleValue();
            }
            else if (id == "color")
            {
                Color = parser.ParseSFColorValue();
            }
            else if (id == "function")
            {
                Function = parser.ParseSFStringOrMFStringValue();
            }
            else if (id == "mode")
            {
                Mode = parser.ParseSFStringOrMFStringValue();
            }
            else if (id == "source")
            {
                Source = parser.ParseSFStringOrMFStringValue();
            }
            else if (id == "texture")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DTextureNode tn = node as X3DTextureNode;
                    if (tn == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Texture.Add(tn);
                    }
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 21
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "geoCenter")
            {
                GeoCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "size")
            {
                Size = parser.ParseSFVec3fValue();
            }
            else if (id == "geoOrigin")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    GeoOrigin = node as IX3DGeoOriginNode;
                    if (GeoOrigin == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "geoSystem")
            {
                if (wasGeoSystem)
                {
                    GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    GeoSystem = parser.ParseSFStringOrMFStringValue();
                }
                wasGeoSystem = true;
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="name") Name=parser.ParseStringValue();
			else if(id=="reference") Reference=parser.ParseStringValue();
			else if(id=="value") Value.AddRange(parser.ParseSFStringOrMFStringValue());
			else return false;
			return true;
		}
Exemplo n.º 23
0
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="directOutput") DirectOutput=parser.ParseBoolValue();
			else if(id=="mustEvaluate") MustEvaluate=parser.ParseBoolValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="anchorPoint") AnchorPoint=parser.ParseSFVec3fValue();
			else if(id=="axis1") Axis1=parser.ParseSFVec3fValue();
			else if(id=="axis2") Axis2=parser.ParseSFVec3fValue();
			else if(id=="body1")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body1=node as IX3DRigidBodyNode;
					if(Body1==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="body2")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body2=node as IX3DRigidBodyNode;
					if(Body2==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="desiredAngularVelocity1") DesiredAngularVelocity1=parser.ParseDoubleValue();
			else if(id=="desiredAngularVelocity2") DesiredAngularVelocity2=parser.ParseDoubleValue();
			else if(id=="forceOutput"||id=="mustOutput")
			{
				if(wasForceOutput) ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
				else ForceOutput=parser.ParseSFStringOrMFStringValue();
				wasForceOutput=true;
			}
			else if(id=="maxAngle1") MaxAngle1=parser.ParseDoubleValue();
			else if(id=="maxTorque1") MaxTorque1=parser.ParseDoubleValue();
			else if(id=="maxTorque2") MaxTorque2=parser.ParseDoubleValue();
			else if(id=="minAngle1") MinAngle1=parser.ParseDoubleValue();
			else if(id=="stopBounce1") StopBounce1=parser.ParseDoubleValue();
			else if(id=="stopConstantForceMix1") StopConstantForceMix1=parser.ParseDoubleValue();
			else if(id=="stopErrorCorrection1") StopErrorCorrection1=parser.ParseDoubleValue();
			else if(id=="suspensionErrorCorrection") SuspensionErrorCorrection=parser.ParseDoubleValue();
			else if(id=="suspensionForce") SuspensionForce=parser.ParseDoubleValue();
			else return false;
			return true;
		}
Exemplo n.º 25
0
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="load") Load=parser.ParseBoolValue();
			else if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="description") Description=parser.ParseStringValue();
			else if(id=="loop") Loop=parser.ParseBoolValue();
			else if(id=="pitch") Pitch=parser.ParseDoubleValue();
			else if(id=="startTime") StartTime=parser.ParseDoubleValue();
			else if(id=="stopTime") StopTime=parser.ParseDoubleValue();
			else if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else return false;
			return true;
		}
Exemplo n.º 27
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "data")
     {
         Data.AddRange(parser.ParseSFNodeOrMFNodeValue());
     }
     else if (id == "summary")
     {
         Summary.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "url")
     {
         URL.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     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)
		{
			if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="category") Category=parser.ParseIntValue();
			else if(id=="country") Country=parser.ParseIntValue();
			else if(id=="domain") Domain=parser.ParseIntValue();
			else if(id=="extra") Extra=parser.ParseIntValue();
			else if(id=="kind") Kind=parser.ParseIntValue();
			else if(id=="specific") Specific=parser.ParseIntValue();
			else if(id=="subcategory") Subcategory=parser.ParseIntValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="axis") Axis=parser.ParseSFVec3fValue();
			else if(id=="body1")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body1=node as IX3DRigidBodyNode;
					if(Body1==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="body2")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body2=node as IX3DRigidBodyNode;
					if(Body2==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="forceOutput"||id=="mustOutput")
			{
				if(wasForceOutput) ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
				else ForceOutput=parser.ParseSFStringOrMFStringValue();
				wasForceOutput=true;
			}
			else if(id=="maxSeparation") MaxSeparation=parser.ParseDoubleValue();
			else if(id=="minSeparation") MinSeparation=parser.ParseDoubleValue();
			else if(id=="sliderForce") SliderForce=parser.ParseDoubleValue();
			else if(id=="stopBounce") StopBounce=parser.ParseDoubleValue();
			else if(id=="stopErrorCorrection") StopErrorCorrection=parser.ParseDoubleValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="family")
			{
				if(wasFamily) Family.AddRange(parser.ParseSFStringOrMFStringValue());
				else Family=parser.ParseSFStringOrMFStringValue();
				wasFamily=true;
			}
			else if(id=="horizontal") Horizontal=parser.ParseBoolValue();
			else if(id=="justify")
			{
				if(wasJustify) Justify.AddRange(parser.ParseSFStringOrMFStringValue());
				else Justify=parser.ParseSFStringOrMFStringValue();
				wasJustify=true;
			}
			else if(id=="language") Language=parser.ParseStringValue();
			else if(id=="leftToRight") LeftToRight=parser.ParseBoolValue();
			else if(id=="size") Size=parser.ParseDoubleValue();
			else if(id=="spacing") Spacing=parser.ParseDoubleValue();
			else if(id=="style") Style=parser.ParseStringValue();
			else if(id=="topToBottom") TopToBottom=parser.ParseBoolValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "url")
     {
         URL = parser.ParseSFStringOrMFStringValue();
     }
     else if (id == "type")
     {
         Type = parser.ParseStringValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "info")
     {
         Info.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "title")
     {
         Title = parser.ParseStringValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 34
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "url")
     {
         URL.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "language")
     {
         Language = parser.ParseStringValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="url") URL=parser.ParseSFStringOrMFStringValue();
			else if(id=="textureProperties")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TextureProperties=node as IX3DTexturePropertiesNode;
					if(TextureProperties==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "url")
     {
         URL.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "directOutput")
     {
         DirectOutput = parser.ParseBoolValue();
     }
     else if (id == "mustEvaluate")
     {
         MustEvaluate = parser.ParseBoolValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "name")
     {
         Name = parser.ParseStringValue();
     }
     else if (id == "reference")
     {
         Reference = parser.ParseStringValue();
     }
     else if (id == "value")
     {
         Value.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 38
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "url")
     {
         URL.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "category")
     {
         Category = parser.ParseIntValue();
     }
     else if (id == "country")
     {
         Country = parser.ParseIntValue();
     }
     else if (id == "domain")
     {
         Domain = parser.ParseIntValue();
     }
     else if (id == "extra")
     {
         Extra = parser.ParseIntValue();
     }
     else if (id == "kind")
     {
         Kind = parser.ParseIntValue();
     }
     else if (id == "specific")
     {
         Specific = parser.ParseIntValue();
     }
     else if (id == "subcategory")
     {
         Subcategory = parser.ParseIntValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 39
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "fontStyle")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    FontStyle = node as X3DFontStyleNode;
                    if (FontStyle == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "length")
            {
                Length.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "maxExtent")
            {
                MaxExtent = parser.ParseDoubleValue();
            }
            else if (id == "string")
            {
                String.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "solid")
            {
                Solid = parser.ParseBoolValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 40
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "load")
     {
         Load = parser.ParseBoolValue();
     }
     else if (id == "url")
     {
         URL.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else if (id == "bboxCenter")
     {
         BBoxCenter = parser.ParseSFVec3fValue();
     }
     else if (id == "bboxSize")
     {
         BBoxSize = parser.ParseSFVec3fValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "center")
            {
                Center = parser.ParseSFVec3fStringValue();
            }
            else if (id == "child1Url")
            {
                Child1URL.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "child2Url")
            {
                Child2URL.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "child3Url")
            {
                Child3URL.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "child4Url")
            {
                Child4URL.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "geoOrigin")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    GeoOrigin = node as IX3DGeoOriginNode;
                    if (GeoOrigin == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "geoSystem")
            {
                if (wasGeoSystem)
                {
                    GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    GeoSystem = parser.ParseSFStringOrMFStringValue();
                }
                wasGeoSystem = true;
            }
            else if (id == "range")
            {
                Range = parser.ParseDoubleValue();
            }
            else if (id == "rootUrl")
            {
                RootURL.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "rootNode")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DChildNode rn = node as X3DChildNode;
                    if (rn == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        RootNode.Add(rn);
                    }
                }
            }
            else if (id == "bboxCenter")
            {
                BBoxCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "bboxSize")
            {
                BBoxSize = parser.ParseSFVec3fValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="center") Center=parser.ParseSFVec3fValue();
			else if(id=="info") Info.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="joints")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DHAnimJointNode joint=node as IX3DHAnimJointNode;
					if(joint==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Joints.Add(joint);
				}
			}
			else if(id=="name") Name=parser.ParseStringValue();
			else if(id=="rotation") Rotation=parser.ParseSFRotationValue();
			else if(id=="scale") Scale=parser.ParseSFVec3fValue();
			else if(id=="scaleOrientation") ScaleOrientation=parser.ParseSFRotationValue();
			else if(id=="segments")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DHAnimeSegmentNode segment=node as IX3DHAnimeSegmentNode;
					if(segment==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Segments.Add(segment);
				}
			}
			else if(id=="sites")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DHAnimSiteNode site=node as IX3DHAnimSiteNode;
					if(site==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Sites.Add(site);
				}
			}
			else if(id=="skeleton")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DHAnimHumanoidSkeleton skeleton=node as IX3DHAnimHumanoidSkeleton;
					if(skeleton==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Skeleton.Add(skeleton);
				}
			}
			else if(id=="skin")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DChildNode skin=node as X3DChildNode;
					if(skin==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Skin.Add(skin);
				}
			}
			else if(id=="skinCoord")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					SkinCoord=node as X3DCoordinateNode;
					if(SkinCoord==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="skinNormal")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					SkinNormal=node as X3DNormalNode;
					if(SkinNormal==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="translation") Translation=parser.ParseSFVec3fValue();
			else if(id=="version") Version=parser.ParseStringValue();
			else if(id=="viewpoints")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DViewpointNode vp=node as X3DViewpointNode; // x3d-Spec specs. x3dHAnimSite change to interface if neccessary
					if(vp==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Viewpoints.Add(vp);
				}
			}
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="color")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Color=node as X3DColorNode;
					if(Color==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="normal")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Normal=node as X3DNormalNode;
					if(Normal==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="texCoord")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TexCoord=node as X3DTextureCoordinateNode;
					if(TexCoord==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="yScale") YScale=parser.ParseDoubleValue();
			else if(id=="ccw") CCW=parser.ParseBoolValue();
			else if(id=="colorPerVertex") ColorPerVertex=parser.ParseBoolValue();
			else if(id=="creaseAngle") CreaseAngle=parser.ParseDoubleValue();
			else if(id=="geoGridOrigin") GeoGridOrigin=parser.ParseSFVec3fStringValue();
			else if(id=="geoOrigin")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					GeoOrigin=node as IX3DGeoOriginNode;
					if(GeoOrigin==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="geoSystem")
			{
				if(wasGeoSystem) GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
				else GeoSystem=parser.ParseSFStringOrMFStringValue();
				wasGeoSystem=true;
			}
			else if(id=="height")
			{
				if(wasHeight) Height.AddRange(parser.ParseSFFloatOrMFFloatValue());
				else Height=parser.ParseSFFloatOrMFFloatValue();
				wasHeight=true;
			}
			else if(id=="normalPerVertex") NormalPerVertex=parser.ParseBoolValue();
			else if(id=="solid") Solid=parser.ParseBoolValue();
			else if(id=="xDimension") XDimension=parser.ParseIntValue();
			else if(id=="xSpacing") XSpacing=parser.ParseDoubleStringValue();
			else if(id=="zDimension") ZDimension=parser.ParseIntValue();
			else if(id=="zSpacing") ZSpacing=parser.ParseDoubleStringValue();
			else return false;
			return true;
		}
Exemplo n.º 44
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "centerOfRotation")
            {
                CenterOfRotation = parser.ParseSFVec3fStringValue();
            }
            else if (id == "description")
            {
                Description = parser.ParseStringValue();
            }
            else if (id == "fieldOfView")
            {
                FieldOfView = parser.ParseDoubleValue();
            }
            else if (id == "headlight")
            {
                Headlight = parser.ParseBoolValue();
            }
            else if (id == "jump")
            {
                Jump = parser.ParseBoolValue();
            }
            else if (id == "navType")
            {
                if (wasNavType)
                {
                    NavType.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    NavType = parser.ParseSFStringOrMFStringValue();
                }
                wasNavType = true;
            }
            else if (id == "geoOrigin")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    GeoOrigin = node as IX3DGeoOriginNode;
                    if (GeoOrigin == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "geoSystem")
            {
                if (wasGeoSystem)
                {
                    GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    GeoSystem = parser.ParseSFStringOrMFStringValue();
                }
                wasGeoSystem = true;
            }
            else if (id == "orientation")
            {
                Orientation = parser.ParseSFRotationValue();
            }
            else if (id == "position")
            {
                Position = parser.ParseSFVec3fStringValue();
            }
            else if (id == "retainUserOffsets")
            {
                RetainUserOffsets = parser.ParseBoolValue();
            }
            else if (id == "speedFactor")
            {
                SpeedFactor = parser.ParseDoubleValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "appliedParameters")
     {
         if (wasAppliedParameters)
         {
             AppliedParameters.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         AppliedParameters    = parser.ParseSFStringOrMFStringValue();
         wasAppliedParameters = true;
     }
     else if (id == "bounce")
     {
         Bounce = parser.ParseDoubleValue();
     }
     else if (id == "contactNormal")
     {
         ContactNormal = parser.ParseSFVec3fValue();
     }
     else if (id == "depth")
     {
         Depth = parser.ParseDoubleValue();
     }
     else if (id == "frictionCoefficients")
     {
         FrictionCoefficients = parser.ParseSFVec2fValue();
     }
     else if (id == "frictionDirection")
     {
         FrictionDirection = parser.ParseSFVec3fValue();
     }
     else if (id == "minbounceSpeed")
     {
         MinbounceSpeed = parser.ParseDoubleValue();
     }
     else if (id == "position")
     {
         Position = parser.ParseSFVec3fValue();
     }
     else if (id == "slipCoefficients")
     {
         SlipCoefficients = parser.ParseSFVec2fValue();
     }
     else if (id == "softnessConstantForceMix")
     {
         SoftnessConstantForceMix = parser.ParseDoubleValue();
     }
     else if (id == "softnessErrorCorrection")
     {
         SoftnessErrorCorrection = parser.ParseDoubleValue();
     }
     else if (id == "surfaceSpeed")
     {
         SurfaceSpeed = parser.ParseSFVec2fValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 46
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "axis")
            {
                Axis = parser.ParseSFVec3fValue();
            }
            else if (id == "body1")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body1 = node as IX3DRigidBodyNode;
                    if (Body1 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "body2")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body2 = node as IX3DRigidBodyNode;
                    if (Body2 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "forceOutput" || id == "mustOutput")
            {
                if (wasForceOutput)
                {
                    ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    ForceOutput = parser.ParseSFStringOrMFStringValue();
                }
                wasForceOutput = true;
            }
            else if (id == "maxSeparation")
            {
                MaxSeparation = parser.ParseDoubleValue();
            }
            else if (id == "minSeparation")
            {
                MinSeparation = parser.ParseDoubleValue();
            }
            else if (id == "sliderForce")
            {
                SliderForce = parser.ParseDoubleValue();
            }
            else if (id == "stopBounce")
            {
                StopBounce = parser.ParseDoubleValue();
            }
            else if (id == "stopErrorCorrection")
            {
                StopErrorCorrection = parser.ParseDoubleValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 47
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "objectType")
            {
                if (wasObjectType)
                {
                    ObjectType.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    ObjectType = parser.ParseSFStringOrMFStringValue();
                }
                wasObjectType = true;
            }
            else if (id == "pickingGeometry")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    PickingGeometry = node as IX3DPointPickSensorPickingGeometry;
                    if (PickingGeometry == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "pickTarget")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DPickSensorNodePickTarget pt = node as IX3DPickSensorNodePickTarget;
                    if (pt == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        PickTarget.Add(pt);
                    }
                }
            }
            else if (id == "intersectionType")
            {
                IntersectionType = parser.ParseStringValue();
            }
            else if (id == "sortOrder")
            {
                SortOrder = parser.ParseStringValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "color")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Color = node as X3DColorNode;
                    if (Color == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "normal")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Normal = node as X3DNormalNode;
                    if (Normal == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "texCoord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TexCoord = node as X3DTextureCoordinateNode;
                    if (TexCoord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "yScale")
            {
                YScale = parser.ParseDoubleValue();
            }
            else if (id == "ccw")
            {
                CCW = parser.ParseBoolValue();
            }
            else if (id == "colorPerVertex")
            {
                ColorPerVertex = parser.ParseBoolValue();
            }
            else if (id == "creaseAngle")
            {
                CreaseAngle = parser.ParseDoubleValue();
            }
            else if (id == "geoGridOrigin")
            {
                GeoGridOrigin = parser.ParseSFVec3fStringValue();
            }
            else if (id == "geoOrigin")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    GeoOrigin = node as IX3DGeoOriginNode;
                    if (GeoOrigin == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "geoSystem")
            {
                if (wasGeoSystem)
                {
                    GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    GeoSystem = parser.ParseSFStringOrMFStringValue();
                }
                wasGeoSystem = true;
            }
            else if (id == "height")
            {
                if (wasHeight)
                {
                    Height.AddRange(parser.ParseSFFloatOrMFFloatValue());
                }
                else
                {
                    Height = parser.ParseSFFloatOrMFFloatValue();
                }
                wasHeight = true;
            }
            else if (id == "normalPerVertex")
            {
                NormalPerVertex = parser.ParseBoolValue();
            }
            else if (id == "solid")
            {
                Solid = parser.ParseBoolValue();
            }
            else if (id == "xDimension")
            {
                XDimension = parser.ParseIntValue();
            }
            else if (id == "xSpacing")
            {
                XSpacing = parser.ParseDoubleStringValue();
            }
            else if (id == "zDimension")
            {
                ZDimension = parser.ParseIntValue();
            }
            else if (id == "zSpacing")
            {
                ZSpacing = parser.ParseDoubleStringValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 49
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "center")
            {
                Center = parser.ParseSFVec3fValue();
            }
            else if (id == "info")
            {
                Info.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "joints")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimJointNode joint = node as IX3DHAnimJointNode;
                    if (joint == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Joints.Add(joint);
                    }
                }
            }
            else if (id == "name")
            {
                Name = parser.ParseStringValue();
            }
            else if (id == "rotation")
            {
                Rotation = parser.ParseSFRotationValue();
            }
            else if (id == "scale")
            {
                Scale = parser.ParseSFVec3fValue();
            }
            else if (id == "scaleOrientation")
            {
                ScaleOrientation = parser.ParseSFRotationValue();
            }
            else if (id == "segments")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimeSegmentNode segment = node as IX3DHAnimeSegmentNode;
                    if (segment == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Segments.Add(segment);
                    }
                }
            }
            else if (id == "sites")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimSiteNode site = node as IX3DHAnimSiteNode;
                    if (site == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Sites.Add(site);
                    }
                }
            }
            else if (id == "skeleton")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimHumanoidSkeleton skeleton = node as IX3DHAnimHumanoidSkeleton;
                    if (skeleton == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Skeleton.Add(skeleton);
                    }
                }
            }
            else if (id == "skin")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DChildNode skin = node as X3DChildNode;
                    if (skin == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Skin.Add(skin);
                    }
                }
            }
            else if (id == "skinCoord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    SkinCoord = node as X3DCoordinateNode;
                    if (SkinCoord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "skinNormal")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    SkinNormal = node as X3DNormalNode;
                    if (SkinNormal == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "translation")
            {
                Translation = parser.ParseSFVec3fValue();
            }
            else if (id == "version")
            {
                Version = parser.ParseStringValue();
            }
            else if (id == "viewpoints")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DViewpointNode vp = node as X3DViewpointNode;                   // x3d-Spec specs. x3dHAnimSite change to interface if neccessary
                    if (vp == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Viewpoints.Add(vp);
                    }
                }
            }
            else if (id == "bboxCenter")
            {
                BBoxCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "bboxSize")
            {
                BBoxSize = parser.ParseSFVec3fValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "axis1Angle")
            {
                Axis1Angle = parser.ParseDoubleValue();
            }
            else if (id == "axis1Torque")
            {
                Axis1Torque = parser.ParseDoubleValue();
            }
            else if (id == "axis2Angle")
            {
                Axis2Angle = parser.ParseDoubleValue();
            }
            else if (id == "axis2Torque")
            {
                Axis2Torque = parser.ParseDoubleValue();
            }
            else if (id == "axis3Angle")
            {
                Axis3Angle = parser.ParseDoubleValue();
            }
            else if (id == "axis3Torque")
            {
                Axis3Torque = parser.ParseDoubleValue();
            }
            else if (id == "body1")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body1 = node as IX3DRigidBodyNode;
                    if (Body1 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "body2")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Body2 = node as IX3DRigidBodyNode;
                    if (Body2 == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "enabledAxes")
            {
                EnabledAxes = parser.ParseIntValue();
            }
            else if (id == "forceOutput")
            {
                if (wasForceOutput)
                {
                    ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    ForceOutput = parser.ParseSFStringOrMFStringValue();
                }
                wasForceOutput = true;
            }
            else if (id == "motor1Axis")
            {
                Motor1Axis = parser.ParseSFVec3fValue();
            }
            else if (id == "motor2Axis")
            {
                Motor2Axis = parser.ParseSFVec3fValue();
            }
            else if (id == "motor3Axis")
            {
                Motor3Axis = parser.ParseSFVec3fValue();
            }
            else if (id == "stop1Bounce")
            {
                Stop1Bounce = parser.ParseDoubleValue();
            }
            else if (id == "stop1ErrorCorrection")
            {
                Stop1ErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "stop2Bounce")
            {
                Stop2Bounce = parser.ParseDoubleValue();
            }
            else if (id == "stop2ErrorCorrection")
            {
                Stop2ErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "stop3Bounce")
            {
                Stop3Bounce = parser.ParseDoubleValue();
            }
            else if (id == "stop3ErrorCorrection")
            {
                Stop3ErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "autoCalc")
            {
                AutoCalc = parser.ParseBoolValue();
            }
            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 == "description")
            {
                Description = parser.ParseStringValue();
            }
            else if (id == "loop")
            {
                Loop = parser.ParseBoolValue();
            }
            else if (id == "pauseTime")
            {
                PauseTime = parser.ParseDoubleValue();
            }
            else if (id == "resumeTime")
            {
                ResumeTime = parser.ParseDoubleValue();
            }
            else if (id == "speed" || id == "pitch")
            {
                Pitch = parser.ParseDoubleValue();
            }
            else if (id == "startTime")
            {
                StartTime = parser.ParseDoubleValue();
            }
            else if (id == "stopTime")
            {
                StopTime = parser.ParseDoubleValue();
            }
            else if (id == "url")
            {
                URL.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "repeatS")
            {
                RepeatS = parser.ParseBoolValue();
            }
            else if (id == "repeatT")
            {
                RepeatT = parser.ParseBoolValue();
            }
            else if (id == "textureProperties")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TextureProperties = node as IX3DTexturePropertiesNode;
                    if (TextureProperties == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="axis1Angle") Axis1Angle=parser.ParseDoubleValue();
			else if(id=="axis1Torque") Axis1Torque=parser.ParseDoubleValue();
			else if(id=="axis2Angle") Axis2Angle=parser.ParseDoubleValue();
			else if(id=="axis2Torque") Axis2Torque=parser.ParseDoubleValue();
			else if(id=="axis3Angle") Axis3Angle=parser.ParseDoubleValue();
			else if(id=="axis3Torque") Axis3Torque=parser.ParseDoubleValue();
			else if(id=="body1")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body1=node as IX3DRigidBodyNode;
					if(Body1==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="body2")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body2=node as IX3DRigidBodyNode;
					if(Body2==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="enabledAxes") EnabledAxes=parser.ParseIntValue();
			else if(id=="forceOutput")
			{
				if(wasForceOutput) ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
				else ForceOutput=parser.ParseSFStringOrMFStringValue();
				wasForceOutput=true;
			}
			else if(id=="motor1Axis") Motor1Axis=parser.ParseSFVec3fValue();
			else if(id=="motor2Axis") Motor2Axis=parser.ParseSFVec3fValue();
			else if(id=="motor3Axis") Motor3Axis=parser.ParseSFVec3fValue();
			else if(id=="stop1Bounce") Stop1Bounce=parser.ParseDoubleValue();
			else if(id=="stop1ErrorCorrection") Stop1ErrorCorrection=parser.ParseDoubleValue();
			else if(id=="stop2Bounce") Stop2Bounce=parser.ParseDoubleValue();
			else if(id=="stop2ErrorCorrection") Stop2ErrorCorrection=parser.ParseDoubleValue();
			else if(id=="stop3Bounce") Stop3Bounce=parser.ParseDoubleValue();
			else if(id=="stop3ErrorCorrection") Stop3ErrorCorrection=parser.ParseDoubleValue();
			else if(id=="autoCalc") AutoCalc=parser.ParseBoolValue();
			else return false;
			return true;
		}
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "appliedParameters")
            {
                if (wasAppliedParameters)
                {
                    AppliedParameters.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                AppliedParameters    = parser.ParseSFStringOrMFStringValue();
                wasAppliedParameters = true;
            }
            else if (id == "bounce")
            {
                Bounce = parser.ParseDoubleValue();
            }
            else if (id == "collidables")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DCollisionCollectionCollidables colls = node as IX3DCollisionCollectionCollidables;
                    if (colls == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Collidables.Add(colls);
                    }
                }
            }
            else if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "frictionCoefficients")
            {
                FrictionCoefficients = parser.ParseSFVec2fValue();
            }
            else if (id == "minBounceSpeed")
            {
                MinBounceSpeed = parser.ParseDoubleValue();
            }
            else if (id == "slipFactors")
            {
                SlipFactors = parser.ParseSFVec2fValue();
            }
            else if (id == "softnessConstantForceMix")
            {
                SoftnessConstantForceMix = parser.ParseDoubleValue();
            }
            else if (id == "softnessErrorCorrection")
            {
                SoftnessErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "surfaceSpeed")
            {
                SurfaceSpeed = parser.ParseSFVec2fValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }