상속: IfcColourSpecification, IfcColourOrFactor
예제 #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
        public static string STEPString(IfcColourOrFactor colourOrFactor)
        {
            if (colourOrFactor == null)
            {
                return("$");
            }
            IfcColourRgb colourRgb = colourOrFactor as IfcColourRgb;

            if (colourRgb != null)
            {
                return("#" + colourRgb.StepId);
            }
            IfcNormalisedRatioMeasure normalisedRatioMeasure = colourOrFactor as IfcNormalisedRatioMeasure;

            if (normalisedRatioMeasure != null)
            {
                return(normalisedRatioMeasure.ToString());
            }
            return("$");
        }
예제 #3
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)));
        }
예제 #4
0
        internal static IfcColourOrFactor parseColourOrFactor(string str, ConcurrentDictionary <int, BaseClassIfc> dictionary)
        {
            if (string.IsNullOrEmpty(str) || str[0] == '$')
            {
                return(null);
            }

            if (str[0] == '#')
            {
                int i = ParserSTEP.ParseLink(str);
                if (i > 0)
                {
                    return(dictionary[i] as IfcColourOrFactor);
                }
                return(null);
            }
            string kw = "", def = "";
            int    id = 0, pos = 0;

            ParserSTEP.GetKeyWord(str, out id, out kw, out def);
            if (string.IsNullOrEmpty(kw))
            {
                return(null);
            }
            if (string.Compare(kw, "IFCCOLOURRGB", true) == 0)
            {
                IfcColourRgb color = new IfcColourRgb();
                color.parse(def, ref pos, ReleaseVersion.IFC2x3, def.Length, null);
                return(color);
            }
            double ratio = 0;

            if (double.TryParse(def, System.Globalization.NumberStyles.Any, ParserSTEP.NumberFormat, out ratio))
            {
                return(new IfcNormalisedRatioMeasure(ratio));
            }
            return(null);
        }
예제 #5
0
        internal static IfcColourOrFactor parseColourOrFactor(string str)
        {
            if (string.IsNullOrEmpty(str) || str[0] == '#' || str[0] == '$')
            {
                return(null);
            }

            string kw = "", def = "";
            int    id = 0, pos = 0;

            ParserSTEP.GetKeyWord(str, out id, out kw, out def);
            if (string.IsNullOrEmpty(kw))
            {
                return(null);
            }
            if (string.Compare(kw, "IFCCOLOURRGB", false) == 0)
            {
                IfcColourRgb color = new IfcColourRgb();
                color.parse(def, ref pos, ReleaseVersion.IFC2x3, def.Length, null);
                return(color);
            }
            return(new IfcNormalisedRatioMeasure(ParserSTEP.ParseDouble(def)));
        }
예제 #6
0
        internal static IfcColour parseColour(string str)
        {
            string kw = "", def = "";
            int    id = 0, pos = 0;

            ParserSTEP.GetKeyWord(str, out id, out kw, out def);
            if (string.IsNullOrEmpty(kw))
            {
                return(null);
            }
            if (string.Compare(kw, "IFCCOLOURRGB", false) == 0)
            {
                IfcColourRgb color = new IfcColourRgb();
                color.parse(def, ref pos, ReleaseVersion.IFC2x3, def.Length, null);
                return(color);
            }
            if (string.Compare(kw, "IFCDRAUGHTINGPREDEFINEDCOLOUR", false) == 0)
            {
                IfcDraughtingPreDefinedColour color = new IfcDraughtingPreDefinedColour();
                color.parse(def, ref pos, ReleaseVersion.IFC2x3, def.Length, null);
                return(color);
            }
            return(null);
        }
예제 #7
0
파일: IFC C.cs 프로젝트: jenca-cloud/ggIFC
		internal static void parseFields(IfcColourRgb c, List<string> arrFields, ref int ipos) { IfcColourSpecification.parseFields(c, arrFields, ref ipos); c.mRed = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mGreen = ParserSTEP.ParseDouble(arrFields[ipos++]); c.mBlue = ParserSTEP.ParseDouble(arrFields[ipos++]); }
예제 #8
0
파일: IFC C.cs 프로젝트: jenca-cloud/ggIFC
		internal static IfcColourRgb Parse(string strDef) { IfcColourRgb c = new IfcColourRgb(); int ipos = 0; parseFields(c, ParserSTEP.SplitLineFields(strDef), ref ipos); return c; }
예제 #9
0
파일: IFC C.cs 프로젝트: jenca-cloud/ggIFC
		internal IfcColourRgb(IfcColourRgb c) : base(c) { mRed = c.mRed; mGreen = c.mGreen; mBlue = c.mBlue; }
예제 #10
0
파일: IFC S.cs 프로젝트: jenca-cloud/ggIFC
		public IfcSurfaceStyleShading(DatabaseIfc m, Color surface) : base(m) { mSurfaceColour =  new IfcColourRgb(m,"",surface).mIndex; }