Esempio n. 1
0
        /// <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)
        {
            string ID   = this.Attributes.InstanceGuid.ToString();
            string name = new GUIDtoAlpha(Convert.ToString(ID + Convert.ToString(this.RunCount)), false).Text;
            int    C    = this.RunCount;

            wObject  WindObject = new wObject();
            pElement Element    = new pElement();
            bool     Active     = Elements.ContainsKey(C);

            var pControl = new pRadialChart(name);

            if (Elements.ContainsKey(C))
            {
                Active = true;
            }

            //Check if control already exists
            if (Active)
            {
                if (Elements[C] != null)
                {
                    WindObject = Elements[C];
                    Element    = (pElement)WindObject.Element;
                    pControl   = (pRadialChart)Element.PollenControl;
                }
            }
            else
            {
                Elements.Add(C, WindObject);
            }

            //Set Unique Control Properties

            IGH_Goo D = null;
            double  R = 0;

            if (!DA.GetData(0, ref D))
            {
                return;
            }
            if (!DA.GetData(1, ref R))
            {
                return;
            }

            wObject W = new wObject();

            D.CastTo(out W);

            DataSetCollection DC = (DataSetCollection)W.Element;

            if (DC.TotalCustomFill == 0)
            {
                DC.SetDefaultPallet(Wind.Presets.wGradients.Metro, false, false);
            }
            if (DC.TotalCustomStroke == 0)
            {
                DC.SetDefaultStrokes(wStrokes.StrokeTypes.OffWhiteSolid);
            }
            if (DC.TotalCustomFont == 0)
            {
                DC.SetDefaultFonts(wFonts.ChartPoint);
            }
            if (DC.TotalCustomMarker == 0)
            {
                DC.SetDefaultMarkers(wGradients.Metro, wMarker.MarkerType.Circle, false, DC.Sets.Count > 1);
            }
            if (DC.TotalCustomLabel == 0)
            {
                DC.SetDefaultLabels(new wLabel(wLabel.LabelPosition.Center, wLabel.LabelAlignment.Center, new wGraphic(wColors.Transparent)));
            }

            if (DC.TotalCustomTitles == 0)
            {
                DC.Graphics.FontObject = wFonts.AxisLabel;
            }

            List <pRadialSeries> RadialSeriesList = new List <pRadialSeries>();

            pControl.SetProperties(DC, R);
            pControl.SetPollenSeries(name);
            pControl.ForceRefresh();

            /*
             * for (int i = 0; i < DC.Sets.Count; i++)
             * {
             *  pRadialSeries pSeriesSet = new pRadialSeries(Convert.ToString(name + i));
             *  pSeriesSet.SetRadialSeries(DC.Sets[i]);
             *  RadialSeriesList.Add(pSeriesSet);
             * }
             */

            //pControl.SetSeries(RadialSeriesList);
            //pControl.SetAxisAppearance();

            //Set Parrot Element and Wind Object properties
            if (!Active)
            {
                Element = new pElement(pControl.Element, pControl, pControl.Type);
            }
            WindObject          = new wObject(Element, "Pollen", Element.Type);
            WindObject.GUID     = this.InstanceGuid;
            WindObject.Instance = C;

            Elements[this.RunCount] = WindObject;

            DA.SetData(0, WindObject);
        }
Esempio n. 2
0
        /// <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)
        {
            string ID   = this.Attributes.InstanceGuid.ToString();
            string name = new GUIDtoAlpha(Convert.ToString(ID + Convert.ToString(this.RunCount)), false).Text;
            int    C    = this.RunCount;

            wObject  WindObject = new wObject();
            pElement Element    = new pElement();
            bool     Active     = Elements.ContainsKey(C);

            var pControl = new pCartesianChart(name);

            if (Elements.ContainsKey(C))
            {
                Active = true;
            }

            //Check if control already exists
            if (Active)
            {
                if (Elements[C] != null)
                {
                    WindObject = Elements[C];
                    Element    = (pElement)WindObject.Element;
                    pControl   = (pCartesianChart)Element.PollenControl;
                }
            }
            else
            {
                Elements.Add(C, WindObject);
            }

            //Set Unique Control Properties

            IGH_Goo D = null;
            int     M = 0;

            if (!DA.GetData(0, ref D))
            {
                return;
            }
            if (!DA.GetData(1, ref M))
            {
                return;
            }

            wObject W = new wObject();

            D.CastTo(out W);

            DataSetCollection DC = (DataSetCollection)W.Element;

            if (DC.TotalCustomFill == 0)
            {
                DC.SetDefaultPallet(wGradients.Metro, false, DC.Sets.Count > 1);
            }
            if (DC.TotalCustomStroke == 0)
            {
                DC.SetDefaultStrokes(wStrokes.StrokeTypes.Transparent);
            }
            if (DC.TotalCustomFont == 0)
            {
                DC.SetDefaultFonts(wFonts.ChartPoint);
            }
            if (DC.TotalCustomMarker == 0)
            {
                DC.SetDefaultMarkers(wGradients.SolidTransparent, wMarker.MarkerType.None, false, DC.Sets.Count > 1);
            }
            if (DC.TotalCustomLabel == 0)
            {
                if ((M == 0) || (M == 3))
                {
                    DC.SetDefaultLabels(new wLabel(wLabel.LabelPosition.Center, wLabel.LabelAlignment.Center, new wGraphic(wColors.Transparent)));
                }
                else
                {
                    DC.SetDefaultLabels(new wLabel(wLabel.LabelPosition.Top, wLabel.LabelAlignment.Perp, new wGraphic(wColors.Transparent)));
                }
            }

            List <pCartesianSeries> PointSeriesList = new List <pCartesianSeries>();

            pControl.SetProperties(DC);
            switch (M)
            {
            case 0:
                pControl.SetAdjacentBarChart();
                break;

            case 1:
                pControl.SetStackBarChart(false);
                break;

            case 2:
                pControl.SetStackBarChart(true);
                break;

            case 3:
                pControl.SetAdjacentColumnChart();
                break;

            case 4:
                pControl.SetStackColumnChart(false);
                break;

            case 5:
                pControl.SetStackColumnChart(true);
                break;
            }
            pControl.ForceRefresh();
            pControl.SetAxisAppearance();

            //Set Parrot Element and Wind Object properties
            if (!Active)
            {
                Element = new pElement(pControl.Element, pControl, pControl.Type);
            }
            WindObject          = new wObject(Element, "Pollen", Element.Type);
            WindObject.GUID     = this.InstanceGuid;
            WindObject.Instance = C;

            Elements[this.RunCount] = WindObject;

            DA.SetData(0, WindObject);
        }
Esempio n. 3
0
        /// <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)
        {
            string ID   = this.Attributes.InstanceGuid.ToString();
            string name = new GUIDtoAlpha(Convert.ToString(ID + Convert.ToString(this.RunCount)), false).Text;
            int    C    = this.RunCount;

            wObject  WindObject = new wObject();
            pElement Element    = new pElement();
            bool     Active     = Elements.ContainsKey(C);

            var pControl = new pGaugeChartSeries(name);

            if (Elements.ContainsKey(C))
            {
                Active = true;
            }

            //Check if control already exists
            if (Active)
            {
                if (Elements[C] != null)
                {
                    WindObject = Elements[C];
                    Element    = (pElement)WindObject.Element;
                    pControl   = (pGaugeChartSeries)Element.PollenControl;
                }
            }
            else
            {
                Elements.Add(C, WindObject);
            }

            //Set Unique Control Properties

            IGH_Goo D = null;
            int     M = 0;
            bool    B = true;
            int     S = 100;

            if (!DA.GetData(0, ref D))
            {
                return;
            }
            if (!DA.GetData(1, ref M))
            {
                return;
            }
            if (!DA.GetData(2, ref B))
            {
                return;
            }
            if (!DA.GetData(3, ref S))
            {
                return;
            }

            wObject W = new wObject();

            D.CastTo(out W);

            DataSetCollection DC = (DataSetCollection)W.Element;

            if (DC.TotalCustomFill == 0)
            {
                DC.SetDefaultPallet(wGradients.Metro, false, false);
            }
            if (DC.TotalCustomStroke == 0)
            {
                DC.SetDefaultStrokes(wStrokes.StrokeTypes.Transparent);
            }
            if (DC.TotalCustomFont == 0)
            {
                DC.SetDefaultFonts(wFonts.ChartGauge);
            }
            if (DC.TotalCustomMarker == 0)
            {
                DC.SetDefaultMarkers(wGradients.SolidTransparent, wMarker.MarkerType.None, false, false);
            }
            if (DC.TotalCustomLabel == 0)
            {
                DC.SetDefaultLabels(new wLabel(wLabel.LabelPosition.Center, wLabel.LabelAlignment.Center, new wGraphic(wColors.Transparent)));
            }

            pControl.SetProperties(DC, B, 0);
            pControl.SetCharts(S, M, modeStatus);

            if (DC.TotalCustomFont > 0)
            {
                pControl.SetFont();
            }

            //Set Parrot Element and Wind Object properties
            if (!Active)
            {
                Element = new pElement(pControl.Element, pControl, pControl.Type);
            }
            WindObject          = new wObject(Element, "Pollen", Element.Type);
            WindObject.GUID     = this.InstanceGuid;
            WindObject.Instance = C;

            Elements[this.RunCount] = WindObject;

            DA.SetData(0, WindObject);
        }
Esempio n. 4
0
        /// <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)
        {
            string ID   = this.Attributes.InstanceGuid.ToString();
            string name = new GUIDtoAlpha(Convert.ToString(ID + Convert.ToString(this.RunCount)), false).Text;
            int    C    = this.RunCount;

            wObject  WindObject = new wObject();
            pElement Element    = new pElement();
            bool     Active     = Elements.ContainsKey(C);

            var pControl = new pPointChart(name);

            if (Elements.ContainsKey(C))
            {
                Active = true;
            }

            //Check if control already exists
            if (Active)
            {
                if (Elements[C] != null)
                {
                    WindObject = Elements[C];
                    Element    = (pElement)WindObject.Element;
                    pControl   = (pPointChart)Element.PollenControl;
                }
            }
            else
            {
                Elements.Add(C, WindObject);
            }

            //Set Unique Control Properties

            IGH_Goo D = null;
            int     M = 0;

            if (!DA.GetData(0, ref D))
            {
                return;
            }
            if (!DA.GetData(1, ref M))
            {
                return;
            }

            wObject W = new wObject();

            D.CastTo(out W);

            DataSetCollection DC = (DataSetCollection)W.Element;

            if (DC.TotalCustomFill == 0)
            {
                DC.SetDefaultPallet(wGradients.Metro, false, DC.Sets.Count > 1);
            }
            if (DC.TotalCustomStroke == 0)
            {
                if (M == 1)
                {
                    DC.SetDefaultStrokes(wStrokes.StrokeTypes.Transparent);
                }
                else
                {
                    DC.SetDefaultStrokes(wStrokes.StrokeTypes.LineChart, wGradients.Metro, false, true);
                }
            }
            if (DC.TotalCustomMarker == 0)
            {
                if (M == 0)
                {
                    DC.SetDefaultMarkers(wGradients.Metro, wMarker.MarkerType.Circle, false, DC.Sets.Count > 1);
                }
                else
                {
                    DC.SetDefaultMarkers(wGradients.SolidTransparent, wMarker.MarkerType.None, false, DC.Sets.Count > 1);
                }
            }
            if (DC.TotalCustomFont == 0)
            {
                DC.SetDefaultFonts(wFonts.ChartPointDark);
            }
            if (DC.TotalCustomLabel == 0)
            {
                DC.SetDefaultLabels(new wLabel(wLabel.LabelPosition.Center, wLabel.LabelAlignment.None, new wGraphic(wColors.Transparent)));
            }

            if (DC.TotalCustomTitles == 0)
            {
                DC.Graphics.FontObject = wFonts.AxisLabel;
            }

            List <pPointSeries> PointSeriesList = new List <pPointSeries>();

            int T = 0;

            double X = DC.Sets.Count;
            double Y = 99.0 / X;

            if (!DC.Axes.Enabled)
            {
                DC.Axes.AxisX.Enabled  = true;
                DC.Axes.AxisX.HasLabel = false;
                DC.Axes.AxisY.Enabled  = true;
                DC.Axes.AxisY.HasLabel = false;
            }

            pControl.SetProperties(DC);

            for (int i = 0; i < DC.Sets.Count; i++)
            {
                pPointSeries pSeriesSet = new pPointSeries(DC.Sets[i].Title);
                pSeriesSet.SetProperties(DC.Sets[i]);
                pSeriesSet.SetRadialChartType(M);
                pSeriesSet.SetChartLabels(DC.Label);
                pSeriesSet.SetNumericData(4);
                PointSeriesList.Add(pSeriesSet);
            }

            pControl.SetSeries(PointSeriesList);
            pControl.SetAxisScale();
            pControl.SetAxisAppearance();
            if (M == 0)
            {
                pControl.SetXaxis(new wDomain(0, PointSeriesList[0].DataList.Count - 1));
            }

            //Set Parrot Element and Wind Object properties
            if (!Active)
            {
                Element = new pElement(pControl.Element, pControl, pControl.Type);
            }
            WindObject          = new wObject(Element, "Pollen", Element.Type);
            WindObject.GUID     = this.InstanceGuid;
            WindObject.Instance = C;

            Elements[this.RunCount] = WindObject;

            DA.SetData(0, WindObject);
        }
Esempio n. 5
0
        /// <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)
        {
            string ID   = this.Attributes.InstanceGuid.ToString();
            string name = new GUIDtoAlpha(Convert.ToString(ID + Convert.ToString(this.RunCount)), false).Text;
            int    C    = this.RunCount;

            wObject  WindObject = new wObject();
            pElement Element    = new pElement();
            bool     Active     = Elements.ContainsKey(C);

            var pControl = new pPointChart(name);

            if (Elements.ContainsKey(C))
            {
                Active = true;
            }

            //Check if control already exists
            if (Active)
            {
                if (Elements[C] != null)
                {
                    WindObject = Elements[C];
                    Element    = (pElement)WindObject.Element;
                    pControl   = (pPointChart)Element.PollenControl;
                }
            }
            else
            {
                Elements.Add(C, WindObject);
            }

            //Set Unique Control Properties

            IGH_Goo D = null;
            int     M = 0;
            int     P = 0;
            int     T = 0;
            int     L = 0;

            if (!DA.GetData(0, ref D))
            {
                return;
            }
            if (!DA.GetData(1, ref M))
            {
                return;
            }
            if (!DA.GetData(2, ref P))
            {
                return;
            }
            if (!DA.GetData(3, ref T))
            {
                return;
            }
            if (!DA.GetData(4, ref L))
            {
                return;
            }

            wObject W = new wObject();

            D.CastTo(out W);

            bool LineMode  = ((M > 2) & (M < 6));
            bool TagMode   = ((M == 1) || (M == 2));
            bool LabelMode = ((M == 0) || (LineMode));

            DataSetCollection DC = (DataSetCollection)W.Element;

            if (DC.TotalCustomFill == 0)
            {
                DC.SetDefaultPallet(Wind.Presets.wGradients.Metro, false, DC.Sets.Count > 1);
            }
            if (DC.TotalCustomStroke == 0)
            {
                if (LineMode)
                {
                    DC.SetDefaultStrokes(wStrokes.StrokeTypes.LineChart, wGradients.Metro, false, DC.Sets.Count > 1);
                }
                else
                {
                    DC.SetDefaultStrokes(wStrokes.StrokeTypes.OffWhiteSolid);
                }
            }
            if (DC.TotalCustomMarker == 0)
            {
                if (M == 0)
                {
                    DC.SetDefaultMarkers(wGradients.Metro, wMarker.MarkerType.Circle, false, DC.Sets.Count > 1);
                }
                else
                {
                    DC.SetDefaultMarkers(wGradients.SolidTransparent, wMarker.MarkerType.None, false, DC.Sets.Count > 1);
                }
            }
            if (DC.TotalCustomFont == 0)
            {
                DC.SetDefaultFonts(wFonts.ChartPointDark);
            }
            if (DC.TotalCustomLabel == 0)
            {
                if (LabelMode)
                {
                    DC.SetDefaultLabels(new wLabel(wLabel.LabelPosition.Center, wLabel.LabelAlignment.None, new wGraphic(wColors.Transparent)));
                }
                else
                {
                    DC.SetDefaultLabels(new wLabel(wLabel.LabelPosition.Center, wLabel.LabelAlignment.Center, new wGraphic(wColors.Transparent)));
                }
            }

            if (DC.TotalCustomTitles == 0)
            {
                DC.Graphics.FontObject = wFonts.AxisLabel;
            }

            List <pPointSeries> PointSeriesList = new List <pPointSeries>();

            pControl.SetProperties(DC);

            for (int i = 0; i < DC.Sets.Count; i++)
            {
                pPointSeries pSeriesSet = new pPointSeries(DC.Sets[i].Title);
                pSeriesSet.SetProperties(DC.Sets[i]);
                pSeriesSet.SetNumberChartType(M, ModeStack, LineMode);
                pSeriesSet.SetChartLabels(DC.Label);
                pSeriesSet.SetNumericData(0);
                PointSeriesList.Add(pSeriesSet);
            }

            pControl.View = new Pollen.Utilities.p3D(P, T, L, (Pollen.Utilities.p3D.LightingMode)ModeLighting);

            pControl.SetSeries(PointSeriesList);
            pControl.SetThreeDView();
            pControl.SetAxisScale();
            pControl.SetAxisAppearance();

            //Set Parrot Element and Wind Object properties
            if (!Active)
            {
                Element = new pElement(pControl.Element, pControl, pControl.Type);
            }
            WindObject          = new wObject(Element, "Pollen", Element.Type);
            WindObject.GUID     = this.InstanceGuid;
            WindObject.Instance = C;

            Elements[this.RunCount] = WindObject;

            DA.SetData(0, WindObject);
        }
Esempio n. 6
0
        /// <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)
        {
            string ID   = this.Attributes.InstanceGuid.ToString();
            string name = new GUIDtoAlpha(Convert.ToString(ID + Convert.ToString(this.RunCount)), false).Text;
            int    C    = this.RunCount;

            wObject  WindObject = new wObject();
            pElement Element    = new pElement();
            bool     Active     = Elements.ContainsKey(C);

            var pControl = new pHeatChart(name);

            if (Elements.ContainsKey(C))
            {
                Active = true;
            }

            //Check if control already exists
            if (Active)
            {
                if (Elements[C] != null)
                {
                    WindObject = Elements[C];
                    Element    = (pElement)WindObject.Element;
                    pControl   = (pHeatChart)Element.PollenControl;
                }
            }
            else
            {
                Elements.Add(C, WindObject);
            }

            //Set Unique Control Properties

            IGH_Goo D = null;
            IGH_Goo G = null;

            if (!DA.GetData(0, ref D))
            {
                return;
            }
            if (!DA.GetData(1, ref G))
            {
                return;
            }

            wObject  W  = new wObject();
            wGraphic GR = new wGraphic();

            GR.Gradient = wGradients.Metro;
            D.CastTo(out W);
            G.CastTo(out GR);


            DataSetCollection DC = (DataSetCollection)W.Element;

            if (DC.TotalCustomFill == 0)
            {
                DC.SetDefaultPallet(wGradients.Metro, false, DC.Sets.Count > 1);
            }
            if (DC.TotalCustomFont == 0)
            {
                DC.SetDefaultFonts(wFonts.ChartPoint);
            }
            if (DC.TotalCustomMarker == 0)
            {
                DC.SetDefaultMarkers(wGradients.SolidTransparent, wMarker.MarkerType.None, false, DC.Sets.Count > 1);
            }
            if (DC.TotalCustomStroke == 0)
            {
                DC.SetDefaultStrokes(wStrokes.StrokeTypes.Transparent);
            }
            if (DC.TotalCustomLabel == 0)
            {
                DC.SetDefaultLabels(new wLabel(wLabel.LabelPosition.Center, wLabel.LabelAlignment.Center, new wGraphic(wColors.Transparent)));
            }


            pControl.SetProperties(DC);
            pControl.SetPollenSeries();
            pControl.SetFormatting();
            pControl.SetToolTip();
            pControl.ForceRefresh();
            //pControl.SetAxisAppearance();

            if (G != null)
            {
                pControl.SetGradient(GR);
            }

            //Set Parrot Element and Wind Object properties
            if (!Active)
            {
                Element = new pElement(pControl.Element, pControl, pControl.Type);
            }
            WindObject          = new wObject(Element, "Pollen", Element.Type);
            WindObject.GUID     = this.InstanceGuid;
            WindObject.Instance = C;

            Elements[this.RunCount] = WindObject;

            DA.SetData(0, WindObject);
        }