예제 #1
0
        internal static IfcColour parseColour(string str)
        {
            string kw = "", def = "";
            int    id = 0;

            ParserSTEP.GetKeyWord(str, out id, out kw, out def);
            if (string.IsNullOrEmpty(kw))
            {
                return(null);
            }
            if (string.Compare(kw, "IFCCOLOURRGB", false) == 0)
            {
                return(IfcColourRgb.Parse(str));
            }
            if (string.Compare(kw, "IFCDRAUGHTINGPREDEFINEDCOLOUR", false) == 0)
            {
                return(IfcDraughtingPreDefinedColour.Parse(str));
            }
            return(null);
        }
예제 #2
0
        internal static IfcColourOrFactor parseColourOrFactor(string str)
        {
            if (str[0] == '#')
            {
                return(null);
            }
            string kw = "", def = "";
            int    id = 0;

            ParserIfc.GetKeyWord(str, out id, out kw, out def);
            if (string.IsNullOrEmpty(kw))
            {
                return(null);
            }
            if (string.Compare(kw, "IFCCOLOURRGB", false) == 0)
            {
                return(IfcColourRgb.Parse(str));
            }
            return(new IfcNormalisedRatioMeasure(ParserSTEP.ParseDouble(def)));
        }