internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="autoDisable") AutoDisable=parser.ParseBoolValue();
			else if(id=="bodies")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DRigidBodyNode rb=node as IX3DRigidBodyNode;
					if(rb==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Bodies.Add(rb);
				}
			}
			else if(id=="constantForceMix") ConstantForceMix=parser.ParseDoubleValue();
			else if(id=="contactSurfaceThickness") ContactSurfaceThickness=parser.ParseDoubleValue();
			else if(id=="disableAngularSpeed") DisableAngularSpeed=parser.ParseDoubleValue();
			else if(id=="disableLinearSpeed") DisableLinearSpeed=parser.ParseDoubleValue();
			else if(id=="disableTime") DisableTime=parser.ParseDoubleValue();
			else if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="errorCorrection") ErrorCorrection=parser.ParseDoubleValue();
			else if(id=="gravity") Gravity=parser.ParseSFVec3fValue();
			else if(id=="iterations") Iterations=parser.ParseIntValue();
			else if(id=="joints")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DRigidJointNode rj=node as X3DRigidJointNode;
					if(rj==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Joints.Add(rj);
				}
			}
			else if(id=="maxCorrectionSpeed") MaxCorrectionSpeed=parser.ParseDoubleValue();
			else if(id=="preferAccuracy") PreferAccuracy=parser.ParseBoolValue();
			else if(id=="collider")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Collider=node as IX3DCollisionCollectionNode;
					if(Collider==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=="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=="collide"||id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else if(id=="proxy")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Proxy=node as X3DChildNode;
					if(Proxy==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=="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=="isPickable") IsPickable=parser.ParseBoolValue();
			else if(id=="viewport")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Viewport=node as X3DViewportNode;
					if(Viewport==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=="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=="clipBoundary")
			{
				if(wasClipBoundary) ClipBoundary.AddRange(parser.ParseSFFloatOrMFFloatValue());
				else ClipBoundary=parser.ParseSFFloatOrMFFloatValue();
				wasClipBoundary=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=="center") Center=parser.ParseSFVec3fValue();
			else 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=="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=="translation") Translation=parser.ParseSFVec3fValue();
			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 == "texCoord" || id == "coord")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DTextureCoordinateNode tcn = node as X3DTextureCoordinateNode;
                    if (tcn == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        TexCoord.Add(tcn);
                    }
                }
            }
            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;
		}
Example #9
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "collidables")
     {
         Collidables.AddRange(parser.ParseSFNodeOrMFNodeValue());
     }
     else if (id == "enabled")
     {
         Enabled = parser.ParseBoolValue();
     }
     else if (id == "useGeometry")
     {
         UseGeometry = 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 == "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 == "programs")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DShaderProgramNode sp = node as IX3DShaderProgramNode;
                    if (sp == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Programs.Add(sp);
                    }
                }
            }
            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 == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "timeOut")
            {
                TimeOut = parser.ParseDoubleValue();
            }
            else if (id == "watchList")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DUrlObject url = node as X3DUrlObject;
                    if (url == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        WatchList.Add(url);
                    }
                }
            }
            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)
		{
			int line=parser.Line;

			if(id=="centerOfMass") CenterOfMass=parser.ParseSFVec3fValue();
			else 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=="coord")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Coord=node as X3DCoordinateNode;
					if(Coord==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="displacers")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DHAnimDisplacerNode displacer=node as IX3DHAnimDisplacerNode;
					if(displacer==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Displacers.Add(displacer);
				}
			}
			else if(id=="mass") Mass=parser.ParseDoubleValue();
			else if(id=="momentsOfInertia")
			{
				if(wasMomentsOfInertia) MomentsOfInertia.AddRange(parser.ParseSFFloatOrMFFloatValue());
				else MomentsOfInertia=parser.ParseSFFloatOrMFFloatValue();
				wasMomentsOfInertia=true;
			}
			else if(id=="name") Name=parser.ParseStringValue();
			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=="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=="name") Name=parser.ParseStringValue();
			else if(id=="reference") Reference=parser.ParseStringValue();
			else if(id=="value") Value.AddRange(parser.ParseSFNodeOrMFNodeValue());
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="collidables") Collidables.AddRange(parser.ParseSFNodeOrMFNodeValue());
			else if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="useGeometry") UseGeometry=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 == "isPickable")
            {
                IsPickable = parser.ParseBoolValue();
            }
            else if (id == "layout")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Layout = node as X3DLayoutNode;
                    if (Layout == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "viewport")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Viewport = node as X3DViewportNode;
                    if (Viewport == 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=="angularDampingFactor") AngularDampingFactor=parser.ParseDoubleValue();
			else if(id=="angularVelocity") AngularVelocity=parser.ParseSFVec3fValue();
			else if(id=="autoDamp") AutoDamp=parser.ParseBoolValue();
			else if(id=="autoDisable") AutoDisable=parser.ParseBoolValue();
			else if(id=="centerOfMass") CenterOfMass=parser.ParseSFVec3fValue();
			else if(id=="disableAngularSpeed") DisableAngularSpeed=parser.ParseDoubleValue();
			else if(id=="disableLinearSpeed") DisableLinearSpeed=parser.ParseDoubleValue();
			else if(id=="disableTime") DisableTime=parser.ParseDoubleValue();
			else if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="finiteRotationAxis") FiniteRotationAxis=parser.ParseSFVec3fValue();
			else if(id=="fixed") Fixed=parser.ParseBoolValue();
			else if(id=="forces") Forces.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
			else if(id=="geometry")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DNBodyCollidableNode nbcn=node as X3DNBodyCollidableNode;
					if(nbcn==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Geometry.Add(nbcn);
				}
			}
			else if(id=="inertia") Inertia=parser.ParseSFMatrix3fValue();
			else if(id=="linearDampingFactor") LinearDampingFactor=parser.ParseDoubleValue();
			else if(id=="linearVelocity") LinearVelocity=parser.ParseSFVec3fValue();
			else if(id=="mass") Mass=parser.ParseDoubleValue();
			else if(id=="massDensityModel")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					MassDensityModel=node as X3DGeometryNode;
					if(MassDensityModel==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="orientation") Orientation=parser.ParseSFRotationValue();
			else if(id=="position") Position=parser.ParseSFVec3fValue();
			else if(id=="torques") Torques.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
			else if(id=="useFiniteRotation") UseFiniteRotation=parser.ParseBoolValue();
			else if(id=="useGlobalGravity") UseGlobalGravity=parser.ParseBoolValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="controlPoint")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					ControlPoint=node as X3DCoordinateNode;
					if(ControlPoint==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="texCoord")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TexCoord=node as IX3DNurbsSurfaceGeometryNodeTexCoord;
					if(TexCoord==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="trimmingContour")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DContour2DNode contour=node as IX3DContour2DNode;
					if(contour==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else TrimmingContour.Add(contour);
				}
			}
			else if(id=="uTessellation") UTessellation=parser.ParseIntValue();
			else if(id=="vTessellation") VTessellation=parser.ParseIntValue();
			else if(id=="weight") Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="solid") Solid=parser.ParseBoolValue();
			else if(id=="uClosed") UClosed=parser.ParseBoolValue();
			else if(id=="uDimension") UDimension=parser.ParseIntValue();
			else if(id=="uKnot") UKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="uOrder") UOrder=parser.ParseIntValue();
			else if(id=="vClosed") VClosed=parser.ParseBoolValue();
			else if(id=="vDimension") VDimension=parser.ParseIntValue();
			else if(id=="vKnot") VKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="vOrder") VOrder=parser.ParseIntValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;
			
			if(id=="attrib")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DVertexAttributeNode attr=node as X3DVertexAttributeNode;
					if(attr==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Attrib.Add(attr);
				}
			}
			else 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=="coord")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Coord=node as X3DCoordinateNode;
					if(Coord==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="fogCoord")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					FogCoord=node as IX3DFogCoordinateNode;
					if(FogCoord==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="colorIndex") ColorIndex=parser.ParseSFInt32OrMFInt32Value();
			else if(id=="colorPerVertex") ColorPerVertex=parser.ParseBoolValue();
			else if(id=="coordIndex") CoordIndex=parser.ParseSFInt32OrMFInt32Value();
			else return false;
			return true;
		}
Example #22
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "center")
            {
                Center = parser.ParseSFVec3fValue();
            }
            else if (id == "children")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DViewpointgroupChildren child = node as IX3DViewpointgroupChildren;
                    if (child == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Children.Add(child);
                    }
                }
            }
            else if (id == "description")
            {
                Description = parser.ParseStringValue();
            }
            else if (id == "displayed")
            {
                Displayed = parser.ParseBoolValue();
            }
            else if (id == "retainUserOffsets")
            {
                RetainUserOffsets = parser.ParseBoolValue();
            }
            else if (id == "size")
            {
                Size = parser.ParseSFVec3fValue();
            }
            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);
        }
		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)
				{
					IX3DContour2DChildren child=node as IX3DContour2DChildren;
					if(child==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Children.Add(child);
				}
			}
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="textureTransform")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DTextureTransformNode tfn=node as X3DTextureTransformNode;
					if(tfn==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else TextureTransform.Add(tfn);
				}
			}
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="parts")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DShaderPartNode shaderPart=node as IX3DShaderPartNode;
					if(shaderPart==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Parts.Add(shaderPart);
				}
			}
			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 == "activeLayer")
            {
                ActiveLayer = parser.ParseIntValue();
            }
            else if (id == "layers")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DLayerNode ln = node as X3DLayerNode;
                    if (ln == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Layers.Add(ln);
                    }
                }
            }
            else if (id == "order")
            {
                if (wasOrder)
                {
                    Order.AddRange(parser.ParseSFInt32OrMFInt32Value());
                }
                else
                {
                    Order = parser.ParseSFInt32OrMFInt32Value();
                }
                wasOrder = true;
            }
            else
            {
                return(false);
            }
            return(true);
        }
Example #28
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "address")
            {
                Address = parser.ParseStringValue();
            }
            else if (id == "applicationID")
            {
                ApplicationID = parser.ParseIntValue();
            }
            else if (id == "mapping")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DDISEntityTypeMappingNode disetm = node as IX3DDISEntityTypeMappingNode;
                    if (disetm == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Mapping.Add(disetm);
                    }
                }
            }
            else if (id == "port")
            {
                Port = parser.ParseIntValue();
            }
            else if (id == "siteID")
            {
                SiteID = parser.ParseIntValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="geometry")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DNurbsSurfaceGeometryNode ns=node as X3DNurbsSurfaceGeometryNode;
					if(ns==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Geometry.Add(ns);
				}
			}
			else if(id=="tessellationScale") TessellationScale=parser.ParseDoubleValue();
			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 == "name")
     {
         Name = parser.ParseStringValue();
     }
     else if (id == "reference")
     {
         Reference = parser.ParseStringValue();
     }
     else if (id == "value")
     {
         Value.AddRange(parser.ParseSFNodeOrMFNodeValue());
     }
     else
     {
         return(false);
     }
     return(true);
 }
Example #31
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)
		{
			int line=parser.Line;

			if(id=="textures")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DTexture2DNode texture2DNode=node as X3DTexture2DNode;
					if(texture2DNode==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Textures.Add(texture2DNode);
				}
			}
			else if(id=="repeatS") RepeatS=parser.ParseBoolValue();
			else if(id=="repeatT") RepeatT=parser.ParseBoolValue();
			else if(id=="repeatR") RepeatR=parser.ParseBoolValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="choice"||id=="children")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DChildNode choice=node as X3DChildNode;
					if(choice==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Choice.Add(choice);
				}
			}
			else if(id=="whichChoice") WhichChoice=parser.ParseIntValue();
			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=="address") Address=parser.ParseStringValue();
			else if(id=="applicationID") ApplicationID=parser.ParseIntValue();
			else if(id=="mapping")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DDISEntityTypeMappingNode disetm=node as IX3DDISEntityTypeMappingNode;
					if(disetm==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Mapping.Add(disetm);
				}
			}
			else if(id=="port") Port=parser.ParseIntValue();
			else if(id=="siteID") SiteID=parser.ParseIntValue();
			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=="children")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DViewpointgroupChildren child=node as IX3DViewpointgroupChildren;
					if(child==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Children.Add(child);
				}
			}
			else if(id=="description") Description=parser.ParseStringValue();
			else if(id=="displayed") Displayed=parser.ParseBoolValue();
			else if(id=="retainUserOffsets") RetainUserOffsets=parser.ParseBoolValue();
			else if(id=="size") Size=parser.ParseSFVec3fValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="children"||id=="level"||id=="levels")
			{
				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=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else if(id=="center") Center=parser.ParseSFVec3fValue();
			else if(id=="forceTransitions") ForceTransitions=parser.ParseBoolValue();
			else if(id=="range") Range=parser.ParseSFFloatOrMFFloatValue();
			else return false;
			return true;
		}
Example #37
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "textures")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DTexture2DNode texture2DNode = node as X3DTexture2DNode;
                    if (texture2DNode == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Textures.Add(texture2DNode);
                    }
                }
            }
            else if (id == "repeatS")
            {
                RepeatS = parser.ParseBoolValue();
            }
            else if (id == "repeatT")
            {
                RepeatT = parser.ParseBoolValue();
            }
            else if (id == "repeatR")
            {
                RepeatR = parser.ParseBoolValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Example #38
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "geometry")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DNurbsSurfaceGeometryNode ns = node as X3DNurbsSurfaceGeometryNode;
                    if (ns == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Geometry.Add(ns);
                    }
                }
            }
            else if (id == "tessellationScale")
            {
                TessellationScale = parser.ParseDoubleValue();
            }
            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 == "controlPoint")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    ControlPoint = node as X3DCoordinateNode;
                    if (ControlPoint == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "texCoord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TexCoord = node as IX3DNurbsSurfaceGeometryNodeTexCoord;
                    if (TexCoord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "trimmingContour")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DContour2DNode contour = node as IX3DContour2DNode;
                    if (contour == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        TrimmingContour.Add(contour);
                    }
                }
            }
            else if (id == "uTessellation")
            {
                UTessellation = parser.ParseIntValue();
            }
            else if (id == "vTessellation")
            {
                VTessellation = parser.ParseIntValue();
            }
            else if (id == "weight")
            {
                Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "solid")
            {
                Solid = parser.ParseBoolValue();
            }
            else if (id == "uClosed")
            {
                UClosed = parser.ParseBoolValue();
            }
            else if (id == "uDimension")
            {
                UDimension = parser.ParseIntValue();
            }
            else if (id == "uKnot")
            {
                UKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "uOrder")
            {
                UOrder = parser.ParseIntValue();
            }
            else if (id == "vClosed")
            {
                VClosed = parser.ParseBoolValue();
            }
            else if (id == "vDimension")
            {
                VDimension = parser.ParseIntValue();
            }
            else if (id == "vKnot")
            {
                VKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "vOrder")
            {
                VOrder = parser.ParseIntValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "centerOfMass")
            {
                CenterOfMass = parser.ParseSFVec3fValue();
            }
            else 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 == "coord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Coord = node as X3DCoordinateNode;
                    if (Coord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "displacers")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimDisplacerNode displacer = node as IX3DHAnimDisplacerNode;
                    if (displacer == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Displacers.Add(displacer);
                    }
                }
            }
            else if (id == "mass")
            {
                Mass = parser.ParseDoubleValue();
            }
            else if (id == "momentsOfInertia")
            {
                if (wasMomentsOfInertia)
                {
                    MomentsOfInertia.AddRange(parser.ParseSFFloatOrMFFloatValue());
                }
                else
                {
                    MomentsOfInertia = parser.ParseSFFloatOrMFFloatValue();
                }
                wasMomentsOfInertia = true;
            }
            else if (id == "name")
            {
                Name = parser.ParseStringValue();
            }
            else if (id == "bboxCenter")
            {
                BBoxCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "bboxSize")
            {
                BBoxSize = parser.ParseSFVec3fValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Example #41
0
        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 X3DShapeNode;
                    if (child == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Children.Add(child);
                    }
                }
            }
            else if (id == "controlPoint")
            {
                object token = parser.PeekNextToken();
                if (token is VRMLTokenIdKeywordOrFieldType)
                {
                    X3DNode node = parser.ParseSFNodeValue();
                    if (node != null)
                    {
                        ControlPoint = node as X3DCoordinateNode;
                        if (ControlPoint == null)
                        {
                            parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                        }
                    }
                }
                else
                {
                    x3dCoordinate coords = new x3dCoordinate();
                    coords.Point = parser.ParseSFVec3fOrMFVec3fValue();
                    ControlPoint = coords;
                }
            }
            else if (id == "inputCoord")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DCoordinateNode coord = node as X3DCoordinateNode;
                    if (coord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        InputCoord.Add(coord);
                    }
                }
            }
            else if (id == "inputTransform")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DCoordinateDeformerInputTransform transf = node as IX3DCoordinateDeformerInputTransform;
                    if (transf == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        InputTransform.Add(transf);
                    }
                }
            }
            else if (id == "outputCoord")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DCoordinateNode coord = node as X3DCoordinateNode;
                    if (coord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        OutputCoord.Add(coord);
                    }
                }
            }
            else if (id == "weight")
            {
                Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "bboxCenter")
            {
                BBoxCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "bboxSize")
            {
                BBoxSize = parser.ParseSFVec3fValue();
            }
            else if (id == "uDimension")
            {
                UDimension = parser.ParseIntValue();
            }
            else if (id == "uKnot")
            {
                UKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "uOrder")
            {
                UOrder = parser.ParseIntValue();
            }
            else if (id == "vDimension")
            {
                VDimension = parser.ParseIntValue();
            }
            else if (id == "vKnot")
            {
                VKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "vOrder")
            {
                VOrder = parser.ParseIntValue();
            }
            else if (id == "wDimension")
            {
                WDimension = parser.ParseIntValue();
            }
            else if (id == "wKnot")
            {
                WKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "wOrder")
            {
                WOrder = parser.ParseIntValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "autoDisable")
            {
                AutoDisable = parser.ParseBoolValue();
            }
            else if (id == "bodies")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DRigidBodyNode rb = node as IX3DRigidBodyNode;
                    if (rb == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Bodies.Add(rb);
                    }
                }
            }
            else if (id == "constantForceMix")
            {
                ConstantForceMix = parser.ParseDoubleValue();
            }
            else if (id == "contactSurfaceThickness")
            {
                ContactSurfaceThickness = parser.ParseDoubleValue();
            }
            else if (id == "disableAngularSpeed")
            {
                DisableAngularSpeed = parser.ParseDoubleValue();
            }
            else if (id == "disableLinearSpeed")
            {
                DisableLinearSpeed = parser.ParseDoubleValue();
            }
            else if (id == "disableTime")
            {
                DisableTime = parser.ParseDoubleValue();
            }
            else if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "errorCorrection")
            {
                ErrorCorrection = parser.ParseDoubleValue();
            }
            else if (id == "gravity")
            {
                Gravity = parser.ParseSFVec3fValue();
            }
            else if (id == "iterations")
            {
                Iterations = parser.ParseIntValue();
            }
            else if (id == "joints")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DRigidJointNode rj = node as X3DRigidJointNode;
                    if (rj == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Joints.Add(rj);
                    }
                }
            }
            else if (id == "maxCorrectionSpeed")
            {
                MaxCorrectionSpeed = parser.ParseDoubleValue();
            }
            else if (id == "preferAccuracy")
            {
                PreferAccuracy = parser.ParseBoolValue();
            }
            else if (id == "collider")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Collider = node as IX3DCollisionCollectionNode;
                    if (Collider == 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 == "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 == "angularDampingFactor")
            {
                AngularDampingFactor = parser.ParseDoubleValue();
            }
            else if (id == "angularVelocity")
            {
                AngularVelocity = parser.ParseSFVec3fValue();
            }
            else if (id == "autoDamp")
            {
                AutoDamp = parser.ParseBoolValue();
            }
            else if (id == "autoDisable")
            {
                AutoDisable = parser.ParseBoolValue();
            }
            else if (id == "centerOfMass")
            {
                CenterOfMass = parser.ParseSFVec3fValue();
            }
            else if (id == "disableAngularSpeed")
            {
                DisableAngularSpeed = parser.ParseDoubleValue();
            }
            else if (id == "disableLinearSpeed")
            {
                DisableLinearSpeed = parser.ParseDoubleValue();
            }
            else if (id == "disableTime")
            {
                DisableTime = parser.ParseDoubleValue();
            }
            else if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "finiteRotationAxis")
            {
                FiniteRotationAxis = parser.ParseSFVec3fValue();
            }
            else if (id == "fixed")
            {
                Fixed = parser.ParseBoolValue();
            }
            else if (id == "forces")
            {
                Forces.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
            }
            else if (id == "geometry")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DNBodyCollidableNode nbcn = node as X3DNBodyCollidableNode;
                    if (nbcn == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Geometry.Add(nbcn);
                    }
                }
            }
            else if (id == "inertia")
            {
                Inertia = parser.ParseSFMatrix3fValue();
            }
            else if (id == "linearDampingFactor")
            {
                LinearDampingFactor = parser.ParseDoubleValue();
            }
            else if (id == "linearVelocity")
            {
                LinearVelocity = parser.ParseSFVec3fValue();
            }
            else if (id == "mass")
            {
                Mass = parser.ParseDoubleValue();
            }
            else if (id == "massDensityModel")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    MassDensityModel = node as X3DGeometryNode;
                    if (MassDensityModel == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "orientation")
            {
                Orientation = parser.ParseSFRotationValue();
            }
            else if (id == "position")
            {
                Position = parser.ParseSFVec3fValue();
            }
            else if (id == "torques")
            {
                Torques.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
            }
            else if (id == "useFiniteRotation")
            {
                UseFiniteRotation = parser.ParseBoolValue();
            }
            else if (id == "useGlobalGravity")
            {
                UseGlobalGravity = 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);
        }
Example #46
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "appearance")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Appearance = node as X3DAppearanceNode;
                    if (Appearance == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "createParticles")
            {
                CreateParticles = parser.ParseBoolValue();
            }
            else if (id == "geometry")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Geometry = node as X3DGeometryNode;
                    if (Geometry == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "lifetimeVariation")
            {
                LifetimeVariation = parser.ParseDoubleValue();
            }
            else if (id == "maxParticles")
            {
                MaxParticles = parser.ParseIntValue();
            }
            else if (id == "particleLifetime")
            {
                ParticleLifetime = parser.ParseDoubleValue();
            }
            else if (id == "particleSize")
            {
                ParticleSize = parser.ParseSFVec2fValue();
            }
            else if (id == "bboxCenter")
            {
                BBoxCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "bboxSize")
            {
                BBoxSize = parser.ParseSFVec3fValue();
            }
            else if (id == "colorRamp")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    ColorRamp = node as X3DColorNode;
                    if (ColorRamp == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "colorKey")
            {
                ColorKey.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "emitter")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Emitter = node as X3DParticleEmitterNode;
                    if (Emitter == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "geometryType")
            {
                GeometryType = parser.ParseStringValue();
            }
            else if (id == "physics")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DParticlePhysicsModelNode ppmn = node as X3DParticlePhysicsModelNode;
                    if (ppmn == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Physics.Add(ppmn);
                    }
                }
            }
            else if (id == "texCoordRamp")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TexCoordRamp = node as X3DTextureCoordinateNode;
                    if (TexCoordRamp == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "texCoordKey")
            {
                TexCoordKey.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else
            {
                return(false);
            }
            return(true);
        }
Example #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 == "attrib")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DVertexAttributeNode attr = node as X3DVertexAttributeNode;
                    if (attr == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Attrib.Add(attr);
                    }
                }
            }
            else 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 == "coord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Coord = node as X3DCoordinateNode;
                    if (Coord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "fogCoord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    FogCoord = node as IX3DFogCoordinateNode;
                    if (FogCoord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
Example #49
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "attrib")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DVertexAttributeNode attr = node as X3DVertexAttributeNode;
                    if (attr == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Attrib.Add(attr);
                    }
                }
            }
            else 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 == "coord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Coord = node as X3DCoordinateNode;
                    if (Coord == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "fogCoord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    FogCoord = node as IX3DFogCoordinateNode;
                    if (FogCoord == 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 == "ccw")
            {
                CCW = parser.ParseBoolValue();
            }
            else if (id == "colorPerVertex")
            {
                ColorPerVertex = parser.ParseBoolValue();
            }
            else if (id == "normalPerVertex")
            {
                NormalPerVertex = parser.ParseBoolValue();
            }
            else if (id == "solid")
            {
                Solid = parser.ParseBoolValue();
            }
            else if (id == "index")
            {
                Index = parser.ParseSFInt32OrMFInt32Value();
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="attrib")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DVertexAttributeNode attr=node as X3DVertexAttributeNode;
					if(attr==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Attrib.Add(attr);
				}
			}
			else 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=="fogCoord")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					FogCoord=node as IX3DFogCoordinateNode;
					if(FogCoord==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=="ccw") CCW=parser.ParseBoolValue();
			else if(id=="colorPerVertex") ColorPerVertex=parser.ParseBoolValue();
			else if(id=="creaseAngle") CreaseAngle=parser.ParseDoubleValue();
			else if(id=="height") Height.AddRange(parser.ParseSFFloatOrMFFloatValue());
			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.ParseDoubleValue();
			else if(id=="zDimension") ZDimension=parser.ParseIntValue();
			else if(id=="zSpacing") ZSpacing=parser.ParseDoubleValue();
			else return false;
			return true;
		}
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "address")
            {
                Address = parser.ParseStringValue();
            }
            else if (id == "applicationID")
            {
                ApplicationID = parser.ParseIntValue();
            }
            else if (id == "articulationParameterCount")
            {
                ArticulationParameterCount = parser.ParseIntValue();
            }
            else if (id == "articulationParameterDesignatorArray")
            {
                ArticulationParameterDesignatorArray.AddRange(parser.ParseSFInt32OrMFInt32Value());
            }
            else if (id == "articulationParameterChangeIndicatorArray")
            {
                ArticulationParameterChangeIndicatorArray.AddRange(parser.ParseSFInt32OrMFInt32Value());
            }
            else if (id == "articulationParameterIdPartAttachedToArray")
            {
                ArticulationParameterIdPartAttachedToArray.AddRange(parser.ParseSFInt32OrMFInt32Value());
            }
            else if (id == "articulationParameterTypeArray")
            {
                ArticulationParameterTypeArray.AddRange(parser.ParseSFInt32OrMFInt32Value());
            }
            else if (id == "articulationParameterArray")
            {
                ArticulationParameterArray.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "center")
            {
                Center = parser.ParseSFVec3fValue();
            }
            else 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 == "collisionType")
            {
                CollisionType = parser.ParseIntValue();
            }
            else if (id == "deadReckoning")
            {
                DeadReckoning = parser.ParseIntValue();
            }
            else if (id == "detonationLocation")
            {
                DetonationLocation = parser.ParseSFVec3fValue();
            }
            else if (id == "detonationRelativeLocation")
            {
                DetonationRelativeLocation = parser.ParseSFVec3fValue();
            }
            else if (id == "detonationResult")
            {
                DetonationResult = parser.ParseIntValue();
            }
            else if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "entityCategory")
            {
                EntityCategory = parser.ParseIntValue();
            }
            else if (id == "entityCountry")
            {
                EntityCountry = parser.ParseIntValue();
            }
            else if (id == "entityDomain")
            {
                EntityDomain = parser.ParseIntValue();
            }
            else if (id == "entityExtra")
            {
                EntityExtra = parser.ParseIntValue();
            }
            else if (id == "entityID")
            {
                EntityID = parser.ParseIntValue();
            }
            else if (id == "entityKind")
            {
                EntityKind = parser.ParseIntValue();
            }
            else if (id == "entitySpecific")
            {
                EntitySpecific = parser.ParseIntValue();
            }
            else if (id == "entitySubCategory")
            {
                EntitySubCategory = parser.ParseIntValue();
            }
            else if (id == "eventApplicationID")
            {
                EventApplicationID = parser.ParseIntValue();
            }
            else if (id == "eventEntityID")
            {
                EventEntityID = parser.ParseIntValue();
            }
            else if (id == "eventNumber")
            {
                EventNumber = parser.ParseIntValue();
            }
            else if (id == "eventSiteID")
            {
                EventSiteID = parser.ParseIntValue();
            }
            else if (id == "fired1")
            {
                Fired1 = parser.ParseBoolValue();
            }
            else if (id == "fired2")
            {
                Fired2 = parser.ParseBoolValue();
            }
            else if (id == "fireMissionIndex")
            {
                FireMissionIndex = parser.ParseIntValue();
            }
            else if (id == "firingRange")
            {
                FiringRange = parser.ParseDoubleValue();
            }
            else if (id == "firingRate")
            {
                FiringRate = parser.ParseIntValue();
            }
            else if (id == "forceID")
            {
                ForceID = parser.ParseIntValue();
            }
            else if (id == "fuse")
            {
                Fuse = parser.ParseIntValue();
            }
            else if (id == "linearVelocity")
            {
                LinearVelocity = parser.ParseSFVec3fValue();
            }
            else if (id == "linearAcceleration")
            {
                LinearAcceleration = parser.ParseSFVec3fValue();
            }
            else if (id == "marking")
            {
                Marking = parser.ParseStringValue();
            }
            else if (id == "multicastRelayHost")
            {
                MulticastRelayHost = parser.ParseStringValue();
            }
            else if (id == "multicastRelayPort")
            {
                MulticastRelayPort = parser.ParseIntValue();
            }
            else if (id == "munitionApplicationID")
            {
                MunitionApplicationID = parser.ParseIntValue();
            }
            else if (id == "munitionEndPoint")
            {
                MunitionEndPoint = parser.ParseSFVec3fValue();
            }
            else if (id == "munitionEntityID")
            {
                MunitionEntityID = parser.ParseIntValue();
            }
            else if (id == "munitionQuantity")
            {
                MunitionQuantity = parser.ParseIntValue();
            }
            else if (id == "munitionSiteID")
            {
                MunitionSiteID = parser.ParseIntValue();
            }
            else if (id == "munitionStartPoint")
            {
                MunitionStartPoint = parser.ParseSFVec3fValue();
            }
            else if (id == "networkMode")
            {
                NetworkMode = parser.ParseStringValue();
            }
            else if (id == "port")
            {
                Port = parser.ParseIntValue();
            }
            else if (id == "readInterval")
            {
                ReadInterval = parser.ParseDoubleValue();
            }
            else if (id == "rotation")
            {
                Rotation = parser.ParseSFRotationValue();
            }
            else if (id == "scale")
            {
                Scale = parser.ParseSFVec3fValue();
            }
            else if (id == "scaleOrientation")
            {
                ScaleOrientation = parser.ParseSFRotationValue();
            }
            else if (id == "siteID")
            {
                SiteID = parser.ParseIntValue();
            }
            else if (id == "translation")
            {
                Translation = parser.ParseSFVec3fValue();
            }
            else if (id == "warhead")
            {
                Warhead = parser.ParseIntValue();
            }
            else if (id == "writeInterval")
            {
                WriteInterval = parser.ParseDoubleValue();
            }
            else if (id == "bboxCenter")
            {
                BBoxCenter = parser.ParseSFVec3fValue();
            }
            else if (id == "bboxSize")
            {
                BBoxSize = parser.ParseSFVec3fValue();
            }
            else if (id == "rtpHeaderExpected")
            {
                RtpHeaderExpected = parser.ParseBoolValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="fillProperties")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					FillProperties=node as IX3DFillPropertiesNode;
					if(FillProperties==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="lineProperties")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					LineProperties=node as IX3DLinePropertiesNode;
					if(LineProperties==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="material")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Material=node as X3DMaterialNode;
					if(Material==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="shaders")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DShaderNode sn=node as X3DShaderNode;
					if(sn==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Shaders.Add(sn);
				}
			}
			else if(id=="texture")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Texture=node as X3DTextureNode;
					if(Texture==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="textureTransform")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TextureTransform=node as X3DTextureTransformNode;
					if(TextureTransform==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=="appearance")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Appearance=node as X3DAppearanceNode;
					if(Appearance==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="createParticles") CreateParticles=parser.ParseBoolValue();
			else if(id=="geometry")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Geometry=node as X3DGeometryNode;
					if(Geometry==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="lifetimeVariation") LifetimeVariation=parser.ParseDoubleValue();
			else if(id=="maxParticles") MaxParticles=parser.ParseIntValue();
			else if(id=="particleLifetime") ParticleLifetime=parser.ParseDoubleValue();
			else if(id=="particleSize") ParticleSize=parser.ParseSFVec2fValue();
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else if(id=="colorRamp")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					ColorRamp=node as X3DColorNode;
					if(ColorRamp==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="colorKey") ColorKey.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="emitter")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Emitter=node as X3DParticleEmitterNode;
					if(Emitter==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="geometryType") GeometryType=parser.ParseStringValue();
			else if(id=="physics")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DParticlePhysicsModelNode ppmn=node as X3DParticlePhysicsModelNode;
					if(ppmn==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Physics.Add(ppmn);
				}
			}
			else if(id=="texCoordRamp")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TexCoordRamp=node as X3DTextureCoordinateNode;
					if(TexCoordRamp==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="texCoordKey") TexCoordKey.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else return false;
			return true;
		}
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "attrib")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DVertexAttributeNode attr = node as X3DVertexAttributeNode;
                    if (attr == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Attrib.Add(attr);
                    }
                }
            }
            else 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 == "fogCoord")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    FogCoord = node as IX3DFogCoordinateNode;
                    if (FogCoord == 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 == "ccw")
            {
                CCW = parser.ParseBoolValue();
            }
            else if (id == "colorPerVertex")
            {
                ColorPerVertex = parser.ParseBoolValue();
            }
            else if (id == "creaseAngle")
            {
                CreaseAngle = parser.ParseDoubleValue();
            }
            else if (id == "height")
            {
                Height.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            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.ParseDoubleValue();
            }
            else if (id == "zDimension")
            {
                ZDimension = parser.ParseIntValue();
            }
            else if (id == "zSpacing")
            {
                ZSpacing = parser.ParseDoubleValue();
            }
            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 X3DShapeNode;
					if(child==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Children.Add(child);
				}
			}
			else if(id=="controlPoint")
			{
				object token=parser.PeekNextToken();
				if(token is VRMLTokenIdKeywordOrFieldType)
				{
					X3DNode node=parser.ParseSFNodeValue();
					if(node!=null)
					{
						ControlPoint=node as X3DCoordinateNode;
						if(ControlPoint==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					}
				}
				else
				{
					x3dCoordinate coords=new x3dCoordinate();
					coords.Point=parser.ParseSFVec3fOrMFVec3fValue();
					ControlPoint=coords;
				}
			}
			else if(id=="inputCoord")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DCoordinateNode coord=node as X3DCoordinateNode;
					if(coord==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else InputCoord.Add(coord);
				}
			}
			else if(id=="inputTransform")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					IX3DCoordinateDeformerInputTransform transf=node as IX3DCoordinateDeformerInputTransform;
					if(transf==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else InputTransform.Add(transf);
				}
			}
			else if(id=="outputCoord")
			{
				List<X3DNode> nodes=parser.ParseSFNodeOrMFNodeValue();
				foreach(X3DNode node in nodes)
				{
					X3DCoordinateNode coord=node as X3DCoordinateNode;
					if(coord==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else OutputCoord.Add(coord);
				}
			}
			else if(id=="weight") Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else if(id=="uDimension") UDimension=parser.ParseIntValue();
			else if(id=="uKnot") UKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="uOrder") UOrder=parser.ParseIntValue();
			else if(id=="vDimension") VDimension=parser.ParseIntValue();
			else if(id=="vKnot") VKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="vOrder") VOrder=parser.ParseIntValue();
			else if(id=="wDimension") WDimension=parser.ParseIntValue();
			else if(id=="wKnot") WKnot.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="wOrder") WOrder=parser.ParseIntValue();
			else return false;
			return true;
		}
Example #56
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 == "center")
            {
                Center = parser.ParseSFVec3fValue();
            }
            else if (id == "children")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DChildNode child = node as IX3DHAnimJointChildren;
                    if (child == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Children.Add(child);
                    }
                }
            }
            else if (id == "displacers")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    IX3DHAnimDisplacerNode displacer = node as IX3DHAnimDisplacerNode;
                    if (displacer == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Displacers.Add(displacer);
                    }
                }
            }
            else if (id == "limitOrientation")
            {
                LimitOrientation = parser.ParseSFRotationValue();
            }
            else if (id == "llimit")
            {
                Llimit.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            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 == "skinCoordIndex")
            {
                SkinCoordIndex.AddRange(parser.ParseSFInt32OrMFInt32Value());
            }
            else if (id == "skinCoordWeight")
            {
                SkinCoordWeight.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "stiffness")
            {
                if (wasStiffness)
                {
                    Stiffness.AddRange(parser.ParseSFFloatOrMFFloatValue());
                }
                else
                {
                    Stiffness = parser.ParseSFFloatOrMFFloatValue();
                }
                wasStiffness = true;
            }
            else if (id == "translation")
            {
                Translation = parser.ParseSFVec3fValue();
            }
            else if (id == "ulimit")
            {
                Ulimit.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            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;
		}
Example #59
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "fillProperties")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    FillProperties = node as IX3DFillPropertiesNode;
                    if (FillProperties == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "lineProperties")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    LineProperties = node as IX3DLinePropertiesNode;
                    if (LineProperties == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "material")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Material = node as X3DMaterialNode;
                    if (Material == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "shaders")
            {
                List <X3DNode> nodes = parser.ParseSFNodeOrMFNodeValue();
                foreach (X3DNode node in nodes)
                {
                    X3DShaderNode sn = node as X3DShaderNode;
                    if (sn == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                    else
                    {
                        Shaders.Add(sn);
                    }
                }
            }
            else if (id == "texture")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Texture = node as X3DTextureNode;
                    if (Texture == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "textureTransform")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TextureTransform = node as X3DTextureTransformNode;
                    if (TextureTransform == 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=="address") Address=parser.ParseStringValue();
			else if(id=="applicationID") ApplicationID=parser.ParseIntValue();
			else if(id=="articulationParameterCount") ArticulationParameterCount=parser.ParseIntValue();
			else if(id=="articulationParameterDesignatorArray") ArticulationParameterDesignatorArray.AddRange(parser.ParseSFInt32OrMFInt32Value());
			else if(id=="articulationParameterChangeIndicatorArray") ArticulationParameterChangeIndicatorArray.AddRange(parser.ParseSFInt32OrMFInt32Value());
			else if(id=="articulationParameterIdPartAttachedToArray") ArticulationParameterIdPartAttachedToArray.AddRange(parser.ParseSFInt32OrMFInt32Value());
			else if(id=="articulationParameterTypeArray") ArticulationParameterTypeArray.AddRange(parser.ParseSFInt32OrMFInt32Value());
			else if(id=="articulationParameterArray") ArticulationParameterArray.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="center") Center=parser.ParseSFVec3fValue();
			else 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=="collisionType") CollisionType=parser.ParseIntValue();
			else if(id=="deadReckoning") DeadReckoning=parser.ParseIntValue();
			else if(id=="detonationLocation") DetonationLocation=parser.ParseSFVec3fValue();
			else if(id=="detonationRelativeLocation") DetonationRelativeLocation=parser.ParseSFVec3fValue();
			else if(id=="detonationResult") DetonationResult=parser.ParseIntValue();
			else if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="entityCategory") EntityCategory=parser.ParseIntValue();
			else if(id=="entityCountry") EntityCountry=parser.ParseIntValue();
			else if(id=="entityDomain") EntityDomain=parser.ParseIntValue();
			else if(id=="entityExtra") EntityExtra=parser.ParseIntValue();
			else if(id=="entityID") EntityID=parser.ParseIntValue();
			else if(id=="entityKind") EntityKind=parser.ParseIntValue();
			else if(id=="entitySpecific") EntitySpecific=parser.ParseIntValue();
			else if(id=="entitySubCategory") EntitySubCategory=parser.ParseIntValue();
			else if(id=="eventApplicationID") EventApplicationID=parser.ParseIntValue();
			else if(id=="eventEntityID") EventEntityID=parser.ParseIntValue();
			else if(id=="eventNumber") EventNumber=parser.ParseIntValue();
			else if(id=="eventSiteID") EventSiteID=parser.ParseIntValue();
			else if(id=="fired1") Fired1=parser.ParseBoolValue();
			else if(id=="fired2") Fired2=parser.ParseBoolValue();
			else if(id=="fireMissionIndex") FireMissionIndex=parser.ParseIntValue();
			else if(id=="firingRange") FiringRange=parser.ParseDoubleValue();
			else if(id=="firingRate") FiringRate=parser.ParseIntValue();
			else if(id=="forceID") ForceID=parser.ParseIntValue();
			else if(id=="fuse") Fuse=parser.ParseIntValue();
			else if(id=="linearVelocity") LinearVelocity=parser.ParseSFVec3fValue();
			else if(id=="linearAcceleration") LinearAcceleration=parser.ParseSFVec3fValue();
			else if(id=="marking") Marking=parser.ParseStringValue();
			else if(id=="multicastRelayHost") MulticastRelayHost=parser.ParseStringValue();
			else if(id=="multicastRelayPort") MulticastRelayPort=parser.ParseIntValue();
			else if(id=="munitionApplicationID") MunitionApplicationID=parser.ParseIntValue();
			else if(id=="munitionEndPoint") MunitionEndPoint=parser.ParseSFVec3fValue();
			else if(id=="munitionEntityID") MunitionEntityID=parser.ParseIntValue();
			else if(id=="munitionQuantity") MunitionQuantity=parser.ParseIntValue();
			else if(id=="munitionSiteID") MunitionSiteID=parser.ParseIntValue();
			else if(id=="munitionStartPoint") MunitionStartPoint=parser.ParseSFVec3fValue();
			else if(id=="networkMode") NetworkMode=parser.ParseStringValue();
			else if(id=="port") Port=parser.ParseIntValue();
			else if(id=="readInterval") ReadInterval=parser.ParseDoubleValue();
			else if(id=="rotation") Rotation=parser.ParseSFRotationValue();
			else if(id=="scale") Scale=parser.ParseSFVec3fValue();
			else if(id=="scaleOrientation") ScaleOrientation=parser.ParseSFRotationValue();
			else if(id=="siteID") SiteID=parser.ParseIntValue();
			else if(id=="translation") Translation=parser.ParseSFVec3fValue();
			else if(id=="warhead") Warhead=parser.ParseIntValue();
			else if(id=="writeInterval") WriteInterval=parser.ParseDoubleValue();
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else if(id=="rtpHeaderExpected") RtpHeaderExpected=parser.ParseBoolValue();
			else return false;
			return true;
		}