Example #1
0
        public void DragMove(int X, int Y)
        {
            CFigure cFigure = CFigureList.Where(o => o.Perenos).FirstOrDefault();

            if (cFigure != null && CLineList != null)
            {
                cFigure.Position = new Point(X - cFigure.Delta.X, Y - cFigure.Delta.Y);
                PologenieLine.PerenosLine(cFigure);
            }
        }
Example #2
0
        public void DragMoveLine(int Xl, int Yl)
        {
            Line line = CLineList.Where(o => o.Otrisovka).FirstOrDefault();

            if (line != null)
            {
                CFigure cFigure = CFigureList.Where(o => o.Id == line.IdFigureNachalo).FirstOrDefault();
                line.PositionLineKonec = new Point(Xl, Yl);

                numMin = PologenieLine.OptimalPut(cFigure, line.PositionLineKonec);
                line.PositionLineNachalo = new Point(cFigure.SerediniStoron[numMin].X, cFigure.SerediniStoron[numMin].Y);
            }
        }
Example #3
0
        private static void firstFigure()
        {
            CFigure cFigure = CCanvas.CFigureList.Where(o => o is Circle).FirstOrDefault();

            if (cFigure != null)
            {
                cFigure.Position = new Point(329, 10);
                cFigure.SerediniStoronMethPoints();

                cfigureList.Add(cFigure);
                PologenieLine.PerenosLine(cFigure);
            }
        }
Example #4
0
        private static void figurePosleNeRhombus(CFigure cfigure, Line line)
        {
            newCFigure          = CCanvas.CFigureList.Where(o => o.Id == line.IdFigureKonec).FirstOrDefault();
            newCFigure.Position = new Point(cfigure.SerediniStoron[2].X - newCFigure.Width / 2,
                                            cfigure.Position.Y + cfigure.Height + 20);
            newCFigure.Perenos = true;
            newCFigure.SerediniStoronMethPoints();

            maxMinX();

            PologenieLine.PerenosLine(newCFigure);
            cnewfigureList.Add(newCFigure);
        }
Example #5
0
 private static void figurePosleRhombus(LineNY lineNY, CFigure cfigure)
 {
     newCFigure = CCanvas.CFigureList.Where(o => o.Id == lineNY.IdFigureKonec).FirstOrDefault();
     //линия из 3 точек
     if (newCFigure.Perenos == false)
     {
         figurePosleRhombusBezPerenosa(lineNY, cfigure);
         cnewfigureList.Add(newCFigure);
     }
     //линия из 4 точек
     else
     {
         PologenieLine.PositionLineFourDot(cfigure, lineNY, newCFigure);
     }
 }
Example #6
0
        private void btnClick_AddText(object sender, EventArgs e)
        {
            CFigure cFigure = CCanvas.CFigureList.Where(o => o.ColorFigure == Color.Blue).FirstOrDefault();

            if (cFigure != null)
            {
                cFigure.ColorFigure = Color.Black;
                cFigure.TextFigure  = textBox1.Text;
                textBox1.Text       = "";
                ReDrow();

                PologenieLine.PerenosLine(cFigure);
                ReDrow();

                skritT();
            }
        }
Example #7
0
        public void DragMouseUpLine(int Xl, int Yl)
        {
            CFigure cFigure = CFigureList.Where(o => o.Vhod(Xl, Yl)).FirstOrDefault();

            Line line = CLineList.Where(o => o.Otrisovka).FirstOrDefault();

            if (cFigure != null && line != null && line.PositionLineNachalo != line.PositionLineKonec)
            {
                numMin = PologenieLine.OptimalPut(cFigure, line.PositionLineNachalo);
                line.PositionLineKonec = new Point(cFigure.SerediniStoron[numMin].X, cFigure.SerediniStoron[numMin].Y);
                line.IdFigureKonec     = cFigure.Id;

                line.Otrisovka = false;
            }
            else
            {
                CLineList.Remove(line);
            }
        }