internal static List<Edge> SelectNonIntersectingEdges(BitmapData keepOutMask, List<Edge> edgesToTest)
 {
     if (keepOutMask == null)
     {
         return edgesToTest;
     }
     _keepOutMask = keepOutMask;
     return edgesToTest.Filter(MyTest);
 }
Example #2
0
 /**
  *
  * @param proximityMap a BitmapData whose regions are filled with the site index values; see PlaneVector2sCanvas::fillRegions()
  * @param x
  * @param y
  * @return coordinates of nearest Site to (x, y)
  *
  */
 public Vector2 NearestSiteVector2(BitmapData proximityMap, float x, float y)
 {
     uint index = proximityMap.getPixel(x, y);
     if (index > _sites.Count - 1)
     {
         return Vector2.zero;
     }
     return _sites[(int)index].Coord();
 }
Example #3
0
 /**
  *
  * @param proximityMap a BitmapData whose regions are filled with the site index values; see PlanePointFsCanvas::fillRegions()
  * @param x
  * @param y
  * @return coordinates of nearest Site to (x, y)
  *
  */
 public PointF NearestSitePointF(BitmapData proximityMap, float x, float y)
 {
     uint index = proximityMap.getPixel(x, y);
     if (index > _sites.Count - 1)
     {
         return PointF.Empty;
     }
     return _sites[(int)index].Coord();
 }
Example #4
0
        public void Dispose()
        {
            if (_delaunayLineBmp != null)
            {
                _delaunayLineBmp.dispose();
                _delaunayLineBmp = null;
            }
            _leftVertex = null;
            _rightVertex = null;
            if (_clippedVertices != null)
            {
                _clippedVertices[LR.LEFT] = Vector2.zero;
                _clippedVertices[LR.RIGHT] = Vector2.zero;
                _clippedVertices = null;
            }
            _sites[LR.LEFT] = null;
            _sites[LR.RIGHT] = null;
            _sites = null;

            _pool.Add(this);
        }
Example #5
0
 public List<uint> SiteColors(BitmapData referenceImage)
 {
     List<uint> colors = new List<uint>();
     foreach (Site site in _sites)
     {
         colors.Add(referenceImage != null ? referenceImage.getPixel(site.X, site.Y) : site.color);
     }
     return colors;
 }
Example #6
0
 public bool hitTest(PointF a, int b, BitmapData c, PointF d, int e)
 {
     throw new NotImplementedException();
 }
Example #7
0
 public List<LineSegment> SpanningTree(string type, BitmapData keepOutMask)
 {
     List<Edge> edges = selectNonIntersectingEdgesClass.SelectNonIntersectingEdges(keepOutMask, _edges);
     List<LineSegment> segments = DelaunayLinesForEdgesClass.DelaunayLinesForEdges(edges);
     return Kruskal.GetKruskal(segments, type);
 }
Example #8
0
 public List<LineSegment> DelaunayTriangulation(BitmapData keepOutMask)
 {
     return DelaunayLinesForEdgesClass.DelaunayLinesForEdges(selectNonIntersectingEdgesClass.SelectNonIntersectingEdges(keepOutMask, _edges));
 }
Example #9
0
 public List<LineSegment> SpanningTree(BitmapData keepOutMask)
 {
     return SpanningTree("minimum", keepOutMask);
 }
Example #10
0
 public List<uint> SiteColors(BitmapData referenceImage)
 {
     return _sites.SiteColors(referenceImage);
 }
Example #11
0
 /**
  *
  * @param proximityMap a BitmapData whose regions are filled with the site index values; see PlaneVector2sCanvas::fillRegions()
  * @param x
  * @param y
  * @return coordinates of nearest Site to (x, y)
  *
  */
 public Vector2 NearestSiteVector2(BitmapData proximityMap, float x, float y)
 {
     return _sites.NearestSiteVector2(proximityMap, x, y);
 }
Example #12
0
 public bool hitTest(Vector2 a, int b, BitmapData c, Vector2 d, int e)
 {
     throw new NotImplementedException();
 }
Example #13
0
 /**
  *
  * @param proximityMap a BitmapData whose regions are filled with the site index values; see PlanePointFsCanvas::fillRegions()
  * @param x
  * @param y
  * @return coordinates of nearest Site to (x, y)
  *
  */
 public PointF NearestSitePointF(BitmapData proximityMap, float x, float y)
 {
     return _sites.NearestSitePointF(proximityMap, x, y);
 }