Example #1
0
 protected IfcBSplineCurve(DatabaseIfc db, IfcBSplineCurve c) : base(db, c)
 {
     mDegree = c.mDegree;
     ControlPointsList.AddRange(c.ControlPointsList.Select(x => db.Factory.Duplicate(x) as IfcCartesianPoint));
     mCurveForm     = c.mCurveForm;
     mClosedCurve   = c.mClosedCurve;
     mSelfIntersect = c.mSelfIntersect;
 }
Example #2
0
		protected IfcBSplineSurface(DatabaseIfc db, IfcBSplineSurface s, DuplicateOptions options) : base(db, s, options)
		{
			mUDegree = s.mUDegree;
			mVDegree = s.mVDegree;
			foreach(LIST<IfcCartesianPoint> ps in s.ControlPointsList)
				mControlPointsList.Add(new LIST<IfcCartesianPoint>(ps.ConvertAll(x=>db.Factory.Duplicate(x) as IfcCartesianPoint)));
			mSurfaceForm = s.mSurfaceForm;
			mUClosed = s.mUClosed;
			mVClosed = s.mVClosed;
			mSelfIntersect = s.mSelfIntersect;
		}
Example #3
0
 public static string LogicalToString(IfcLogicalEnum l)
 {
     if (l == IfcLogicalEnum.TRUE)
     {
         return(".T.");
     }
     else if (l == IfcLogicalEnum.FALSE)
     {
         return(".F.");
     }
     return(".U.");
 }
Example #4
0
        public static IfcLogicalEnum StripLogical(string s, ref int pos, int len)
        {
            IfcLogicalEnum result   = IfcLogicalEnum.UNKNOWN;
            int            icounter = pos;

            while (char.IsWhiteSpace(s[icounter]))
            {
                icounter++;
                if (icounter == len)
                {
                    break;
                }
            }
            if (s[icounter] == '$')
            {
                if (++icounter < len)
                {
                    while (s[icounter++] != ',')
                    {
                        if (icounter == len)
                        {
                            break;
                        }
                    }
                }
                pos = icounter;
                return(result);
            }
            if (s[icounter++] != '.')
            {
                throw new Exception("Unrecognized format!");
            }
            char c = char.ToUpper(s[icounter++]);

            if (c == 'T')
            {
                result = IfcLogicalEnum.TRUE;
            }
            else if (c == 'F')
            {
                result = IfcLogicalEnum.TRUE;
            }
            pos = icounter + 2;
            return(result);
        }
Example #5
0
 internal IfcIndexedPolyCurve(DatabaseIfc db, IfcIndexedPolyCurve c) : base(db, c)
 {
     Points = db.Factory.Duplicate(c.Points) as IfcCartesianPointList; mSegments.AddRange(c.mSegments); mSelfIntersect = c.mSelfIntersect;
 }
Example #6
0
 protected virtual void Parse(string str, ref int pos, int len)
 {
     mUDegree =  int.Parse(ParserSTEP.StripField(str, ref pos, len));
     mVDegree = int.Parse(ParserSTEP.StripField(str, ref pos, len));
     mControlPointsList = ParserSTEP.StripListListLink(str, ref pos, len);
     string s = ParserSTEP.StripField(str, ref pos, len);
     if(s[0] == '.')
         Enum.TryParse<IfcBSplineSurfaceForm>(s.Replace(".", ""),out mSurfaceForm);
     mUClosed = ParserIfc.StripLogical(str,ref pos, len);
     mVClosed = ParserIfc.StripLogical(str,ref pos, len);
     mSelfIntersect = ParserIfc.StripLogical(str,ref pos, len);
 }
 protected IfcAlignment2DSegment(DatabaseIfc m, bool tangential, string startTag, string endTag) : base(m)
 {
     mTangentialContinuity = (tangential ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); StartTag = startTag; EndTag = endTag;
 }
Example #8
0
 public IfcLogical(bool value)
 {
     mValue = value ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE;
 }
Example #9
0
		public IfcLogical(bool value) { mValue = value ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE; }
Example #10
0
 protected IfcAlignment2DSegment(DatabaseIfc m, bool tangential, string startTag, string endTag)
     : base(m)
 {
     mTangentialContinuity = (tangential ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); StartTag = startTag; EndTag = endTag;
 }
Example #11
0
		internal IfcBSplineSurfaceWithKnots(DatabaseIfc m, int uDegree, int vDegree, IfcBSplineSurfaceForm form, List<List<IfcCartesianPoint>> controlPoints, IfcLogicalEnum uClosed, IfcLogicalEnum vClosed, IfcLogicalEnum selfIntersect, List<int> uMultiplicities, List<int> vMultiplicities, List<double> uKnots, List<double> vKnots, IfcKnotType type)
			: base(m, uDegree, vDegree, controlPoints, form, uClosed, vClosed, selfIntersect)
		{
			mUMultiplicities.AddRange(uMultiplicities);
			mVMultiplicities.AddRange(vMultiplicities);
			mUKnots.AddRange(uKnots);
			mVKnots.AddRange(vKnots);
		}
Example #12
0
		internal IfcMaterialLayer(IfcMaterialLayer m) : base(m) { mMaterial = m.mMaterial; mLayerThickness = m.mLayerThickness; mIsVentilated = m.mIsVentilated; }
Example #13
0
		private IfcBSplineSurface(DatabaseIfc m, int uDegree, int vDegree, IfcBSplineSurfaceForm form, IfcLogicalEnum uClosed, IfcLogicalEnum vClosed, IfcLogicalEnum selfIntersect)
			: base(m)
		{
			mUDegree = uDegree;
			mVDegree = vDegree;
			mSurfaceForm = form;
			mUClosed = uClosed;
			mVClosed = vClosed;
			mSelfIntersect = selfIntersect;
		}
Example #14
0
		protected IfcBSplineSurface(DatabaseIfc m, int uDegree, int vDegree, List<List<IfcCartesianPoint>> controlPoints, IfcBSplineSurfaceForm form, IfcLogicalEnum uClosed, IfcLogicalEnum vClosed, IfcLogicalEnum selfIntersect) :
			this(m, uDegree, vDegree, form, uClosed, vClosed, selfIntersect)
		{
			foreach (List<IfcCartesianPoint> cps in controlPoints)
				mControlPointsList.Add(cps.ConvertAll(x => x.mIndex));
		}
Example #15
0
		protected IfcBSplineSurface(IfcBSplineSurface pl)
			: base(pl)
		{
			mUDegree = pl.mUDegree;
			mVDegree = pl.mVDegree;
			for (int icounter = 0; icounter < pl.mControlPointsList.Count; icounter++)
				mControlPointsList.Add(new List<int>(pl.mControlPointsList[icounter].ToArray()));
			mSurfaceForm = pl.mSurfaceForm;
			mUClosed = pl.mUClosed;
			mVClosed = pl.mVClosed;
			mSelfIntersect = pl.mSelfIntersect;
		}
Example #16
0
		private IfcBSplineCurve(DatabaseIfc m, int degree, IfcBSplineCurveForm form, IfcLogicalEnum closed, IfcLogicalEnum selfIntersect)
			: base(m)
		{
			mDegree = degree;
			mCurveForm = form;
			mClosedCurve = closed;
			mSelfIntersect = selfIntersect;
		}
Example #17
0
		protected IfcBSplineCurve(IfcBSplineCurve pl)
			: base(pl)
		{
			mDegree = pl.mDegree;
			mControlPointsList = new List<int>(pl.mControlPointsList.ToArray());
			mCurveForm = pl.mCurveForm;
			mClosedCurve = pl.mClosedCurve;
			mSelfIntersect = pl.mSelfIntersect;
		}
Example #18
0
 internal IfcLogical(IfcLogicalEnum value)
 {
     mValue = value;
 }
Example #19
0
 internal IfcIndexedPolyCurve(IfcIndexedPolyCurve p) : base(p)
 {
     mPoints = p.mPoints; mSegments.AddRange(p.mSegments); mSelfIntersect = p.mSelfIntersect;
 }
Example #20
0
		internal IfcCompositeCurve(IfcCompositeCurve pl) : base(pl) { mSegments = new List<int>(pl.mSegments.ToArray()); mSelfIntersect = pl.mSelfIntersect; }
Example #21
0
		public static string LogicalToString(IfcLogicalEnum l)
		{
			if (l == IfcLogicalEnum.TRUE)
				return ".T.";
			else if (l == IfcLogicalEnum.FALSE)
				return ".F.";
			return ".U.";
		}
Example #22
0
        internal static IfcSimpleValue parseSimpleValue(string str)
        {
            if (str.StartsWith("IFCBOOLEAN("))
            {
                return(new IfcBoolean(string.Compare(str.Substring(11, str.Length - 12), ".T.") == 0));
            }
            if (str.StartsWith("IFCIDENTIFIER("))
            {
                return(new IfcIdentifier(ParserIfc.Decode(str.Substring(15, str.Length - 17))));
            }
            if (str.StartsWith("IFCINTEGER("))
            {
                return(new IfcInteger(long.Parse(str.Substring(11, str.Length - 12))));
            }
            if (str.StartsWith("IFCLABEL("))
            {
                if (str.Length <= 12)
                {
                    return(new IfcLabel(""));
                }
                string s = str.Substring(10, str.Length - 12);
                return(new IfcLabel((str[10] == '$' || s == null ? "" : ParserIfc.Decode(s))));
            }
            if (str.StartsWith("IFCLOGICAL("))
            {
                string         s = str.Substring(11, str.Length - 12);
                IfcLogicalEnum l = IfcLogicalEnum.UNKNOWN;
                if (s == ".T.")
                {
                    l = IfcLogicalEnum.TRUE;
                }
                else if (s == ".F.")
                {
                    l = IfcLogicalEnum.FALSE;
                }
                return(new IfcLogical(l));
            }
            if (str.StartsWith("IFCREAL("))
            {
                return(new IfcReal(ParserSTEP.ParseDouble(str.Substring(8, str.Length - 9))));
            }
            if (str.StartsWith("IFCTEXT("))
            {
                string s = str.Substring(9, str.Length - 11);
                return(new IfcText((str[9] == '$' || s == null ? "" : ParserIfc.Decode(s))));
            }
            if (str.StartsWith("IFCURIREFERENCE("))
            {
                return(new IfcURIReference(str[16] == '$' ? "" : ParserIfc.Decode(str.Substring(17, str.Length - 19))));
            }
            if (str.StartsWith("IFCDURATION("))
            {
                return(IfcDuration.Convert(str.Substring(13, str.Length - 15)));
            }
            int i = 0;

            if (int.TryParse(str, out i))
            {
                return(new IfcInteger(i));
            }
            double d = 0;

            if (double.TryParse(str, System.Globalization.NumberStyles.Any, ParserSTEP.NumberFormat, out d))
            {
                return(new IfcReal(d));
            }
            if (str == ".T.")
            {
                return(new IfcBoolean(true));
            }
            if (str == ".F.")
            {
                return(new IfcBoolean(false));
            }
            if (str == ".U.")
            {
                return(new IfcLogical(IfcLogicalEnum.UNKNOWN));
            }
            return(null);
        }
Example #23
0
 internal IfcIndexedPolyCurve(DatabaseIfc db, IfcIndexedPolyCurve c)
     : base(db, c)
 {
     Points = db.Factory.Duplicate(c.Points) as IfcCartesianPointList; mSegments.AddRange(c.mSegments); mSelfIntersect = c.mSelfIntersect;
 }
Example #24
0
 protected IfcAlignment2DSegment(IfcAlignment2DSegment s)
     : base()
 {
     mTangentialContinuity = s.mTangentialContinuity; mStartTag = s.mStartTag; mEndTag = s.mEndTag;
 }
Example #25
0
		internal IfcPresentationLayerWithStyle(IfcPresentationLayerWithStyle o) : base(o) { mLayerOn = o.mLayerOn; mLayerFrozen = o.mLayerFrozen; mLayerBlocked = o.mLayerBlocked; mLayerStyles = new List<int>(o.mLayerStyles.ToArray()); }
 protected IfcAlignment2DSegment(IfcAlignment2DSegment s) : base()
 {
     mTangentialContinuity = s.mTangentialContinuity; mStartTag = s.mStartTag; mEndTag = s.mEndTag;
 }
Example #27
0
 protected IfcBSplineCurve(DatabaseIfc db, IfcBSplineCurve c)
     : base(db, c)
 {
     mDegree = c.mDegree;
     ControlPointsList = c.ControlPointsList.ConvertAll(x => db.Factory.Duplicate(x) as IfcCartesianPoint);
     mCurveForm = c.mCurveForm;
     mClosedCurve = c.mClosedCurve;
     mSelfIntersect = c.mSelfIntersect;
 }
Example #28
0
 public IfcLogical(IfcLogicalEnum value)
 {
     mValue = value;
 }
Example #29
0
		public IfcLogical(IfcLogicalEnum value) { mValue = value; }
Example #30
0
		internal IfcLogical(IfcLogicalEnum value) { mValue = value; }
Example #31
0
		internal IfcIndexedPolyCurve(IfcIndexedPolyCurve p) : base(p) { mPoints = p.mPoints; mSegments.AddRange(p.mSegments); mSelfIntersect = p.mSelfIntersect; }
Example #32
0
		internal IfcPresentationLayerWithStyle(string name, string desc, List<IfcLayeredItem> items, string identifier, bool on, bool frozen, bool blocked, List<IfcPresentationStyle> styles )
			: base(name, desc, items, identifier) { mLayerOn = (on ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); mLayerFrozen = (frozen ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); mLayerBlocked = (blocked ? IfcLogicalEnum.TRUE : IfcLogicalEnum.FALSE); if (styles != null && styles.Count > 0) mLayerStyles = styles.ConvertAll(x => x.Index); }
Example #33
0
 protected IfcBSplineSurface(DatabaseIfc db, IfcBSplineSurface s)
     : base(db,s)
 {
     mUDegree = s.mUDegree;
     mVDegree = s.mVDegree;
     List<List<IfcCartesianPoint>> points = s.ControlPointsList;
     foreach(List<IfcCartesianPoint> ps in points)
         mControlPointsList.Add(ps.ConvertAll(x=>db.Factory.Duplicate(x).mIndex));
     mSurfaceForm = s.mSurfaceForm;
     mUClosed = s.mUClosed;
     mVClosed = s.mVClosed;
     mSelfIntersect = s.mSelfIntersect;
 }
Example #34
0
        internal static IfcSimpleValue parseSimpleValue(string str)
        {
            if (str.StartsWith("IFCBOOLEAN("))
            {
                return(new IfcBoolean(string.Compare(str.Substring(11, str.Length - 12), ".T.") == 0));
            }
            if (str.StartsWith("IFCIDENTIFIER("))
            {
                return(new IfcIdentifier(str.Substring(15, str.Length - 17)));
            }
            if (str.StartsWith("IFCINTEGER("))
            {
                return(new IfcInteger(int.Parse(str.Substring(11, str.Length - 12))));
            }
            if (str.StartsWith("IFCLABEL("))
            {
                if (str.Length <= 12)
                {
                    return(new IfcLabel("DEFAULT"));
                }
                string s = str.Substring(10, str.Length - 12);
                return(new IfcLabel((s == "$" || string.IsNullOrEmpty(s) ? "DEFAULT" : s)));
            }
            if (str.StartsWith("IFCLOGICAL("))
            {
                string         s = str.Substring(11, str.Length - 12);
                IfcLogicalEnum l = IfcLogicalEnum.UNKNOWN;
                if (s == ".T.")
                {
                    l = IfcLogicalEnum.TRUE;
                }
                else if (s == ".F.")
                {
                    l = IfcLogicalEnum.FALSE;
                }
                return(new IfcLogical(l));
            }
            if (str.StartsWith("IFCREAL("))
            {
                return(new IfcReal(ParserSTEP.ParseDouble(str.Substring(8, str.Length - 9))));
            }
            if (str.StartsWith("IFCTEXT("))
            {
                string s = str.Substring(9, str.Length - 11);
                return(new IfcText((s == "$" || string.IsNullOrEmpty(s) ? "DEFAULT" : s)));
            }
            int i = 0;

            if (int.TryParse(str, out i))
            {
                return(new IfcInteger(i));
            }
            double d = 0;

            if (double.TryParse(str, out d))
            {
                return(new IfcReal(d));
            }
            if (str == ".T.")
            {
                return(new IfcBoolean(true));
            }
            if (str == ".F.")
            {
                return(new IfcBoolean(false));
            }
            if (str == ".U.")
            {
                return(new IfcLogical(IfcLogicalEnum.UNKNOWN));
            }
            return(null);
        }
Example #35
0
		internal IfcShapeAspect(IfcShapeAspect a) : base()
		{
			mShapeRepresentations = new List<int>(a.mShapeRepresentations.ToArray());
			mName = a.mName;
			mDescription = a.mDescription;
			mProductDefinitional = a.mProductDefinitional;
			mPartOfProductDefinitionShape = a.mPartOfProductDefinitionShape;
		}