Commit ee4a663b authored by a001188's avatar a001188
Browse files

Initial commit

parent 7aa1404f
......@@ -14,10 +14,10 @@ import java.util.ArrayList;
*/
public class Colors extends ArrayList<Color>{
public Colors(){
add(Color.RED);
add(Color.BLUE);
add(Color.BLACK);
add(Color.GRAY);
// add(Color.RED);
// add(Color.BLUE);
// add(Color.BLACK);
// add(Color.GRAY);
}
@Override
......
......@@ -47,7 +47,7 @@ public class IsoSpline {
isc.getIsoSplineContainer(r, c).createSplineElement(isoLevel);
}
Polygon polygon = new Polygon(isoLevel, name, color, matrix.getCoordinate(0, 0));
for (IsoSplineContainer c : isc) {
for(IsoSplineContainer c : isc) {
if(c.hasIsoSplineElement())
polygon.add(c.getIsoSplineElement(false));
}
......
......@@ -35,8 +35,7 @@ public class IsoSplineContainer {
ise = null;
includedInPolygon = false;
//System.out.println(ref);
if(!canCreateIsoSplineElement(isoLevel))
return;
int j=0;
for(int i = 0; i<coords.size(); i++){
if(i==coords.size()-1)
......
......@@ -19,7 +19,7 @@ import org.json.JSONException;
* @author a001188
*/
public class Main {
public static final int ISO_LEVELS = 3;
public static final int ISO_LEVELS = 17;
public static final boolean test = false;
/**
* @param args the command line arguments
......@@ -27,6 +27,14 @@ public class Main {
public static void main(String[] args) {
try {
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);
System.out.println("Coords size: " + coords.size());
IsoSpline iso = new IsoSpline(coords);
......@@ -38,7 +46,7 @@ public class Main {
IsoApi clone = coords.clone();
iso = new IsoSpline(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));
gui.addPolygon(polygon);
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