/// <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) { // Declare variables IGH_Goo Z = null; IGH_Goo Y = null; int L = 1; // Access the input parameters if (!DA.GetData(0, ref Z)) { return; } if (!DA.GetData(1, ref Y)) { return; } if (!DA.GetData(2, ref L)) { return; } wObject X = new wObject(); mFilters F = new mFilters(); mSequence S = new mSequence(); Bitmap A = new Bitmap(10, 10); if (Z != null) { Z.CastTo(out A); } if (Y != null) { Y.CastTo(out X); } if (X.SubType == "Filters") { S.AddFilter((mFilters)X.Element); } else if (X.SubType == "Filter") { S.AddFilter((mFilter)X.Element); } F = S; Bitmap B = new mIterate(A, F, L).ModifiedBitmap; DA.SetData(0, B); }
/// <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) { // Declare variables List <IGH_Goo> X = new List <IGH_Goo>(); // Access the input parameters if (!DA.GetDataList(0, X)) { return; } mFilters F = new mFilters(); mSequence S = new mSequence(); S.ClearSequence(); List <string> types = new List <string>(); for (int i = 0; i < X.Count; i++) { wObject Y = new wObject(); X[i].CastTo(out Y); if (Y.SubType == "Filters") { S.AddFilter((mFilters)Y.Element); } else if (Y.SubType == "Filter") { S.AddFilter((mFilter)Y.Element); } } F = S; wObject W = new wObject(F, "Macaw", F.Type); DA.SetData(0, W); }