// selection
        public override void Select(ViewportRect rect, TransformMatrix matrix, Viewport3D viewport3d)
        {
            int nDotNo = GetDataNo();

            if (nDotNo == 0)
            {
                return;
            }

            double xMin = rect.XMin();
            double xMax = rect.XMax();
            double yMin = rect.YMin();
            double yMax = rect.YMax();

            for (int i = 0; i < nDotNo; i++)
            {
                ScatterPlotItem plotItem = Get(i);
                Point           pt       = matrix.VertexToViewportPt(new Point3D(plotItem.x, plotItem.y, plotItem.z),
                                                                     viewport3d);

                if ((pt.X > xMin) && (pt.X < xMax) && (pt.Y > yMin) && (pt.Y < yMax))
                {
                    m_vertices[i].selected = true;
                }
                else
                {
                    m_vertices[i].selected = false;
                }
            }
        }
Beispiel #2
0
        // selection
        public override void Select(ViewportRect rect, TransformMatrix matrix, Viewport3D viewport3D)
        {
            var nDotNo = GetDataNo();

            if (nDotNo == 0)
            {
                return;
            }

            var xMin = rect.XMin();
            var xMax = rect.XMax();
            var yMin = rect.YMin();
            var yMax = rect.YMax();

            for (var i = 0; i < nDotNo; i++)
            {
                var plotItem = Get(i);
                if (plotItem == null)
                {
                    continue;
                }
                var pt = matrix.VertexToViewportPt(new Point3D(plotItem.x, plotItem.y, plotItem.z),
                                                   viewport3D);

                if ((pt.X > xMin) && (pt.X < xMax) && (pt.Y > yMin) && (pt.Y < yMax))
                {
                    MVertices[i].selected = true;
                }
                else
                {
                    MVertices[i].selected = false;
                }
            }
        }
Beispiel #3
0
        // selection
        public override void Select(ViewportRect rect, TransformMatrix matrix, Viewport3D viewport3d)
        {
            int nDotNo = GetDataNo();
            if (nDotNo == 0) return;

            double xMin = rect.XMin();
            double xMax = rect.XMax();
            double yMin = rect.YMin();
            double yMax = rect.YMax();

            for (int i = 0; i < nDotNo; i++)
            {
                ScatterPlotItem plotItem = Get(i);
                Point pt = matrix.VertexToViewportPt(new Point3D(plotItem.x, plotItem.y, plotItem.z),
                    viewport3d);

                if ((pt.X > xMin) && (pt.X < xMax) && (pt.Y > yMin) && (pt.Y < yMax))
                {
                    m_vertices[i].selected = true;
                }
                else
                {
                    m_vertices[i].selected = false;
                }
            }
        }