Commit ee4a663b authored by a001188's avatar a001188
Browse files

Initial commit

parent 7aa1404f
...@@ -14,10 +14,10 @@ import java.util.ArrayList; ...@@ -14,10 +14,10 @@ import java.util.ArrayList;
*/ */
public class Colors extends ArrayList<Color>{ public class Colors extends ArrayList<Color>{
public Colors(){ public Colors(){
add(Color.RED); // add(Color.RED);
add(Color.BLUE); // add(Color.BLUE);
add(Color.BLACK); // add(Color.BLACK);
add(Color.GRAY); // add(Color.GRAY);
} }
@Override @Override
......
...@@ -47,7 +47,7 @@ public class IsoSpline { ...@@ -47,7 +47,7 @@ public class IsoSpline {
isc.getIsoSplineContainer(r, c).createSplineElement(isoLevel); isc.getIsoSplineContainer(r, c).createSplineElement(isoLevel);
} }
Polygon polygon = new Polygon(isoLevel, name, color, matrix.getCoordinate(0, 0)); Polygon polygon = new Polygon(isoLevel, name, color, matrix.getCoordinate(0, 0));
for (IsoSplineContainer c : isc) { for(IsoSplineContainer c : isc) {
if(c.hasIsoSplineElement()) if(c.hasIsoSplineElement())
polygon.add(c.getIsoSplineElement(false)); polygon.add(c.getIsoSplineElement(false));
} }
......
...@@ -35,8 +35,7 @@ public class IsoSplineContainer { ...@@ -35,8 +35,7 @@ public class IsoSplineContainer {
ise = null; ise = null;
includedInPolygon = false; includedInPolygon = false;
//System.out.println(ref); //System.out.println(ref);
if(!canCreateIsoSplineElement(isoLevel))
return;
int j=0; int j=0;
for(int i = 0; i<coords.size(); i++){ for(int i = 0; i<coords.size(); i++){
if(i==coords.size()-1) if(i==coords.size()-1)
......
...@@ -19,7 +19,7 @@ import org.json.JSONException; ...@@ -19,7 +19,7 @@ import org.json.JSONException;
* @author a001188 * @author a001188
*/ */
public class Main { public class Main {
public static final int ISO_LEVELS = 3; public static final int ISO_LEVELS = 17;
public static final boolean test = false; public static final boolean test = false;
/** /**
* @param args the command line arguments * @param args the command line arguments
...@@ -27,6 +27,14 @@ public class Main { ...@@ -27,6 +27,14 @@ public class Main {
public static void main(String[] args) { public static void main(String[] args) {
try { try {
Colors colors = new Colors(); Colors colors = new Colors();
for(int i= 0; i<ISO_LEVELS;i++)
if(ISO_LEVELS / 2 > i)
colors.add(Color.blue);
else if(ISO_LEVELS/2 < i)
colors.add(Color.red);
else
colors.add(Color.black);
Matrix coords = JSONMatrix.read(test); Matrix coords = JSONMatrix.read(test);
System.out.println("Coords size: " + coords.size()); System.out.println("Coords size: " + coords.size());
IsoSpline iso = new IsoSpline(coords); IsoSpline iso = new IsoSpline(coords);
...@@ -38,7 +46,7 @@ public class Main { ...@@ -38,7 +46,7 @@ public class Main {
IsoApi clone = coords.clone(); IsoApi clone = coords.clone();
iso = new IsoSpline(clone); iso = new IsoSpline(clone);
Filter filter = new Filter(clone); Filter filter = new Filter(clone);
filter.filtering(2, 5); filter.filtering(2, 4);
Polygon polygon = iso.createIso(clone, "test" + i + "isoLevel: " + isoLevels.get(i), colors.get(i), isoLevels.get(i)); Polygon polygon = iso.createIso(clone, "test" + i + "isoLevel: " + isoLevels.get(i), colors.get(i), isoLevels.get(i));
gui.addPolygon(polygon); gui.addPolygon(polygon);
gui.repaint(); gui.repaint();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment