Inheritance: IfcGeometricRepresentationItem
Example #1
0
 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);
     }
 }
Example #2
0
        internal override void parseJObject(JObject obj)
        {
            base.parseJObject(obj);
            JObject jobj = obj.GetValue("RelatingProfileProperties", StringComparison.InvariantCultureIgnoreCase) as JObject;

            if (jobj != null)
            {
                RelatingProfileProperties = mDatabase.ParseJObject <IfcProfileProperties>(jobj);
            }
            jobj = obj.GetValue("ProfileSectionLocation", StringComparison.InvariantCultureIgnoreCase) as JObject;
            if (jobj != null)
            {
                ProfileSectionLocation = mDatabase.ParseJObject <IfcShapeAspect>(jobj);
            }

            jobj = obj.GetValue("ProfileOrientation", StringComparison.InvariantCultureIgnoreCase) as JObject;
            if (jobj != null)
            {
                JToken measure = jobj["IfcPlaneAngleMeasure"];
                if (measure != null)
                {
                    mProfileOrientationValue = measure.Value <double>();
                }
                else
                {
                    IfcDirection dir = mDatabase.ParseJObject <IfcDirection>(jobj);
                    if (dir != null)
                    {
                        mProfileOrientation = dir.mIndex;
                    }
                }
            }
        }
Example #3
0
 internal IfcFixedReferenceSweptAreaSolid(DatabaseIfc db, IfcFixedReferenceSweptAreaSolid s) : base(db, s)
 {
     Directrix      = db.Factory.Duplicate(s.Directrix) as IfcCurve;
     mStartParam    = s.mStartParam;
     mEndParam      = s.mEndParam;
     FixedReference = db.Factory.Duplicate(s.FixedReference) as IfcDirection;
 }
Example #4
0
 internal IfcGeometricRepresentationContext(DatabaseIfc db, int SpaceDimension, double precision) : base(db)
 {
     mCoordinateSpaceDimension = SpaceDimension;
     mPrecision            = Math.Max(1e-8, precision);
     WorldCoordinateSystem = new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, 0));
     TrueNorth             = new IfcDirection(mDatabase, 0, 1);
 }
Example #5
0
        internal override void parseJObject(JObject obj)
        {
            base.parseJObject(obj);
            IfcCartesianPoint cp = Location;

            if (cp != null)
            {
                cp.Coordinates = cp.Coordinates;                 // Force 3d
            }
            IfcDirection dir = mDatabase.parseJObject <IfcDirection>(obj.GetValue("Axis", StringComparison.InvariantCultureIgnoreCase) as JObject);

            if (dir != null)
            {
                mAxis = dir.mIndex;
                dir.DirectionRatioY = dir.DirectionRatioY;
                dir.DirectionRatioZ = dir.DirectionRatioZ;
            }
            dir = mDatabase.parseJObject <IfcDirection>(obj.GetValue("RefDirection", StringComparison.InvariantCultureIgnoreCase) as JObject);
            if (dir != null)
            {
                mRefDirection       = dir.mIndex;
                dir.DirectionRatioY = dir.DirectionRatioY;
                dir.DirectionRatioZ = dir.DirectionRatioZ;
            }
        }
 internal IfcAxis2Placement2D(DatabaseIfc db, Point2D position, Vector2D dir) : base(db, position)
 {
     if (dir.Length > 0 && new Vector3D(dir.X, dir.Y, 0).IsParallelTo(new Vector3D(1, 0, 0), Math.PI / 1800))
     {
         RefDirection = new IfcDirection(db, dir);
     }
 }
Example #7
0
        internal void initGeom()
        {
            IfcCartesianPoint point     = Origin;
            IfcDirection      direction = XAxis;

            direction = YAxis;
            direction = ZAxis;
            IfcAxis2Placement   pl        = this.WorldCoordinatePlacement;
            IfcAxis2Placement2D placement = Origin2dPlace;
        }
Example #8
0
        protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed)
        {
            base.setJSON(obj, host, processed);
            IfcDirection refDirection = RefDirection;

            if (refDirection != null)
            {
                obj["RefDirection"] = refDirection.getJson(this, processed);
            }
        }
Example #9
0
        protected override void setJSON(JObject obj, BaseClassIfc host, HashSet <int> processed)
        {
            base.setJSON(obj, host, processed);
            IfcDirection axis = Axis;

            if (axis != null)
            {
                obj["Axis"] = axis.getJson(this, processed);
            }
        }
Example #10
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            base.setJSON(obj, host, options);
            IfcDirection axis = Axis;

            if (axis != null)
            {
                obj["Axis"] = axis.getJson(this, options);
            }
        }
Example #11
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            base.setJSON(obj, host, options);
            IfcDirection refDirection = RefDirection;

            if (refDirection != null)
            {
                obj["RefDirection"] = refDirection.getJson(this, options);
            }
        }
Example #12
0
        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;
            }
        }
Example #13
0
        public IfcAxis2Placement3D(DatabaseIfc db, Plane plane) : base(db)
        {
            Location = new IfcCartesianPoint(db, plane.Origin);
            double angTol = Math.PI / 1800;

            if (plane.ZAxis.IsParallelTo(Vector3d.ZAxis, angTol) != 1)
            {
                Axis         = IfcDirection.convert(db, plane.ZAxis);
                RefDirection = IfcDirection.convert(db, plane.XAxis);
            }
            else if (plane.XAxis.IsParallelTo(Vector3d.XAxis, angTol) != 1)
            {
                RefDirection = IfcDirection.convert(db, plane.XAxis);
                Axis         = db.Factory.ZAxis;
            }
        }
Example #14
0
        protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
        {
            base.setJSON(obj, host, options);
            IfcDirection axis = Axis, refDirection = RefDirection;

            if (axis == null)
            {
                if (refDirection != null)
                {
                    obj["Axis"]         = mDatabase.Factory.ZAxis.getJson(this, options);
                    obj["RefDirection"] = refDirection.getJson(this, options);
                }
            }
            else if (refDirection == null)
            {
                obj["Axis"]         = axis.getJson(this, options);
                obj["RefDirection"] = mDatabase.Factory.XAxis.getJson(this, options);
            }
            else if (!axis.isZAxis || !refDirection.isXAxis)
            {
                obj["Axis"]         = axis.getJson(this, options);
                obj["RefDirection"] = refDirection.getJson(this, options);
            }
        }
		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;
		}
Example #16
0
		internal IfcAxis1Placement(DatabaseIfc db, IfcAxis1Placement p) : base(db,p) { if(p.mAxis > 0) Axis = db.Factory.Duplicate( p.Axis) as IfcDirection; }
Example #17
0
 public IfcFixedReferenceSweptAreaSolid(IfcProfileDef sweptArea, IfcCurve directrix, IfcDirection reference) : base(sweptArea)
 {
     Directrix      = directrix;
     FixedReference = reference;
 }
Example #18
0
        internal double mStartParam = double.NaN; // : OPT IfcParameterValue;

        #endregion Fields

        #region Constructors

        public IfcFixedReferenceSweptAreaSolid(IfcProfileDef sweptArea, IfcCurve directrix, IfcDirection reference)
            : base(sweptArea)
        {
            Directrix = directrix;
            FixedReference = reference;
        }
Example #19
0
 internal IfcAxis2Placement2D(DatabaseIfc db, Point2D position, Vector2D dir)
     : base(db, position)
 {
     if (dir.Length > 0 && new Vector3D(dir.X, dir.Y, 0).IsParallelTo(new Vector3D(1,0,0), Math.PI / 1800))
         RefDirection = new IfcDirection(db, dir);
 }
Example #20
0
		protected IfcCartesianTransformationOperator(DatabaseIfc db, IfcDirection ax1, IfcDirection ax2, IfcCartesianPoint o, double scale)
			: base(db) { if (ax1 != null) mAxis1 = ax1.mIndex; if (ax2 != null) mAxis2 = ax2.mIndex; mLocalOrigin = o.mIndex; mScale = scale; }
Example #21
0
		public IfcAxis1Placement(IfcCartesianPoint location, IfcDirection axis) : base(location) { Axis = axis; }
Example #22
0
		internal IfcAxis2Placement2D(DatabaseIfc db, IfcAxis2Placement2D p) : base(db, p)
		{
			if (p.mRefDirection > 0)
				RefDirection = db.Factory.Duplicate(p.RefDirection) as IfcDirection;
		}
Example #23
0
 public IfcVector(IfcDirection orientation, double magnitude)
 {
     Orientation = orientation; Magnitude = magnitude;
 }
Example #24
0
 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);
 }
Example #25
0
		public IfcExtrudedAreaSolid(IfcProfileDef prof, IfcDirection dir, double depth) : base(prof) { mExtrudedDirection = dir.mIndex; mDepth = depth; }
        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);
        }
 public IfcVector(DatabaseIfc db, Vector3d v) : base(db)
 {
     Orientation = new IfcDirection(db, v); mMagnitude = v.Length;
 }
 public IfcVector(DatabaseIfc db, Vector3d v)
     : base(db)
 {
     Orientation = new IfcDirection(db, v); mMagnitude = v.Length;
 }
Example #29
0
		internal static IfcDirection Parse(string str)
		{
			IfcDirection d = new IfcDirection();
			string s = str.Trim();
			if (s[0] == '(')
			{
				string[] fields = str.Substring(1,str.Length-2).Split(",".ToCharArray());
				if (fields != null && fields.Length > 0)
				{
					d.mDirectionRatioX = ParserSTEP.ParseDouble(fields[0]);
					if (fields.Length > 1)
					{
						d.mDirectionRatioY = ParserSTEP.ParseDouble(fields[1]);
						if (fields.Length > 2)
							d.mDirectionRatioZ = ParserSTEP.ParseDouble(fields[2]);
					}
				}
			}
			
			return d;
		}
 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;
     }
 }
Example #31
0
		internal IfcDirection(DatabaseIfc db, IfcDirection d) : base(db,d) { mDirectionRatioX = d.mDirectionRatioX; mDirectionRatioY = d.mDirectionRatioY; mDirectionRatioZ = d.mDirectionRatioZ; }
Example #32
0
		public IfcAxis1Placement(IfcDirection axis) : base(axis.mDatabase) { Axis = axis; }
Example #33
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);
        }
Example #34
0
		internal IfcDirection(IfcDirection d) : base(d) { mCoordinateX = d.mCoordinateX; mCoordinateY = d.mCoordinateY; mCoordinateZ = d.mCoordinateZ; }
Example #35
0
		public IfcExtrudedAreaSolid(IfcProfileDef prof, IfcAxis2Placement3D placement, IfcDirection dir, double depth) : base(prof, placement) { mExtrudedDirection = dir.mIndex; mDepth = depth; }
Example #36
0
		internal static void parseFields(IfcDirection d, List<string> arrFields, ref int ipos)
		{
			IfcGeometricRepresentationItem.parseFields(d, arrFields, ref ipos);
			//int count = arrFields.Count;
			string s = arrFields[ipos++];
			List<string> arrCoords = ParserSTEP.SplitLineFields(s.Substring(1, s.Length - 2));
			if (arrCoords.Count > 0)
			{
				d.mCoordinateX = ParserSTEP.ParseDouble(arrCoords[0]);
				if (arrCoords.Count > 1)
				{
					d.mCoordinateY = ParserSTEP.ParseDouble(arrCoords[1]);
					d.mCoordinateZ = (arrCoords.Count > 2 ? ParserSTEP.ParseDouble(arrCoords[2]) : double.NaN);
				}
			}
		}
Example #37
0
		internal static IfcDirection Parse(string strDef) { IfcDirection d = new IfcDirection(); int ipos = 0; parseFields(d, ParserSTEP.SplitLineFields(strDef), ref ipos); return d; }
Example #38
0
		public IfcAxis2Placement3D(IfcCartesianPoint p, IfcDirection axis, IfcDirection refDirection) : base(p) { mAxis = (axis == null ? 0 : axis.mIndex); mRefDirection = (refDirection == null ? 0 : refDirection.mIndex); }
 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);
 }
Example #40
0
		public IfcVector(IfcDirection orientation, double magnitude) { Orientation = orientation; Magnitude = magnitude; }