Beispiel #1
0
        private float GetValue(PointF pointProject)
        {
            PointF origin = this.selectedAxe.Line.P1;
            PointF xtm = this.selectedAxe.Line.P2;
            float  a = UtilsModel.LineLength(origin, xtm), b = this.selectedAxe.UpperX, c = UtilsModel.LineLength(origin, pointProject);

            return(UtilsModel.RuleOfThree(a, b, c));
        }
Beispiel #2
0
        private void PaintCurr(PaintEventArgs e)
        {
            List <PointF> peaks = new List <PointF>();

            Pen pen = new Pen(ColorTranslator.FromHtml("#cf7b1f"));

            foreach (Axe axe in axes)
            {
                float  length = UtilsModel.RuleOfThree(axe.UpperX, UtilsModel.LineLength(axe.Line.P1, axe.Line.P2), axe.CurrValue);
                PointF tmp    = UtilsModel.CalculateCurrPoint(length, axe.Angle, rectLimit.Width, rectLimit.Location.X);
                peaks.Add(tmp);
            }
            e.Graphics.DrawPolygon(pen, peaks.ToArray());
        }
Beispiel #3
0
        private void PaintCmp(PaintEventArgs e)
        {
            List <PointF> peaks = new List <PointF>();

            Brush pen = new SolidBrush(ColorTranslator.FromHtml("#d2d6d0"));

            foreach (Axe axe in axesCmp)
            {
                Axe    vrai       = this.FindAxe(axe);
                float  lineLength = UtilsModel.LineLength(vrai.Line.P1, vrai.Line.P2);
                float  length     = UtilsModel.RuleOfThree(axe.UpperX, lineLength, axe.CurrValue);
                PointF tmp        = UtilsModel.CalculateCurrPoint(length, vrai.Angle, rectLimit.Width, rectLimit.Location.X);
                peaks.Add(tmp);
            }
            e.Graphics.FillPolygon(pen, peaks.ToArray());
        }
Beispiel #4
0
        private void DragAndDrop_MouseDown(object sender, MouseEventArgs e)
        {
            PointF mousePos = UtilsModel.InvertFromGraph(new PointF(e.X, e.Y), 0, rectLimit.Location.X);

            foreach (Axe axe in axes)
            {
                float  length   = UtilsModel.RuleOfThree(axe.UpperX, UtilsModel.LineLength(axe.Line.P1, axe.Line.P2), axe.CurrValue);
                PointF tmp      = UtilsModel.CalculateCurrPoint(length, axe.Angle, rectLimit.Width, rectLimit.Location.X);
                float  distance = UtilsModel.LineLength(mousePos, tmp);
                if (distance <= 10)
                {
                    this.selectedAxe    = axe;
                    this.textAxe.Text   = this.selectedAxe.Name;
                    this.valeurAxe.Text = this.selectedAxe.CurrValue + "";
                    this.uniteAxe.Text  = this.selectedAxe.Unit;
                    showSimilaire       = false;
                    axesSimilsaires     = null;
                    break;
                }
            }
        }