private void IDepth_MouseMove(object sender, MouseEventArgs e)
        {
            if (!MouseManipulation)
            {
                return;
            }
            if (Mouse.LeftButton == MouseButtonState.Released)
            {
                MouseManipulation = false;
                Mouse.Capture(null);
                Settings.TurntableEllipse.Value    = SelectedEllipse;
                Settings.TurntableRectangleA.Value = SelectedRectangleA;
                Settings.TurntableRectangleB.Value = SelectedRectangleB;
                return;
            }
            EndPoint = Mouse.GetPosition(VI);
            Point start = VI.PointToCanvas(StartPoint);
            Point end   = VI.PointToCanvas(EndPoint);

            if (Mouse.LeftButton == MouseButtonState.Pressed)
            {
                switch (Step)
                {
                case 1:
                {
                    EllipseGeometry eg = SelectionGeometry as EllipseGeometry;
                    eg.Center       = new Point((start.X + end.X) / 2d, (start.Y + end.Y) / 2d);
                    eg.RadiusX      = Math.Abs(start.X - end.X) / 2d;
                    eg.RadiusY      = Math.Abs(start.Y - end.Y) / 2d;
                    SelectedEllipse = new Rect(start, end);
                }
                break;

                case 3:
                {
                    RectangleGeometry rg = SelectionGeometry as RectangleGeometry;
                    SelectedRectangleA = rg.Rect = new Rect(start, end);
                }
                break;

                case 4:
                {
                    RectangleGeometry rg = SelectionGeometry as RectangleGeometry;
                    SelectedRectangleB = rg.Rect = new Rect(start, end);
                }
                break;
                }
            }
        }
    private void Start()
    {
        identity = GetComponent <SNet_Identity>();
        info     = new VI(identity.identity);
        vehicle  = new V(identity.identity);
        health   = new VH(identity.identity, maxHealth);

        vehicle.p = new List <ulong>();
        for (int i = 0; i < seatPoints.Count; i++)
        {
            vehicle.p.Add(0);
        }

        MonoBehaviourExtensions.Invoke(this, VehicleUpdate, 3f);
    }
Ejemplo n.º 3
0
 static void Main(string[] args)
 {
     Calc.SOLVE(VI.ENTER());
     Console.ReadKey();
 }
Ejemplo n.º 4
0
 public override string ToString()
 {
     return(Frame.Index + ": I->(" + NI.ToString("0.0") + ", " + VI.ToString("0.0") + ", " + MI.ToString("0.0") + "), J->(" +
            NJ.ToString("0.0") + ", " + VJ.ToString("0.0") + ", " + MJ.ToString("0.0") + ")");
 }
        void SetStep(int step)
        {
            Step                = step;
            BNext.IsEnabled     = Step < StepDescriptions.Length - 1;
            BPrevious.IsEnabled = Step > 0;
            TBDescription.Text  = StepDescriptions[step];
            PBProgress.Value    = Step * 100d / (StepDescriptions.Length - 1);
            VI.Clear();
            Float4[,] vertices;
            switch (Step)
            {
            case 1:
                if (Canvas.GetVertices(out vertices))
                {
                    TableDepthData = vertices;
                    IDepth.Source  = Vector4ArrayToBitmapSource(TableDepthData, 2f);
                }
                VI.Pen            = new Pen(Brushes.Blue, 2d);
                VI.Brush          = new SolidColorBrush(Color.FromArgb(128, 0, 0, 255));
                SelectionGeometry = new EllipseGeometry(SelectedEllipse);
                VI.AddGeometry(SelectionGeometry);
                break;

            case 2:
                if (TableDepthData != null)
                {
                    Calibrator.CalibrateTable(TableDepthData, SelectedEllipse.TopLeft, SelectedEllipse.BottomRight);
                }
                VI.Pen   = new Pen(Brushes.Green, 2d);
                VI.Brush = new SolidColorBrush(Color.FromArgb(128, 0, 255, 0));
                VI.DrawPlane(Calibrator.Ground);
                break;

            case 3:
                if (Canvas.GetVertices(out vertices))
                {
                    StandardDepthData = vertices;
                    IDepth.Source     = Vector4ArrayToBitmapSource(StandardDepthData, 2f);
                }
                VI.Pen            = new Pen(Brushes.Blue, 2d);
                VI.Brush          = new SolidColorBrush(Color.FromArgb(128, 0, 0, 255));
                SelectionGeometry = new RectangleGeometry(SelectedRectangleA);
                VI.AddGeometry(SelectionGeometry);
                BNext.Visibility   = Visibility.Visible;
                BFinish.Visibility = Visibility.Collapsed;
                break;

            case 4:
                VI.Pen            = new Pen(Brushes.Blue, 2d);
                VI.Brush          = new SolidColorBrush(Color.FromArgb(128, 0, 0, 255));
                SelectionGeometry = new RectangleGeometry(SelectedRectangleB);
                VI.AddGeometry(SelectionGeometry);
                BNext.Visibility   = Visibility.Visible;
                BFinish.Visibility = Visibility.Collapsed;
                break;

            case 5:
                if (StandardDepthData != null)
                {
                    Calibrator.CalibrateStandard(StandardDepthData, SelectedRectangleA, SelectedRectangleB);
                }
                VI.Pen   = new Pen(Brushes.Green, 2d);
                VI.Brush = new SolidColorBrush(Color.FromArgb(128, 0, 255, 0));
                VI.DrawPlane(Calibrator.StandardA);
                VI.DrawPlane(Calibrator.StandardB);
                VI.DrawPlane(Calibrator.Table);
                BNext.Visibility   = Visibility.Collapsed;
                BFinish.Visibility = Visibility.Visible;
                break;
            }
        }