Exemple #1
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);
 }
 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);
 }
Exemple #3
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            int line = parser.Line;

            if (id == "key")
            {
                Key.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "keyValue")
            {
                KeyValue.AddRange(parser.ParseSFVec3fStringOrMFVec3fStringsValue());
            }
            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);
        }
Exemple #4
0
        internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
        {
            if (id == "key")
            {
                Key.AddRange(parser.ParseSFFloatOrMFFloatValue());
            }
            else if (id == "keyValue")
            {
                object token = parser.PeekNextToken();
                if (token is VRMLTokenString)
                {
                    string   values = parser.ParseStringValue();
                    string[] parts  = values.Split(new char[] { ' ', '\t', '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);

                    foreach (string part in parts)
                    {
                        string l = part.ToLower();
                        if (l == "true")
                        {
                            KeyValue.Add(new SFBool(true));
                        }
                        else
                        {
                            KeyValue.Add(new SFBool(false));
                        }
                    }
                }
                else
                {
                    List <bool> values = parser.ParseSFBoolOrMFBoolValue();
                    foreach (bool value in values)
                    {
                        KeyValue.Add(new SFBool(value));
                    }
                }
            }
            else
            {
                return(false);
            }
            return(true);
        }
Exemple #5
0
 internal override bool ParseNodeBodyElement(string id, VRMLParser parser)
 {
     if (id == "key")
     {
         Key.AddRange(parser.ParseSFFloatOrMFFloatValue());
     }
     else if (id == "keyValue")
     {
         List <double> values = parser.ParseSFFloatOrMFFloatValue();
         foreach (double value in values)
         {
             KeyValue.Add(new SFFloat(value));
         }
     }
     else
     {
         return(false);
     }
     return(true);
 }
Exemple #6
0
 /// <summary>
 /// Initializes a new instance of <see cref="CatFactory.Mapping.Constraint"/> class
 /// </summary>
 /// <param name="key">Key for constraint</param>
 public Constraint(params string[] key)
 {
     Key.AddRange(key);
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of <see cref="Constraint"/> class
 /// </summary>
 /// <param name="constraintName">Constraint name</param>
 /// <param name="key">Key for constraint</param>
 public Constraint(string constraintName, string[] key)
 {
     ConstraintName = constraintName;
     Key.AddRange(key);
 }