Esempio n. 1
0
        /// <inheritdoc />
        public void MouseDown(PickData pickData, IChartEventArg chartEventArg)
        {
            prevRelativeLocation = chartEventArg.InteractorEventArg.RelativeLocation;
            Vector3F clickDataPosition = pickData.RenderData.GetTransformRef().GetTranslation();

            prevCrossPoint = chartEventArg.CrossWithLookAtPlane(prevRelativeLocation);
        }
            public void MouseUp(PickData pickData, IChartEventArg arg)
            {
                // We're getting contour index as subindex of picked data.
                int     contourIndex = pickData.GetRoundedIndex();
                Contour contour      = contourGetter(contourIndex);

                infoLabel.IsVisible = true;
                infoLabel.Text      = $"Contour: {pickData.GetRoundedIndex()}; Level: {contour.Level:G4}";
            }
Esempio n. 3
0
                public void MouseMove(PickData pickData, IChartEventArgCapturable chartEventArg)
                {
                    chartEventArg.Capture();
                    Vector3F currentLocation = GetPosition(pickData.RenderData);
                    Vector3F crossPoint      = chartEventArg.CrossWithLookAtPlane(chartEventArg.InteractorEventArg.RelativeLocation);
                    Vector3F diff            = crossPoint - prevCrossPoint;

                    SetPosition(pickData.RenderData, currentLocation + diff);
                    prevCrossPoint = crossPoint;
                }
Esempio n. 4
0
        public void MouseMove(PickData pickData, IChartEventArgCapturable chartEventArg)
        {
            chartEventArg.Capture();
            Vector3F currentLocation = pickData.RenderData.Transform.GetTranslation();
            Vector3F crossPoint      = chartEventArg.CrossWithLookAtPlane(chartEventArg.InteractorEventArg.RelativeLocation);

            Vector3F diff = crossPoint - prevCrossPoint;

            pickData.RenderData.Transform = pickData.RenderData.Transform.WithNewTranslation(currentLocation + diff);
            prevCrossPoint = crossPoint;
        }
Esempio n. 5
0
        // Maybe even better if we could do this based on distance only, and not pointing.
        static List <Vector3> GetSnapTransforms(Matrix4 pointerTransform)
        {
            var gc = (GraphicControl)UIEnvironment.Windows.FirstOrDefault(w => w.Control is GraphicControl)?.Control;

            if (gc == null || gc.IsDisposed)
            {
                return new List <Vector3> {
                           Vector3.ZeroVector
                }
            }
            ;

            var result = new List <Vector3>();

            var pickManager = new PickManager();

            PickRay ray = new PickRay
            {
                Ray = new Ray
                {
                    origin    = pointerTransform.Translation,
                    direction = pointerTransform.UpperLeft.z
                }
            };

            PickData res = new PickData();
            // Ordered by priority
            var snapModes = new[] { SnapMode.Snap, SnapMode.Edge };

            foreach (var snapMode in snapModes)
            {
                pickManager.SnapMode = snapMode;

                pickManager.PickOneObject(gc, ray, true, out res);
                result.Add(res.snapPos);
            }
            // Add the raw hitpoint as well as the least prioritized point
            result.Add(res.rawPos);

            return(result);
        }
    }
        public string Post([FromBody] PickData NavData)         //for navision to insert new pick in database
        {
            Main      objmain   = new Main();
            string    navresult = "Unsucces Pick No." + NavData.line[0].pickno;
            DataTable dt        = new DataTable();

            dt = ToDataTable(NavData.line);
            if (dt.Rows.Count > 0)
            {
                using (SqlConnection con = objmain.GetConnection())
                {
                    using (SqlBulkCopy sqlBulkCopy = new SqlBulkCopy(objmain.GetDataString(), SqlBulkCopyOptions.FireTriggers))
                    {
                        sqlBulkCopy.DestinationTableName = "Pick_Line";
                        sqlBulkCopy.WriteToServer(dt);
                        con.Close();
                    }
                }
                navresult = "Succes Pick No." + NavData.line[0].pickno;
            }
            return(navresult);
        }
Esempio n. 7
0
 public void MouseDown(PickData pickData, IChartEventArg chartEventArg)
 {
     prevRelativeLocation = chartEventArg.InteractorEventArg.RelativeLocation;
     prevCrossPoint       = chartEventArg.CrossWithLookAtPlane(prevRelativeLocation);
 }
Esempio n. 8
0
 public void MouseUp(PickData pickData, IChartEventArg arg)
 {
 }
Esempio n. 9
0
 public void DoubleClick(PickData pickData, IChartEventArg args)
 {
 }
 public void MouseMove(PickData pickData, IChartEventArgCapturable arg)
 {
 }