示例#1
0
文件: GDIView.cs 项目: PoltP/sapper
        protected override void SetVisualParameters()
        {
            base.SetVisualParameters();
            int count = base.CellCount;
            CellOperationInitialize <Point2D, Box2D> initCell = new CellOperationInitialize <Point2D, Box2D>(Settings.UseEffect3D);

            initCell.BigBox     = Settings.BoundsBox;
            initCell.ExtentsBox = new Box2D(0, 0, Settings.BoundsBox.Width / (2 * (RowCount + 1)), Settings.BoundsBox.Height / (2 * (RowCount + 1)));
            initCell.SweepAngle = 360.0f / ColumnCount;
            initCell.StartAngle = 0;
            for (int i = 0, row; i < count; i++)
            {
                row = (i / ColumnCount) + 1;
                if ((row > 1) && (i % ColumnCount) == 0)
                {
                    initCell.BigBox = initCell.SmallBox;
                }
                initCell.StartAngle = initCell.SweepAngle * (i % ColumnCount);
                initCell.SmallBox   = new Box2D(Settings.BoundsBox.Location.X + initCell.ExtentsBox.Width * row,
                                                Settings.BoundsBox.Location.Y + initCell.ExtentsBox.Height * row,
                                                Settings.BoundsBox.Width - 2 * initCell.ExtentsBox.Width * row,
                                                Settings.BoundsBox.Height - 2 * initCell.ExtentsBox.Height * row);
                Cells[i].Initialize(initCell);
            }
            if (HasCenterCell)
            {
                initCell.ExtentsBox = initCell.SmallBox;
                Cells[count].Initialize(initCell);
            }
        }
示例#2
0
文件: GDIView.cs 项目: PoltP/sapper
 internal override void InitializeVertices(CellOperationInitialize <Point2D, Box2D> cellInit)
 {
     FillVertices(vertices, BoundsBox);
     Center = Geometric.CenterPoint(vertices[0], vertices[VertexCount / 2]);
     if (cellInit.UseEffect3D)
     {
         FillVertices(verticesEffect3D, Box2D.Inflate(BoundsBox, -Geometric.CellOffset, -Geometric.CellOffset));
     }
 }
示例#3
0
 public void Initialize(CellOperationInitialize <TVertex, TBox> cellInit)
 {
     vertices = new TVertex[VertexCount];
     if (cellInit.UseEffect3D)
     {
         verticesEffect3D = new TVertex[VertexCount];
     }
     BoundsBox = cellInit.ExtentsBox;
     InitializeVertices(cellInit);
 }
示例#4
0
文件: GDIView.cs 项目: PoltP/sapper
        internal override void InitializeVertices(CellOperationInitialize <Point2D, Box2D> cellInit)
        {
            Point2D centerElliptic = Geometric.CalculateEllipticPoints(vertices, VertexCount, 0, cellInit.ExtentsBox, 0, 360, true);

            Center = Geometric.CenterPoint(vertices[0], centerElliptic);
            if (cellInit.UseEffect3D)
            {
                cellInit.ExtentsBox = Box2D.Inflate(cellInit.ExtentsBox, -Geometric.CellOffset, -Geometric.CellOffset);
                Geometric.CalculateEllipticPoints(verticesEffect3D, VertexCount, 0, cellInit.ExtentsBox, 0, 360, true);
            }
        }
示例#5
0
文件: GDIView.cs 项目: PoltP/sapper
        protected override void SetVisualParameters()
        {
            base.SetVisualParameters();
            CellOperationInitialize <Point2D, Box2D> initCell = new CellOperationInitialize <Point2D, Box2D>(Settings.UseEffect3D);
            double width  = Settings.BoundsBox.Width / ColumnCount;
            double height = Settings.BoundsBox.Height / RowCount;

            for (int i = 0; i < Cells.Count; i++)
            {
                initCell.ExtentsBox = new Box2D((Float2D)(Settings.BoundsBox.Location.X + width * (i % ColumnCount)),
                                                (Float2D)(Settings.BoundsBox.Location.Y + height * (i / ColumnCount)), (Float2D)width, (Float2D)height);
                Cells[i].Initialize(initCell);
            }
        }
示例#6
0
文件: GDIView.cs 项目: PoltP/sapper
        internal override void InitializeVertices(CellOperationInitialize <Point2D, Box2D> cellInit)
        {
            int     count   = VertexCount / 2;
            Point2D center1 = Geometric.CalculateEllipticPoints(vertices, count, 0, cellInit.BigBox, cellInit.StartAngle, cellInit.SweepAngle, true);
            Point2D center2 = Geometric.CalculateEllipticPoints(vertices, count, count, cellInit.SmallBox, cellInit.StartAngle, cellInit.SweepAngle, false);

            Center = Geometric.CenterPoint(center1, center2);
            if (cellInit.UseEffect3D)
            {
                Box2D  bigBox      = Box2D.Inflate(cellInit.BigBox, -Geometric.CellOffset, -Geometric.CellOffset);
                Box2D  smallBox    = Box2D.Inflate(cellInit.SmallBox, Geometric.CellOffset, Geometric.CellOffset);
                double bigOffset   = Geometric.Degree(Geometric.EllipticAngle(Geometric.CellOffset, bigBox.Size));
                double smallOffset = Geometric.Degree(Geometric.EllipticAngle(Geometric.CellOffset, smallBox.Size));
                Geometric.CalculateEllipticPoints(verticesEffect3D, count, 0, bigBox, cellInit.StartAngle + bigOffset, cellInit.SweepAngle - 2 * bigOffset, true);
                Geometric.CalculateEllipticPoints(verticesEffect3D, count, count, smallBox, cellInit.StartAngle + smallOffset, cellInit.SweepAngle - 2 * smallOffset, false);
            }
        }
示例#7
0
 internal abstract void InitializeVertices(CellOperationInitialize <TVertex, TBox> cellInit);