Esempio n. 1
0
 public override void CleanUp()
 {
     if (triangleList != null)
     {
         triangleList.Clear();
     }
     triangleList = null;
     base.CleanUp();
 }
Esempio n. 2
0
        private void InitializeRoute(RenderContext11 renderContext)
        {
            triangleList               = new TriangleList();
            triangleList.Decay         = 1000;
            triangleList.Sky           = this.Astronomical;
            triangleList.TimeSeries    = true;
            triangleList.DepthBuffered = false;
            triangleList.AutoTime      = false;

            int steps = 500;

            Vector3d start = Coordinates.GeoTo3dDouble(latStart, lngStart);
            Vector3d end   = Coordinates.GeoTo3dDouble(latEnd, lngEnd);
            Vector3d dir   = end - start;

            dir.Normalize();

            Vector3d startNormal = start;

            startNormal.Normalize();

            Vector3d left  = Vector3d.Cross(startNormal, dir);
            Vector3d right = Vector3d.Cross(dir, startNormal);

            left.Normalize();
            right.Normalize();

            left.Multiply(.001 * width);
            right.Multiply(.001 * width);

            Vector3d lastLeft  = new Vector3d();
            Vector3d lastRight = new Vector3d();
            bool     firstTime = true;

            for (int i = 0; i <= steps; i++)
            {
                Vector3d v = Vector3d.Lerp(start, end, i / (float)steps);
                v.Normalize();
                Vector3d cl = v;
                Vector3d cr = v;

                cl.Add(left);
                cr.Add(right);

                if (!firstTime)
                {
                    triangleList.AddQuad(lastRight, lastLeft, cr, cl, Color, new Dates(i / (float)steps, 2));
                }
                else
                {
                    firstTime = false;
                }

                lastLeft  = cl;
                lastRight = cr;
            }
        }
 public override void CleanUp()
 {
     if (triangleList != null)
     {
         triangleList.Clear();
     }
     triangleList = null;
     base.CleanUp();
 }
        private void InitializeRoute(RenderContext11 renderContext)
        {
            triangleList = new TriangleList();
            triangleList.Decay = 1000;
            triangleList.Sky = this.Astronomical;
            triangleList.TimeSeries = true;
            triangleList.DepthBuffered = false;
            triangleList.AutoTime = false;

            int steps = 500;

            Vector3d start = Coordinates.GeoTo3dDouble(latStart, lngStart);
            Vector3d end = Coordinates.GeoTo3dDouble(latEnd, lngEnd);
            Vector3d dir = end - start;
            dir.Normalize();

            Vector3d startNormal = start;
            startNormal.Normalize();

            Vector3d left = Vector3d.Cross(startNormal, dir);
            Vector3d right = Vector3d.Cross(dir, startNormal);
            left.Normalize();
            right.Normalize();

            left.Multiply(.001*width);
            right.Multiply(.001 * width);

            Vector3d lastLeft = new Vector3d();
            Vector3d lastRight = new Vector3d();
            bool firstTime = true;
            for (int i = 0; i <= steps; i++)
            {
                Vector3d v = Vector3d.Lerp(start, end, i / (float)steps);
                v.Normalize();
                Vector3d cl = v;
                Vector3d cr = v;

                cl.Add(left);
                cr.Add(right);

                if (!firstTime)
                {
                    triangleList.AddQuad(lastRight, lastLeft, cr, cl, Color, new Dates(i / (float)steps, 2));
                }
                else
                {
                   firstTime = false;
                }

                lastLeft = cl;
                lastRight = cr;

            }
        }
        protected override bool PrepVertexBuffer(float opacity)
        {
            table.Lock();

            CleanAndReady = true;

            if (lineList != null)
            {
                lineList.Clear();
            }

            if (lineList2d != null)
            {
                lineList2d.Clear();
            }
            if (triangleList != null)
            {
                triangleList.Clear();
            }

            if (triangleList2d != null)
            {
                triangleList2d.Clear();
            }

            if (textBatch != null)
            {
                textBatch.CleanUp();
            }

            if (lineList == null)
            {
                lineList = new LineList();
            }

            lineList.TimeSeries = timeSeries;

            if (lineList2d == null)
            {
                lineList2d = new LineList();
                lineList2d.DepthBuffered = false;

            }

            lineList.TimeSeries = timeSeries;

            if (triangleList == null)
            {
                triangleList = new TriangleList();
            }

            if (triangleList2d == null)
            {
                triangleList2d = new TriangleList();
                triangleList2d.DepthBuffered = false;
            }

            var vertList = new List<TimeSeriesPointVertex>();
            var indexList = new List<UInt32>();
            var lastItem = new TimeSeriesPointVertex();
            positions.Clear();
            UInt32 currentIndex = 0;

            var color = Color.FromArgb((int)Color.A, Color);

            // for space 3d
            ecliptic = Coordinates.MeanObliquityOfEcliptic(SpaceTimeController.JNow) / 180.0 * Math.PI;

            var baseDate = new DateTime(2010,1,1,12,00,00);

            foreach (var fgt in Filters)
            {
                var filter = fgt.Stats;
                filter.SelectDomain.Clear();
                if (filter.Computed)
                {
                    if (filter.DomainColumn > -1)
                    {
                        var i = 0;
                        foreach (var domainValue in filter.DomainValues)
                        {
                            if (filter.Selected[i])
                            {
                                filter.SelectDomain.Add(domainValue, filter.Selected[i]);
                            }
                            i++;
                        }
                    }
                }
            }

            var mr = LayerManager.AllMaps[ReferenceFrame].Frame.MeanRadius;
            if (mr != 0)
            {
                meanRadius = mr;
            }

            foreach (var row in table.Rows)
            {
                try
                {
                    var selected = false;
                    var firstFilter = true;
                    foreach (var fgt in Filters)
                    {
                        var filter = fgt.Stats;
                        if (filter.Computed && (selected || firstFilter))
                        {
                            if (filter.IsSelected(row))
                            {
                                selected = true;
                            }
                            else
                            {
                                selected = false;
                            }
                            firstFilter = false;

                        }
                    }

                    if (geometryColumn > -1 || (CoordinatesType == CoordinatesTypes.Spherical && (lngColumn > -1 && latColumn > -1)) || ((CoordinatesType == CoordinatesTypes.Rectangular) && (XAxisColumn > -1 && YAxisColumn > -1)))
                    {
                        double Xcoord = 0;
                        double Ycoord = 0;
                        double Zcoord = 0;

                        double alt = 1;
                        double altitude = 0;
                        double distParces = 0;
                        var factor = GetScaleFactor(AltUnit, 1);
                        if (altColumn == -1 || AltType == AltTypes.SeaLevel || bufferIsFlat)
                        {
                            alt = 1;
                            if (astronomical & !bufferIsFlat)
                            {
                                alt = UiTools.AuPerLightYear * 100;
                            }
                        }
                        else
                        {
                            if (AltType == AltTypes.Depth)
                            {
                                factor = -factor;
                            }

                            if (!double.TryParse(row[altColumn], out alt))
                            {
                                alt = 0;
                            }

                            if (astronomical)
                            {
                                factor = factor / (1000 * UiTools.KilometersPerAu);
                                distParces = (alt * factor) / UiTools.AuPerParsec;

                                altitude = (factor * alt);
                                alt = (factor * alt);
                            }
                            else if (AltType == AltTypes.Distance)
                            {
                                altitude = (factor * alt);
                                alt = (factor * alt / meanRadius);
                            }
                            else
                            {
                                altitude = (factor * alt);
                                alt = 1 + (factor * alt / meanRadius);
                            }
                        }

                        if (CoordinatesType == CoordinatesTypes.Spherical && lngColumn > -1 && latColumn > -1)
                        {
                            Xcoord = Coordinates.Parse(row[lngColumn]);
                            Ycoord = Coordinates.Parse(row[latColumn]);

                            if (astronomical)
                            {
                                if (RaUnits == RAUnits.Hours)
                                {
                                    Xcoord *= 015;
                                }
                                if (bufferIsFlat)
                                {
                                    Xcoord += 180;
                                }
                            }
                            if (!astronomical)
                            {
                                var offset = EGM96Geoid.Height(Ycoord, Xcoord);

                                altitude += offset;
                                alt += offset / meanRadius;
                            }
                            var pos = Coordinates.GeoTo3dDouble(Ycoord, Xcoord, alt);

                            lastItem.Position = pos.Vector311;

                            positions.Add(lastItem.Position);

                        }
                        else if (CoordinatesType == CoordinatesTypes.Rectangular)
                        {
                            var xyzScale = GetScaleFactor(CartesianScale, CartesianCustomScale) / meanRadius;

                            if (ZAxisColumn > -1)
                            {
                                Zcoord = Convert.ToDouble(row[ZAxisColumn]);
                            }

                            Xcoord = Convert.ToDouble(row[XAxisColumn]);
                            Ycoord = Convert.ToDouble(row[YAxisColumn]);

                            if (XAxisReverse)
                            {
                                Xcoord = -Xcoord;
                            }
                            if (YAxisReverse)
                            {
                                Ycoord = -Ycoord;
                            }
                            if (ZAxisReverse)
                            {
                                Zcoord = -Zcoord;
                            }

                            lastItem.Position = new Vector3((float)(Xcoord * xyzScale), (float)(Zcoord * xyzScale), (float)(Ycoord * xyzScale));
                            positions.Add(lastItem.Position);
                        }

                        switch (ColorMap)
                        {
                            case ColorMaps.Same_For_All:
                                lastItem.Color = color;
                                break;
                            case ColorMaps.Per_Column_Literal:
                                if (ColorMapColumn > -1)
                                {
                                    lastItem.Color = ParseColor(row[ColorMapColumn], color);
                                }
                                else
                                {
                                    lastItem.Color = color;
                                }
                                break;
                            //case ColorMaps.Group_by_Range:
                            //    break;
                            //case ColorMaps.Gradients_by_Range:
                            //    break;
                            case ColorMaps.Group_by_Values:
                                if (!ColorDomainValues.ContainsKey(row[ColorMapColumn]))
                                {
                                    MakeColorDomainValues();
                                }
                                lastItem.Color = Color.FromArgb(ColorDomainValues[row[ColorMapColumn]].MarkerIndex);
                                break;

                            default:
                                break;
                        }

                        if (selected)
                        {
                            lastItem.Color = Color.Yellow;
                        }

                        if (sizeColumn > -1)
                        {
                            switch (pointScaleType)
                            {
                                case PointScaleTypes.Linear:
                                    lastItem.PointSize = Convert.ToSingle(row[sizeColumn]);
                                    break;
                                case PointScaleTypes.Log:
                                    lastItem.PointSize = (float)Math.Log(Convert.ToSingle(row[sizeColumn]));
                                    break;
                                case PointScaleTypes.Power:
                                    {
                                        double size = 0;
                                        if (double.TryParse(row[sizeColumn], out size))
                                        {
                                            lastItem.PointSize = (float)Math.Pow(2, size);
                                        }
                                        else
                                        {
                                            lastItem.PointSize = 0;
                                        }
                                    }
                                    break;
                                case PointScaleTypes.StellarMagnitude:
                                    {
                                        double size = 0;
                                        if (double.TryParse(row[sizeColumn], out size))
                                        {

                                            if (!bufferIsFlat)
                                            {
                                                size = size - 5 * ((Math.Log10(distParces) - 1));
                                                lastItem.PointSize = (float)(120000000 / Math.Pow(1.6, size));
                                            }
                                            else
                                            {
                                                lastItem.PointSize = (float)(40 / Math.Pow(1.6, size));
                                            }

                                        }
                                        else
                                        {
                                            lastItem.PointSize = 0;
                                        }

                                    }
                                    break;

                                case PointScaleTypes.Constant:
                                    lastItem.PointSize = 1;
                                    break;
                                default:
                                    break;
                            }
                        }
                        else
                        {
                            lastItem.PointSize = 1;
                        }
                        if (PlotType == PlotTypes.Point)
                        {
                            lastItem.PointSize = 1;
                        }

                        if (startDateColumn > -1)
                        {
                            var dateTime = ParseDate(row[startDateColumn]);
                            lastItem.Tu = (float)(SpaceTimeController.UtcToJulian(dateTime) - SpaceTimeController.UtcToJulian(baseDate));

                            if (endDateColumn > -1)
                            {
                                dateTime = ParseDate(row[endDateColumn]);

                                lastItem.Tv = (float)(SpaceTimeController.UtcToJulian(dateTime) - SpaceTimeController.UtcToJulian(baseDate));
                            }
                            else
                            {
                                lastItem.Tv = lastItem.Tu;
                            }
                        }

                        if ((CoordinatesType == CoordinatesTypes.Spherical && (lngColumn > -1 && latColumn > -1)) || ((CoordinatesType == CoordinatesTypes.Rectangular) && (XAxisColumn > -1 && YAxisColumn > -1)))
                        {
                            vertList.Add(lastItem);
                            if (barChartBitmask != 0)
                            {
                                MakeBarChart(row, Ycoord, Xcoord, lastItem.PointSize, factor, lastItem.Color, selected, new Dates(lastItem.Tu, lastItem.Tv));
                            }
                        }

                        if (geometryColumn > -1)
                        {

                            ParseGeometry(row[geometryColumn], lastItem.Color, lastItem.Color, altitude, new Dates(lastItem.Tu, lastItem.Tv));

                        }

                        currentIndex++;
                    }
                }
                catch
                {
                }
                lines = false;
            }

            shapeVertexCount = vertList.Count;
            if (vertList.Count != 0)
            {
                shapeFileVertex = new TimeSeriesPointSpriteSet(RenderContext11.PrepDevice, vertList.ToArray());
                table.Unlock();
                return true;
            }

            table.Unlock();
            return false;
        }
        static void MakeCube(TriangleList tl, Vector3d center, double size, System.Drawing.Color color)
        {
            System.Drawing.Color dark = System.Drawing.Color.FromArgb((int)(color.R * .6), (color.G), (int)(color.B * .6));
            System.Drawing.Color med = System.Drawing.Color.FromArgb((int)(color.R * .8), (int)(color.G * .8), (int)(color.B * .8));

            tl.AddQuad(
                new Vector3d(center.X + size, center.Y + size, center.Z + size),
                new Vector3d(center.X + size, center.Y + size, center.Z - size),
                new Vector3d(center.X - size, center.Y + size, center.Z + size),
                new Vector3d(center.X - size, center.Y + size, center.Z - size),
                color, new Dates());

            tl.AddQuad(
                new Vector3d(center.X + size, center.Y - size, center.Z + size),
                new Vector3d(center.X - size, center.Y - size, center.Z + size),
                new Vector3d(center.X + size, center.Y - size, center.Z - size),
                new Vector3d(center.X - size, center.Y - size, center.Z - size),
                color, new Dates());

            tl.AddQuad(
               new Vector3d(center.X - size, center.Y + size, center.Z + size),
               new Vector3d(center.X - size, center.Y + size, center.Z - size),
               new Vector3d(center.X - size, center.Y - size, center.Z + size),
               new Vector3d(center.X - size, center.Y - size, center.Z - size),
               dark, new Dates());

            tl.AddQuad(
                new Vector3d(center.X + size, center.Y + size, center.Z + size),
                new Vector3d(center.X + size, center.Y - size, center.Z + size),
                new Vector3d(center.X + size, center.Y + size, center.Z - size),
                new Vector3d(center.X + size, center.Y - size, center.Z - size),
                dark, new Dates());

            tl.AddQuad(
              new Vector3d(center.X + size, center.Y + size, center.Z + size),
              new Vector3d(center.X - size, center.Y + size, center.Z + size),
              new Vector3d(center.X + size, center.Y - size, center.Z + size),
              new Vector3d(center.X - size, center.Y - size, center.Z + size),
              med, new Dates());

            tl.AddQuad(
              new Vector3d(center.X + size, center.Y + size, center.Z - size),
              new Vector3d(center.X + size, center.Y - size, center.Z - size),
              new Vector3d(center.X - size, center.Y + size, center.Z - size),
              new Vector3d(center.X - size, center.Y - size, center.Z - size),
              med, new Dates());
        }
        //public static SimpleLineList11 sketch = null;
        static void InitTranslateUI()
        {
            TranslateUILines = new LineList();
            TranslateUILines.TimeSeries = false;
            TranslateUILines.DepthBuffered = false;
            TranslateUILines.ShowFarSide = true;

            TranslateUI = new TriangleList();
            TranslateUI.DepthBuffered = false;
            TranslateUI.TimeSeries = false;
            TranslateUI.WriteZbuffer = false;

            double twoPi = Math.PI * 2;
            double step = twoPi / 45;
            double rad = .05;

            // X

            for (double a = 0; a < twoPi; a += step)
            {
                Vector3d pnt1 = new Vector3d(1 - rad * 4, 0, 0);
                Vector3d pnt2 = new Vector3d(1 - rad * 4, Math.Cos(a) * rad, Math.Sin(a) * rad);
                Vector3d pnt3 = new Vector3d(1 - rad * 4, Math.Cos(a + step) * rad, Math.Sin(a + step) * rad);
                TranslateUI.AddTriangle(pnt1, pnt2, pnt3, System.Drawing.Color.Red, new Dates());
            }
            for (double a = 0; a < twoPi; a += step)
            {
                Vector3d pnt1 = new Vector3d(1, 0, 0);
                Vector3d pnt3 = new Vector3d(1 - rad * 4, Math.Cos(a) * rad, Math.Sin(a) * rad);
                Vector3d pnt2 = new Vector3d(1 - rad * 4, Math.Cos(a + step) * rad, Math.Sin(a + step) * rad);
                TranslateUI.AddTriangle(pnt1, pnt2, pnt3, System.Drawing.Color.FromArgb(255, Math.Max(0, (int)(Math.Sin(a) * 128)), Math.Max(0, (int)(Math.Sin(a) * 128))), new Dates());
            }

            TranslateUILines.AddLine(new Vector3d(0, 0, 0), new Vector3d(1, 0, 0), System.Drawing.Color.Red);

            // Y
            for (double a = 0; a < twoPi; a += step)
            {
                Vector3d pnt1 = new Vector3d(0, 1 - rad * 4, 0);
                Vector3d pnt3 = new Vector3d(Math.Cos(a) * rad, 1 - rad * 4, Math.Sin(a) * rad);
                Vector3d pnt2 = new Vector3d(Math.Cos(a + step) * rad, 1 - rad * 4, Math.Sin(a + step) * rad);
                TranslateUI.AddTriangle(pnt1, pnt2, pnt3, System.Drawing.Color.Green, new Dates());
            }

            for (double a = 0; a < twoPi; a += step)
            {
                Vector3d pnt1 = new Vector3d(0, 1, 0);
                Vector3d pnt2 = new Vector3d(Math.Cos(a) * rad, 1 - rad * 4, Math.Sin(a) * rad);
                Vector3d pnt3 = new Vector3d(Math.Cos(a + step) * rad, 1 - rad * 4, Math.Sin(a + step) * rad);
                TranslateUI.AddTriangle(pnt1, pnt2, pnt3, System.Drawing.Color.FromArgb(Math.Max(0, (int)(Math.Sin(a) * 128)), 255, Math.Max(0, (int)(Math.Sin(a) * 128))), new Dates());
            }

            TranslateUILines.AddLine(new Vector3d(0, 0, 0), new Vector3d(0, 1, 0), System.Drawing.Color.Green);

            // Z
            for (double a = 0; a < twoPi; a += step)
            {
                Vector3d pnt1 = new Vector3d(0, 0, 1 - rad * 4);
                Vector3d pnt2 = new Vector3d(Math.Cos(a) * rad, Math.Sin(a) * rad, 1 - rad * 4);
                Vector3d pnt3 = new Vector3d(Math.Cos(a + step) * rad, Math.Sin(a + step) * rad, 1 - rad * 4);
                TranslateUI.AddTriangle(pnt1, pnt2, pnt3, System.Drawing.Color.Blue, new Dates());
            }

            for (double a = 0; a < twoPi; a += step)
            {
                Vector3d pnt1 = new Vector3d(0, 0, 1);
                Vector3d pnt3 = new Vector3d(Math.Cos(a) * rad, Math.Sin(a) * rad, 1 - rad * 4);
                Vector3d pnt2 = new Vector3d(Math.Cos(a + step) * rad, Math.Sin(a + step) * rad, 1 - rad * 4);
                TranslateUI.AddTriangle(pnt1, pnt2, pnt3, System.Drawing.Color.FromArgb(Math.Max(0, (int)(Math.Sin(a) * 128)), Math.Max(0, (int)(Math.Sin(a) * 128)), 255), new Dates());
            }

            TranslateUILines.AddLine(new Vector3d(0, 0, 0), new Vector3d(0, 0, 1), System.Drawing.Color.Blue);
            InitRotateUI();
            InitScaleUI();
        }
        static void InitScaleUI()
        {
            ScaleUI = new TriangleList();
            ScaleUI.DepthBuffered = false;
            ScaleUI.TimeSeries = false;
            ScaleUI.WriteZbuffer = false;

            double twoPi = Math.PI * 2;
            double step = twoPi / 45;
            double rad = .05;

            // X

            MakeCube(ScaleUI, new Vector3d(1 - rad * 2, 0, 0), rad * 2, System.Drawing.Color.Red);
            MakeCube(ScaleUI, new Vector3d(0, 1 - rad * 2, 0), rad * 2, System.Drawing.Color.Green);
            MakeCube(ScaleUI, new Vector3d(0, 0, 1 - rad * 2), rad * 2, System.Drawing.Color.Blue);
        }
        static void InitRotateUI()
        {
            RotateUi = new TriangleList();
            RotateUi.DepthBuffered = false;
            RotateUi.TimeSeries = false;
            RotateUi.WriteZbuffer = false;

            double twoPi = Math.PI * 2;
            double step = twoPi / 40;
            double rad = .05;
            int index = 0;

            for (double a = 0; a < twoPi; a += step)
            {
                bool start = (index % 10) == 0;
                bool end = ((index + 1) % 10) == 0;
                Vector3d pnt1 = new Vector3d(rad * (start ? 0 : (end ? 1.5 : 1)), Math.Cos(a), Math.Sin(a));
                Vector3d pnt2 = new Vector3d(-rad * (start ? 0 : (end ? 1.5 : 1)), Math.Cos(a), Math.Sin(a));
                Vector3d pnt3 = new Vector3d(rad * (start ? 1.5 : (end ? 0 : 1)), Math.Cos(a + step), Math.Sin(a + step));
                Vector3d pnt4 = new Vector3d(-rad * (start ? 1.5 : (end ? 0 : 1)), Math.Cos(a + step), Math.Sin(a + step));
                RotateUi.AddQuad(pnt1, pnt3, pnt2, pnt4, System.Drawing.Color.FromArgb(192, System.Drawing.Color.DarkRed), new Dates());
                //TranslateUI.AddQuad(pnt1, pnt2, pnt3, pnt4, System.Drawing.Color.FromArgb(192, Math.Max(0, (int)(Math.Sin(a) * 128)), Math.Max(0, (int)(Math.Sin(a) * 128))), new Dates());
                index++;
            }

            index = 0;
            for (double a = 0; a < twoPi; a += step)
            {
                bool start = (index % 10) == 0;
                bool end = ((index + 1) % 10) == 0;
                Vector3d pnt1 = new Vector3d(Math.Cos(a), Math.Sin(a), rad * (start ? 0 : (end ? 1.5 : 1)));
                Vector3d pnt2 = new Vector3d(Math.Cos(a), Math.Sin(a), -rad * (start ? 0 : (end ? 1.5 : 1)));
                Vector3d pnt3 = new Vector3d(Math.Cos(a + step), Math.Sin(a + step), rad * (start ? 1.5 : (end ? 0 : 1)));
                Vector3d pnt4 = new Vector3d(Math.Cos(a + step), Math.Sin(a + step), -rad * (start ? 1.5 : (end ? 0 : 1)));
                RotateUi.AddQuad(pnt1, pnt3, pnt2, pnt4, System.Drawing.Color.FromArgb(192, System.Drawing.Color.DarkBlue), new Dates());
                //TranslateUI.AddQuad(pnt1, pnt2, pnt3, pnt4, System.Drawing.Color.FromArgb(192, Math.Max(0, (int)(Math.Sin(a) * 128)), Math.Max(0, (int)(Math.Sin(a) * 128))), new Dates());
                index++;
            }

            index = 0;
            for (double a = 0; a < twoPi; a += step)
            {
                bool start = (index % 10) == 0;
                bool end = ((index + 1) % 10) == 0;
                Vector3d pnt1 = new Vector3d(Math.Cos(a), rad * (start ? 0 : (end ? 1.5 : 1)), Math.Sin(a));
                Vector3d pnt2 = new Vector3d(Math.Cos(a), -rad * (start ? 0 : (end ? 1.5 : 1)), Math.Sin(a));
                Vector3d pnt3 = new Vector3d(Math.Cos(a + step), rad * (start ? 1.5 : (end ? 0 : 1)), Math.Sin(a + step));
                Vector3d pnt4 = new Vector3d(Math.Cos(a + step), -rad * (start ? 1.5 : (end ? 0 : 1)), Math.Sin(a + step));
                RotateUi.AddQuad(pnt1, pnt2, pnt3, pnt4, System.Drawing.Color.FromArgb(192, System.Drawing.Color.DarkGreen), new Dates());
                //TranslateUI.AddQuad(pnt1, pnt2, pnt3, pnt4, System.Drawing.Color.FromArgb(192, Math.Max(0, (int)(Math.Sin(a) * 128)), Math.Max(0, (int)(Math.Sin(a) * 128))), new Dates());
                index++;
            }

            // X
            index = 0;
            for (double a = 0; a < twoPi; a += step)
            {
                bool start = (index % 10) == 0;
                bool end = ((index + 1) % 10) == 0;
                Vector3d pnt1 = new Vector3d(-rad * (start ? 0 : (end ? 1.5 : 1)), Math.Cos(a), Math.Sin(a));
                Vector3d pnt2 = new Vector3d(rad * (start ? 0 : (end ? 1.5 : 1)), Math.Cos(a), Math.Sin(a));
                Vector3d pnt3 = new Vector3d(-rad * (start ? 1.5 : (end ? 0 : 1)), Math.Cos(a + step), Math.Sin(a + step));
                Vector3d pnt4 = new Vector3d(rad * (start ? 1.5 : (end ? 0 : 1)), Math.Cos(a + step), Math.Sin(a + step));
                RotateUi.AddQuad(pnt1, pnt3, pnt2, pnt4, System.Drawing.Color.Red, new Dates());
                //TranslateUI.AddQuad(pnt1, pnt2, pnt3, pnt4, System.Drawing.Color.FromArgb(255, Math.Max(0, (int)(Math.Sin(a) * 128)), Math.Max(0, (int)(Math.Sin(a) * 128))), new Dates());
                index++;
            }

            //Y
            index = 0;
            for (double a = 0; a < twoPi; a += step)
            {
                bool start = (index % 10) == 0;
                bool end = ((index + 1) % 10) == 0;
                Vector3d pnt1 = new Vector3d(Math.Cos(a), Math.Sin(a), -rad * (start ? 0 : (end ? 1.5 : 1)));
                Vector3d pnt2 = new Vector3d(Math.Cos(a), Math.Sin(a), rad * (start ? 0 : (end ? 1.5 : 1)));
                Vector3d pnt3 = new Vector3d(Math.Cos(a + step), Math.Sin(a + step), -rad * (start ? 1.5 : (end ? 0 : 1)));
                Vector3d pnt4 = new Vector3d(Math.Cos(a + step), Math.Sin(a + step), rad * (start ? 1.5 : (end ? 0 : 1)));
                RotateUi.AddQuad(pnt1, pnt3, pnt2, pnt4, System.Drawing.Color.Blue, new Dates());
                //TranslateUI.AddQuad(pnt1, pnt2, pnt3, pnt4, System.Drawing.Color.FromArgb(255, Math.Max(0, (int)(Math.Sin(a) * 128)), Math.Max(0, (int)(Math.Sin(a) * 128))), new Dates());
                index++;
            }

            //Z
            index = 0;
            for (double a = 0; a < twoPi; a += step)
            {
                bool start = (index % 10) == 0;
                bool end = ((index + 1) % 10) == 0;
                Vector3d pnt1 = new Vector3d(Math.Cos(a), -rad * (start ? 0 : (end ? 1.5 : 1)), Math.Sin(a));
                Vector3d pnt2 = new Vector3d(Math.Cos(a), rad * (start ? 0 : (end ? 1.5 : 1)), Math.Sin(a));
                Vector3d pnt3 = new Vector3d(Math.Cos(a + step), -rad * (start ? 1.5 : (end ? 0 : 1)), Math.Sin(a + step));
                Vector3d pnt4 = new Vector3d(Math.Cos(a + step), rad * (start ? 1.5 : (end ? 0 : 1)), Math.Sin(a + step));
                RotateUi.AddQuad(pnt1, pnt2, pnt3, pnt4, System.Drawing.Color.Green, new Dates());
                //TranslateUI.AddQuad(pnt1, pnt2, pnt3, pnt4, System.Drawing.Color.FromArgb(255, Math.Max(0, (int)(Math.Sin(a) * 128)), Math.Max(0, (int)(Math.Sin(a) * 128))), new Dates());
                index++;
            }
        }