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

            if (id == "center")
            {
                Center = parser.ParseSFVec3fValue();
            }
            else if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else if (id == "size")
            {
                Size = parser.ParseSFVec3fValue();
            }
            else if (id == "targetObject")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TargetObject = node as IX3DTranformSensorTargetObject;
                    if (TargetObject == 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=="direction") Direction=parser.ParseSFVec3fValue();
			else if(id=="intensity") Intensity=parser.ParseDoubleValue();
			else if(id=="location") Location=parser.ParseSFVec3fValue();
			else if(id=="maxBack") MaxBack=parser.ParseDoubleValue();
			else if(id=="maxFront") MaxFront=parser.ParseDoubleValue();
			else if(id=="minBack") MinBack=parser.ParseDoubleValue();
			else if(id=="minFront") MinFront=parser.ParseDoubleValue();
			else if(id=="priority") Priority=parser.ParseDoubleValue();
			else if(id=="source")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Source=node as X3DSoundSourceNode;
					if(Source==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="spatialize") Spatialize=parser.ParseBoolValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "avatarSize")
     {
         if (wasAvatarSize)
         {
             AvatarSize.AddRange(parser.ParseSFFloatOrMFFloatValue());
         }
         else
         {
             AvatarSize = parser.ParseSFFloatOrMFFloatValue();
         }
         wasAvatarSize = true;
     }
     else if (id == "headlight")
     {
         Headlight = parser.ParseBoolValue();
     }
     else if (id == "speed")
     {
         Speed = parser.ParseDoubleValue();
     }
     else if (id == "transitionTime")
     {
         TransitionTime = parser.ParseDoubleValue();
     }
     else if (id == "transitionType")
     {
         if (wasTransitionType)
         {
             TransitionType.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             TransitionType = parser.ParseSFStringOrMFStringValue();
         }
         wasTransitionType = true;
     }
     else if (id == "type")
     {
         if (wasType)
         {
             Type.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             Type = parser.ParseSFStringOrMFStringValue();
         }
         wasType = true;
     }
     else if (id == "visibilityLimit")
     {
         VisibilityLimit = parser.ParseDoubleValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			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 == "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)
 {
     if (id == "align")
     {
         Align = parser.ParseSFStringOrMFStringValue();
     }
     else if (id == "offset")
     {
         Offset = parser.ParseSFFloatOrMFFloatValue();
     }
     else if (id == "offsetUnits")
     {
         OffsetUnits = parser.ParseSFStringOrMFStringValue();
     }
     else if (id == "scaleMode")
     {
         ScaleMode = parser.ParseSFStringOrMFStringValue();
     }
     else if (id == "size")
     {
         Size = parser.ParseSFFloatOrMFFloatValue();
     }
     else if (id == "sizeUnits")
     {
         SizeUnits = parser.ParseSFStringOrMFStringValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "name")
            {
                Name = parser.ParseStringValue();
            }
            else if (id == "shape")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Shape = node as IX3DCADFaceShape;
                    if (Shape == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            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=="anchorPoint") AnchorPoint=parser.ParseSFVec3fValue();
			else if(id=="body1")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body1=node as IX3DRigidBodyNode;
					if(Body1==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="body2")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					Body2=node as IX3DRigidBodyNode;
					if(Body2==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="forceOutput"||id=="mustOutput")
			{
				if(wasForceOutput) ForceOutput.AddRange(parser.ParseSFStringOrMFStringValue());
				else ForceOutput=parser.ParseSFStringOrMFStringValue();
				wasForceOutput=true;
			}
			else return false;
			return true;
		}
Esempio n. 10
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "ambientIntensity")
     {
         AmbientIntensity = parser.ParseDoubleValue();
     }
     else if (id == "backAmbientIntensity")
     {
         BackAmbientIntensity = parser.ParseDoubleValue();
     }
     else if (id == "backDiffuseColor")
     {
         BackDiffuseColor = parser.ParseSFColorValue();
     }
     else if (id == "backEmissiveColor")
     {
         BackEmissiveColor = parser.ParseSFColorValue();
     }
     else if (id == "backShininess")
     {
         BackShininess = parser.ParseDoubleValue();
     }
     else if (id == "backSpecularColor")
     {
         BackSpecularColor = parser.ParseSFColorValue();
     }
     else if (id == "backTransparency")
     {
         BackTransparency = parser.ParseDoubleValue();
     }
     else if (id == "diffuseColor")
     {
         DiffuseColor = parser.ParseSFColorValue();
     }
     else if (id == "emissiveColor")
     {
         EmissiveColor = parser.ParseSFColorValue();
     }
     else if (id == "shininess")
     {
         Shininess = parser.ParseDoubleValue();
     }
     else if (id == "separateBackColor")
     {
         SeparateBackColor = parser.ParseBoolValue();
     }
     else if (id == "specularColor")
     {
         SpecularColor = parser.ParseSFColorValue();
     }
     else if (id == "transparency")
     {
         Transparency = parser.ParseDoubleValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "closureType")
     {
         ClosureType = parser.ParseStringValue();
     }
     else if (id == "endAngle")
     {
         EndAngle = parser.ParseDoubleValue();
     }
     else if (id == "radius")
     {
         Radius = parser.ParseDoubleValue();
     }
     else if (id == "solid")
     {
         Solid = parser.ParseBoolValue();
     }
     else if (id == "startAngle")
     {
         StartAngle = parser.ParseDoubleValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="info") Info.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="title") Title=parser.ParseStringValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="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;
		}
Esempio n. 14
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "position")
     {
         Position = parser.ParseSFVec3fValue();
     }
     else if (id == "speed")
     {
         Speed = parser.ParseDoubleValue();
     }
     else if (id == "variation")
     {
         Variation = parser.ParseDoubleValue();
     }
     else if (id == "mass")
     {
         Mass = parser.ParseDoubleValue();
     }
     else if (id == "surfaceArea")
     {
         SurfaceArea = parser.ParseDoubleValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
Esempio n. 15
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "collidables" || 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 if (id == "enabled")
            {
                Enabled = parser.ParseBoolValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="groundAngle") GroundAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="groundColor") GroundColor.AddRange(parser.ParseSFColorOrMFColorValue());
			else if(id=="backUrl") BackUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="bottomUrl") BottomUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="frontUrl") FrontUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="leftUrl") LeftUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="rightUrl") RightUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="topUrl") TopUrl.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="skyAngle") SkyAngle.AddRange(parser.ParseSFFloatOrMFFloatValue());
			else if(id=="skyColor")
			{
				if(wasSkyColor) SkyColor.AddRange(parser.ParseSFColorOrMFColorValue());
				else SkyColor=parser.ParseSFColorOrMFColorValue();
				wasSkyColor=true;
			}
			else if(id=="transparency")
			{
				// since X3D Node Spec and VRML Classic Coding Spec disagree on the fieldType
				List<double> values=parser.ParseSFFloatOrMFFloatValue();
				if(values.Count!=0) Transparency=values[0];
			}
			else return false;
			return true;
		}
Esempio n. 17
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=="geoCoords") GeoCoords=parser.ParseSFVec3fStringValue();
			else if(id=="geoOrigin")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					GeoOrigin=node as IX3DGeoOriginNode;
					if(GeoOrigin==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="geoSystem")
			{
				if(wasGeoSystem) GeoSystem.AddRange(parser.ParseSFStringOrMFStringValue());
				else GeoSystem=parser.ParseSFStringOrMFStringValue();
				wasGeoSystem=true;
			}
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="deletionAllowed") DeletionAllowed=parser.ParseBoolValue();
			else if(id=="enabled") Enabled=parser.ParseBoolValue();
			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)
		{
			if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="name") Name=parser.ParseStringValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "bottom")
     {
         Bottom = parser.ParseBoolValue();
     }
     else if (id == "height")
     {
         Height = parser.ParseDoubleValue();
     }
     else if (id == "radius")
     {
         Radius = parser.ParseDoubleValue();
     }
     else if (id == "side")
     {
         Side = parser.ParseBoolValue();
     }
     else if (id == "solid")
     {
         Solid = parser.ParseBoolValue();
     }
     else if (id == "top")
     {
         Top = parser.ParseBoolValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "direction")
     {
         Direction = parser.ParseSFVec3fValue();
     }
     else if (id == "enabled")
     {
         Enabled = parser.ParseBoolValue();
     }
     else if (id == "gustiness")
     {
         Gustiness = parser.ParseDoubleValue();
     }
     else if (id == "speed")
     {
         Speed = parser.ParseDoubleValue();
     }
     else if (id == "turbulence")
     {
         Turbulence = parser.ParseDoubleValue();
     }
     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)
		{
			if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="name") Name=parser.ParseStringValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "description")
     {
         Description = parser.ParseStringValue();
     }
     else if (id == "loop")
     {
         Loop = parser.ParseBoolValue();
     }
     else if (id == "pitch")
     {
         Pitch = parser.ParseDoubleValue();
     }
     else if (id == "startTime")
     {
         StartTime = parser.ParseDoubleValue();
     }
     else if (id == "stopTime")
     {
         StopTime = parser.ParseDoubleValue();
     }
     else if (id == "url")
     {
         URL.AddRange(parser.ParseSFStringOrMFStringValue());
     }
     else
     {
         return(false);
     }
     return(true);
 }
Esempio n. 27
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 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)
		{
			if(id=="value") Value.AddRange(parser.ParseSFMatrix4fOrMFMatrix4fValue());
			else if(id=="name") Name=parser.ParseStringValue();
			else return false;
			return true;
		}
Esempio n. 29
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")
            {
                Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else
            {
                return(false);
            }
            return(true);
        }
Esempio n. 30
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=="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=="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;
		}
Esempio n. 32
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "family")
     {
         if (wasFamily)
         {
             Family.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             Family = parser.ParseSFStringOrMFStringValue();
         }
         wasFamily = true;
     }
     else if (id == "horizontal")
     {
         Horizontal = parser.ParseBoolValue();
     }
     else if (id == "justify")
     {
         if (wasJustify)
         {
             Justify.AddRange(parser.ParseSFStringOrMFStringValue());
         }
         else
         {
             Justify = parser.ParseSFStringOrMFStringValue();
         }
         wasJustify = true;
     }
     else if (id == "language")
     {
         Language = parser.ParseStringValue();
     }
     else if (id == "leftToRight")
     {
         LeftToRight = parser.ParseBoolValue();
     }
     else if (id == "pointSize")
     {
         PointSize = parser.ParseDoubleValue();
     }
     else if (id == "spacing")
     {
         Spacing = parser.ParseDoubleValue();
     }
     else if (id == "style")
     {
         Style = parser.ParseStringValue();
     }
     else if (id == "topToBottom")
     {
         TopToBottom = parser.ParseBoolValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="vertices")Vertices.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
			else if(id=="solid") Solid=parser.ParseBoolValue();
			else return false;
			return true;
		}
Esempio n. 34
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "url")
            {
                URL.AddRange(parser.ParseSFStringOrMFStringValue());
            }
            else if (id == "repeatS")
            {
                RepeatS = parser.ParseBoolValue();
            }
            else if (id == "repeatT")
            {
                RepeatT = parser.ParseBoolValue();
            }
            else if (id == "textureProperties")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TextureProperties = node as IX3DTexturePropertiesNode;
                    if (TextureProperties == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            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)
		{
			if(id=="address") Address=parser.ParseStringValue();
			else if(id=="applicationID") ApplicationID=parser.ParseIntValue();
			else if(id=="data") Data.AddRange(parser.ParseSFInt32OrMFInt32Value());
			else if(id=="dataLength") DataLength=parser.ParseIntValue();
			else if(id=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="encodingScheme") EncodingScheme=parser.ParseIntValue();
			else if(id=="entityID") EntityID=parser.ParseIntValue();
			else if(id=="multicastRelayHost") MulticastRelayHost=parser.ParseStringValue();
			else if(id=="multicastRelayPort") MulticastRelayPort=parser.ParseIntValue();
			else if(id=="networkMode") NetworkMode=parser.ParseStringValue();
			else if(id=="port") Port=parser.ParseIntValue();
			else if(id=="radioID") RadioID=parser.ParseIntValue();
			else if(id=="readInterval") ReadInterval=parser.ParseDoubleValue();
			else if(id=="rtpHeaderExpected") RtpHeaderExpected=parser.ParseBoolValue();
			else if(id=="sampleRate") SampleRate=parser.ParseIntValue();
			else if(id=="samples") Samples=parser.ParseIntValue();
			else if(id=="siteID") SiteID=parser.ParseIntValue();
			else if(id=="tdlType") TdlType=parser.ParseIntValue();
			else if(id=="whichGeometry") WhichGeometry=parser.ParseIntValue();
			else if(id=="writeInterval") WriteInterval=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=="enabled") Enabled=parser.ParseBoolValue();
			else if(id=="force") Force=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);
        }
Esempio n. 39
0
 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.ParseSFVec2fOrMFVec2fValue());
     }
     else if (id == "keyVelocity")
     {
         KeyVelocity.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
     }
     else if (id == "normalizeVelocity")
     {
         NormalizeVelocity = parser.ParseBoolValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
Esempio n. 40
0
 public Scene3D TestConv(string vrmlPath)
 {
     VRML97Tokenizer tokenizer = new VRML97Tokenizer(File.Open(vrmlPath, FileMode.Open));
     VRMLParser parser = new VRMLParser(tokenizer);
     VRMLScene vrml = parser.Parse();
     return TestConv(vrml);
 }
		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)
		{
			if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="type") Type=parser.ParseStringValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "tau")
     {
         Tau = parser.ParseDoubleValue();
     }
     else if (id == "tolerance")
     {
         Tolerance = parser.ParseDoubleValue();
     }
     else if (id == "initialDestination")
     {
         InitialDestination = parser.ParseSFVec2fValue();
     }
     else if (id == "initialValue")
     {
         InitialValue = parser.ParseSFVec2fValue();
     }
     else if (id == "order")
     {
         Order = parser.ParseIntValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

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

            if (id == "enabled")
            {
                Enabled = 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
            {
                return(false);
            }
            return(true);
        }
Esempio n. 47
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "update")
            {
                Update = parser.ParseStringValue();
            }
            else if (id == "size")
            {
                Size = parser.ParseIntValue();
            }
            else if (id == "textureProperties")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    TextureProperties = node as IX3DTexturePropertiesNode;
                    if (TextureProperties == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="crossSectionCurve")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					CrossSectionCurve=node as X3DNurbsControlCurveNode;
					if(CrossSectionCurve==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="trajectoryCurve")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TrajectoryCurve=node as IX3DNurbsCurveNode;
					if(TrajectoryCurve==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else if(id=="ccw") CCW=parser.ParseBoolValue();
			else if(id=="solid") Solid=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 X3DChildNode;
					if(child==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
					else Children.Add(child);
				}
			}
			else if(id=="objectType")
			{
				if(wasObjectType) ObjectType.AddRange(parser.ParseSFStringOrMFStringValue());
				else ObjectType=parser.ParseSFStringOrMFStringValue();
				wasObjectType=true;
			}
			else if(id=="pickable") Pickable=parser.ParseBoolValue();
			else if(id=="bboxCenter") BBoxCenter=parser.ParseSFVec3fValue();
			else if(id=="bboxSize") BBoxSize=parser.ParseSFVec3fValue();
			else return false;
			return true;
		}
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "ambientIntensity")
     {
         AmbientIntensity = parser.ParseDoubleValue();
     }
     else if (id == "color")
     {
         Color = parser.ParseSFColorValue();
     }
     else if (id == "direction")
     {
         Direction = parser.ParseSFVec3fValue();
     }
     else if (id == "global")
     {
         Global = parser.ParseBoolValue();
     }
     else if (id == "intensity")
     {
         Intensity = parser.ParseDoubleValue();
     }
     else if (id == "on")
     {
         On = parser.ParseBoolValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			if(id=="description") Description=parser.ParseStringValue();
			else if(id=="loop") Loop=parser.ParseBoolValue();
			else if(id=="pauseTime") PauseTime=parser.ParseDoubleValue();
			else if(id=="resumeTime") ResumeTime=parser.ParseDoubleValue();
			else if(id=="speed"||id=="pitch") Pitch=parser.ParseDoubleValue();
			else if(id=="startTime") StartTime=parser.ParseDoubleValue();
			else if(id=="stopTime") StopTime=parser.ParseDoubleValue();
			else if(id=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="repeatS") RepeatS=parser.ParseBoolValue();
			else if(id=="repeatT") RepeatT=parser.ParseBoolValue();
			else if(id=="textureProperties")
			{
				X3DNode node=parser.ParseSFNodeValue();
				if(node!=null)
				{
					TextureProperties=node as IX3DTexturePropertiesNode;
					if(TextureProperties==null) parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
				}
			}
			else return false;
			return true;
		}
Esempio n. 52
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "controlPoint")
     {
         ControlPoint.AddRange(parser.ParseSFVec2fOrMFVec2fValue());
     }
     else if (id == "tessellation")
     {
         Tessellation = parser.ParseIntValue();
     }
     else if (id == "weight")
     {
         Weight.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     else if (id == "closed")
     {
         Closed = parser.ParseBoolValue();
     }
     else if (id == "knot")
     {
         Knot.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     else if (id == "order")
     {
         Order = parser.ParseIntValue();
     }
     else
     {
         return(false);
     }
     return(true);
 }
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			int line=parser.Line;

			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=="direction") Direction=parser.ParseSFVec3fValue();
			else if(id=="speed") Speed=parser.ParseDoubleValue();
			else if(id=="variation") Variation=parser.ParseDoubleValue();
			else if(id=="coordIndex")
			{
				if(wasCoordIndex) CoordIndex.AddRange(parser.ParseSFInt32OrMFInt32Value());
				else CoordIndex=parser.ParseSFInt32OrMFInt32Value();
				wasCoordIndex=true;
			}
			else if(id=="internal") Internal=parser.ParseBoolValue();
			else if(id=="mass") Mass=parser.ParseDoubleValue();
			else if(id=="surfaceArea") SurfaceArea=parser.ParseDoubleValue();
			else return false;
			return true;
		}
Esempio n. 54
0
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="color") Color=parser.ParseSFColorValue();
			else if(id=="fogType") FogType=parser.ParseStringValue();
			else if(id=="visibilityRange") VisibilityRange=parser.ParseDoubleValue();
			else return false;
			return true;
		}
		internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
		{
			if(id=="innerRadius") InnerRadius=parser.ParseDoubleValue();
			else if(id=="outerRadius") OuterRadius=parser.ParseDoubleValue();
			else if(id=="solid") Solid=parser.ParseBoolValue();
			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=="url") URL.AddRange(parser.ParseSFStringOrMFStringValue());
			else if(id=="directOutput") DirectOutput=parser.ParseBoolValue();
			else if(id=="mustEvaluate") MustEvaluate=parser.ParseBoolValue();
			else return false;
			return true;
		}
Esempio n. 58
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "direction")
            {
                Direction = parser.ParseSFVec3fValue();
            }
            else if (id == "intensity")
            {
                Intensity = parser.ParseDoubleValue();
            }
            else if (id == "location")
            {
                Location = parser.ParseSFVec3fValue();
            }
            else if (id == "maxBack")
            {
                MaxBack = parser.ParseDoubleValue();
            }
            else if (id == "maxFront")
            {
                MaxFront = parser.ParseDoubleValue();
            }
            else if (id == "minBack")
            {
                MinBack = parser.ParseDoubleValue();
            }
            else if (id == "minFront")
            {
                MinFront = parser.ParseDoubleValue();
            }
            else if (id == "priority")
            {
                Priority = parser.ParseDoubleValue();
            }
            else if (id == "source")
            {
                X3DNode node = parser.ParseSFNodeValue();
                if (node != null)
                {
                    Source = node as X3DSoundSourceNode;
                    if (Source == null)
                    {
                        parser.ErrorParsingNode(VRMLReaderError.UnexpectedNodeType, this, id, node, line);
                    }
                }
            }
            else if (id == "spatialize")
            {
                Spatialize = parser.ParseBoolValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Esempio n. 59
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            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 == "direction")
            {
                Direction = parser.ParseSFVec3fValue();
            }
            else if (id == "speed")
            {
                Speed = parser.ParseDoubleValue();
            }
            else if (id == "variation")
            {
                Variation = parser.ParseDoubleValue();
            }
            else if (id == "coordIndex")
            {
                if (wasCoordIndex)
                {
                    CoordIndex.AddRange(parser.ParseSFInt32OrMFInt32Value());
                }
                else
                {
                    CoordIndex = parser.ParseSFInt32OrMFInt32Value();
                }
                wasCoordIndex = true;
            }
            else if (id == "internal")
            {
                Internal = parser.ParseBoolValue();
            }
            else if (id == "mass")
            {
                Mass = parser.ParseDoubleValue();
            }
            else if (id == "surfaceArea")
            {
                SurfaceArea = parser.ParseDoubleValue();
            }
            else
            {
                return(false);
            }
            return(true);
        }
Esempio n. 60
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);
        }