Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Peter Lundin
iso_spline_2
Commits
8d462ca4
Commit
8d462ca4
authored
Oct 06, 2017
by
a001188
Browse files
Initial commit
parent
c4d09f7f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
isospline/Coordinate.java
View file @
8d462ca4
...
...
@@ -16,7 +16,7 @@ public class Coordinate implements Cloneable{
public
static
double
OFFSET_Y
=
0.1
;
public
static
double
WIDTH
=
0.8
;
public
static
double
HEIGHT
=
0.8
;
public
final
static
double
MAX_DIFF
=
0.
0000
00001
;
public
final
static
double
MAX_DIFF
=
0.00001
;
public
final
double
lat
;
public
final
double
lon
;
public
double
value
;
...
...
@@ -97,8 +97,7 @@ public class Coordinate implements Cloneable{
}
public
boolean
equals
(
Coordinate
coord
){
double
diff
=
0.0000001
;
if
(
Math
.
abs
(
lon
-
coord
.
lon
)<
diff
&&
Math
.
abs
(
lat
-
coord
.
lat
)<
diff
)
if
(
Math
.
abs
(
lon
-
coord
.
lon
)<
MAX_DIFF
&&
Math
.
abs
(
lat
-
coord
.
lat
)<
MAX_DIFF
)
return
true
;
return
false
;
}
...
...
isospline/IsoSplineContainer.java
View file @
8d462ca4
...
...
@@ -129,7 +129,7 @@ public class IsoSplineContainer {
}
else
{
boolean
ok
=
canCreateIsoSplineElement
(
isoLevel
);
System
.
out
.
println
(
"Wrong number of iso points: ("
+
ok
+
")"
+
splineC
oords
.
toString
());
System
.
out
.
println
(
"Wrong number of iso points: ("
+
ok
+
")"
+
c
oords
.
toString
());
}
}
...
...
@@ -183,7 +183,7 @@ public class IsoSplineContainer {
if
(
isoLevel
<=
min
||
max
<=
isoLevel
)
return
false
;
if
(
Math
.
abs
(
min
-
max
)
<
0.00001
)
if
(
Math
.
abs
(
min
-
max
)
<
Coordinate
.
MAX_DIFF
)
return
false
;
return
true
;
...
...
isospline/Main.java
View file @
8d462ca4
...
...
@@ -21,12 +21,12 @@ import org.json.JSONException;
public
class
Main
{
public
static
final
int
ISO_LEVELS
=
3
;
public
static
final
boolean
test
=
false
;
public
static
int
minPolygonSize
=
0
;
public
static
int
minPolygonSize
=
1
;
public
static
boolean
filtering
=
true
;
public
static
boolean
original
=
false
;
public
static
int
filterWidth
=
2
;
public
static
int
filterIter
=
3
;
public
static
double
filterRange
=
0.8
;
public
static
double
filterRange
=
1.0
;
/**
...
...
@@ -52,11 +52,11 @@ public class Main {
gui
.
setVisible
(
true
);
int
f0
=
0
;
int
f1
=
0
;
if
(
filtering
){
if
(
!
original
&&
filtering
){
f0
=
1
;
f1
=
2
;
}
if
(
original
){
if
(
original
&&
!
filtering
){
f0
=
0
;
f1
=
1
;
}
...
...
@@ -65,7 +65,7 @@ public class Main {
f1
=
2
;
}
for
(
int
f
=
f0
;
f
0
<
f1
;
f
0
++){
for
(
int
f
=
f0
;
f
<
f1
;
f
++){
for
(
int
i
=
0
;
i
<
isoLevels
.
size
();
i
++){
IsoApi
clone
=
coords
.
clone
();
iso
=
new
IsoSpline
(
clone
);
...
...
isospline/analyze/IsoSplineAnalyze.java
0 → 100644
View file @
8d462ca4
/*
* 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.analyze
;
import
isospline.Coordinate
;
import
isospline.IsoSplineContainer
;
import
isospline.IsoSplineContainers
;
import
isospline.Matrix
;
/**
*
* @author a001188
*/
public
class
IsoSplineAnalyze
{
public
static
final
int
SIZE
=
31
;
public
void
calc
(){
Coordinate
coord
;
IsoSplineContainers
iscs
;
Matrix
matrix
;
for
(
int
i1
=
0
;
i1
<
SIZE
;
i1
++)
for
(
int
i2
=
0
;
i2
<
SIZE
;
i2
=
i2
+
2
)
for
(
int
i3
=
0
;
i3
<
SIZE
;
i3
=
i3
+
4
)
for
(
int
i4
=
0
;
i4
<
SIZE
;
i4
=
i4
+
8
){
matrix
=
new
Matrix
(
2
,
2
);
matrix
.
add
(
new
Coordinate
(
0.0
,
0.0
,
0
,
0
,
i1
));
matrix
.
add
(
new
Coordinate
(
0.0
,
1.0
,
0
,
1
,
i2
));
matrix
.
add
(
new
Coordinate
(
1.0
,
0.0
,
1
,
0
,
i3
));
matrix
.
add
(
new
Coordinate
(
1.0
,
1.0
,
1
,
1
,
i4
));
iscs
=
new
IsoSplineContainers
(
1
,
1
);
iscs
.
createIsoSplineContainers
(
matrix
);
IsoSplineContainer
isc
=
iscs
.
getIsoSplineContainer
(
0
,
0
);
if
(
isc
.
canCreateIsoSplineElement
(
15
))
System
.
out
.
println
(
"JA "
+
isc
.
toString
());
}
}
public
static
void
main
(
String
[]
args
){
IsoSplineAnalyze
analyze
=
new
IsoSplineAnalyze
();
analyze
.
calc
();
}
}
isospline/data/data_temp_2017-10-04.json
0 → 100644
View file @
8d462ca4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment