internal IfcEdge(DatabaseIfc db, IfcEdge e) : base(db, e) { if(e.mEdgeStart > 0) EdgeStart = db.Factory.Duplicate( e.EdgeStart) as IfcVertex; if(e.mEdgeEnd > 0) EdgeEnd = db.Factory.Duplicate( e.EdgeEnd) as IfcVertex; }
public IfcCartesianPointList2D(DatabaseIfc m, IEnumerable<Point2d> coordList) : base(m) { List<Tuple<double, double>> pts = new List<Tuple<double, double>>(); foreach (Point2d t in coordList) pts.Add(new Tuple<double, double>(t.X, t.Y)); mCoordList = pts.ToArray(); }
public static void Import_IFC(string ifcpath = "") { if (ifcpath == "") ifcpath = IO.LoadFile("IFC File|*.ifc"); if (string.IsNullOrEmpty(ifcpath)) return; var database = new GeometryGym.Ifc.DatabaseIfc(ifcpath); ImportProject(database); }
private void attachModel(DatabaseIfc m) { bool added = false; for (int icounter = m.mNextBlank; icounter < m.mIfcObjects.Count; icounter++) { if (m.mIfcObjects[icounter] == null) { added = true; mIndex = icounter; m.mNextBlank = icounter + 1; m.mIfcObjects[icounter] = this; break; } } if (!added) { if (m.mNextBlank > m.mIfcObjects.Count) { int count = m.mNextBlank - m.mIfcObjects.Count; for (int pcounter = 0; pcounter < count; pcounter++) m.mIfcObjects.Add(null); } mIndex = m.mIfcObjects.Count; m.mIfcObjects.Add(this); m.mNextBlank = mIndex + 1; } mDatabase = m; }
internal IfcRationalBSplineCurveWithKnots(DatabaseIfc db, NurbsCurve nc, bool twoD) : base(db, nc, twoD) { mWeightsData = new List<double>(nc.Points.Count); for (int icounter = 0; icounter < nc.Points.Count; icounter++) mWeightsData.Add(nc.Points[icounter].Weight); }
static void Main(string[] args) { DatabaseIfc db = new DatabaseIfc(Console.In); IfcProject project = db.Project; IfcSpatialElement rootElement = project.RootElement; int buildingStoreyCount = CountStories(rootElement); Console.Out.Write("Number of Stories in file :" + buildingStoreyCount); }
public IfcDirection(DatabaseIfc db, Vector2D v) : base(db) { double len = v.Length; mDirectionRatioX = v.X / len; mDirectionRatioY = v.Y / len; mDirectionRatioZ = double.NaN; }
protected IfcParameterizedProfileDef(DatabaseIfc m) : base(m) { if (mDatabase.mModelView == ModelView.Ifc4Reference) throw new Exception("Invalid Model View for IfcParameterizedProfileDef : " + m.ModelView.ToString()); if (mDatabase.mSchema == Schema.IFC2x3) Position = (mDatabase.m2DPlaceOrigin == null ? new IfcAxis2Placement2D(m) : mDatabase.m2DPlaceOrigin); }
public IfcDirection(DatabaseIfc db, Vector3D v) : base(db) { UnitVector3D unit = v.Normalize(); mDirectionRatioX = unit.X; mDirectionRatioY = unit.Y; mDirectionRatioZ = unit.Z; }
public IfcTable(DatabaseIfc m, string name, List<IfcTableRow> rows, List<IfcTableColumn> cols) : base(m) { if (!string.IsNullOrEmpty(name)) mName = name.Replace("'", ""); if (rows != null && rows.Count > 0) mRows = rows.ConvertAll(x => x.mIndex); if (cols != null && cols.Count > 0) mColumns = cols.ConvertAll(x => x.mIndex); }
internal IfcMapConversion(DatabaseIfc m, IfcCoordinateReferenceSystemSelect source, IfcCoordinateReferenceSystem target, double eastings, double northings, double orthogonalHeight, double XAxisAbscissa, double XAxisOrdinate, double scale) : base(m, source, target) { mEastings = eastings; mNorthings = northings; mOrthogonalHeight = orthogonalHeight; mXAxisAbscissa = XAxisAbscissa; mXAxisOrdinate = XAxisOrdinate; mScale = scale; }
public IfcDirection(DatabaseIfc db, Vector3d v) : base(db) { Vector3d unit = v; unit.Unitize(); mDirectionRatioX = unit.X; mDirectionRatioY = unit.Y; mDirectionRatioZ = unit.Z; }
public IfcColourRgbList(DatabaseIfc db, IEnumerable<Color> colourList) : base(db) { mColourList = new Tuple<double, double, double>[colourList.Count()]; int ilast = colourList.Count(); for (int icounter = 0; icounter < ilast; icounter++) { Color c = colourList.ElementAt(icounter); mColourList[icounter] = new Tuple<double, double, double>(c.R / 255.0, c.G / 255.0, c.B / 255.0); } }
public static IfcBoundedCurve ConvertRhinoCommonCurve(DatabaseIfc db, Curve crv) { double tol = db.Tolerance, angTol = Math.PI / 1800; if (crv.IsLinear(tol)) return new IfcPolyline(new List<IfcCartesianPoint>() { new IfcCartesianPoint(db, crv.PointAtStart), new IfcCartesianPoint(db, crv.PointAtEnd) }); Plane pln = new Plane(); if (crv.TryGetPlane(out pln, tol)) { if (Math.Abs(pln.Origin.Z) < tol && pln.ZAxis.IsParallelTo(Vector3d.ZAxis, angTol) != 0) return convCurve(db, crv, true); } return convCurve(db, crv, false); }
protected IfcNamedUnit(DatabaseIfc m, IfcUnitEnum unitEnum, bool gendims) : base(m) { mUnitType = unitEnum; if (gendims) { if (unitEnum == IfcUnitEnum.LENGTHUNIT) mDimensions = new IfcDimensionalExponents(m, 1, 0, 0, 0, 0, 0, 0).mIndex; else if (unitEnum == IfcUnitEnum.AREAUNIT) mDimensions = new IfcDimensionalExponents(m, 2, 0, 0, 0, 0, 0, 0).mIndex; else if (unitEnum == IfcUnitEnum.VOLUMEUNIT) mDimensions = new IfcDimensionalExponents(m, 3, 0, 0, 0, 0, 0, 0).mIndex; else if (unitEnum == IfcUnitEnum.PLANEANGLEUNIT) mDimensions = new IfcDimensionalExponents(m, 0, 0, 0, 0, 0, 0, 0).mIndex; } }
internal IfcTrimmedCurve(DatabaseIfc db, Arc a, bool twoD, IfcCartesianPoint optStrt, out IfcCartesianPoint end) : base(db) { Point3d o = a.Plane.Origin, s = a.StartPoint, e = a.EndPoint; Vector3d x = s - o; mSenseAgreement = true; if (optStrt == null) optStrt = twoD ? new IfcCartesianPoint(db, new Point2d(s.X, s.Y)) : new IfcCartesianPoint(db, s); end = twoD ? new IfcCartesianPoint(db, new Point2d(e.X, e.Y)) : new IfcCartesianPoint(db,e); double angleFactor = mDatabase.mContext.UnitsInContext.getScaleSI(IfcUnitEnum.PLANEANGLEUNIT); if (twoD) { if (a.Plane.ZAxis.Z < 0) { mSenseAgreement = false; x = e - o; IfcAxis2Placement2D ap = new IfcAxis2Placement2D(db, new Point2d(o.X, o.Y), new Vector2d(x.X, x.Y)); BasisCurve = new IfcCircle(ap, a.Radius); mTrim1 = new IfcTrimmingSelect(a.Angle / angleFactor, optStrt); mTrim2 = new IfcTrimmingSelect(0, end); } else { IfcAxis2Placement2D ap = new IfcAxis2Placement2D(db, new Point2d(o.X, o.Y), new Vector2d(x.X, x.Y)); BasisCurve = new IfcCircle(ap, a.Radius); mTrim1 = new IfcTrimmingSelect(0, optStrt); mTrim2 = new IfcTrimmingSelect(a.Angle / angleFactor, end); } } else { Vector3d y = Vector3d.CrossProduct(a.Plane.ZAxis, x); Plane pl = new Plane(o, x, y); IfcAxis2Placement3D ap = new IfcAxis2Placement3D(db, pl); BasisCurve = new IfcCircle(ap, a.Radius); mTrim1 = new IfcTrimmingSelect(0, optStrt); mTrim2 = new IfcTrimmingSelect(a.Angle / angleFactor, end); } mMasterRepresentation = IfcTrimmingPreference.PARAMETER; }
internal IfcZShapeProfileDef(DatabaseIfc db, IfcZShapeProfileDef p) : base(db, p) { mDepth = p.mDepth; mFlangeWidth = p.mFlangeWidth; mWebThickness = p.mWebThickness; mFlangeThickness = p.mFlangeThickness; mFilletRadius = p.mFilletRadius; mEdgeRadius = p.mEdgeRadius; }
protected IfcPlacement(DatabaseIfc db, Point3d position) : base(db) { Location = new IfcCartesianPoint(db, position); }
internal void setStructuralUnits() { if (mStructuralSet) { return; } mStructuralSet = true; DatabaseIfc m = mDatabase; IfcNamedUnit fu = Find(IfcUnitEnum.FORCEUNIT); if (fu == null) { fu = new IfcSIUnit(m, IfcUnitEnum.FORCEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.NEWTON); mUnits.Add(fu.mIndex); } if (Find(IfcDerivedUnitEnum.TORQUEUNIT) == null) { mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, 1), IfcDerivedUnitEnum.TORQUEUNIT).mIndex); } if (Find(IfcDerivedUnitEnum.LINEARFORCEUNIT) == null) { mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, -1), IfcDerivedUnitEnum.LINEARFORCEUNIT).mIndex); } if (Find(IfcDerivedUnitEnum.PLANARFORCEUNIT) == null) { mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, -2), IfcDerivedUnitEnum.PLANARFORCEUNIT).mIndex); } if (Find(IfcDerivedUnitEnum.MODULUSOFELASTICITYUNIT) == null) { mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, -2), IfcDerivedUnitEnum.MODULUSOFELASTICITYUNIT).mIndex); } IfcNamedUnit time = Find(IfcUnitEnum.TIMEUNIT); if (time == null || Math.Abs(time.getSIFactor() - 1) < mDatabase.Tolerance) { time = new IfcSIUnit(mDatabase, IfcUnitEnum.TIMEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.SECOND); } mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(m.mSILength, 1), new IfcDerivedUnitElement(time, -2), IfcDerivedUnitEnum.ACCELERATIONUNIT).mIndex); mUnits.Add(new IfcSIUnit(m, IfcUnitEnum.PRESSUREUNIT, IfcSIPrefix.NONE, IfcSIUnitName.PASCAL).mIndex); mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(m.mSILength, 3), IfcDerivedUnitEnum.SECTIONMODULUSUNIT).mIndex); mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(m.mSILength, 4), IfcDerivedUnitEnum.MOMENTOFINERTIAUNIT).mIndex); IfcSIUnit massu = Find(IfcUnitEnum.MASSUNIT) as IfcSIUnit; if (massu == null) { massu = new IfcSIUnit(m, IfcUnitEnum.MASSUNIT, IfcSIPrefix.KILO, IfcSIUnitName.GRAM); mUnits.Add(massu.mIndex); } if (Find(IfcDerivedUnitEnum.MASSDENSITYUNIT) == null) { mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(massu, 1), new IfcDerivedUnitElement(m.mSIVolume, -1), IfcDerivedUnitEnum.MASSDENSITYUNIT).mIndex); } IfcSIUnit kelvin = Find(IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT) as IfcSIUnit; if (kelvin == null) { kelvin = new IfcSIUnit(m, IfcUnitEnum.THERMODYNAMICTEMPERATUREUNIT, IfcSIPrefix.NONE, IfcSIUnitName.KELVIN); mUnits.Add(kelvin.mIndex); } if (Find(IfcDerivedUnitEnum.THERMALEXPANSIONCOEFFICIENTUNIT) == null) { mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(kelvin, -1), IfcDerivedUnitEnum.THERMALEXPANSIONCOEFFICIENTUNIT).mIndex); } mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, -1), IfcDerivedUnitEnum.LINEARSTIFFNESSUNIT).mIndex); IfcNamedUnit radians = Find(IfcUnitEnum.PLANEANGLEUNIT); if (radians == null || Math.Abs(radians.getSIFactor() - 1) < mDatabase.Tolerance) { radians = new IfcSIUnit(mDatabase, IfcUnitEnum.PLANEANGLEUNIT, IfcSIPrefix.NONE, IfcSIUnitName.RADIAN); } mUnits.Add(new IfcDerivedUnit(new IfcDerivedUnitElement(fu, 1), new IfcDerivedUnitElement(m.mSILength, 1), new IfcDerivedUnitElement(radians, -1), IfcDerivedUnitEnum.ROTATIONALSTIFFNESSUNIT).mIndex); }
internal IfcHumidifier(DatabaseIfc db, IfcHumidifier h) : base(db, h) { mPredefinedType = h.mPredefinedType; }
internal IfcHeatExchangerType(DatabaseIfc db, IfcHeatExchangerType t) : base(db, t) { mPredefinedType = t.mPredefinedType; }
internal IfcHeatExchanger(DatabaseIfc db, IfcHeatExchanger e) : base(db, e) { mPredefinedType = e.mPredefinedType; }
internal IfcHumidifierType(DatabaseIfc m, string name, IfcHumidifierTypeEnum type) : base(m) { Name = name; mPredefinedType = type; }
internal IfcWindowLiningProperties(DatabaseIfc db, IfcWindowLiningProperties p) : base(db, p) { mLiningDepth = p.mLiningDepth; mLiningThickness = p.mLiningThickness; mTransomThickness = p.mTransomThickness; mMullionThickness = p.mMullionThickness; mFirstTransomOffset = p.mFirstTransomOffset; mSecondTransomOffset = p.mSecondTransomOffset; mFirstMullionOffset = p.mFirstMullionOffset; mSecondMullionOffset = p.mSecondMullionOffset; if (p.mShapeAspectStyle > 0) ShapeAspectStyle = db.Factory.Duplicate(p.ShapeAspectStyle) as IfcShapeAspect; mLiningOffset = p.mLiningOffset; mLiningToPanelOffsetX = p.mLiningToPanelOffsetX; mLiningToPanelOffsetY = p.mLiningToPanelOffsetY; }
internal IfcWindowPanelProperties(DatabaseIfc db, IfcWindowPanelProperties p) : base(db, p) { mOperationType = p.mOperationType; mPanelPosition = p.mPanelPosition; mFrameDepth = p.mFrameDepth; mFrameThickness = p.mFrameThickness; if (p.mShapeAspectStyle > 0) ShapeAspectStyle = db.Factory.Duplicate(p.ShapeAspectStyle) as IfcShapeAspect; }
internal XmlElement getXML(XmlDocument doc, string name, HashSet <int> processed, DatabaseIfc db) { XmlElement result = doc.CreateElement(name); if (!double.IsNaN(mIfcParameterValue)) { XmlElement element = doc.CreateElement("IfcParameterValue-wrapper"); element.InnerText = mIfcParameterValue.ToString(); result.AppendChild(element); } if (mIfcCartesianPoint > 0) { result.AppendChild(db[mIfcCartesianPoint].GetXML(doc, "", null, processed)); } return(result); }
public IfcZShapeProfileDef(DatabaseIfc db, string name, double depth, double flangeWidth, double webThickness, double flangeThickness) : base(db, name) { mDepth = depth; mFlangeWidth = flangeWidth; mWebThickness = webThickness; mFlangeThickness = flangeThickness; }
internal static IfcIndexedPolyCurve Convert(DatabaseIfc db, PolyCurve polycurve, bool twoD) { double tol = db.Tolerance; Curve[] segments = polycurve.Explode(); PolyCurve pc = new PolyCurve(); foreach (Curve s in segments) { if (s.IsLinear(tol)) { pc.Append(new Line(s.PointAtStart, s.PointAtEnd)); } else { Arc a = Arc.Unset; if (s.TryGetArc(out a, tol)) { pc.Append(a); } else { return(null); } } } List <IfcSegmentIndexSelect> segs = new List <IfcSegmentIndexSelect>(); IfcCartesianPointList cpl = null; bool closed = pc.PointAtStart.DistanceTo(pc.PointAtEnd) < tol; if (twoD) { Point2d pt = new Point2d(pc.PointAtStart.X, pc.PointAtStart.Y); int pcounter = 1; List <Point2d> pts = new List <Point2d>(); pts.Add(pt); IfcLineIndex li = null; for (int icounter = 0; icounter < pc.SegmentCount; icounter++) { Curve c = pc.SegmentCurve(icounter); if (c.IsLinear(tol) && c.PointAtStart.DistanceTo(c.PointAtEnd) < tol) { continue; } if (c.IsLinear(tol)) { if (closed && icounter + 1 == segments.Length) { if (li != null) { li.Add(1); } else { li = new IfcLineIndex(pcounter, 1); } } else { pts.Add(new Point2d(c.PointAtEnd.X, c.PointAtEnd.Y)); if (li != null) { li.Add(++pcounter); } else { li = new IfcLineIndex(pcounter++, pcounter); } } } else { if (li != null) { segs.Add(li); li = null; } Point3d tp = c.PointAt(c.Domain.Mid); pts.Add(new Point2d(tp.X, tp.Y)); if (closed && icounter + 1 == segments.Length) { segs.Add(new IfcArcIndex(pcounter++, pcounter++, 1)); } else { pts.Add(new Point2d(c.PointAtEnd.X, c.PointAtEnd.Y)); segs.Add(new IfcArcIndex(pcounter++, pcounter++, pcounter)); } } } if (li != null) { segs.Add(li); } cpl = new IfcCartesianPointList2D(db, pts.ToArray()); } else { Point3d pt = pc.PointAtStart; int pcounter = 1; List <Point3d> pts = new List <Point3d>(); pts.Add(pt); List <IfcSegmentIndexSelect> sis = new List <IfcSegmentIndexSelect>(segments.Length); IfcLineIndex li = null; for (int icounter = 0; icounter < pc.SegmentCount; icounter++) { Curve c = pc.SegmentCurve(icounter); if (c.IsLinear(tol) && c.PointAtStart.DistanceTo(c.PointAtEnd) < tol) { continue; } if (c.IsLinear(tol)) { if (closed && icounter + 1 == segments.Length) { if (li != null) { li.Add(0); } else { li = new IfcLineIndex(pcounter, 0); } } else { pts.Add(c.PointAtEnd); if (li != null) { li.Add(++pcounter); } else { li = new IfcLineIndex(pcounter++, pcounter); } } } else { if (li != null) { segs.Add(li); li = null; } pts.Add(c.PointAt(c.Domain.Mid)); if (closed && icounter + 1 == segments.Length) { segs.Add(new IfcArcIndex(pcounter++, pcounter, 0)); } else { pts.Add(c.PointAtEnd); segs.Add(new IfcArcIndex(pcounter++, pcounter++, pcounter)); } } } if (li != null) { segs.Add(li); } cpl = new IfcCartesianPointList3D(db, pts.ToArray()); } return(new IfcIndexedPolyCurve(cpl, segs) { }); }
internal IfcUnitaryControlElementType(DatabaseIfc m, string name, IfcUnitaryControlElementTypeEnum t) : base(m) { Name = name; mPredefinedType = t; }
public IfcUShapeProfileDef(DatabaseIfc m, string name, double depth, double flangeWidth, double webThickness, double flangeThickness, double filletRadius, double edgeRadius, double flangeSlope) : base(m) { Name = name; mDepth = depth; mFlangeWidth = flangeWidth; mWebThickness = webThickness; mFlangeThickness = flangeThickness; mFilletRadius = filletRadius; mEdgeRadius = edgeRadius; mFlangeSlope = flangeSlope; }
internal IfcZone(DatabaseIfc m, string name) : base(m, name) { }
internal IfcWindowStandardCase(DatabaseIfc db, IfcWindowStandardCase w) : base(db,w) { }
internal IfcZone(DatabaseIfc db, IfcZone z, IfcOwnerHistory ownerHistory, bool downStream) : base(db, z, ownerHistory, downStream) { mLongName = z.mLongName; }
internal string mUserDefinedPartitioningType = "$"; // : OPTIONAL IfcLabel; #endregion Fields #region Constructors public IfcWindowType(DatabaseIfc m, string name, IfcWindowTypeEnum type) : base(m) { Name = name; mPredefinedType = type; }
internal IfcHalfSpaceSolid(DatabaseIfc db, IfcHalfSpaceSolid h) : base(db, h) { BaseSurface = db.Factory.Duplicate(h.BaseSurface) as IfcSurface; mAgreementFlag = h.mAgreementFlag; }
internal IfcWindowType(DatabaseIfc m, string name, IfcWindowTypeEnum type, IfcWindowTypePartitioningEnum partition, bool parameterTakesPrecendence) : base(m) { Name = name; mPredefinedType = type; mPartitioningType = partition; mParameterTakesPrecedence = parameterTakesPrecendence; }
internal IfcHumidifierType(DatabaseIfc db, IfcHumidifierType t) : base(db, t) { mPredefinedType = t.mPredefinedType; }
internal IfcWorkCalendar(DatabaseIfc db, IfcWorkCalendar c) : base(db,c) { WorkingTimes = c.WorkingTimes.ConvertAll(x => db.Factory.Duplicate(x) as IfcWorkTime); ExceptionTimes = c.ExceptionTimes.ConvertAll(x=>db.Factory.Duplicate(x) as IfcWorkTime); mPredefinedType = c.mPredefinedType; }
internal IfcHeatExchangerType(DatabaseIfc m, string name, IfcHeatExchangerTypeEnum type) : base(m) { Name = name; mPredefinedType = type; }
public IfcAxis2Placement3D(DatabaseIfc db, Plane plane) : base(db,plane.Origin) { double angTol = Math.PI / 1800; if (plane.ZAxis.IsParallelTo(Vector3d.ZAxis, angTol) != 1) { Axis = new IfcDirection(db, plane.ZAxis); RefDirection = new IfcDirection(db, plane.XAxis); } else if (plane.XAxis.IsParallelTo(Vector3d.XAxis, angTol) != 1) { RefDirection = new IfcDirection(db, plane.XAxis); Axis = db.Factory.ZAxis; } }
internal IfcPolyline(DatabaseIfc db, Line l) : base(db) { Points.Add(new IfcCartesianPoint(db, l.From)); Points.Add(new IfcCartesianPoint(db, l.To)); }
internal override void parseJObject(JObject obj) { base.parseJObject(obj); JToken token = obj.GetValue("Name", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Name = token.Value <string>(); } token = obj.GetValue("Description", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Description = token.Value <string>(); } JObject jobj = obj.GetValue("AppliedValue", StringComparison.InvariantCultureIgnoreCase) as JObject; if (jobj != null) { AppliedValue = mDatabase.parseJObject <IfcAppliedValueSelect>(jobj); if (mAppliedValueIndex <= 0) { mAppliedValueValue = DatabaseIfc.ParseValue(jobj); } } jobj = obj.GetValue("UnitBasis", StringComparison.InvariantCultureIgnoreCase) as JObject; if (jobj != null) { UnitBasis = mDatabase.parseJObject <IfcMeasureWithUnit>(jobj); } Components = mDatabase.extractJArray <IfcAppliedValue>(obj.GetValue("Components", StringComparison.InvariantCultureIgnoreCase) as JArray); List <IfcExternalReferenceRelationship> ers = mDatabase.extractJArray <IfcExternalReferenceRelationship>(obj.GetValue("HasExternalReferences", StringComparison.InvariantCultureIgnoreCase) as JArray); for (int icounter = 0; icounter < ers.Count; icounter++) { ers[icounter].addRelated(this); } List <IfcResourceConstraintRelationship> crs = mDatabase.extractJArray <IfcResourceConstraintRelationship>(obj.GetValue("HasConstraintRelationships", StringComparison.InvariantCultureIgnoreCase) as JArray); for (int icounter = 0; icounter < crs.Count; icounter++) { crs[icounter].addRelated(this); } //todo token = obj.GetValue("Category", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Category = token.Value <string>(); } token = obj.GetValue("Condition", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Condition = token.Value <string>(); } token = obj.GetValue("ArithmeticOperator", StringComparison.InvariantCultureIgnoreCase); if (token != null) { Enum.TryParse <IfcArithmeticOperatorEnum>(token.Value <string>(), out mArithmeticOperator); } }
internal IfcJunctionBoxType(DatabaseIfc m, string name, IfcJunctionBoxTypeEnum type) : base(m) { Name = name; mPredefinedType = type; }
internal IfcUnitAssignment(DatabaseIfc m) : base(m) { }
internal IfcWall(DatabaseIfc db, IfcWall w) : base(db, w) { mPredefinedType = w.mPredefinedType; }
protected IfcObjectDefinition(DatabaseIfc db) : base(db) { }
internal IfcWindowLiningProperties(DatabaseIfc m, string name, double lngDpth, double lngThck, double trnsmThck, double mllnThck, double trnsmOffst1, double trnsmOffst2, double mllnOffst1, double mllnOffst2, double lngOffset, double lngToPnlOffstX, double lngToPnlOffstY) : base(m, name) { mLiningDepth = lngDpth; mLiningThickness = lngThck; mTransomThickness = trnsmThck; mMullionThickness = mllnThck; mFirstTransomOffset = Math.Min(1, Math.Max(0, trnsmOffst1)); mSecondTransomOffset = Math.Min(1, Math.Max(0, trnsmOffst2)); mFirstMullionOffset = Math.Min(1, Math.Max(0, mllnOffst1)); mSecondMullionOffset = Math.Min(1, Math.Max(0, mllnOffst2)); mLiningOffset = lngOffset; mLiningToPanelOffsetX = lngToPnlOffstX; mLiningToPanelOffsetY = lngToPnlOffstY; }
protected IfcObjectPlacement(DatabaseIfc db) : base(db) { }
internal IfcWindowPanelProperties(DatabaseIfc m, string name, IfcWindowPanelOperationEnum op, IfcWindowPanelPositionEnum panel, double frameDepth, double frameThick) : base(m, name) { mOperationType = op; mPanelPosition = panel; mFrameDepth = frameDepth; mFrameThickness = frameThick; }
protected IfcObjectPlacement(DatabaseIfc db, IfcObjectPlacement p) : base(db, p) { }
internal IfcWindowStyle(DatabaseIfc db, IfcWindowStyle s) : base(db,s) { mConstructionType = s.mConstructionType; mOperationType = s.mOperationType; mParameterTakesPrecedence = s.mParameterTakesPrecedence; mSizeable = s.mSizeable; }
internal IfcObjective(DatabaseIfc db, IfcObjective o) : base(db, o) { BenchmarkValues = o.BenchmarkValues.ConvertAll(x => db.Factory.Duplicate(x) as IfcConstraint); mLogicalAggregator = o.mLogicalAggregator; mObjectiveQualifier = o.mObjectiveQualifier; mUserDefinedQualifier = o.mUserDefinedQualifier; }
internal IfcWindowType(DatabaseIfc db, IfcWindowType t) : base(db,t) { mPredefinedType = t.mPredefinedType; mPartitioningType = t.mPartitioningType; mParameterTakesPrecedence = t.mParameterTakesPrecedence; mUserDefinedPartitioningType = t.mUserDefinedPartitioningType; }
public IfcObjective(DatabaseIfc db, string name, IfcConstraintEnum constraint, IfcObjectiveEnum qualifier) : base(db, name, constraint) { mObjectiveQualifier = qualifier; }
internal IfcWindowType(DatabaseIfc m, string name, IfcWindowTypeEnum type, IfcWindowTypePartitioningEnum partition, string userDefinedPartionType, IfcWindowLiningProperties wlp, List<IfcWindowPanelProperties> pps) : base(m) { Name = name; mPredefinedType = type; mPartitioningType = partition; mParameterTakesPrecedence = true; if (wlp != null) mHasPropertySets.Add(wlp.mIndex); if (pps != null && pps.Count > 0) mHasPropertySets.AddRange(pps.ConvertAll(x => x.mIndex)); if (!string.IsNullOrEmpty(userDefinedPartionType)) mUserDefinedPartitioningType = userDefinedPartionType.Replace("'", ""); }
internal IfcOccupant(DatabaseIfc db, IfcOccupant o) : base(db, o) { mPredefinedType = o.mPredefinedType; }
internal IfcWorkCalendar(DatabaseIfc m, List<IfcWorkTime> working, List<IfcWorkTime> exception, IfcWorkCalendarTypeEnum type, IfcProject prj) : base(m) { if (working != null) mWorkingTimes = working.ConvertAll(x => x.mIndex); if (exception != null) mExceptionTimes = exception.ConvertAll(x => x.mIndex); mPredefinedType = type; if (prj != null) prj.AddDeclared(this); }
internal IfcOneDirectionRepeatFactor(DatabaseIfc db, IfcOneDirectionRepeatFactor f) : base(db, f) { RepeatFactor = db.Factory.Duplicate(f.RepeatFactor) as IfcVector; }
internal IfcAxis2Placement2D(DatabaseIfc db, Point2d position, Vector2d dir) : base(db, position) { if (dir.Length > 0 && new Vector3d(dir.X, dir.Y, 0).IsParallelTo(Vector3d.XAxis, Math.PI / 1800) != 1) RefDirection = new IfcDirection(db, dir); }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); obj["EnumerationValues"] = new JArray(EnumerationValues.ToList().ConvertAll(x => DatabaseIfc.extract(x))); if (mEnumerationReference > 0) { obj["EnumerationReference"] = EnumerationReference.getJson(this, options); } }