Skip to content

Commit 3d9907b

Browse files
committed
Address comments from pull request
1 parent a90c8b1 commit 3d9907b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

core/src/main/java/edu/wpi/grip/core/operations/composite/FilterContoursOperation.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,10 @@ public class FilterContoursOperation implements Operation {
4646
SocketHints.Inputs.createNumberListRangeSocketHint("Solidity", 0, 100);
4747

4848
private final SocketHint<Number> minVertexHint =
49-
SocketHints.Inputs.createNumberSpinnerSocketHint("Min Vertex Count", 0, 0, Integer.MAX_VALUE);
49+
SocketHints.Inputs.createNumberSpinnerSocketHint("Min Vertices", 0, 0, Integer.MAX_VALUE);
5050

5151
private final SocketHint<Number> maxVertexHint =
52-
SocketHints.Inputs.createNumberSpinnerSocketHint("Max Vertex Count", 0, 1000, Integer.MAX_VALUE);
53-
54-
private final SocketHint<Boolean> forceConvexHint =
55-
SocketHints.createBooleanSocketHint("Force Convex", false);
52+
SocketHints.Inputs.createNumberSpinnerSocketHint("Max Vertices", 0, 1000000, Integer.MAX_VALUE);
5653

5754
private final SocketHint<Number> minRatioHint =
5855
SocketHints.Inputs.createNumberSpinnerSocketHint("Min Ratio", 0, 0, Integer.MAX_VALUE);
@@ -94,7 +91,6 @@ public InputSocket<?>[] createInputSockets(EventBus eventBus) {
9491
new InputSocket<>(eventBus, solidityHint),
9592
new InputSocket<>(eventBus, minVertexHint),
9693
new InputSocket<>(eventBus, maxVertexHint),
97-
new InputSocket<>(eventBus, forceConvexHint),
9894
new InputSocket<>(eventBus, minRatioHint),
9995
new InputSocket<>(eventBus, maxRatioHint),
10096
};
@@ -119,9 +115,8 @@ public void perform(InputSocket<?>[] inputs, OutputSocket<?>[] outputs) {
119115
final double maxSolidity = ((List<Number>) inputs[7].getValue().get()).get(1).doubleValue();
120116
final double minVertexCount = ((Number) inputs[8].getValue().get()).doubleValue();
121117
final double maxVertexCount = ((Number) inputs[9].getValue().get()).doubleValue();
122-
final boolean forceConvex = ((Boolean) inputs[10].getValue().get()).booleanValue();
123-
final double minRatio = ((Number) inputs[11].getValue().get()).doubleValue();
124-
final double maxRatio = ((Number) inputs[12].getValue().get()).doubleValue();
118+
final double minRatio = ((Number) inputs[10].getValue().get()).doubleValue();
119+
final double maxRatio = ((Number) inputs[11].getValue().get()).doubleValue();
125120

126121

127122
final MatVector inputContours = inputSocket.getValue().get().getContours();
@@ -148,8 +143,6 @@ public void perform(InputSocket<?>[] inputs, OutputSocket<?>[] outputs) {
148143

149144
if(contour.rows() < minVertexCount || contour.rows() > maxVertexCount) continue;
150145

151-
if(forceConvex && !isContourConvex(contour)) continue;
152-
153146
final double ratio = bb.width() / bb.height();
154147
if (ratio < minRatio || ratio > maxRatio) continue;
155148

0 commit comments

Comments
 (0)