internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="beginCap") BeginCap=parser.ParseBoolValue();
			else if(id=="ccw") CCW=parser.ParseBoolValue();
			else if(id=="convex") Convex=parser.ParseBoolValue();
			else if(id=="creaseAngle") CreaseAngle=parser.ParseDoubleValue();
			else if(id=="crossSection")
			{
				if(wasCrossSection) CrossSection.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
				else CrossSection=parser.ParseSFVec2fOrMFVec2fValue();
				wasCrossSection=true;
			}
			else if(id=="endCap") EndCap=parser.ParseBoolValue();
			else if(id=="orientation")
			{
				if(wasOrientation) Orientation.AddRange(parser.ParseSFRotationOrMFRotationValue());
				else Orientation=parser.ParseSFRotationOrMFRotationValue();
				wasOrientation=true;
			}
			else if(id=="scale")
			{
				if(wasScale) Scale.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
				else Scale=parser.ParseSFVec2fOrMFVec2fValue();
				wasScale=true;
			}
			else if(id=="solid") Solid=parser.ParseBoolValue();
			else if(id=="spine")
			{
				if(wasSpine) Spine.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
				else Spine=parser.ParseSFVec3fOrMFVec3fValue();
				wasSpine=true;
			}
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "closed")
     {
         Closed = parser.ParseBoolValue();
     }
     else if (id == "key")
     {
         Key.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     else if (id == "keyValue")
     {
         KeyValue.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
     }
     else if (id == "keyVelocity")
     {
         KeyVelocity.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
     }
     else if (id == "normalizeVelocity")
     {
         NormalizeVelocity = parser.ParseBoolValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="coordIndex") CoordIndex.AddRange(parser.ParseSFInt32OrMFInt32Value());
			else if(id=="displacements") Displacements.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
			else if(id=="name") Name=parser.ParseStringValue();
			else if(id=="weight") Weight=parser.ParseDoubleValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "tau")
     {
         Tau = parser.ParseDoubleValue();
     }
     else if (id == "tolerance")
     {
         Tolerance = parser.ParseDoubleValue();
     }
     else if (id == "order")
     {
         Order = parser.ParseIntValue();
     }
     else if (id == "initialDestination")
     {
         if (wasInitialDestination)
         {
             InitialDestination.Values.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
         }
         else
         {
             InitialDestination = parser.ParseMFVec3fValue();
         }
         wasInitialDestination = true;
     }
     else if (id == "initialValue")
     {
         if (wasInitialValue)
         {
             InitialValue.Values.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
         }
         else
         {
             InitialValue = parser.ParseMFVec3fValue();
         }
         wasInitialValue = true;
     }
     else
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 5
0
        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 == "knot")
            {
                Knot.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "order")
            {
                Order = parser.ParseIntValue();
            }
            else if (id == "weight" || id == "keyWeight")
            {
                Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "dimension")
            {
                Dimension = parser.ParseIntValue();
            }
            else if (id == "fractionAbsolute")
            {
                FractionAbsolute = parser.ParseBoolValue();
            }
            else if (id == "keyValue")
            {
                List <SFVec3f> controlPoints = parser.ParseSFVec3fOrMFVec3fValue();
                if (ControlPoint == null)
                {
                    ControlPoint = new x3dCoordinate();
                }

                x3dCoordinate cp = ControlPoint as x3dCoordinate;
                if (cp != null)
                {
                    cp.Point.AddRange(controlPoints);
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 6
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "point")
     {
         Point.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
     }
     else
     {
         return(false);
     }
     return(true);
 }
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "key")
     {
         Key.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     else if (id == "keyValue")
     {
         KeyValue.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
     }
     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)
 {
     if (id == "coordIndex")
     {
         CoordIndex.AddRange(parser.ParseSFInt32OrMFInt32Value());
     }
     else if (id == "displacements")
     {
         Displacements.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
     }
     else if (id == "name")
     {
         Name = parser.ParseStringValue();
     }
     else if (id == "weight")
     {
         Weight = parser.ParseDoubleValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
Ejemplo n.º 10
0
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="vector") Vector.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
			else return false;
			return true;
		}
Ejemplo n.º 11
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "beginCap")
     {
         BeginCap = parser.ParseBoolValue();
     }
     else if (id == "ccw")
     {
         CCW = parser.ParseBoolValue();
     }
     else if (id == "convex")
     {
         Convex = parser.ParseBoolValue();
     }
     else if (id == "creaseAngle")
     {
         CreaseAngle = parser.ParseDoubleValue();
     }
     else if (id == "crossSection")
     {
         if (wasCrossSection)
         {
             CrossSection.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
         }
         else
         {
             CrossSection = parser.ParseSFVec2fOrMFVec2fValue();
         }
         wasCrossSection = true;
     }
     else if (id == "endCap")
     {
         EndCap = parser.ParseBoolValue();
     }
     else if (id == "orientation")
     {
         if (wasOrientation)
         {
             Orientation.AddRange(parser.ParseSFRotationOrMFRotationValue());
         }
         else
         {
             Orientation = parser.ParseSFRotationOrMFRotationValue();
         }
         wasOrientation = true;
     }
     else if (id == "scale")
     {
         if (wasScale)
         {
             Scale.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
         }
         else
         {
             Scale = parser.ParseSFVec2fOrMFVec2fValue();
         }
         wasScale = true;
     }
     else if (id == "solid")
     {
         Solid = parser.ParseBoolValue();
     }
     else if (id == "spine")
     {
         if (wasSpine)
         {
             Spine.AddRange(parser.ParseSFVec3fOrMFVec3fValue());
         }
         else
         {
             Spine = parser.ParseSFVec3fOrMFVec3fValue();
         }
         wasSpine = true;
     }
     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=="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;
		}
Ejemplo n.º 14
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);
        }
Ejemplo n.º 15
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            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 == "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 == "uTessellation")
            {
                UTessellation = parser.ParseIntValue();
            }
            else if (id == "vTessellation")
            {
                VTessellation = parser.ParseIntValue();
            }
            else if (id == "weight")
            {
                Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "ccw")
            {
                CCW = parser.ParseBoolValue();
            }
            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);
        }