In Java, we can iterate through the vertexes of a Shape with PathIterator (and detect loops and other functionality), I have been trying to convert the following code to C# by I can't find what is the class in C# that is equivalent to PathIterator. So does anyone knows what is the equivalent class or approach in C#.
The code is:
private void processCircleShape(Circle circle, final Shape cellBoundaryPolygon)
{
initializeForNewCirclePrivate(circle);
if (cellBoundaryPolygon == null)
{
return;
}
PathIterator boundaryPathIterator = cellBoundaryPolygon.getPathIterator(null);
double[] firstVertex = new double[2];
double[] oldVertex = new double[2];
double[] newVertex = new double[2];
int segmentType = boundaryPathIterator.currentSegment(firstVertex);
if (segmentType != PathIterator.SEG_MOVETO)
{
throw new AssertionError();
}
System.arraycopy(firstVertex, 0, newVertex, 0, 2);
boundaryPathIterator.next();
System.arraycopy(newVertex, 0, oldVertex, 0, 2);
segmentType = boundaryPathIterator.currentSegment(newVertex);
while (segmentType != PathIterator.SEG_CLOSE)
{
processSegment(oldVertex, newVertex);
boundaryPathIterator.next();
System.arraycopy(newVertex, 0, oldVertex, 0, 2);
segmentType = boundaryPathIterator.currentSegment(newVertex);
}
processSegment(newVertex, firstVertex);
}
The code is from the following answer:
Compute the area of intersection between a circle and a triangle?