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

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

            if (id == "centerOfRotation")
            {
                CenterOfRotation = parser.ParseSFVec3fStringValue();
            }
            else if (id == "description")
            {
                Description = parser.ParseStringValue();
            }
            else if (id == "fieldOfView")
            {
                FieldOfView = parser.ParseDoubleValue();
            }
            else if (id == "headlight")
            {
                Headlight = parser.ParseBoolValue();
            }
            else if (id == "jump")
            {
                Jump = parser.ParseBoolValue();
            }
            else if (id == "navType")
            {
                if (wasNavType)
                {
                    NavType.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    NavType = parser.ParseSFStringOrMFStringValue();
                }
                wasNavType = true;
            }
            else if (id == "geoOrigin")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    GeoOrigin = node as IX3DGeoOriginNode;
                    if (GeoOrigin == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "geoSystem")
            {
                if (wasGeoSystem)
                {
                    GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
                }
                else
                {
                    GeoSystem = parser.ParseSFStringOrMFStringValue();
                }
                wasGeoSystem = true;
            }
            else if (id == "orientation")
            {
                Orientation = parser.ParseSFRotationValue();
            }
            else if (id == "position")
            {
                Position = parser.ParseSFVec3fStringValue();
            }
            else if (id == "retainUserOffsets")
            {
                RetainUserOffsets = parser.ParseBoolValue();
            }
            else if (id == "speedFactor")
            {
                SpeedFactor = parser.ParseDoubleValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }