コード例 #1
0
        public void Draw3DTickLine(ChartGraphics graph, PointF point1, PointF point2, bool horizontal, float scrollBarSize, bool backElements, bool selectionMode)
        {
            ChartArea chartArea      = base.axis.chartArea;
            bool      flag           = default(bool);
            float     marksZPosition = base.axis.GetMarksZPosition(out flag);
            bool      flag2          = flag;

            if ((!flag2 || base.axis.MajorTickMark.Style != TickMarkStyle.Cross) && base.axis.MajorTickMark.Style != TickMarkStyle.Inside && base.axis.MinorTickMark.Style != TickMarkStyle.Cross && base.axis.MinorTickMark.Style != TickMarkStyle.Inside)
            {
                goto IL_006d;
            }
            flag2 = false;
            goto IL_006d;
IL_006d:
            SurfaceNames surfaceName = (SurfaceNames)((marksZPosition != 0.0) ? 1 : 2);

            if (chartArea.ShouldDrawOnSurface(surfaceName, backElements, flag2))
            {
                if (base.axis.AxisPosition == AxisPosition.Bottom && (!base.axis.IsMarksNextToAxis() || flag) && chartArea.IsBottomSceneWallVisible())
                {
                    point2.Y += chartArea.areaSceneWallWidth.Height;
                }
                else if (base.axis.AxisPosition == AxisPosition.Left && (!base.axis.IsMarksNextToAxis() || flag) && chartArea.IsSideSceneWallOnLeft())
                {
                    point1.X -= chartArea.areaSceneWallWidth.Width;
                }
                else if (base.axis.AxisPosition == AxisPosition.Right && (!base.axis.IsMarksNextToAxis() || flag) && !chartArea.IsSideSceneWallOnLeft())
                {
                    point2.X += chartArea.areaSceneWallWidth.Width;
                }
                else if (base.axis.AxisPosition == AxisPosition.Top && (!base.axis.IsMarksNextToAxis() || flag))
                {
                    point1.Y -= chartArea.areaSceneWallWidth.Height;
                }
                Point3D point3D  = null;
                Point3D point3D2 = null;
                if (flag && chartArea.areaSceneWallWidth.Width != 0.0)
                {
                    if (base.axis.AxisPosition == AxisPosition.Top)
                    {
                        float y = base.axis.PlotAreaPosition.Y;
                        if (this.style == TickMarkStyle.Inside)
                        {
                            point1.Y = y;
                            point2.Y = y + this.size;
                            point3D  = new Point3D(point1.X, point1.Y, (float)(0.0 - chartArea.areaSceneWallWidth.Width));
                            point3D2 = new Point3D(point1.X, point1.Y, 0f);
                        }
                        else if (this.style == TickMarkStyle.Outside)
                        {
                            point1.Y = y;
                            point2.Y = y;
                            point3D  = new Point3D(point1.X, y, marksZPosition);
                            point3D2 = new Point3D(point1.X, point1.Y, (float)(0.0 - this.size - chartArea.areaSceneWallWidth.Width));
                        }
                        else if (this.style == TickMarkStyle.Cross)
                        {
                            point1.Y = y;
                            point2.Y = (float)(y + this.size / 2.0);
                            point3D  = new Point3D(point1.X, y, marksZPosition);
                            point3D2 = new Point3D(point1.X, point1.Y, (float)((0.0 - this.size) / 2.0 - chartArea.areaSceneWallWidth.Width));
                        }
                        if (chartArea.ShouldDrawOnSurface(SurfaceNames.Top, backElements, false))
                        {
                            point3D  = null;
                            point3D2 = null;
                        }
                    }
                    if (base.axis.AxisPosition == AxisPosition.Left && !chartArea.IsSideSceneWallOnLeft())
                    {
                        float x = base.axis.PlotAreaPosition.X;
                        if (this.style == TickMarkStyle.Inside)
                        {
                            point1.X = x;
                            point2.X = x + this.size;
                            point3D  = new Point3D(point1.X, point1.Y, (float)(0.0 - chartArea.areaSceneWallWidth.Width));
                            point3D2 = new Point3D(point1.X, point1.Y, 0f);
                        }
                        else if (this.style == TickMarkStyle.Outside)
                        {
                            point1.X = x;
                            point2.X = x;
                            point3D  = new Point3D(x, point1.Y, marksZPosition);
                            point3D2 = new Point3D(x, point1.Y, (float)(0.0 - this.size - chartArea.areaSceneWallWidth.Width));
                        }
                        else if (this.style == TickMarkStyle.Cross)
                        {
                            point1.X = x;
                            point2.X = (float)(x + this.size / 2.0);
                            point3D  = new Point3D(x, point1.Y, marksZPosition);
                            point3D2 = new Point3D(x, point1.Y, (float)((0.0 - this.size) / 2.0 - chartArea.areaSceneWallWidth.Width));
                        }
                        if (chartArea.ShouldDrawOnSurface(SurfaceNames.Left, backElements, false))
                        {
                            point3D  = null;
                            point3D2 = null;
                        }
                    }
                    else if (base.axis.AxisPosition == AxisPosition.Right && chartArea.IsSideSceneWallOnLeft())
                    {
                        float num = base.axis.PlotAreaPosition.Right();
                        if (this.style == TickMarkStyle.Inside)
                        {
                            point1.X = num - this.size;
                            point2.X = num;
                            point3D  = new Point3D(point2.X, point2.Y, (float)(0.0 - chartArea.areaSceneWallWidth.Width));
                            point3D2 = new Point3D(point2.X, point2.Y, 0f);
                        }
                        else if (this.style == TickMarkStyle.Outside)
                        {
                            point1.X = num;
                            point2.X = num;
                            point3D  = new Point3D(num, point1.Y, marksZPosition);
                            point3D2 = new Point3D(num, point1.Y, (float)(0.0 - this.size - chartArea.areaSceneWallWidth.Width));
                        }
                        else if (this.style == TickMarkStyle.Cross)
                        {
                            point1.X = (float)(num - this.size / 2.0);
                            point2.X = num;
                            point3D  = new Point3D(num, point1.Y, marksZPosition);
                            point3D2 = new Point3D(num, point1.Y, (float)((0.0 - this.size) / 2.0 - chartArea.areaSceneWallWidth.Width));
                        }
                        if (chartArea.ShouldDrawOnSurface(SurfaceNames.Right, backElements, false))
                        {
                            point3D  = null;
                            point3D2 = null;
                        }
                    }
                }
                graph.Draw3DLine(chartArea.matrix3D, base.borderColor, base.borderWidth, base.borderStyle, new Point3D(point1.X, point1.Y, marksZPosition), new Point3D(point2.X, point2.Y, marksZPosition), base.axis.Common, this, ChartElementType.TickMarks);
                if (point3D != null && point3D2 != null)
                {
                    graph.Draw3DLine(chartArea.matrix3D, base.borderColor, base.borderWidth, base.borderStyle, point3D, point3D2, base.axis.Common, this, ChartElementType.TickMarks);
                }
            }
        }
コード例 #2
0
        internal void Draw3DTickLine(ChartGraphics graph, PointF point1, PointF point2, bool horizontal, float scrollBarSize, bool backElements, bool selectionMode)
        {
            ChartArea chartArea = axis.chartArea;
            bool      axisOnEdge;
            float     marksZPosition = axis.GetMarksZPosition(out axisOnEdge);
            bool      flag           = axisOnEdge;

            if ((flag && axis.MajorTickMark.Style == TickMarkStyle.Cross) || axis.MajorTickMark.Style == TickMarkStyle.Inside || axis.MinorTickMark.Style == TickMarkStyle.Cross || axis.MinorTickMark.Style == TickMarkStyle.Inside)
            {
                flag = false;
            }
            SurfaceNames surfaceName = (marksZPosition != 0f) ? SurfaceNames.Front : SurfaceNames.Back;

            if (!chartArea.ShouldDrawOnSurface(surfaceName, backElements, flag))
            {
                return;
            }
            if (axis.AxisPosition == AxisPosition.Bottom && (!axis.IsMarksNextToAxis() || axisOnEdge) && chartArea.IsBottomSceneWallVisible())
            {
                point2.Y += chartArea.areaSceneWallWidth.Height;
            }
            else if (axis.AxisPosition == AxisPosition.Left && (!axis.IsMarksNextToAxis() || axisOnEdge) && chartArea.IsSideSceneWallOnLeft())
            {
                point1.X -= chartArea.areaSceneWallWidth.Width;
            }
            else if (axis.AxisPosition == AxisPosition.Right && (!axis.IsMarksNextToAxis() || axisOnEdge) && !chartArea.IsSideSceneWallOnLeft())
            {
                point2.X += chartArea.areaSceneWallWidth.Width;
            }
            else if (axis.AxisPosition == AxisPosition.Top && (!axis.IsMarksNextToAxis() || axisOnEdge))
            {
                point1.Y -= chartArea.areaSceneWallWidth.Height;
            }
            Point3D point3D  = null;
            Point3D point3D2 = null;

            if (axisOnEdge && chartArea.areaSceneWallWidth.Width != 0f)
            {
                if (axis.AxisPosition == AxisPosition.Top)
                {
                    float y = axis.PlotAreaPosition.Y;
                    if (style == TickMarkStyle.Inside)
                    {
                        point1.Y = y;
                        point2.Y = y + size;
                        point3D  = new Point3D(point1.X, point1.Y, 0f - chartArea.areaSceneWallWidth.Width);
                        point3D2 = new Point3D(point1.X, point1.Y, 0f);
                    }
                    else if (style == TickMarkStyle.Outside)
                    {
                        point1.Y = y;
                        point2.Y = y;
                        point3D  = new Point3D(point1.X, y, marksZPosition);
                        point3D2 = new Point3D(point1.X, point1.Y, 0f - size - chartArea.areaSceneWallWidth.Width);
                    }
                    else if (style == TickMarkStyle.Cross)
                    {
                        point1.Y = y;
                        point2.Y = y + size / 2f;
                        point3D  = new Point3D(point1.X, y, marksZPosition);
                        point3D2 = new Point3D(point1.X, point1.Y, (0f - size) / 2f - chartArea.areaSceneWallWidth.Width);
                    }
                    if (chartArea.ShouldDrawOnSurface(SurfaceNames.Top, backElements, onEdge: false))
                    {
                        point3D  = null;
                        point3D2 = null;
                    }
                }
                if (axis.AxisPosition == AxisPosition.Left && !chartArea.IsSideSceneWallOnLeft())
                {
                    float x = axis.PlotAreaPosition.X;
                    if (style == TickMarkStyle.Inside)
                    {
                        point1.X = x;
                        point2.X = x + size;
                        point3D  = new Point3D(point1.X, point1.Y, 0f - chartArea.areaSceneWallWidth.Width);
                        point3D2 = new Point3D(point1.X, point1.Y, 0f);
                    }
                    else if (style == TickMarkStyle.Outside)
                    {
                        point1.X = x;
                        point2.X = x;
                        point3D  = new Point3D(x, point1.Y, marksZPosition);
                        point3D2 = new Point3D(x, point1.Y, 0f - size - chartArea.areaSceneWallWidth.Width);
                    }
                    else if (style == TickMarkStyle.Cross)
                    {
                        point1.X = x;
                        point2.X = x + size / 2f;
                        point3D  = new Point3D(x, point1.Y, marksZPosition);
                        point3D2 = new Point3D(x, point1.Y, (0f - size) / 2f - chartArea.areaSceneWallWidth.Width);
                    }
                    if (chartArea.ShouldDrawOnSurface(SurfaceNames.Left, backElements, onEdge: false))
                    {
                        point3D  = null;
                        point3D2 = null;
                    }
                }
                else if (axis.AxisPosition == AxisPosition.Right && chartArea.IsSideSceneWallOnLeft())
                {
                    float num = axis.PlotAreaPosition.Right();
                    if (style == TickMarkStyle.Inside)
                    {
                        point1.X = num - size;
                        point2.X = num;
                        point3D  = new Point3D(point2.X, point2.Y, 0f - chartArea.areaSceneWallWidth.Width);
                        point3D2 = new Point3D(point2.X, point2.Y, 0f);
                    }
                    else if (style == TickMarkStyle.Outside)
                    {
                        point1.X = num;
                        point2.X = num;
                        point3D  = new Point3D(num, point1.Y, marksZPosition);
                        point3D2 = new Point3D(num, point1.Y, 0f - size - chartArea.areaSceneWallWidth.Width);
                    }
                    else if (style == TickMarkStyle.Cross)
                    {
                        point1.X = num - size / 2f;
                        point2.X = num;
                        point3D  = new Point3D(num, point1.Y, marksZPosition);
                        point3D2 = new Point3D(num, point1.Y, (0f - size) / 2f - chartArea.areaSceneWallWidth.Width);
                    }
                    if (chartArea.ShouldDrawOnSurface(SurfaceNames.Right, backElements, onEdge: false))
                    {
                        point3D  = null;
                        point3D2 = null;
                    }
                }
            }
            graph.Draw3DLine(chartArea.matrix3D, borderColor, borderWidth, borderStyle, new Point3D(point1.X, point1.Y, marksZPosition), new Point3D(point2.X, point2.Y, marksZPosition), axis.Common, this, ChartElementType.TickMarks);
            if (point3D != null && point3D2 != null)
            {
                graph.Draw3DLine(chartArea.matrix3D, borderColor, borderWidth, borderStyle, point3D, point3D2, axis.Common, this, ChartElementType.TickMarks);
            }
        }