Exemplo n.º 1
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 == "weight")
            {
                Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            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
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "controlPoint")
     {
         ControlPoint.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
     }
     else if (id == "weight")
     {
         Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     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
     {
         return(false);
     }
     return(true);
 }
Exemplo n.º 3
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 == "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);
        }
Exemplo n.º 5
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);
        }