public IfcOwnerHistory(IfcPersonAndOrganization po, IfcApplication app, IfcChangeActionEnum ca) : base(po.mDatabase) { mOwningUser = po.mIndex; mOwningApplication = app.mIndex; mState = IfcStateEnum.NA; mChangeAction = ca; TimeSpan ts = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0); mCreationDate = (int)ts.TotalSeconds; mLastModifiedDate = (int)ts.TotalSeconds; }
internal IfcOwnerHistory(IfcPersonAndOrganization po, IfcApplication app, IfcChangeActionEnum ca) : base(po.mDatabase) { mOwningUser = po.mIndex; mOwningApplication = app.mIndex; mState = IfcStateEnum.NA; mChangeAction = ca; TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0); //if(ca == IfcChangeActionEnum.ADDED) mCreationDate = (int)ts.TotalSeconds; //if (ca != IfcChangeActionEnum.NOTDEFINED) mLastModifiedDate = (int)ts.TotalSeconds; }
internal BaseClassIfc InterpretLine(string line) { if (line.StartsWith("ISO")) { return(null); } string ts = line.Trim().Replace(" ", ""); if (ts.StartsWith("FILE_SCHEMA(('IFC2X4", true, System.Globalization.CultureInfo.CurrentCulture) || ts.StartsWith("FILE_SCHEMA(('IFC4", true, System.Globalization.CultureInfo.CurrentCulture)) { mRelease = ReleaseVersion.IFC4; return(null); } BaseClassIfc result = ParserIfc.ParseLine(line, mRelease); if (result == null) { int ifcID = 0; string kw = "", str = ""; ParserIfc.GetKeyWord(line, out ifcID, out kw, out str); if (string.IsNullOrEmpty(kw)) { return(null); } result = new BaseClassIfc(ifcID, kw, str); } if (result == null) { return(null); } IfcApplication application = result as IfcApplication; if (application != null) { IfcApplication ea = mFactory.mApplication; if (ea != null && ea.mVersion == application.mVersion) { if (string.Compare(ea.ApplicationFullName, application.ApplicationFullName, true) == 0) { if (string.Compare(ea.mApplicationIdentifier, application.mApplicationIdentifier) == 0) { mIfcObjects[ea.mIndex] = null; mFactory.mApplication = application; mFactory.OwnerHistory(IfcChangeActionEnum.ADDED).mLastModifyingApplication = application.mIndex; if (mFactory.mOwnerHistoryModify != null) { mFactory.mOwnerHistoryModify.mLastModifyingApplication = application.mIndex; } } } } } IfcContext context = result as IfcContext; if (context != null) { mContext = context; } IfcGeometricRepresentationContext geometricRepresentationContext = result as IfcGeometricRepresentationContext; if (geometricRepresentationContext != null) { if (string.Compare(geometricRepresentationContext.mContextType, "Plan", true) != 0) { mFactory.mGeomRepContxt = geometricRepresentationContext; } if (geometricRepresentationContext.mPrecision > 1e-6) { Tolerance = geometricRepresentationContext.mPrecision; } } IfcSIUnit unit = result as IfcSIUnit; if (unit != null) { if (unit.Name == IfcSIUnitName.METRE && unit.Prefix == IfcSIPrefix.NONE) { mFactory.mSILength = unit; } else if (unit.Name == IfcSIUnitName.SQUARE_METRE && unit.Prefix == IfcSIPrefix.NONE) { mFactory.mSIArea = unit; } else if (unit.Name == IfcSIUnitName.CUBIC_METRE && unit.Prefix == IfcSIPrefix.NONE) { mFactory.mSIVolume = unit; } } this[result.mIndex] = result; //IfcWorkPlan workPlan = result as IfcWorkPlan; //if(workPlan != null) //{ // mWorkPlans.Add(workPlan); // return workPlan; //} return(result); }
internal BaseClassIfc interpretLine(string line) { BaseClassIfc result = ParserIfc.ParseLine(line, mRelease); if (result == null) { if (line.StartsWith("ISO")) { return(null); } if (setFileLine(line)) { return(null); } int ifcID = 0; string kw = "", str = ""; ParserSTEP.GetKeyWord(line, out ifcID, out kw, out str); if (string.IsNullOrEmpty(kw) || !kw.ToLower().StartsWith("ifc")) { return(null); } result = new BaseClassIfc(ifcID, kw, str); } if (result == null) { return(null); } IfcApplication application = result as IfcApplication; if (application != null) { IfcApplication ea = mFactory.mApplication; if (ea != null && ea.mVersion == application.mVersion) { if (string.Compare(ea.ApplicationFullName, application.ApplicationFullName, true) == 0) { if (string.Compare(ea.mApplicationIdentifier, application.mApplicationIdentifier) == 0) { this[ea.mIndex] = null; mFactory.mApplication = application; // mFactory.OwnerHistory(IfcChangeActionEnum.ADDED).mLastModifyingApplication = application.mIndex; // if (mFactory.mOwnerHistories.ContainsKey(IfcChangeActionEnum.MODIFIED)) // mFactory.mOwnerHistories[IfcChangeActionEnum.MODIFIED].mLastModifyingApplication = application.mIndex; } } } } IfcGeometricRepresentationContext geometricRepresentationContext = result as IfcGeometricRepresentationContext; if (geometricRepresentationContext != null) { Tolerance = geometricRepresentationContext.mPrecision; } IfcSIUnit unit = result as IfcSIUnit; if (unit != null) { if (unit.Name == IfcSIUnitName.METRE && unit.Prefix == IfcSIPrefix.NONE) { mFactory.mSILength = unit; } else if (unit.Name == IfcSIUnitName.SQUARE_METRE && unit.Prefix == IfcSIPrefix.NONE) { mFactory.mSIArea = unit; } else if (unit.Name == IfcSIUnitName.CUBIC_METRE && unit.Prefix == IfcSIPrefix.NONE) { mFactory.mSIVolume = unit; } } return(result); }
internal static IfcApplication Parse(string strDef) { IfcApplication a = new IfcApplication(); int ipos = 0; parseFields(a, ParserSTEP.SplitLineFields(strDef), ref ipos); return a; }
internal static void parseFields(IfcApplication a, List<string> arrFields, ref int ipos) { a.mApplicationDeveloper = ParserSTEP.ParseLink(arrFields[ipos++]); a.mVersion = arrFields[ipos++]; a.mApplicationFullName = arrFields[ipos++]; a.mApplicationIdentifier = arrFields[ipos++]; }
internal IfcApplication(IfcApplication o) : base() { mApplicationDeveloper = o.mApplicationDeveloper; mVersion = o.mVersion; mApplicationFullName = o.mApplicationFullName; mApplicationIdentifier = o.mApplicationIdentifier; }
internal IfcApplication(DatabaseIfc db, IfcApplication a) : base(db,a) { ApplicationDeveloper = db.Factory.Duplicate(a.ApplicationDeveloper) as IfcOrganization; mVersion = a.mVersion; mApplicationFullName = a.mApplicationFullName; mApplicationIdentifier = a.mApplicationIdentifier; }
internal BaseClassIfc InterpretLine(string line,Aggregate aggregate) { if (line.StartsWith("ISO")) return null; string ts = line.Trim().Replace(" ", ""); if (ts.StartsWith("FILE_SCHEMA(('IFC2X4", true, System.Globalization.CultureInfo.CurrentCulture) || ts.StartsWith("FILE_SCHEMA(('IFC4", true, System.Globalization.CultureInfo.CurrentCulture)) { mSchema = Schema.IFC4; return null; } BaseClassIfc result = ParserIfc.ParseLine(line, mSchema); if (result == null) { int ifcID = 0; string kw = "", str = ""; ParserIfc.GetKeyWord(line, out ifcID, out kw, out str); if (string.IsNullOrEmpty(kw)) return null; result = new BaseClassIfc(ifcID, kw,str); } if(result == null) return null; IfcApplication application = result as IfcApplication; if (application != null) { IfcApplication ea = mApplication; if (ea != null && ea.mVersion == application.mVersion) { if (string.Compare(ea.ApplicationFullName, application.ApplicationFullName, true) == 0) { if (string.Compare(ea.mApplicationIdentifier, application.mApplicationIdentifier) == 0) { mIfcObjects[ea.mIndex] = null; mApplication = application; OwnerHistory(IfcChangeActionEnum.ADDED).mLastModifyingApplication = application.mIndex; if (mOwnerHistoryModify != null) mOwnerHistoryModify.mLastModifyingApplication = application.mIndex; } } } } IfcContext context = result as IfcContext; if (context != null) { mContext = context; #warning merge project if existing } IfcGeometricRepresentationContext geometricRepresentationContext = result as IfcGeometricRepresentationContext; if (geometricRepresentationContext != null) { if (string.Compare(geometricRepresentationContext.mContextType, "Plan", true) != 0) mGeomRepContxt = geometricRepresentationContext; if (geometricRepresentationContext.mPrecision > 1e-6) Tolerance = geometricRepresentationContext.mPrecision; } IfcSIUnit unit = result as IfcSIUnit; if(unit != null) { if (unit.Name == IfcSIUnitName.METRE && unit.Prefix == IfcSIPrefix.NONE) mSILength = unit; else if (unit.Name == IfcSIUnitName.SQUARE_METRE && unit.Prefix == IfcSIPrefix.NONE) mSIArea = unit; else if (unit.Name == IfcSIUnitName.CUBIC_METRE && unit.Prefix == IfcSIPrefix.NONE) mSIVolume = unit; } aggregate.setAggregate(result); if (mIfcObjects.Count <= result.mIndex) for (int ncounter = mIfcObjects.Count; ncounter <= result.mIndex; ncounter++) mIfcObjects.Add(new BaseClassIfc()); mIfcObjects[result.mIndex] = result; result.mDatabase = this; //IfcWorkPlan workPlan = result as IfcWorkPlan; //if(workPlan != null) //{ // mWorkPlans.Add(workPlan); // return workPlan; //} return result; }