private KDG() { if (instance == null) { instance = this; } }
public void Getdir(List <Point3d> points) { Polyline poly; boundary.TryGetPolyline(out poly); normDir = KDG.getInstance().normalDirection(points, poly, out slopeRatio, out ground); }
public KDGinfo(Curve boundary, double ScaleFactor, bool drawing) { //long mem1 = GC.GetTotalMemory(false); scalefactor = ScaleFactor; surrbuildings = KDG.getInstance().GetRectAndHideOtherObjects(boundary); //long mem2 = GC.GetTotalMemory(false); //GC.Collect(); outrect = KDG.getInstance().OutRect(boundary); //long mem3 = GC.GetTotalMemory(false); //GC.Collect(); center = AreaMassProperties.Compute(boundary).Centroid; //long mem4 = GC.GetTotalMemory(false); //GC.Collect(); this.boundary = boundary.DuplicateCurve(); ExtendKDG(ScaleFactor); //long mem5 = GC.GetTotalMemory(false); //GC.Collect(); SetCampos(); //split surface if (drawing) { var objectsToHide = Rhino.RhinoDoc.ActiveDoc.Objects.FindByObjectType(Rhino.DocObjects.ObjectType.AnyObject); foreach (var objectToHide in objectsToHide) { Rhino.RhinoDoc.ActiveDoc.Objects.Hide(objectToHide.Id, true); } var regrec = Rhino.RhinoDoc.ActiveDoc.Objects.Add(outrect); regacy.Add(regrec); foreach (Curve curve in surrbuildings) { var reg = Rhino.RhinoDoc.ActiveDoc.Objects.Add(curve); regacy.Add(reg); } } //long mem6 = GC.GetTotalMemory(false); //Rhino.RhinoApp.WriteLine("Memory123: {0} , {1} , {2}", mem1,mem2,mem3); //Rhino.RhinoApp.WriteLine("Memory456: {0} , {1} , {2}", mem4, mem5, mem6); }