/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { var treeg = new treeGoo(); DA.GetData(0, ref treeg); var tree = treeg.Value; DA.SetDataTree(0, tree.GetLevelsID()); DA.SetDataTree(1, tree.GetLevelsTopology()); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { treeGoo treeGoo = new treeGoo(); DA.GetData(0, ref treeGoo); var tree = treeGoo.Value; DA.SetDataList(0, tree.NodeSet.Select(i => i.Name)); DA.SetDataList(1, tree.NodeSet.Select(i => i.Level)); DA.SetDataList(2, tree.NodeSet.Select(i => i.Parent.ID)); DA.SetDataList(3, tree.GetAddressList()); DA.SetDataTree(4, tree.ToNN()); DA.SetDataTree(5, tree.ToCN()); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { treeGoo treeg = new treeGoo(); DA.GetData(0, ref treeg); TreeStructure t = null; double tn, sn, an, pie; tn = sn = an = pie = 0; Point3d cen = new Point3d(); DA.GetData(0, ref t); DA.GetData("Center", ref cen); DA.GetData("Domain", ref pie); DA.GetData("TN", ref tn); DA.GetData("AN", ref sn); DA.GetData("SN", ref an); var dom = new Interval((pie - 1) * Math.PI / 2, (3 - pie) * Math.PI / 2); var arcs = Enumerable.Range(0, t.Depth + 1).Select(i => new Arc(new Circle(cen, sn * Math.Pow(i, tn) + an), dom)).ToList(); var layers = treeg.Value.GetLayers(arcs.Select(i => i.ToNurbsCurve())); var Pointset = new DataTree <GeoNode>(); var TigSet = new DataTree <Curve>(); foreach (var gLayer in layers) { var path = new GH_Path(gLayer.Level); Pointset.AddRange(gLayer.ToList(), path); TigSet.AddRange(gLayer.Draw(), path); } TigSet.RemovePath(TigSet.Paths.Last()); DA.SetDataTree(0, TigSet); DA.SetDataTree(1, Pointset); var m = layers.ByOuterMosts(); DA.SetDataList(2, m[GLayerSet.dets.Outermodes]); DA.SetDataList(3, m[GLayerSet.dets.InMiddles]); DA.SetDataList(4, m[GLayerSet.dets.Invalid]); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { var treeg = new treeGoo(); string d = ""; DA.GetData(1, ref d); DA.GetData(0, ref treeg); var tree = treeg.Value; var adds = tree.GetAddressList(); var names = tree.NodeSet.Select(i => i.Name).ToList(); var gset = adds.Select(i => i.Indices.Select(u => names[u]).ToList()).ToList(); var r = new DataTree <string>(); for (var i = 0; i < gset.Count; i++) { r.AddRange(gset[i], new GH_Path(i)); } var rs = gset.Select(i => string.Join(d, i)); DA.SetDataList(0, rs); DA.SetDataTree(1, r); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object can be used to retrieve data from input parameters and /// to store data in output parameters.</param> protected override void SolveInstance(IGH_DataAccess DA) { treeGoo t = null; DA.GetData(0, ref t); var tree = t.Value; try { DA.SetDataList("MarkDown", tree.ToMarkDown()); DA.SetDataList("Outline", tree.ToOutline()); DA.SetDataList("Pointer CSV", tree.ToPointerCSV()); DA.SetDataList("Outline CSV", tree.ToOutlineCSV()); DA.SetData("JSON", tree.ToJSON()); DA.SetData("Simple JSON", tree.ToSimpleJSON()); DA.SetData("XML", tree.ToXML()); DA.SetData("Simple XML", tree.ToSimpleXML()); } catch { } }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { treeGoo treeg = new treeGoo(); DA.GetData(0, ref treeg); List <Curve> curves = new List <Curve>(); DA.GetDataList(1, curves); var layers = treeg.Value.GetLayers(curves); var pp = layers.SelectMany(la => la.Select(i => i.PV.Point)).ToList(); var Pointset = new DataTree <GeoNode>(); var TigSet = new DataTree <Curve>(); foreach (var gLayer in layers) { var path = new GH_Path(gLayer.Level); Pointset.AddRange(gLayer.ToList(), path); TigSet.AddRange(gLayer.Draw(), path); } TigSet.RemovePath(TigSet.Paths.Last()); DA.SetDataTree(0, TigSet); DA.SetDataTree(1, Pointset); var m = layers.ByOuterMosts(); DA.SetDataList(2, m[GLayerSet.dets.Outermodes]); DA.SetDataList(3, m[GLayerSet.dets.InMiddles]); DA.SetDataList(4, m[GLayerSet.dets.Invalid]); }