Пример #1
0
        //****************************************************************
        // Picking - Methods for picking the camera and it's view.
        //****************************************************************

        /// <summary>
        /// Generate and return a PPickPath for the point x,y specified in the local
        /// coordinate system of this camera.
        /// </summary>
        /// <param name="x">The x coordinate of the pick point.</param>
        /// <param name="y">The y coordinate of the pick point.</param>
        /// <param name="halo">
        /// The value to use for the width and height of the rectangle used for picking.
        /// </param>
        /// <returns>A PPickPath for the given point.</returns>
        /// <remarks>
        /// Picking is done with a rectangle, halo specifies how large that rectangle
        /// will be.
        /// </remarks>
        public virtual PPickPath Pick(float x, float y, float halo)
        {
            RectangleF b      = PUtil.InflatedRectangle(new PointF(x, y), halo, halo);
            PPickPath  result = new PPickPath(this, b);

            FullPick(result);

            // make sure this camera is pushed.
            if (result.NodeStackReference.Count == 0)
            {
                result.PushNode(this);
                result.PushMatrix(MatrixReference);
            }

            return(result);
        }