Exemplo n.º 1
0
        /// <summary>
        /// Cuts an arc at a specified point
        /// </summary>
        /// <param name="pointAtWhichToCut">The point at which to cut the arc - this must lie on the arc</param>
        /// <returns>The cut piece of the original arc</returns>
        public PSEntity Cut(Point pointAtWhichToCut)
        {
            // Check that point lies on arc
            // TODO: Write this functionality

            // Carry out operation
            PSArc newArc = (PSArc)PSEntityCutter.CutEntity(this, pointAtWhichToCut);

            // Return arc
            return(newArc);
        }
        /// <summary>
        /// Cuts a single line to produce two lines.
        /// </summary>
        /// <param name="pointAtWhichToCut">Point at which to cut the line. This point must lie on the line.</param>
        /// <exception cref="ApplicationException">Point does not lie on the line.</exception>
        /// <returns>A new line</returns>
        public PSEntity Cut(Point pointAtWhichToCut)
        {
            // Check that the point lies on the line
            if (pointAtWhichToCut.LiesOnLine(StartPoint, EndPoint) == false)
            {
                throw new ApplicationException("Point does not lie on the line");
            }

            // Cut line at defined point
            return(PSEntityCutter.CutEntity(this, pointAtWhichToCut));
        }