Example #1
0
        public Vector3d InputPoint()
        {
            Env.OpenPopupMessage("Input point", PlotterCallback.MessageType.INPUT);

            InteractCtrl ctrl = Controller.InteractCtrl;

            ctrl.Start();

            ItConsole.print(AnsiEsc.Yellow + "Input point >> " + AnsiEsc.Reset);

            InteractCtrl.States ret = ctrl.WaitPoint();
            ctrl.End();

            if (ret != InteractCtrl.States.CONTINUE)
            {
                Env.ClosePopupMessage();
                ItConsole.println("Cancel!");
                return(VectorExt.InvalidVector3d);
            }

            Vector3d p = ctrl.PointList[0];

            ItConsole.println(p.CoordString());

            Env.ClosePopupMessage();

            return(p);
        }
Example #2
0
        public Vector3d InputUnitVector()
        {
            InteractCtrl ctrl = Controller.InteractCtrl;

            ctrl.Start();

            ItConsole.println(AnsiEsc.Yellow + "Input point 1 >>");

            InteractCtrl.States ret;

            ret = ctrl.WaitPoint();

            if (ret != InteractCtrl.States.CONTINUE)
            {
                ctrl.End();
                ItConsole.println("Cancel!");
                return(VectorExt.InvalidVector3d);
            }

            Vector3d p0 = ctrl.PointList[0];

            ItConsole.println(p0.CoordString());

            ItConsole.println(AnsiEsc.Yellow + "Input point 2 >>");

            ret = ctrl.WaitPoint();

            if (ret != InteractCtrl.States.CONTINUE)
            {
                ctrl.End();
                ItConsole.println("Cancel!");
                return(VectorExt.InvalidVector3d);
            }

            Vector3d p1 = Controller.InteractCtrl.PointList[1];

            ctrl.End();


            Vector3d v = p1 - p0;

            v = v.UnitVector();

            ItConsole.println(v.CoordString());

            return(v);
        }
Example #3
0
        public (Vector3d, Vector3d) InputLine()
        {
            InteractCtrl ctrl = Controller.InteractCtrl;

            ctrl.Start();

            ItConsole.print(AnsiEsc.Yellow + "Input point 1 >>" + AnsiEsc.Reset + " ");

            InteractCtrl.States ret;

            ret = ctrl.WaitPoint();

            if (ret != InteractCtrl.States.CONTINUE)
            {
                ctrl.End();
                ItConsole.println("Cancel!");
                return(VectorExt.InvalidVector3d, VectorExt.InvalidVector3d);
            }

            Vector3d p0 = ctrl.PointList[0];

            ItConsole.println(p0.CoordString());

            ItConsole.print(AnsiEsc.Yellow + "Input point 2 >>" + AnsiEsc.Reset + " ");

            ret = ctrl.WaitPoint();

            if (ret != InteractCtrl.States.CONTINUE)
            {
                ctrl.End();
                ItConsole.println("Cancel!");
                return(VectorExt.InvalidVector3d, VectorExt.InvalidVector3d);
            }

            Vector3d p1 = Controller.InteractCtrl.PointList[1];

            ItConsole.println(p0.CoordString());

            ctrl.End();

            return(p0, p1);
        }