InteriorClassifier Example
- 1. Use Vector getInterior(Vector polygon, boolean isBoundaryInclusive).
Shape shape = null;
Vector polygon = null;
int[] boundary = {41, 35, 29, 23, 18, 13, 19, 14, 20, 25, 31, 37, 42, 36};
InteriorClassifier polygonOnShape = new InteriorClassifier(shape);
Vector interior = polygonOnShape.getInterior(_polygon, true);
Note: if isBoundaryInclusive is false, then the boundary points will not included in the returning list.
- 2. Use BitSetMask getInterior(BitSetMask contour, boolean isBoundaryInclusive)
Shape shape = null;
int[] boundary = {41, 35, 29, 23, 18, 13, 19, 14, 20, 25, 31, 37, 42, 36};
InteriorClassifier polygonOnShape = new InteriorClassifier(_shape);
int size = _shape.getVertices().size();
!BitSetMask polygon = new BitSetMask(size);
for(int index=0; index<_boundary.length; index++){
polygon.set(_boundary[index]);
}
!BitSetMask mask = polygonOnShape.getInterior(polygon, true);
- 3. Use void getInteriorMask(BitSetMask contour, boolean isBoundaryInclusive)
Note: contour BitSetMask object that represents a polygon. This
BitSetMask will have the same as the mesh surface and will store
a list of per vertex values that to be true if vertex is on a
closed polygon and that to be false if the vertex is not on the
polygon.This BitSetMask will be updated at the end of this method,
and will be used as returning value. This BitSetMask will have
the same size as vertex size and will have values which are true
if vertex is interior vertex; otherwise, false.
|