Exemplo n.º 1
0
        /// <summary>
        /// True if it crosses the line. Provides the intersection points.
        /// </summary>
        /// <param name="Line">The other line.</param>
        /// <param name="IntersectionPts">Output. The intersection points.</param>
        public bool Crosses(C2DLineBase Line, List <C2DPoint> IntersectionPts)
        {
            var LineRect = new C2DRect();

            Line.GetBoundingRect(LineRect);

            if (!BoundingRect.Overlaps(LineRect))
            {
                return(false);
            }

            Debug.Assert(Lines.Count == LineRects.Count);

            if (Lines.Count != LineRects.Count)
            {
                return(false);
            }

            var IntersectionTemp = new C2DPointSet();

            var bResult = false;

            for (var i = 0; i < this.Lines.Count; i++)
            {
                if (LineRects[i].Overlaps(LineRect) &&
                    Lines[i].Crosses(Line, IntersectionTemp as List <C2DPoint>))
                {
                    bResult = true;
                }
            }

            IntersectionPts.InsertRange(0, IntersectionTemp);

            return(bResult);
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Transform by a user defined transformation. e.g. a projection.
        /// </summary>
        public void InverseTransform(CTransformation pProject)
        {
            for (var i = 0; i < this._Lines.Count; i++)
            {
                C2DLineBase pLine = _Lines[i];
                pLine.InverseTransform(pProject);
                pLine.GetBoundingRect(_LineRects[i]);
            }

            this.MakeBoundingRect();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Intersection with a line base.
        /// </summary>
        /// <param name="Line">The other line.</param>
        public bool Crosses(C2DLineBase Line)
        {
            var LineRect = new C2DRect();

            Line.GetBoundingRect(LineRect);

            var Temp = new List <C2DPoint>();

            for (var i = 0; i < this.Lines.Count; i++)
            {
                if (LineRects[i].Overlaps(LineRect) && Lines[i].Crosses(Line, Temp))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 4
0
        /// <summary>
        /// True if it crosses the line. Provides the intersection points.
        /// </summary>
        /// <param name="Line">The other line.</param>
        /// <param name="IntersectionPts">Output. The intersection points.</param>
        public bool Crosses(C2DLineBase Line, List<C2DPoint> IntersectionPts)
        {
	        C2DRect LineRect = new C2DRect();
	        Line.GetBoundingRect( LineRect);

	        if (!BoundingRect.Overlaps(LineRect))
		        return false;

	        Debug.Assert(Lines.Count == LineRects.Count);

	        if(Lines.Count != LineRects.Count)
		        return false;

	        C2DPointSet IntersectionTemp = new C2DPointSet();

	        bool bResult = false;

            for (int i = 0; i < this.Lines.Count; i++)
	        {
		        if (LineRects[i].Overlaps(LineRect) &&
			        Lines[i].Crosses(Line, IntersectionTemp as List<C2DPoint>))
		        {
			        bResult = true;
		        }
	        }

	        IntersectionPts.InsertRange(0, IntersectionTemp);

	        return bResult;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Intersection with a line base.
        /// </summary>
        /// <param name="Line">The other line.</param>
        public bool Crosses(C2DLineBase Line)
        {
	        C2DRect LineRect = new C2DRect ();
	        Line.GetBoundingRect(LineRect);

            List<C2DPoint> Temp = new List<C2DPoint>();

	        for (int i = 0; i < this.Lines.Count; i++)
	        {
		        if (LineRects[i].Overlaps( LineRect ) &&  Lines[i].Crosses(Line, Temp))
			        return true;
	        }
	        return false;

        }