Inheritance: IfcPlacement, IfcAxis2Placement
コード例 #1
0
 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;
 }
コード例 #2
0
        private void postImport(Aggregate aggregate)
        {
            mWorldCoordinatePlacement = null;
            aggregate.RelateObjects(mFolder);
            if (mContext != null)
            {
                mContext.initializeUnitsAndScales();

                if (mContext.mRepresentationContexts.Count > 0)
                {
                    mGeomRepContxt = mIfcObjects[mContext.mRepresentationContexts[0]] as IfcGeometricRepresentationContext;
                }
                if (mContext.mDeclares.Count == 0)
                {
                    List <IfcDefinitionSelect> lds = aggregate.mTypeProducts.ConvertAll(x => (IfcDefinitionSelect)x);
                    IfcRelDeclares             rd  = new IfcRelDeclares(mContext, lds)
                    {
                        Name = "DeclaredTypes"
                    };
                }
            }
            customPostImport(aggregate);
        }
コード例 #3
0
 public IfcBeamStandardCase(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, Tuple <double, double> arcOrigin, double arcAngle) : base(host, profile, placement, arcOrigin, arcAngle)
 {
 }
コード例 #4
0
 public IfcBlock(IfcAxis2Placement3D position, double x, double y, double z) : base(position)
 {
     mXLength = x; mYLength = y; mZLength = z;
 }
コード例 #5
0
ファイル: IFC R.cs プロジェクト: jenca-cloud/ggIFC
		public IfcRepresentationMap(IfcRepresentationItem item) : base(item.mDatabase) { mMappingOrigin = new IfcAxis2Placement3D(item.mDatabase).mIndex; MappedRepresentation = new IfcShapeRepresentation(new List<IfcRepresentationItem>() { item }); }
コード例 #6
0
ファイル: ifc A.cs プロジェクト: jenca-cloud/ggIFC
		internal static IfcAxis2Placement3D Parse(string strDef) { IfcAxis2Placement3D p = new IfcAxis2Placement3D(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; }
コード例 #7
0
ファイル: IFC P.cs プロジェクト: jenca-cloud/ggIFC
		public IfcPlane(IfcAxis2Placement3D placement) : base(placement) { }
コード例 #8
0
ファイル: IFC S.cs プロジェクト: jenca-cloud/ggIFC
		protected IfcSweptAreaSolid(IfcProfileDef prof, IfcAxis2Placement3D placement) : base(prof.mDatabase) { SweptArea = prof; Position = placement; }
コード例 #9
0
ファイル: IFC E.cs プロジェクト: jenca-cloud/ggIFC
		protected IfcElementarySurface(IfcAxis2Placement3D placement) : base(placement.mDatabase) { mPosition = placement.mIndex; }
コード例 #10
0
ファイル: IFC B.cs プロジェクト: jmirtsch/GeometryGymIFC
 protected IfcBeam(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, Tuple<double, double> arcOrigin, double arcAngle)
     : base(host, profile, placement, arcOrigin,arcAngle)
 {
 }
コード例 #11
0
ファイル: IFC B.cs プロジェクト: jmirtsch/GeometryGymIFC
 protected IfcBeam(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, double length)
     : base(host, profile, placement,length)
 {
 }
コード例 #12
0
ファイル: IFC B.cs プロジェクト: jmirtsch/GeometryGymIFC
        private double mXLength, mYLength, mZLength; // : IfcPositiveLengthMeasure;

        #endregion Fields

        #region Constructors

        public IfcBlock(IfcAxis2Placement3D position, double x,double y, double z)
            : base(position)
        {
            mXLength = x; mYLength = y; mZLength = z;
        }
コード例 #13
0
ファイル: IFC B.cs プロジェクト: jmirtsch/GeometryGymIFC
 public IfcBeamStandardCase(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, double length)
     : base(host, profile, placement,length)
 {
 }
コード例 #14
0
 public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, IfcProductDefinitionShape shape)
     : base(container, new IfcLocalPlacement(container.Placement, placement), null)
 {
     setMaterial(layerSetUsage);
     Representation = shape;
 }
コード例 #15
0
 public IfcBuildingElementProxy(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, double length) : base(host, profile, placement, length)
 {
 }
コード例 #16
0
ファイル: IFC E.cs プロジェクト: jenca-cloud/ggIFC
		public IfcExtrudedAreaSolid(IfcProfileDef prof, IfcAxis2Placement3D placement, IfcDirection dir, double depth) : base(prof, placement) { mExtrudedDirection = dir.mIndex; mDepth = depth; }
コード例 #17
0
		public T ParseJObject<T>(JObject obj) where T : IBaseClassIfc
		{
			if (obj == null)
				return default(T);

			Type type = typeof(T);
			
			BaseClassIfc result = null;
			JToken token = obj.GetValue("href", StringComparison.InvariantCultureIgnoreCase);
			if (token != null)
			{
				string hrefId = token.Value<string>();
				if(mDictionary.TryGetValue(hrefId, out result) && obj.Count == 1)
					return (T)(IBaseClassIfc)result;
			}
			if (result == null)
			{
				if (type.IsAbstract)
				{
					JProperty jtoken = (JProperty)obj.First;
					Type valueType = BaseClassIfc.GetType(jtoken.Name);
					if (valueType != null && valueType.IsSubclassOf(typeof(IfcValue)))
					{
						IBaseClassIfc val = ParserIfc.extractValue(jtoken.Name, jtoken.Value.ToString()) as IBaseClassIfc;
						if (val != null)
							return (T)val;
						return default(T);
					}
				}
				else
				{
					token = obj.GetValue("type", StringComparison.InvariantCultureIgnoreCase);
					if(token != null)
					{
						Type nominatedType = BaseClassIfc.GetType(token.Value<string>());
						if (nominatedType != null)
							type = nominatedType;
					}
					string hrefId = "";
					token = obj.GetValue("id", StringComparison.InvariantCultureIgnoreCase);
					if (token != null)
						hrefId = token.Value<string>();
					if (string.IsNullOrEmpty(hrefId) || !mDictionary.TryGetValue(hrefId, out result))
					{
						ConstructorInfo constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
		null, Type.EmptyTypes, null);
						if (constructor != null)
						{
							bool common = false;
							result = constructor.Invoke(new object[] { }) as BaseClassIfc;
							if (result != null)
							{
								result.mDatabase = this;

								IfcCartesianPoint point = result as IfcCartesianPoint;
								if (point != null)
								{
									point.parseJObject(obj);
									if (point.isOrigin(Tolerance))
									{
										if (point.is2D)
											result = Factory.Origin2d;
										else
											result = Factory.Origin;
										common = true;
									}
								}
								else
								{
									IfcDirection direction = result as IfcDirection;
									if (direction != null)
									{
										direction.parseJObject(obj);
										if (!direction.is2D)
										{
											common = true;
											if (direction.isXAxis)
												result = Factory.XAxis;
											else if (direction.isYAxis)
												result = Factory.YAxis;
											else if (direction.isZAxis)
												result = Factory.ZAxis;
											else if (direction.isXAxisNegative)
												result = Factory.XAxisNegative;
											else if (direction.isYAxisNegative)
												result = Factory.YAxisNegative;
											else if (direction.isZAxisNegative)
												result = Factory.ZAxisNegative;
											else
												common = false;
										}
									}
									else
									{
										IfcAxis2Placement3D placement = result as IfcAxis2Placement3D;
										if (placement != null)
										{
											placement.parseJObject(obj);
											if (placement.IsXYPlane(Tolerance))
											{
												result = Factory.XYPlanePlacement;
												common = true;
											}
										}
									}
								}
								token = obj.GetValue("id", StringComparison.InvariantCultureIgnoreCase);
								if (!string.IsNullOrEmpty(hrefId))
								{
									if (!(result is IfcRoot))
										result.setGlobalId(hrefId);
									mDictionary.TryAdd(hrefId, result);
								}

								if (common)
									return (T)(IBaseClassIfc)result;

								int index = NextBlank();
								this[index] = result;
							}
						}
					}
				}
			}
			if(result == null)
				return default(T);
			result.parseJObject(obj);
			parseBespoke(result, obj);
			IfcRoot root = result as IfcRoot;
			if (root != null)
				mDictionary[root.GlobalId] = root;
			return (T)(IBaseClassIfc)result;
		}
コード例 #18
0
ファイル: IFC W.cs プロジェクト: jddaigle/GeometryGymIFC
        public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, double length, double height)
            : base(container, new IfcLocalPlacement(container.Placement, placement), null)
        {
            DatabaseIfc db  = mDatabase;
            double      tol = mDatabase.Tolerance;

            setMaterial(layerSetUsage);

            IfcShapeRepresentation asr  = IfcShapeRepresentation.GetAxisRep(new IfcPolyline(new IfcCartesianPoint(db, 0, 0, 0), new IfcCartesianPoint(db, length, 0, 0)));
            List <IfcShapeModel>   reps = new List <IfcShapeModel>();

            reps.Add(asr);
            double t = layerSetUsage.ForLayerSet.MaterialLayers.ToList().ConvertAll(x => x.LayerThickness).Sum();

            reps.Add(new IfcShapeRepresentation(new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(db, "", length, t), new IfcAxis2Placement3D(new IfcCartesianPoint(db, length / 2.0, layerSetUsage.OffsetFromReferenceLine + (layerSetUsage.DirectionSense == IfcDirectionSenseEnum.POSITIVE ? 1 : -1) * t / 2.0, 0)), height)));
            Representation = new IfcProductDefinitionShape(reps);
        }
コード例 #19
0
ファイル: IFC G.cs プロジェクト: jddaigle/GeometryGymIFC
 public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List <IfcGridAxis> uAxes, List <IfcGridAxis> vAxes, List <IfcGridAxis> wAxes)
     : this(host, placement, uAxes, vAxes)
 {
     wAxes.ForEach(x => AddWAxis(x));
 }
コード例 #20
0
ファイル: IFC E.cs プロジェクト: jmirtsch/GeometryGymIFC
		protected IfcElementarySurface(DatabaseIfc db, IfcElementarySurface s) : base(db,s) { Position = db.Factory.Duplicate(s.Position) as IfcAxis2Placement3D; }
コード例 #21
0
ファイル: IFC G.cs プロジェクト: jmirtsch/GeometryGymIFC
 internal IfcGeometricRepresentationContext(DatabaseIfc db, int SpaceDimension, double precision)
     : base(db)
 {
     if (db.Context != null)
         db.Context.AddRepresentationContext(this);
     mCoordinateSpaceDimension = SpaceDimension;
     mPrecision = Math.Max(1e-8, precision);
     WorldCoordinateSystem = new IfcAxis2Placement3D(new IfcCartesianPoint(db,0,0,0));
     TrueNorth = new IfcDirection(mDatabase, 0, 1);
 }
コード例 #22
0
ファイル: ifc A.cs プロジェクト: jenca-cloud/ggIFC
		internal IfcAxis2Placement3D(IfcAxis2Placement3D i) : base(i) { mAxis = i.mAxis; mRefDirection = i.mRefDirection; }
コード例 #23
0
ファイル: IFC G.cs プロジェクト: jmirtsch/GeometryGymIFC
        private List<int> mWAxes = new List<int>(); // : OPTIONAL LIST [1:?] OF UNIQUE IfcGridAxis;

        #endregion Fields

        #region Constructors

        public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List<IfcGridAxis> uAxes, List<IfcGridAxis> vAxes)
            : base(new IfcLocalPlacement(host.Placement, placement), getRepresentation(uAxes,vAxes, null))
        {
            host.addGrid(this);
            if(uAxes != null)
                mUAxes = uAxes.ConvertAll(x=>x.mIndex);
            if (vAxes != null)
                mVAxes = vAxes.ConvertAll(x => x.mIndex);
        }
コード例 #24
0
ファイル: ifc A.cs プロジェクト: jenca-cloud/ggIFC
		internal static void parseFields(IfcAxis2Placement3D p, List<string> arrFields, ref int ipos) { IfcPlacement.parseFields(p, arrFields, ref ipos); p.mAxis = ParserSTEP.ParseLink(arrFields[ipos++]); p.mRefDirection = ParserSTEP.ParseLink(arrFields[ipos++]); }
コード例 #25
0
ファイル: IFC G.cs プロジェクト: jmirtsch/GeometryGymIFC
 public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List<IfcGridAxis> uAxes, List<IfcGridAxis> vAxes, List<IfcGridAxis> wAxes)
     : this(host,placement, uAxes,vAxes)
 {
     WAxes = wAxes;
 }
コード例 #26
0
ファイル: IFC R.cs プロジェクト: jenca-cloud/ggIFC
		public IfcRevolvedAreaSolid(IfcProfileDef profile, IfcAxis2Placement3D pl, IfcAxis1Placement axis, double angle) : base(profile, pl) { Axis = axis; mAngle = angle; }
コード例 #27
0
ファイル: IFC A.cs プロジェクト: jmirtsch/GeometryGymIFC
		internal IfcAxis2Placement3D(DatabaseIfc db, IfcAxis2Placement3D p) : base(db, p)
		{
			if (p.mAxis > 0)
				Axis = db.Factory.Duplicate(p.Axis) as IfcDirection;
			if (p.mRefDirection > 0)
				RefDirection = db.Factory.Duplicate(p.RefDirection) as IfcDirection;
		}
コード例 #28
0
 public IfcBeamStandardCase(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, double length) : base(host, profile, placement, length)
 {
 }
コード例 #29
0
ファイル: IFC A.cs プロジェクト: jmirtsch/GeometryGymIFC
		internal static IfcAxis2Placement3D Parse(string str) { IfcAxis2Placement3D p = new IfcAxis2Placement3D(); int pos = 0; p.Parse(str,ref pos, str.Length); return p; }
コード例 #30
0
 protected IfcBuildingElement(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, Tuple <double, double> arcOrigin, double arcAngle) : base(host, profile, placement, arcOrigin, arcAngle)
 {
 }
コード例 #31
0
        public T ParseJObject <T>(JObject obj) where T : IBaseClassIfc
        {
            if (obj == null)
            {
                return(default(T));
            }

            BaseClassIfc result = null;
            JToken       token  = obj.GetValue("href", StringComparison.InvariantCultureIgnoreCase);

            if (token != null)
            {
                if (token.Type == JTokenType.Integer)
                {
                    int index = token.Value <int>();
                    result = this[index];
                }
                else if (token.Type == JTokenType.String)
                {
                    mDictionary.TryGetValue(token.Value <string>(), out result);
                }
                if (result != null && obj.Count == 1)
                {
                    return((T)(IBaseClassIfc)result);
                }
            }
            if (result == null)
            {
                Type type = null;
                token = obj.GetValue("type", StringComparison.InvariantCultureIgnoreCase);
                if (token != null)
                {
                    string keyword = token.Value <string>();
                    type = Type.GetType("GeometryGym.Ifc." + keyword, false, true);
                }
                if (token == null)
                {
                    type = typeof(T);
                }
                if (type != null && !type.IsAbstract)
                {
                    ConstructorInfo constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
                                                                      null, Type.EmptyTypes, null);
                    if (constructor != null)
                    {
                        result = constructor.Invoke(new object[] { }) as BaseClassIfc;
                        if (result != null)
                        {
                            result.mDatabase = this;
                            token            = obj.GetValue("id", StringComparison.InvariantCultureIgnoreCase);
                            int index = 0;                            // (int) (this.mIfcObjects.Count * 1.2);
                            if (token != null)
                            {
                                if (token.Type == JTokenType.Integer)
                                {
                                    try
                                    {
                                        int i = token.Value <int>();
                                        if (this[i] == null)
                                        {
                                            index = i;
                                        }
                                    }
                                    catch (Exception) { }
                                    // TODO merge if existing equivalent
                                }
                                else if (token.Type == JTokenType.String)
                                {
                                    result.mGlobalId = token.Value <string>();
                                    mDictionary.TryAdd(result.mGlobalId, result);
                                }
                            }
                            IfcCartesianPoint   point     = result as IfcCartesianPoint;
                            IfcDirection        direction = result as IfcDirection;
                            IfcAxis2Placement3D placement = result as IfcAxis2Placement3D;
                            if (index == 0)
                            {
                                if (point != null)
                                {
                                    point.parseJObject(obj);
                                    if (point.isOrigin)
                                    {
                                        if (point.is2D)
                                        {
                                            return((T)(IBaseClassIfc)Factory.Origin2d);
                                        }
                                        return((T)(IBaseClassIfc)Factory.Origin);
                                    }
                                }
                                else
                                {
                                    if (direction != null)
                                    {
                                        direction.parseJObject(obj);
                                        if (!direction.is2D)
                                        {
                                            if (direction.isXAxis)
                                            {
                                                return((T)(IBaseClassIfc)Factory.XAxis);
                                            }
                                            if (direction.isYAxis)
                                            {
                                                return((T)(IBaseClassIfc)Factory.YAxis);
                                            }
                                            if (direction.isZAxis)
                                            {
                                                return((T)(IBaseClassIfc)Factory.ZAxis);
                                            }
                                            if (direction.isXAxisNegative)
                                            {
                                                return((T)(IBaseClassIfc)Factory.XAxisNegative);
                                            }
                                            if (direction.isYAxisNegative)
                                            {
                                                return((T)(IBaseClassIfc)Factory.YAxisNegative);
                                            }
                                            if (direction.isZAxisNegative)
                                            {
                                                return((T)(IBaseClassIfc)Factory.ZAxisNegative);
                                            }
                                        }
                                    }
                                    if (placement != null)
                                    {
                                        placement.parseJObject(obj);
                                        if (placement.IsXYPlane)
                                        {
                                            return((T)(IBaseClassIfc)Factory.XYPlanePlacement);
                                        }
                                    }
                                }

                                index       = NextBlank();
                                this[index] = result;

                                if (point != null || direction != null || placement != null)
                                {
                                    return((T)(IBaseClassIfc)result);
                                }
                            }
                            else
                            {
                                this[index] = result;
                            }
                        }
                    }
                }
            }
            if (result == null)
            {
                return(default(T));
            }
            result.parseJObject(obj);
            parseBespoke(result, obj);
            return((T)(IBaseClassIfc)result);
        }
コード例 #32
0
        public T ParseJObject <T>(JObject obj) where T : IBaseClassIfc
        {
            if (obj == null)
            {
                return(default(T));
            }

            BaseClassIfc result = null;
            JToken       token  = obj.GetValue("href", StringComparison.InvariantCultureIgnoreCase);

            if (token != null)
            {
                mDictionary.TryGetValue(token.Value <string>(), out result);
                if (result != null && obj.Count == 1)
                {
                    return((T)(IBaseClassIfc)result);
                }
            }
            if (result == null)
            {
                Type type = null;
                token = obj.GetValue("type", StringComparison.InvariantCultureIgnoreCase);
                if (token != null)
                {
                    string keyword = token.Value <string>();
                    type = Type.GetType("GeometryGym.Ifc." + keyword, false, true);
                }
                if (token == null)
                {
                    type = typeof(T);
                }
                if (type != null)
                {
                    if (type.IsAbstract)
                    {
                        JProperty jtoken    = (JProperty)obj.First;
                        Type      valueType = Type.GetType("GeometryGym.Ifc." + jtoken.Name, false, true);
                        if (valueType != null && valueType.IsSubclassOf(typeof(IfcValue)))
                        {
                            return((T)(IBaseClassIfc)ParserIfc.extractValue(jtoken.Name, jtoken.Value.ToString()));
                        }
                    }
                    else
                    {
                        ConstructorInfo constructor = type.GetConstructor(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic,
                                                                          null, Type.EmptyTypes, null);
                        if (constructor != null)
                        {
                            bool common = false;
                            result = constructor.Invoke(new object[] { }) as BaseClassIfc;
                            if (result != null)
                            {
                                result.mDatabase = this;

                                IfcCartesianPoint point = result as IfcCartesianPoint;
                                if (point != null)
                                {
                                    point.parseJObject(obj);
                                    if (point.isOrigin)
                                    {
                                        if (point.is2D)
                                        {
                                            result = Factory.Origin2d;
                                        }
                                        else
                                        {
                                            result = Factory.Origin;
                                        }
                                        common = true;
                                    }
                                }
                                else
                                {
                                    IfcDirection direction = result as IfcDirection;
                                    if (direction != null)
                                    {
                                        direction.parseJObject(obj);
                                        if (!direction.is2D)
                                        {
                                            common = true;
                                            if (direction.isXAxis)
                                            {
                                                result = Factory.XAxis;
                                            }
                                            else if (direction.isYAxis)
                                            {
                                                result = Factory.YAxis;
                                            }
                                            else if (direction.isZAxis)
                                            {
                                                result = Factory.ZAxis;
                                            }
                                            else if (direction.isXAxisNegative)
                                            {
                                                result = Factory.XAxisNegative;
                                            }
                                            else if (direction.isYAxisNegative)
                                            {
                                                result = Factory.YAxisNegative;
                                            }
                                            else if (direction.isZAxisNegative)
                                            {
                                                result = Factory.ZAxisNegative;
                                            }
                                            else
                                            {
                                                common = false;
                                            }
                                        }
                                    }
                                    else
                                    {
                                        IfcAxis2Placement3D placement = result as IfcAxis2Placement3D;
                                        if (placement != null)
                                        {
                                            placement.parseJObject(obj);
                                            if (placement.IsXYPlane)
                                            {
                                                result = Factory.XYPlanePlacement;
                                                common = true;
                                            }
                                        }
                                    }
                                }
                                token = obj.GetValue("id", StringComparison.InvariantCultureIgnoreCase);
                                if (token != null)
                                {
                                    string id = token.Value <string>();
                                    if (!(result is IfcRoot))
                                    {
                                        result.mGlobalId = id;
                                    }
                                    mDictionary.TryAdd(id, result);
                                }

                                if (common)
                                {
                                    return((T)(IBaseClassIfc)result);
                                }

                                int index = NextBlank();
                                this[index] = result;
                            }
                        }
                    }
                }
            }
            if (result == null)
            {
                return(default(T));
            }
            result.parseJObject(obj);
            parseBespoke(result, obj);
            IfcRoot root = result as IfcRoot;

            if (root != null)
            {
                mDictionary[root.GlobalId] = root;
            }
            return((T)(IBaseClassIfc)result);
        }
コード例 #33
0
ファイル: IFC E.cs プロジェクト: jmirtsch/GeometryGymIFC
		public IfcExtrudedAreaSolid(IfcProfileDef prof, IfcAxis2Placement3D position, double depth) : base(prof, position) { ExtrudedDirection = mDatabase.Factory.ZAxis; mDepth = depth; }
コード例 #34
0
ファイル: IFC E.cs プロジェクト: jenca-cloud/ggIFC
		public IfcExtrudedAreaSolidTapered(IfcDerivedProfileDef start, IfcAxis2Placement3D placement, double depth, IfcDerivedProfileDef end) : base(start, placement,new IfcDirection(start.mDatabase,0,0,1), depth ) { EndSweptArea = end; }
コード例 #35
0
ファイル: IFC E.cs プロジェクト: jmirtsch/GeometryGymIFC
		protected IfcElement(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, double length) : base(host,new IfcLocalPlacement(host.Placement,placement), null)
		{
			List<IfcShapeModel> reps = new List<IfcShapeModel>();
			IfcCartesianPoint cp = new IfcCartesianPoint(mDatabase, 0, 0, length);
			IfcPolyline ipl = new IfcPolyline(mDatabase.Factory.Origin, cp);
			reps.Add(IfcShapeRepresentation.GetAxisRep(ipl));
			
			profile.Associates.addAssociation(this);

			IfcMaterialProfileSet ps = profile.ForProfileSet;
			IfcMaterialProfileSetUsageTapering psut = profile as IfcMaterialProfileSetUsageTapering;
			if (psut != null)
				throw new Exception("Tapering Elements not implemented yet!");
			IfcProfileDef pd = null;
			if (ps.mCompositeProfile > 0)
				pd = ps.CompositeProfile;
			else
			{
				if (ps.mMaterialProfiles.Count > 0)
					pd = ps.MaterialProfiles[0].Profile;
				else
					throw new Exception("Profile not provided");
			}
			if (pd != null)
				reps.Add(new IfcShapeRepresentation( new IfcExtrudedAreaSolid(pd, pd.CalculateTransform(profile.CardinalPoint), length))); 
			
			Representation = new IfcProductDefinitionShape(reps);
		
		}
コード例 #36
0
ファイル: IFC W.cs プロジェクト: jmirtsch/GeometryGymIFC
        public IfcWallStandardCase(IfcProduct container, IfcMaterialLayerSetUsage layerSetUsage, IfcAxis2Placement3D placement, double length, double height)
            : base(container,new IfcLocalPlacement(container.Placement, placement),null)
        {
            DatabaseIfc db = mDatabase;
            double tol = mDatabase.Tolerance;
            setMaterial(layerSetUsage);

            IfcShapeRepresentation asr = IfcShapeRepresentation.GetAxisRep(new IfcPolyline(new IfcCartesianPoint(db,0,0,0),new IfcCartesianPoint(db,length,0,0)));
            List<IfcShapeModel> reps = new List<IfcShapeModel>();
            reps.Add(asr);
            double t = layerSetUsage.ForLayerSet.MaterialLayers.ConvertAll(x=>x.LayerThickness).Sum();

            reps.Add(new IfcShapeRepresentation( new IfcExtrudedAreaSolid(new IfcRectangleProfileDef(db,"",length, t), new IfcAxis2Placement3D(new IfcCartesianPoint(db,length/2.0, layerSetUsage.OffsetFromReferenceLine + (layerSetUsage.DirectionSense == IfcDirectionSenseEnum.POSITIVE ? 1 : -1) * t/2.0, 0)), height)));
            Representation = new IfcProductDefinitionShape(reps);
        }
コード例 #37
0
ファイル: IFC E.cs プロジェクト: jmirtsch/GeometryGymIFC
		protected IfcElement(IfcProduct host, IfcMaterialProfileSetUsage profile, IfcAxis2Placement3D placement, Tuple<double,double> arcOrigin, double arcAngle) : base(host, new IfcLocalPlacement(host.Placement, placement), null)
		{
			IfcMaterialProfileSet ps = profile.ForProfileSet;
			profile.Associates.addAssociation(this);
			IfcMaterialProfile mp = ps.MaterialProfiles[0];
			IfcProfileDef pd = mp.Profile;
			DatabaseIfc db = host.mDatabase; 
			List<IfcShapeModel> reps = new List<IfcShapeModel>();
			double length = Math.Sqrt(Math.Pow(arcOrigin.Item1, 2) + Math.Pow(arcOrigin.Item2, 2)), angMultipler = 1 / mDatabase.mContext.UnitsInContext.getScaleSI(IfcUnitEnum.PLANEANGLEUNIT);
			Tuple<double, double> normal = new Tuple<double, double>(-arcOrigin.Item2 / length, arcOrigin.Item1 / length);
			reps.Add(IfcShapeRepresentation.GetAxisRep(new IfcTrimmedCurve(new IfcCircle(new IfcAxis2Placement3D(new IfcCartesianPoint(db,arcOrigin.Item1,arcOrigin.Item2,0),new IfcDirection(db, normal.Item1,normal.Item2, 0), new IfcDirection(db,-arcOrigin.Item1,-arcOrigin.Item2,0)),length),new IfcTrimmingSelect(0),new IfcTrimmingSelect(arcAngle*angMultipler),true, IfcTrimmingPreference.PARAMETER)));
			IfcAxis2Placement3D translation = pd.CalculateTransform(profile.CardinalPoint);
			Tuple<double,double,double> pt = translation.Location.Coordinates;
			IfcAxis1Placement axis = new IfcAxis1Placement(new IfcCartesianPoint(db, arcOrigin.Item1 - pt.Item1, arcOrigin.Item2 - pt.Item2), new IfcDirection(db, normal.Item1, normal.Item2));
			reps.Add(new IfcShapeRepresentation(new IfcRevolvedAreaSolid(pd, translation, axis, arcAngle * angMultipler)));
			Representation = new IfcProductDefinitionShape(reps);
		}
コード例 #38
0
 public IfcGrid(IfcSpatialElement host, IfcAxis2Placement3D placement, List <IfcGridAxis> uAxes, List <IfcGridAxis> vAxes, List <IfcGridAxis> wAxes)
     : this(host, placement, uAxes, vAxes)
 {
     WAxes.AddRange(wAxes);
 }
コード例 #39
0
ファイル: DatabaseIFC.cs プロジェクト: jenca-cloud/ggIFC
		private void postImport(Aggregate aggregate) 
		{
			mWorldCoordinatePlacement = null;
			aggregate.RelateObjects(mFolder);
			if(mContext != null)
			{
				mContext.initializeUnitsAndScales();
				
				if (mContext.mRepresentationContexts.Count > 0)
					mGeomRepContxt = mIfcObjects[mContext.mRepresentationContexts[0]] as IfcGeometricRepresentationContext;
				if (mContext.mDeclares.Count == 0)
				{
					List<IfcDefinitionSelect> lds = aggregate.mTypeProducts.ConvertAll(x => (IfcDefinitionSelect)x);
					IfcRelDeclares rd = new IfcRelDeclares(mContext, lds) { Name = "DeclaredTypes" };
				}
			}
			customPostImport(aggregate);
			
		}