Beispiel #1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string        title      = "";
            List <double> values     = new List <double>();
            List <string> names      = new List <string>();
            string        textFormat = "";
            List <Color>  colors     = new List <Color>();

            DA.GetData(0, ref title);
            DA.GetDataList(1, values);
            DA.GetDataList(2, names);
            DA.GetData(3, ref textFormat);
            DA.GetDataList(4, colors);

            BarChart chartObject = new BarChart();

            dialogImage = chartObject;
            PterodactylGrasshopperBitmapGoo GH_bmp = new PterodactylGrasshopperBitmapGoo();

            chartObject.BarChartData(true, title, values, names, textFormat, colors, GH_bmp.ReferenceTag);
            using (Bitmap b = chartObject.ExportBitmap())
            {
                GH_bmp.Value      = b.Clone(new Rectangle(0, 0, b.Width, b.Height), b.PixelFormat);
                GH_bmp.ReportPart = chartObject.Create();
                DA.SetData(0, GH_bmp);
            }
        }
Beispiel #2
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string        title   = "";
            List <double> xValues = new List <double>();
            List <double> yValues = new List <double>();
            string        xName   = "";
            string        yName   = "";
            Color         color   = new Color();

            DA.GetData(0, ref title);
            DA.GetDataList(1, xValues);
            DA.GetDataList(2, yValues);
            DA.GetData(3, ref xName);
            DA.GetData(4, ref yName);
            DA.GetData(5, ref color);

            LineGraph graphObject = new LineGraph();

            dialogImage = graphObject;
            PterodactylGrasshopperBitmapGoo GH_bmp = new PterodactylGrasshopperBitmapGoo();

            graphObject.LineGraphData(true, title, xValues, yValues, xName, yName, color, GH_bmp.ReferenceTag);
            using (Bitmap b = graphObject.ExportBitmap())
            {
                GH_bmp.Value      = b.Clone(new Rectangle(0, 0, b.Width, b.Height), b.PixelFormat);
                GH_bmp.ReportPart = graphObject.Create();
                DA.SetData(0, GH_bmp);
            }
        }
Beispiel #3
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string title                 = string.Empty;
            string viewportName          = string.Empty;
            bool   drawAxes              = false;
            bool   drawGrid              = false;
            bool   drawGridAxes          = false;
            bool   transparentBackground = true;

            DA.GetData(0, ref title);
            DA.GetData(1, ref viewportName);
            DA.GetData(2, ref drawAxes);
            DA.GetData(3, ref drawGrid);
            DA.GetData(4, ref drawGridAxes);
            DA.GetData(5, ref transparentBackground);

            VieportRh reportDocument = new VieportRh();
            PterodactylGrasshopperBitmapGoo GH_bmp = new PterodactylGrasshopperBitmapGoo();

            PterodactylEngine.Image reportObject = new PterodactylEngine.Image(title, GH_bmp.ReferenceTag);
            using (System.Drawing.Bitmap b = reportDocument.CaptureToBitmap(viewportName, drawAxes, drawGrid, drawGridAxes, transparentBackground))
            {
                GH_bmp.Value      = b.Clone(new Rectangle(0, 0, b.Width, b.Height), b.PixelFormat);
                GH_bmp.ReportPart = reportObject.Create();
                DA.SetData(0, GH_bmp);
            }
        }
Beispiel #4
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            string title = "";
            GrasshopperBitmapGoo GH_b = new GrasshopperBitmapGoo();

            DA.GetData(0, ref title);
            DA.GetData(1, ref GH_b);

            PterodactylGrasshopperBitmapGoo GH_bmp = new PterodactylGrasshopperBitmapGoo();

            PterodactylEngine.Image reportObject = new PterodactylEngine.Image(title, GH_bmp.ReferenceTag);
            GH_bmp.Value      = GH_b.Value.Clone(new Rectangle(0, 0, GH_b.Value.Width, GH_b.Value.Height), GH_b.Value.PixelFormat);
            GH_bmp.ReportPart = reportObject.Create();
            DA.SetData(0, GH_bmp);
        }
Beispiel #5
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            GraphElements graphElements = null;
            GraphSettings graphSettings = null;

            DA.GetData(0, ref graphElements);
            DA.GetData(1, ref graphSettings);

            Graph graphObject = new Graph();

            dialogImage = graphObject;
            PterodactylGrasshopperBitmapGoo GH_bmp = new PterodactylGrasshopperBitmapGoo();

            graphObject.GraphData(true, graphElements, graphSettings, GH_bmp.ReferenceTag);
            using (Bitmap b = graphObject.ExportBitmap())
            {
                GH_bmp.Value      = b.Clone(new Rectangle(0, 0, b.Width, b.Height), b.PixelFormat);
                GH_bmp.ReportPart = graphObject.Create();
                DA.SetData(0, GH_bmp);
            }
        }