internal Joint(Point Point) { BasePt = Point; this.Type = Structure.Type.Joint; //register for cache ID = TracedJointManager.GetNextUnusedID(); TracedJointManager.RegisterJointforID(ID, this); }
public static Joint FromPoint(Point Point) { Joint tJoint; //JointID tJointId = TraceUtils.GetTraceData(TRACE_ID) as JointID; Dictionary <string, ISerializable> getObjs = ProtoCore.Lang.TraceUtils.GetObjectFromTLS(); JointID tJointId = null; foreach (var k in getObjs.Keys) { tJointId = getObjs[k] as JointID; } if (tJointId == null) { // trace cache log didnot return an object, create new one ! tJoint = new Joint(Point); // Set Label tJoint.Label = String.Format("dyn_{0}", tJoint.ID.ToString()); } else { tJoint = TracedJointManager.GetJointbyID(tJointId.IntID); string test = tJoint.Label; tJoint.BasePt = Point; } //Set the trace data on the return to be this Joint Dictionary <string, ISerializable> objs = new Dictionary <string, ISerializable>(); objs.Add(TRACE_ID, new JointID { IntID = tJoint.ID }); ProtoCore.Lang.TraceUtils.SetObjectToTLS(objs); return(tJoint); }