Inheritance: IfcPlacement, IfcAxis2Placement
Esempio n. 1
0
		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);
		}
Esempio n. 2
0
        internal void initGeom()
        {
            IfcCartesianPoint point     = Origin;
            IfcDirection      direction = XAxis;

            direction = YAxis;
            direction = ZAxis;
            IfcAxis2Placement   pl        = this.WorldCoordinatePlacement;
            IfcAxis2Placement2D placement = Origin2dPlace;
        }
Esempio n. 3
0
 protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options)
 {
     base.setJSON(obj, host, options);
     if (mPosition != null)
     {
         IfcAxis2Placement2D position = Position;
         if ((mDatabase != null && mDatabase.Release < ReleaseVersion.IFC4) || !position.IsXYPlane(mDatabase.Tolerance))
         {
             obj["Position"] = Position.getJson(this, options);
         }
     }
 }
        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 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 override Transform Transform()
        {
            IfcAxis2Placement2D pos = Position;

            return(pos == null ? Rhino.Geometry.Transform.Identity : pos.Transform());
        }
Esempio n. 7
0
		internal static void parseFields(IfcAxis2Placement2D p, List<string> arrFields, ref int ipos) { IfcPlacement.parseFields(p, arrFields, ref ipos); p.mRefDirection = ParserSTEP.ParseLink(arrFields[ipos++]); }
Esempio n. 8
0
		internal static IfcAxis2Placement2D Parse(string strDef) { IfcAxis2Placement2D p = new IfcAxis2Placement2D(); int ipos = 0; parseFields(p, ParserSTEP.SplitLineFields(strDef), ref ipos); return p; }
Esempio n. 9
0
		internal IfcAxis2Placement2D(IfcAxis2Placement2D i) : base(i) { mRefDirection = i.mRefDirection; }
Esempio n. 10
0
		internal static IfcAxis2Placement2D Parse(string str) { IfcAxis2Placement2D p = new IfcAxis2Placement2D(); int pos = 0; p.Parse(str, ref pos, str.Length); return p; }
Esempio n. 11
0
		internal IfcAxis2Placement2D(DatabaseIfc db, IfcAxis2Placement2D p) : base(db, p)
		{
			if (p.mRefDirection > 0)
				RefDirection = db.Factory.Duplicate(p.RefDirection) as IfcDirection;
		}