public override void Visit(KdNode<HotPixel> node) { var hp = node.Data; /* * If the hot pixel is not a node, and it contains one of the segment vertices, * then that vertex is the source for the hot pixel. * To avoid over-noding a node is not added at this point. * The hot pixel may be subsequently marked as a node, * in which case the intersection will be added during the final vertex noding phase. */ if (!hp.IsNode) { if (hp.Intersects(P0) || hp.Intersects(P1)) return; } /* * Add a node if the segment intersects the pixel. * Mark the HotPixel as a node (since it may not have been one before). * This ensures the vertex for it is added as a node during the final vertex noding phase. */ if (hp.Intersects(P0, P1)) { //System.out.println("Added intersection: " + hp.getCoordinate()); SS.AddIntersection(hp.Coordinate, SegIndex); hp.IsNode = true; } }
public override void Visit(KdNode<HotPixel> node) { var hp = node.Data; /* * If vertex pixel is a node, add it. */ if (hp.IsNode && hp.Coordinate.Equals2D(P0)) { SS.AddIntersection(P0, SegIndex); } }