Commit ff8fa1d8 authored by a001188's avatar a001188
Browse files

Initial commit

parent 2b68da01
...@@ -37,8 +37,8 @@ public class Coordinate{ ...@@ -37,8 +37,8 @@ public class Coordinate{
this.c=c; this.c=c;
} }
public void fitToFrame(Dimension dimension, GridCorners gridCorners, String type){ public void fitToFrame(Dimension dimension, MatrixCorners gridCorners, String type){
if(type.equals(Coordinates.LONLAT)){ if(type.equals(Matrix.LONLAT)){
double lon1= Math.min(gridCorners.R0C0.lon, gridCorners.R0Cn.lon); double lon1= Math.min(gridCorners.R0C0.lon, gridCorners.R0Cn.lon);
double lat1= Math.min(gridCorners.R0C0.lat, gridCorners.R0Cn.lat); double lat1= Math.min(gridCorners.R0C0.lat, gridCorners.R0Cn.lat);
double lon2= Math.max(gridCorners.RmC0.lon, gridCorners.RmCn.lon); double lon2= Math.max(gridCorners.RmC0.lon, gridCorners.RmCn.lon);
...@@ -46,12 +46,15 @@ public class Coordinate{ ...@@ -46,12 +46,15 @@ public class Coordinate{
double lonWidth = lon2-lon1; double lonWidth = lon2-lon1;
double latHight = lat2-lat1; double latHight = lat2-lat1;
this.x = (int)Math.round(((lat-gridCorners.R0C0.lat)/latHight * HEIGHT + OFFSET_X) * dimension.width); this.x = (int)Math.round(((lat-gridCorners.R0C0.lat)/lonWidth * HEIGHT + OFFSET_X) * dimension.width);
this.y = (int)Math.round(((lon-gridCorners.R0C0.lon)/lonWidth * WIDTH + OFFSET_Y) * dimension.width); this.y = (int)Math.round(((lon-gridCorners.R0C0.lon)/latHight * WIDTH + OFFSET_Y) * dimension.height);
// this.y= (int)Math.round(((lat-lat1)*30 + 100) );
// this.x = (int)Math.round(((lon-lon1)*30 + 100));
} }
else{ else{
double gridWidth = gridCorners.R0Cn.c - gridCorners.R0C0.c; double gridWidth = gridCorners.R0Cn.c - gridCorners.R0C0.c+1;
double gridHeight = gridCorners.RmC0.r - gridCorners.R0C0.r; double gridHeight = gridCorners.RmC0.r - gridCorners.R0C0.r+1;
this.x = (int)Math.round((c/gridWidth * HEIGHT + OFFSET_X) * dimension.width); this.x = (int)Math.round((c/gridWidth * HEIGHT + OFFSET_X) * dimension.width);
this.y = (int)Math.round((r/gridHeight * WIDTH + OFFSET_Y) * dimension.height); this.y = (int)Math.round((r/gridHeight * WIDTH + OFFSET_Y) * dimension.height);
} }
...@@ -87,6 +90,12 @@ public class Coordinate{ ...@@ -87,6 +90,12 @@ public class Coordinate{
sb.append(y); sb.append(y);
sb.append("] => "); sb.append("] => ");
sb.append(value); sb.append(value);
sb.append(" Direction: ");
if(direction!=null)
sb.append(direction);
else
sb.append("null");
return sb.toString(); return sb.toString();
} }
......
...@@ -16,10 +16,10 @@ import javax.swing.JFrame; ...@@ -16,10 +16,10 @@ import javax.swing.JFrame;
*/ */
public class GUI extends JFrame{ public class GUI extends JFrame{
private final Polygons polygons = new Polygons(); private final Polygons polygons = new Polygons();
private final Coordinates coords; private final Matrix coords;
private final String type = Coordinates.RC; private final String type = Matrix.RC;
public GUI(Coordinates coords){ public GUI(Matrix coords){
this.coords = coords; this.coords = coords;
} }
...@@ -38,16 +38,17 @@ public class GUI extends JFrame{ ...@@ -38,16 +38,17 @@ public class GUI extends JFrame{
g.clearRect(0,0, this.getSize().width, this.getSize().height); g.clearRect(0,0, this.getSize().width, this.getSize().height);
coords.fitToFrame(getSize(), type); coords.fitToFrame(getSize(), type);
drawGrid(g, coords); drawGrid(g, coords);
drawCorners(g, coords.getGridCorners());
for(int p = 0; p < polygons.size(); p++) for(int p = 0; p < polygons.size(); p++)
drawIso(g, polygons.get(p)); drawIso(g, polygons.get(p));
} }
private void drawGrid(Graphics g, Coordinates coords){ private void drawGrid(Graphics g, Matrix coords){
coords.fitToFrame(getSize(), type); coords.fitToFrame(getSize(), type);
g.setColor(Color.LIGHT_GRAY); g.setColor(Color.LIGHT_GRAY);
int s = 14; int s = 1;
int x11; int x11;
int x21; int x21;
int x12; int x12;
...@@ -106,11 +107,7 @@ public class GUI extends JFrame{ ...@@ -106,11 +107,7 @@ public class GUI extends JFrame{
g.drawLine(x1, y1, x2, y2); g.drawLine(x1, y1, x2, y2);
} }
g.setColor(Color.BLUE); //Corner
drawDot(g, coords.getCoordinate(0, 0));
drawDot(g, coords.getCoordinate(coords.getRows()-1, 0));
drawDot(g, coords.getCoordinate(0, coords.getCols()-1));
drawDot(g, coords.getCoordinate(coords.getRows()-1, coords.getCols()-1));
} }
...@@ -129,9 +126,13 @@ public class GUI extends JFrame{ ...@@ -129,9 +126,13 @@ public class GUI extends JFrame{
} }
} }
private void drawDot(Graphics g, Coordinate coord){ private void drawCorners(Graphics g, MatrixCorners gridCorners){
int dotDiameter = 4; int dotDiameter = 4;
g.drawOval(coord.x - dotDiameter/2, coord.y - dotDiameter/2, dotDiameter, dotDiameter); g.setColor(Color.BLUE); //Corner
g.drawOval(gridCorners.R0C0.x - dotDiameter/2, gridCorners.R0C0.y - dotDiameter/2, dotDiameter, dotDiameter);
g.drawOval(gridCorners.R0Cn.x - dotDiameter/2, gridCorners.R0Cn.y - dotDiameter/2, dotDiameter, dotDiameter);
g.drawOval(gridCorners.RmC0.x - dotDiameter/2, gridCorners.RmC0.y - dotDiameter/2, dotDiameter, dotDiameter);
g.drawOval(gridCorners.RmCn.x - dotDiameter/2, gridCorners.RmCn.y - dotDiameter/2, dotDiameter, dotDiameter);
} }
} }
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package isospline;
import java.util.ArrayList;
/**
*
* @author a001188
*/
public class IsoLinearSplineElementList extends ArrayList{
}
...@@ -13,42 +13,49 @@ import java.awt.Color; ...@@ -13,42 +13,49 @@ import java.awt.Color;
* @author a001188 * @author a001188
*/ */
public class IsoSpline { public class IsoSpline {
private final Coordinates coords; private final Matrix coords;
private final ArrayList<Double> isoLevels = new ArrayList(); private final ArrayList<Double> isoLevels = new ArrayList();
private final GUI gui; private final GUI gui;
private final double min; private final double min;
private final double max; private final double max;
private final double avg; private final double avg;
public IsoSpline(GUI gui, Coordinates coords){ public IsoSpline(GUI gui, Matrix coords){
this.coords=coords; this.coords=coords;
this.gui=gui; this.gui=gui;
this.avg = coords.average(); this.avg = coords.average();
this.min = coords.getMin(); this.min = coords.getMin();
this.max = coords.getMax(); this.max = coords.getMax();
for(int i=0;i<Main.ISO_LEVELS;i++) for(int i=1;i<Main.ISO_LEVELS+1;i++)
isoLevels.add(i * (max-min)/(Main.ISO_LEVELS-1) + min); isoLevels.add(i * (max-min)/(Main.ISO_LEVELS+1) + min);
System.out.println("Matrix min: " + min + ", Matrix max: " + max + " Matrix avg: " + avg);
System.out.println("isoLevels (" + isoLevels.size() + "): " + isoLevels);
} }
public void createIso(Coordinates coords, String name, Color color){ public void createIso(Matrix coords, String name, Color color){
Polygon polygon = null; Polygon coordinatPairs = null;
Polygons polygons = null; Polygons coordinatePairsList = new Polygons();
for(int n=0; n<isoLevels.size(); n++){ for(int n=0; n<isoLevels.size(); n++){
polygon = new Polygon(isoLevels.get(n), name, color, coords.get(0)); coordinatPairs = new Polygon(isoLevels.get(n), name, color, coords.get(0));
LinearSplineElements lse = new LinearSplineElements(coords, isoLevels.get(n), null); LinearSplineElements lse = new LinearSplineElements(coords, isoLevels.get(n), null);
for(int i = 0; i<lse.size(); i++){ for(int i = 0; i<lse.size(); i++){
Coordinate coord1 = lse.get(i).coord1; Coordinate coord1 = lse.get(i).coord1;
Coordinate coord2 = lse.get(i).coord2; Coordinate coord2 = lse.get(i).coord2;
String direction1 = lse.get(i).coord1.direction; String direction1 = lse.get(i).coord1.direction;
String direction2 = lse.get(i).coord2.direction; String direction2 = lse.get(i).coord2.direction;
polygon.add(new CoordinatePair(coord1,coord2, direction1, direction2)); coordinatPairs.add(new CoordinatePair(coord1,coord2, direction1, direction2));
} }
if(polygon.size()>0) if(coordinatPairs.size()>0)
polygons = polygon.getSeparatePolygons(name, color); coordinatePairsList.add(coordinatPairs);
} }
for(int i =0; i<polygons.size(); i++)
gui.addPolygon(polygons.get(i)); Polygons polygons = new Polygons();
if(coordinatPairs!=null)
for(int i = 0; i<coordinatePairsList.size();i++)
polygons = coordinatPairs.getSeparatePolygons(name, color);
for(int j=0; j<polygons.size();j++)
gui.addPolygon(polygons.get(j));
gui.repaint(); gui.repaint();
} }
...@@ -57,9 +64,9 @@ public class IsoSpline { ...@@ -57,9 +64,9 @@ public class IsoSpline {
public void filtering(){ public void filtering(){
int filterWidth = 2; int filterWidth = 2;
int filtrations = 10; int filtrations = 10;
Coordinates tmp; Matrix tmp;
for(int i = 0; i<filtrations; i++){ for(int i = 0; i<filtrations; i++){
tmp = (Coordinates)coords.clone(); tmp = (Matrix)coords.clone();
for(int r = filterWidth; r<coords.getRows()-filterWidth-1; r++) for(int r = filterWidth; r<coords.getRows()-filterWidth-1; r++)
for(int c = filterWidth; c<coords.getCols()-filterWidth-1; c++){ for(int c = filterWidth; c<coords.getCols()-filterWidth-1; c++){
coords.setValue(r, c, tmp.getFilteredValue(r, c, filterWidth)); coords.setValue(r, c, tmp.getFilteredValue(r, c, filterWidth));
......
...@@ -15,18 +15,36 @@ import org.json.*; ...@@ -15,18 +15,36 @@ import org.json.*;
* *
* @author a001188 * @author a001188
*/ */
/*
http://opendata-download-metfcst.smhi.se/api/category/pmp2g/version/2/geotype/multipoint/validtime/20170923T180000Z/parameter/msl/leveltype/hmsl/level/0/data.json?with-geo=false&downsample=1
*/
public class JSONMatrix{ public class JSONMatrix{
private final static HashMap<Long, Integer> statistics = new HashMap(); private final static HashMap<Long, Integer> statistics = new HashMap();
private static int rows=613;
private static int cols=753;
public static JSONObject parseJSONFile(String filename) throws JSONException, IOException { public static JSONObject parseJSONFile(String filename) throws JSONException, IOException {
String content = new String(Files.readAllBytes(Paths.get(filename))); String content = new String(Files.readAllBytes(Paths.get(filename)));
return new JSONObject(content); return new JSONObject(content);
} }
public static Coordinates read() throws IOException, JSONException { public static Matrix read() throws IOException, JSONException {
Coordinates coords = new Coordinates(612,752); boolean test = true;
String gridfilename = "D:\\git\\GribVisualizer\\src\\isospline\\data\\multipoint.json"; String gridfilename;
String datafilename = "D:\\git\\GribVisualizer\\src\\isospline\\data\\data_temp.json"; String datafilename;
if(test){
rows=4;
cols=4;
gridfilename = "D:\\git\\GribVisualizer\\src\\isospline\\data\\testmultipoint.json";
datafilename = "D:\\git\\GribVisualizer\\src\\isospline\\data\\test_data.json";
}
else{
rows=613;
cols=753;
gridfilename = "D:\\git\\GribVisualizer\\src\\isospline\\data\\multipoint.json";
datafilename = "D:\\git\\GribVisualizer\\src\\isospline\\data\\data_temp.json";
}
Matrix coords = new Matrix(rows,cols);
JSONObject gridObject = parseJSONFile(gridfilename); JSONObject gridObject = parseJSONFile(gridfilename);
JSONArray coordinatesArray = gridObject.getJSONArray("coordinates"); JSONArray coordinatesArray = gridObject.getJSONArray("coordinates");
...@@ -53,17 +71,17 @@ public class JSONMatrix{ ...@@ -53,17 +71,17 @@ public class JSONMatrix{
updateStatistics(lon,lat,value); updateStatistics(lon,lat,value);
coord = new Coordinate(null, lon, lat, r, c, filteredValue(lon, lat, value)); coord = new Coordinate(null, lon, lat, r, c, filteredValue(lon, lat, value));
coords.add(coord); coords.add(coord);
if(c<752){ if(c<cols-1){
c++; c++;
} }
else{ else{
System.out.println(coord + " size " + coords.size()); //System.out.println(coord + " size " + coords.size());
c=0; c=0;
r++; r++;
} }
prevLon=lon; prevLon=lon;
} }
System.out.println(coord + " size " + coords.size()); //System.out.println(coord + " size " + coords.size());
System.out.println(coords.toString()); System.out.println(coords.toString());
Iterator<Long> keys = statistics.keySet().iterator(); Iterator<Long> keys = statistics.keySet().iterator();
Long key; Long key;
......
...@@ -12,10 +12,14 @@ package isospline; ...@@ -12,10 +12,14 @@ package isospline;
public class LinearSplineElement { public class LinearSplineElement {
public final Coordinate coord1; public final Coordinate coord1;
public final Coordinate coord2; public final Coordinate coord2;
public final String dírection1;
public LinearSplineElement(Coordinate intersept1, Coordinate intersept2){ public final String dírection2;
this.coord1=intersept1;
this.coord2=intersept2; public LinearSplineElement(Coordinate coord1, Coordinate coors2, String direction1, String direction2){
this.coord1=coord1;
this.coord2=coors2;
this.dírection1=direction1;
this.dírection2=direction2;
} }
public int compareTo(LinearSplineElement lse) { public int compareTo(LinearSplineElement lse) {
...@@ -25,6 +29,21 @@ public class LinearSplineElement { ...@@ -25,6 +29,21 @@ public class LinearSplineElement {
return -1; return -1;
} }
public boolean hasEqual(Coordinate coord){
if(coord.equals(coord1) || coord.equals(coord2))
return true;
return false;
}
public Coordinate getOpposite(Coordinate coord){
if(coord.equals(coord1))
return coord2;
else
return coord1;
}
public double getZ1(){ public double getZ1(){
return coord1.value; return coord1.value;
} }
......
...@@ -14,11 +14,11 @@ import java.util.ArrayList; ...@@ -14,11 +14,11 @@ import java.util.ArrayList;
* @author peter * @author peter
*/ */
public class LinearSplineElements extends ArrayList<LinearSplineElement>{ public class LinearSplineElements extends ArrayList<LinearSplineElement>{
Coordinates intersepts; Matrix intersepts;
public LinearSplineElements(Coordinates coords, double isoLevel, Float front){ public LinearSplineElements(Matrix coords, double isoLevel, Float front){
for(int r = 0; r < coords.getRows() - 1; r++) for(int r = 0; r < coords.getRows() - 1; r++)
for(int c = 0; c < coords.getCols() - 1; c++){ for(int c = 0; c < coords.getCols() - 1; c++){
if(front==null){ if(front==null){
...@@ -42,34 +42,10 @@ public class LinearSplineElements extends ArrayList<LinearSplineElement>{ ...@@ -42,34 +42,10 @@ public class LinearSplineElements extends ArrayList<LinearSplineElement>{
} }
return sb.toString(); return sb.toString();
} }
/*
private void createDerivateIntersepts(Coordinates coords, int r, int c, double front){
intersepts = new Coordinates();
// North
if(Math.abs(coords.getValue(r, c) - coords.getValue(r, c + 1)) > front) //verticals
add(new LinearSplineElement(new Intersept(r, c, r, c, coords.getValue(r, c)), new Intersept(r, c, r,c+1, coords.getValue(r, c+1))));
// West
if(Math.abs(coords.getValue(r, c) - coords.getValue(r + 1, c)) > front)
add(new LinearSplineElement(new Intersept(r, c, r, c, coords.getValue(r, c)), new Intersept(r, c, r+1,c, coords.getValue(r+1, c))));
// SouthEast
if(Math.abs(coords.getValue(r, c) - coords.getValue(r + 1, c + 1)) > front * (float)Math.pow(2, 0.5))
add(new LinearSplineElement(new Intersept(r, c, r, c, coords.getValue(r, c)), new Intersept(r, c, r+1,c+1, coords.getValue(r+1, c+1))));
// SouthWest
if(Math.abs(coords.getValue(r, c + 1) - coords.getValue(r + 1, c)) > front * (float)Math.pow(2, 0.5))
add(new LinearSplineElement(new Intersept(r, c, r, c + 1, coords.getValue(r + 1, c)), new Intersept(r, c, r + 1, c, coords.getValue(r + 1, c))));
// East
if(Math.abs(coords.getValue(r, c + 1) - coords.getValue(r + 1, c + 1)) > front * (float)Math.pow(2, 0.5))
add(new LinearSplineElement(new Intersept(r, c, r, c + 1, coords.getValue(r + 1, c)), new Intersept(r, c, r + 1, c + 1, coords.getValue(r + 1, c + 1))));
// South
if(Math.abs(coords.getValue(r + 1, c) - coords.getValue(r + 1, c + 1)) > front * (float)Math.pow(2, 0.5))
add(new LinearSplineElement(new Intersept(r, c, r + 1, c, coords.getValue(r + 1, c)), new Intersept(r, c, r + 1, c + 1, coords.getValue(r + 1, c + 1))));
}
*/
private void createIntersepts(Coordinates coords, int r, int c, double isoLevel){ private void createIntersepts(Matrix coords, int r, int c, double isoLevel){
Directions directions = new Directions(new Dimension(r,c)); Directions directions = new Directions(new Dimension(r,c));
intersepts = new Coordinates(coords.getRows(), coords.getCols()); intersepts = new Matrix(coords.getRows(), coords.getCols());
for(int i=0; i<directions.size(); i++){ for(int i=0; i<directions.size(); i++){
Direction direction = directions.get(i); Direction direction = directions.get(i);
Coordinate coord1 = coords.getCoordinate(direction.c1, direction.r1); Coordinate coord1 = coords.getCoordinate(direction.c1, direction.r1);
...@@ -98,10 +74,36 @@ public class LinearSplineElements extends ArrayList<LinearSplineElement>{ ...@@ -98,10 +74,36 @@ public class LinearSplineElements extends ArrayList<LinearSplineElement>{
//intersepts.add(coord1); //intersepts.add(coord1);
//intersepts.add(coord2); //intersepts.add(coord2);
} }
} }
private Coordinate createtIntersept(String direction, Coordinate coord1, Coordinate coord2, double isoLevel){
double v1 = coord1.value;
double v2 = coord2.value;
double range = (isoLevel - v1)/(v2 - v1);
double lat = range * (coord2.lat-coord1.lat) + coord1.lat;
double lon = range * (coord2.lon-coord1.lon) + coord1.lon;
int r = coord1.r;
int c = coord1.c;
return new Coordinate(direction, lon, lat, r, c, isoLevel);
}
private void createSplineElement(Matrix matrix) {
if(matrix.size()==2)
add(new LinearSplineElement(matrix.get(0), matrix.get(1), direction1, direction2));
if(matrix.size()>21)
for(int i = 0;i < matrix.size() - 1; i++)
for(int j = i +1 ; j < matrix.size(); j++){
double xi = matrix.get(i).x;
double yi = matrix.get(i).y;
double xj = matrix.get(j).x;
double yj = matrix.get(j).y;
if(Math.abs(xi-xj) < 1 && Math.abs(yi-yj) < 1)
add(new LinearSplineElement(matrix.get(i), matrix.get(j), direction1, direction2));
}
}
/* /*
private void addIntersept(Coordinates coords, Direction direction, double isoLevel){ private void addIntersept(Matrix coords, Direction direction, double isoLevel){
double v1 = coords.getValue(direction.c1, direction.r1); double v1 = coords.getValue(direction.c1, direction.r1);
double v2 = coords.getValue(direction.c2, direction.r2); double v2 = coords.getValue(direction.c2, direction.r2);
double intersept = getIntersept(v1, v2, isoLevel); double intersept = getIntersept(v1, v2, isoLevel);
...@@ -149,32 +151,29 @@ public class LinearSplineElements extends ArrayList<LinearSplineElement>{ ...@@ -149,32 +151,29 @@ public class LinearSplineElements extends ArrayList<LinearSplineElement>{
} }
*/ */
/*
private Coordinate createtIntersept(String direction, Coordinate coord1, Coordinate coord2, double isoLevel){ private void createDerivateIntersepts(Matrix coords, int r, int c, double front){
double v1 = coord1.value; intersepts = new Matrix();
double v2 = coord2.value; // North
double range = (isoLevel - v1)/(v2 - v1); if(Math.abs(coords.getValue(r, c) - coords.getValue(r, c + 1)) > front) //verticals
double lat = range * (coord2.lat-coord1.lat) + coord1.lat; add(new LinearSplineElement(new Intersept(r, c, r, c, coords.getValue(r, c)), new Intersept(r, c, r,c+1, coords.getValue(r, c+1))));
double lon = range * (coord2.lon-coord1.lon) + coord1.lon; // West
int r = coord1.r; if(Math.abs(coords.getValue(r, c) - coords.getValue(r + 1, c)) > front)
int c = coord1.c; add(new LinearSplineElement(new Intersept(r, c, r, c, coords.getValue(r, c)), new Intersept(r, c, r+1,c, coords.getValue(r+1, c))));
// SouthEast
return new Coordinate(direction, lon, lat, r, c, isoLevel); if(Math.abs(coords.getValue(r, c) - coords.getValue(r + 1, c + 1)) > front * (float)Math.pow(2, 0.5))
add(new LinearSplineElement(new Intersept(r, c, r, c, coords.getValue(r, c)), new Intersept(r, c, r+1,c+1, coords.getValue(r+1, c+1))));
// SouthWest
if(Math.abs(coords.getValue(r, c + 1) - coords.getValue(r + 1, c)) > front * (float)Math.pow(2, 0.5))
add(new LinearSplineElement(new Intersept(r, c, r, c + 1, coords.getValue(r + 1, c)), new Intersept(r, c, r + 1, c, coords.getValue(r + 1, c))));
// East
if(Math.abs(coords.getValue(r, c + 1) - coords.getValue(r + 1, c + 1)) > front * (float)Math.pow(2, 0.5))
add(new LinearSplineElement(new Intersept(r, c, r, c + 1, coords.getValue(r + 1, c)), new Intersept(r, c, r + 1, c + 1, coords.getValue(r + 1, c + 1))));
// South
if(Math.abs(coords.getValue(r + 1, c) - coords.getValue(r + 1, c + 1)) > front * (float)Math.pow(2, 0.5))
add(new LinearSplineElement(new Intersept(r, c, r + 1, c, coords.getValue(r + 1, c)), new Intersept(r, c, r + 1, c + 1, coords.getValue(r + 1, c + 1))));
} }
private void createSplineElement(Coordinates intersepts) { */
if(intersepts.size()==2)
add(new LinearSplineElement(intersepts.get(0), intersepts.get(1)));
if(intersepts.size()>21)
for(int i = 0;i < intersepts.size() - 1; i++)
for(int j = i +1 ; j < intersepts.size(); j++){
double xi = intersepts.get(i).x;
double yi = intersepts.get(i).y;
double xj = intersepts.get(j).x;
double yj = intersepts.get(j).y;
if(Math.abs(xi-xj) < 1 && Math.abs(yi-yj) < 1)
add(new LinearSplineElement(intersepts.get(i), intersepts.get(j)));
}
}
} }
...@@ -15,19 +15,19 @@ import org.json.JSONException; ...@@ -15,19 +15,19 @@ import org.json.JSONException;
* @author a001188 * @author a001188
*/ */
public class Main { public class Main {
public static final int ISO_LEVELS = 17; public static final int ISO_LEVELS = 2;
/** /**
* @param args the command line arguments * @param args the command line arguments
*/ */
public static void main(String[] args) { public static void main(String[] args) {
try { try {
Coordinates coords = JSONMatrix.read(); Matrix coords = JSONMatrix.read();
System.out.println("Coords size: " + coords.size()); System.out.println("Coords size: " + coords.size());
GUI gui = new GUI(coords); GUI gui = new GUI(coords);
IsoSpline ip = new IsoSpline(gui, coords); IsoSpline ip