private List <PolygonIntersectionPoint> _GetEntryPoints()
            {
                List <PolygonIntersectionPoint> res = new List <PolygonIntersectionPoint>();

                PointD firstClipPoint = _clip._vertexManager.GetVertex(0).Location;
                int    moduloRes      = (_subject.Contains(firstClipPoint) ? 0
                                                                   : 1);

                int cnt = 0;

                foreach (var intersectionList in _clipPoints)
                {
                    foreach (var intersectionPoint in intersectionList)
                    {
                        if (cnt % 2 == moduloRes)
                        {
                            res.Add(intersectionPoint);
                        }

                        ++cnt;
                    }
                }

                return(res);
            }
Ejemplo n.º 2
0
 public PolygonPositionRelation GetRelationWith(Polygon other)
 {
     if (this.Contains(other))
     {
         return(PolygonPositionRelation.Contains);
     }
     else if (other.Contains(this))
     {
         return(PolygonPositionRelation.IsInside);
     }
     else if (this.IsDisjointWith(other))
     {
         return(PolygonPositionRelation.Disjoint);
     }
     else
     {
         return(PolygonPositionRelation.Intersects);
     }
 }
 public bool IsDisjointWith(Polygon otherPolygon)
 {
     return(!this.Contains(otherPolygon) &&
            !this.IntersectsWith(otherPolygon) &&
            !otherPolygon.Contains(this._polygon));
 }