Пример #1
0
        internal Frame(Point i, Point j, SectionProp secProp, string just, double angle)
        {
            BaseCrv   = Line.ByStartPointEndPoint(i, j);
            Angle     = angle;
            SecProp   = secProp;
            Just      = just;
            this.Type = Structure.Type.Frame;

            //register for cache
            ID = TracedFrameManager.GetNextUnusedID();
            TracedFrameManager.RegisterFrmforID(ID, this);
        }
Пример #2
0
        internal Frame(Line line, SectionProp secProp, string just, double angle)
        {
            BaseCrv   = line;
            Angle     = angle;
            SecProp   = secProp;
            Just      = just;
            this.Type = Structure.Type.Frame;

            //register for cache
            ID = TracedFrameManager.GetNextUnusedID();
            TracedFrameManager.RegisterFrmforID(ID, this);
        }
Пример #3
0
        public static Frame FromLine(Line Line, SectionProp SectionProp, string Justification = "MiddleCenter", double Rotation = 0)
        {
            Frame tFrm;
            FrmID tFrmid = null;

            Dictionary <string, ISerializable> getObjs = ProtoCore.Lang.TraceUtils.GetObjectFromTLS();

            foreach (var k in getObjs.Keys)
            {
                tFrmid = getObjs[k] as FrmID;
            }

            if (tFrmid == null)
            {
                // trace cache log didnot return an object, create new one !
                tFrm = new Frame(Line, SectionProp, Justification, Rotation);
                // Set Label
                tFrm.Label = String.Format("dyn_{0}", tFrm.ID.ToString());
            }
            else
            {
                tFrm = TracedFrameManager.GetFramebyID(tFrmid.IntID);

                tFrm.BaseCrv = Line;
                tFrm.SecProp = SectionProp;
                tFrm.Just    = Justification;
                tFrm.Angle   = Rotation;
            }

            //Set the trace data on the return to be this Frame
            Dictionary <string, ISerializable> objs = new Dictionary <string, ISerializable>();

            objs.Add(TRACE_ID, new FrmID {
                IntID = tFrm.ID
            });
            ProtoCore.Lang.TraceUtils.SetObjectToTLS(objs);

            return(tFrm);
        }