Esempio n. 1
0
 internal static ThreeMfResource ParseResource(XElement element, Dictionary <int, ThreeMfResource> resourceMap, Package package)
 {
     if (element.Name == ObjectName)
     {
         return(ThreeMfObject.ParseObject(element, resourceMap, package));
     }
     else if (element.Name == BaseMaterialsName)
     {
         return(ThreeMfBaseMaterials.ParseBaseMaterials(element));
     }
     else if (element.Name == ColorGroupName)
     {
         return(ThreeMfColorGroup.ParseColorGroup(element));
     }
     else if (element.Name == Texture2DName)
     {
         return(ThreeMfTexture2D.ParseTexture(element, package));
     }
     else if (element.Name == Texture2DGroupName)
     {
         return(ThreeMfTexture2DGroup.ParseTexture2DGroup(element, resourceMap));
     }
     else
     {
         return(null);
     }
 }
        internal static ThreeMfColorGroup ParseColorGroup(XElement element)
        {
            var colorGroup = new ThreeMfColorGroup();

            colorGroup.Id = element.AttributeIntValueOrThrow(IdAttributeName);
            foreach (var colorElement in element.Elements(ThreeMfColor.ColorName))
            {
                var color = ThreeMfColor.ParseColor(colorElement);
                colorGroup.Colors.Add(color);
            }

            return(colorGroup);
        }