mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-05 15:26:28 +00:00
Cleanup
This commit is contained in:
@@ -36,8 +36,8 @@ public class ArraySignificance<T> implements Significance<T> {
|
||||
this.significance = significance;
|
||||
double s = 0;
|
||||
int v = 0;
|
||||
for (int i = 0; i < significance.size(); i++) {
|
||||
if (significance.get(i) > s) {
|
||||
for(int i = 0; i < significance.size(); i++) {
|
||||
if(significance.get(i) > s) {
|
||||
s = significance.get(i);
|
||||
v = i;
|
||||
}
|
||||
@@ -53,8 +53,8 @@ public class ArraySignificance<T> implements Significance<T> {
|
||||
|
||||
@Override
|
||||
public double getSignificance(T t) {
|
||||
for (int i = 0; i < types.size(); i++) {
|
||||
if (types.get(i).equals(t)) {
|
||||
for(int i = 0; i < types.size(); i++) {
|
||||
if(types.get(i).equals(t)) {
|
||||
return significance.get(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.volmit.iris.util.function.Function3;
|
||||
import com.volmit.iris.util.function.Function4;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import com.volmit.iris.util.math.RNG;
|
||||
import com.volmit.iris.util.reflect.V;
|
||||
import com.volmit.iris.util.stream.arithmetic.AddingStream;
|
||||
import com.volmit.iris.util.stream.arithmetic.ClampedStream;
|
||||
import com.volmit.iris.util.stream.arithmetic.CoordinateBitShiftLeftStream;
|
||||
@@ -67,14 +66,13 @@ import com.volmit.iris.util.stream.utility.SynchronizedStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@SuppressWarnings("ALL")
|
||||
public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
static ProceduralStream<Double> ofDouble(Function2<Double, Double, Double> f) {
|
||||
try {
|
||||
return of(f, Interpolated.DOUBLE);
|
||||
} catch (IncompatibleClassChangeError e) {
|
||||
} catch(IncompatibleClassChangeError e) {
|
||||
Iris.warn(f.toString());
|
||||
Iris.reportError(e);
|
||||
e.printStackTrace();
|
||||
@@ -355,11 +353,11 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
default <V> ProceduralStream<V> selectRarity(V... types) {
|
||||
KList<V> rarityTypes = new KList<>();
|
||||
int totalRarity = 0;
|
||||
for (V i : types) {
|
||||
for(V i : types) {
|
||||
totalRarity += IRare.get(i);
|
||||
}
|
||||
|
||||
for (V i : types) {
|
||||
for(V i : types) {
|
||||
rarityTypes.addMultiple(i, totalRarity / IRare.get(i));
|
||||
}
|
||||
|
||||
@@ -381,11 +379,11 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
default <V> int countPossibilities(List<V> types, Function<V, IRare> loader) {
|
||||
KList<V> rarityTypes = new KList<>();
|
||||
int totalRarity = 0;
|
||||
for (V i : types) {
|
||||
for(V i : types) {
|
||||
totalRarity += IRare.get(loader.apply(i));
|
||||
}
|
||||
|
||||
for (V i : types) {
|
||||
for(V i : types) {
|
||||
rarityTypes.addMultiple(i, totalRarity / IRare.get(loader.apply(i)));
|
||||
}
|
||||
|
||||
@@ -418,11 +416,11 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
default <V> void fill2D(Hunk<V> h, double x, double z, V v, int parallelism) {
|
||||
h.compute2D(parallelism, (xx, __, zz, hh) ->
|
||||
{
|
||||
for (int i = 0; i < hh.getWidth(); i++) {
|
||||
for (int k = 0; k < hh.getDepth(); k++) {
|
||||
for(int i = 0; i < hh.getWidth(); i++) {
|
||||
for(int k = 0; k < hh.getDepth(); k++) {
|
||||
double n = getDouble(i + x + xx, k + z + zz);
|
||||
|
||||
for (int j = 0; j < Math.min(h.getHeight(), n); j++) {
|
||||
for(int j = 0; j < Math.min(h.getHeight(), n); j++) {
|
||||
hh.set(i, j, k, v);
|
||||
}
|
||||
}
|
||||
@@ -433,11 +431,11 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
default <V> void fill2D(Hunk<V> h, double x, double z, ProceduralStream<V> v, int parallelism) {
|
||||
h.compute2D(parallelism, (xx, yy, zz, hh) ->
|
||||
{
|
||||
for (int i = 0; i < hh.getWidth(); i++) {
|
||||
for (int k = 0; k < hh.getDepth(); k++) {
|
||||
for(int i = 0; i < hh.getWidth(); i++) {
|
||||
for(int k = 0; k < hh.getDepth(); k++) {
|
||||
double n = getDouble(i + x + xx, k + z + zz);
|
||||
|
||||
for (int j = 0; j < Math.min(h.getHeight(), n); j++) {
|
||||
for(int j = 0; j < Math.min(h.getHeight(), n); j++) {
|
||||
hh.set(i, j, k, v.get(i + x + xx, j + yy, k + z + zz));
|
||||
}
|
||||
}
|
||||
@@ -448,11 +446,11 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
default <V> void fill2DYLocked(Hunk<V> h, double x, double z, V v, int parallelism) {
|
||||
h.compute2D(parallelism, (xx, yy, zz, hh) ->
|
||||
{
|
||||
for (int i = 0; i < hh.getWidth(); i++) {
|
||||
for (int k = 0; k < hh.getDepth(); k++) {
|
||||
for(int i = 0; i < hh.getWidth(); i++) {
|
||||
for(int k = 0; k < hh.getDepth(); k++) {
|
||||
double n = getDouble(i + x + xx, k + z + zz);
|
||||
|
||||
for (int j = 0; j < Math.min(h.getHeight(), n); j++) {
|
||||
for(int j = 0; j < Math.min(h.getHeight(), n); j++) {
|
||||
hh.set(i, j, k, v);
|
||||
}
|
||||
}
|
||||
@@ -463,11 +461,11 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
default <V> void fill2DYLocked(Hunk<V> h, double x, double z, ProceduralStream<V> v, int parallelism) {
|
||||
h.compute2D(parallelism, (xx, yy, zz, hh) ->
|
||||
{
|
||||
for (int i = 0; i < hh.getWidth(); i++) {
|
||||
for (int k = 0; k < hh.getDepth(); k++) {
|
||||
for(int i = 0; i < hh.getWidth(); i++) {
|
||||
for(int k = 0; k < hh.getDepth(); k++) {
|
||||
double n = getDouble(i + x + xx, k + z + zz);
|
||||
|
||||
for (int j = 0; j < Math.min(h.getHeight(), n); j++) {
|
||||
for(int j = 0; j < Math.min(h.getHeight(), n); j++) {
|
||||
hh.set(i, j, k, v.get(i + x + xx, k + z + zz));
|
||||
}
|
||||
}
|
||||
@@ -478,7 +476,7 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
default <V> void fill3D(Hunk<V> h, double x, int y, double z, V v, int parallelism) {
|
||||
h.compute3D(parallelism, (xx, yy, zz, hh) -> hh.iterate((xv, yv, zv) ->
|
||||
{
|
||||
if (getDouble(xx + xv + x, yy + yv + y, zz + zv + z) > 0.5) {
|
||||
if(getDouble(xx + xv + x, yy + yv + y, zz + zv + z) > 0.5) {
|
||||
hh.set(xv, yv, zv, v);
|
||||
}
|
||||
}));
|
||||
@@ -487,7 +485,7 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
|
||||
default <V> void fill3D(Hunk<V> h, double x, int y, double z, ProceduralStream<V> v, int parallelism) {
|
||||
h.compute3D(parallelism, (xx, yy, zz, hh) -> hh.iterate((xv, yv, zv) ->
|
||||
{
|
||||
if (getDouble(xx + xv + x, yy + yv + y, zz + zv + z) > 0.5) {
|
||||
if(getDouble(xx + xv + x, yy + yv + y, zz + zv + z) > 0.5) {
|
||||
hh.set(xv, yv, zv, v.get(xx + xv + x, yy + yv + y, zz + zv + z));
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -34,7 +34,7 @@ public class AwareConversionStream2D<T, V> extends BasicStream<V> {
|
||||
|
||||
@Override
|
||||
public double toDouble(V t) {
|
||||
if (t instanceof Double) {
|
||||
if(t instanceof Double) {
|
||||
return (Double) t;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ public class AwareConversionStream3D<T, V> extends BasicStream<V> {
|
||||
|
||||
@Override
|
||||
public double toDouble(V t) {
|
||||
if (t instanceof Double) {
|
||||
if(t instanceof Double) {
|
||||
return (Double) t;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ConversionStream<T, V> extends BasicLayer implements ProceduralStre
|
||||
|
||||
@Override
|
||||
public double toDouble(V t) {
|
||||
if (t instanceof Double) {
|
||||
if(t instanceof Double) {
|
||||
return (Double) t;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.volmit.iris.util.stream.BasicStream;
|
||||
import com.volmit.iris.util.stream.ProceduralStream;
|
||||
|
||||
public class ForceDoubleStream extends BasicStream<Double> {
|
||||
private ProceduralStream<?> stream;
|
||||
private final ProceduralStream<?> stream;
|
||||
|
||||
public ForceDoubleStream(ProceduralStream<?> stream) {
|
||||
super(null);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class SelectionStream<T> extends BasicStream<T> {
|
||||
|
||||
@Override
|
||||
public T get(double x, double z) {
|
||||
if (options.length == 0) {
|
||||
if(options.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SelectionStream<T> extends BasicStream<T> {
|
||||
|
||||
@Override
|
||||
public T get(double x, double y, double z) {
|
||||
if (options.length == 0) {
|
||||
if(options.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,14 +55,14 @@ public class SignificanceStream<K extends Significance<T>, T> extends BasicStrea
|
||||
double m = (360d / checks);
|
||||
double v = 0;
|
||||
|
||||
for (int i = 0; i < 360; i += m) {
|
||||
for(int i = 0; i < 360; i += m) {
|
||||
double sin = Math.sin(Math.toRadians(i));
|
||||
double cos = Math.cos(Math.toRadians(i));
|
||||
double cx = x + ((radius * cos) - (radius * sin));
|
||||
double cz = z + ((radius * sin) + (radius * cos));
|
||||
T t = stream.get(cx, cz);
|
||||
|
||||
if (ke.addIfMissing(t)) {
|
||||
if(ke.addIfMissing(t)) {
|
||||
va.add(1D);
|
||||
v++;
|
||||
} else {
|
||||
@@ -71,7 +71,7 @@ public class SignificanceStream<K extends Significance<T>, T> extends BasicStrea
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < va.size(); i++) {
|
||||
for(int i = 0; i < va.size(); i++) {
|
||||
va.set(i, va.get(i) / v);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,23 +56,23 @@ public class BiHermiteStream<T> extends BasicStream<T> implements Interpolator<T
|
||||
|
||||
//@builder
|
||||
return getTypedSource().fromDouble(IrisInterpolation.bihermite(
|
||||
getTypedSource().getDouble(x0, z0),
|
||||
getTypedSource().getDouble(x0, z1),
|
||||
getTypedSource().getDouble(x0, z2),
|
||||
getTypedSource().getDouble(x0, z3),
|
||||
getTypedSource().getDouble(x1, z0),
|
||||
getTypedSource().getDouble(x1, z1),
|
||||
getTypedSource().getDouble(x1, z2),
|
||||
getTypedSource().getDouble(x1, z3),
|
||||
getTypedSource().getDouble(x2, z0),
|
||||
getTypedSource().getDouble(x2, z1),
|
||||
getTypedSource().getDouble(x2, z2),
|
||||
getTypedSource().getDouble(x2, z3),
|
||||
getTypedSource().getDouble(x3, z0),
|
||||
getTypedSource().getDouble(x3, z1),
|
||||
getTypedSource().getDouble(x3, z2),
|
||||
getTypedSource().getDouble(x3, z3),
|
||||
px, pz, tension, bias));
|
||||
getTypedSource().getDouble(x0, z0),
|
||||
getTypedSource().getDouble(x0, z1),
|
||||
getTypedSource().getDouble(x0, z2),
|
||||
getTypedSource().getDouble(x0, z3),
|
||||
getTypedSource().getDouble(x1, z0),
|
||||
getTypedSource().getDouble(x1, z1),
|
||||
getTypedSource().getDouble(x1, z2),
|
||||
getTypedSource().getDouble(x1, z3),
|
||||
getTypedSource().getDouble(x2, z0),
|
||||
getTypedSource().getDouble(x2, z1),
|
||||
getTypedSource().getDouble(x2, z2),
|
||||
getTypedSource().getDouble(x2, z3),
|
||||
getTypedSource().getDouble(x3, z0),
|
||||
getTypedSource().getDouble(x3, z1),
|
||||
getTypedSource().getDouble(x3, z2),
|
||||
getTypedSource().getDouble(x3, z3),
|
||||
px, pz, tension, bias));
|
||||
//@done
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class BiStarcastStream<T> extends BasicStream<T> implements Interpolator<
|
||||
double m = (360D / checks);
|
||||
double v = 0;
|
||||
|
||||
for (int i = 0; i < 360; i += m) {
|
||||
for(int i = 0; i < 360; i += m) {
|
||||
double sin = Math.sin(Math.toRadians(i));
|
||||
double cos = Math.cos(Math.toRadians(i));
|
||||
double cx = x + ((rad * cos) - (rad * sin));
|
||||
|
||||
@@ -48,23 +48,23 @@ public class BicubicStream<T> extends BasicStream<T> implements Interpolator<T>
|
||||
|
||||
//@builder
|
||||
return getTypedSource().fromDouble(IrisInterpolation.bicubic(
|
||||
getTypedSource().getDouble(x0, z0),
|
||||
getTypedSource().getDouble(x0, z1),
|
||||
getTypedSource().getDouble(x0, z2),
|
||||
getTypedSource().getDouble(x0, z3),
|
||||
getTypedSource().getDouble(x1, z0),
|
||||
getTypedSource().getDouble(x1, z1),
|
||||
getTypedSource().getDouble(x1, z2),
|
||||
getTypedSource().getDouble(x1, z3),
|
||||
getTypedSource().getDouble(x2, z0),
|
||||
getTypedSource().getDouble(x2, z1),
|
||||
getTypedSource().getDouble(x2, z2),
|
||||
getTypedSource().getDouble(x2, z3),
|
||||
getTypedSource().getDouble(x3, z0),
|
||||
getTypedSource().getDouble(x3, z1),
|
||||
getTypedSource().getDouble(x3, z2),
|
||||
getTypedSource().getDouble(x3, z3),
|
||||
px, pz));
|
||||
getTypedSource().getDouble(x0, z0),
|
||||
getTypedSource().getDouble(x0, z1),
|
||||
getTypedSource().getDouble(x0, z2),
|
||||
getTypedSource().getDouble(x0, z3),
|
||||
getTypedSource().getDouble(x1, z0),
|
||||
getTypedSource().getDouble(x1, z1),
|
||||
getTypedSource().getDouble(x1, z2),
|
||||
getTypedSource().getDouble(x1, z3),
|
||||
getTypedSource().getDouble(x2, z0),
|
||||
getTypedSource().getDouble(x2, z1),
|
||||
getTypedSource().getDouble(x2, z2),
|
||||
getTypedSource().getDouble(x2, z3),
|
||||
getTypedSource().getDouble(x3, z0),
|
||||
getTypedSource().getDouble(x3, z1),
|
||||
getTypedSource().getDouble(x3, z2),
|
||||
getTypedSource().getDouble(x3, z3),
|
||||
px, pz));
|
||||
//@done
|
||||
}
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@ public class BilinearStream<T> extends BasicStream<T> implements Interpolator<T>
|
||||
|
||||
//@builder
|
||||
return getTypedSource().fromDouble(IrisInterpolation.blerp(
|
||||
getTypedSource().getDouble(x1, z1),
|
||||
getTypedSource().getDouble(x2, z1),
|
||||
getTypedSource().getDouble(x1, z2),
|
||||
getTypedSource().getDouble(x2, z2),
|
||||
px, pz));
|
||||
getTypedSource().getDouble(x1, z1),
|
||||
getTypedSource().getDouble(x2, z1),
|
||||
getTypedSource().getDouble(x1, z2),
|
||||
getTypedSource().getDouble(x2, z2),
|
||||
px, pz));
|
||||
//@done
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public interface Interpolated<T> {
|
||||
T fromDouble(double d);
|
||||
|
||||
default InterpolatorFactory<T> interpolate() {
|
||||
if (this instanceof ProceduralStream) {
|
||||
if(this instanceof ProceduralStream) {
|
||||
return new InterpolatorFactory<>((ProceduralStream<T>) this);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import com.volmit.iris.util.stream.ProceduralStream;
|
||||
public interface Interpolator<T> {
|
||||
@SuppressWarnings("unchecked")
|
||||
default InterpolatorFactory<T> into() {
|
||||
if (this instanceof ProceduralStream) {
|
||||
if(this instanceof ProceduralStream) {
|
||||
return new InterpolatorFactory<>((ProceduralStream<T>) this);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,71 +60,71 @@ public class TriHermiteStream<T> extends BasicStream<T> implements Interpolator<
|
||||
|
||||
//@builder
|
||||
return getTypedSource().fromDouble(IrisInterpolation.trihermite(
|
||||
getTypedSource().getDouble(x0, y0, z0),
|
||||
getTypedSource().getDouble(x0, y0, z1),
|
||||
getTypedSource().getDouble(x0, y0, z2),
|
||||
getTypedSource().getDouble(x0, y0, z3),
|
||||
getTypedSource().getDouble(x1, y0, z0),
|
||||
getTypedSource().getDouble(x1, y0, z1),
|
||||
getTypedSource().getDouble(x1, y0, z2),
|
||||
getTypedSource().getDouble(x1, y0, z3),
|
||||
getTypedSource().getDouble(x2, y0, z0),
|
||||
getTypedSource().getDouble(x2, y0, z1),
|
||||
getTypedSource().getDouble(x2, y0, z2),
|
||||
getTypedSource().getDouble(x2, y0, z3),
|
||||
getTypedSource().getDouble(x3, y0, z0),
|
||||
getTypedSource().getDouble(x3, y0, z1),
|
||||
getTypedSource().getDouble(x3, y0, z2),
|
||||
getTypedSource().getDouble(x3, y0, z3),
|
||||
getTypedSource().getDouble(x0, y1, z0),
|
||||
getTypedSource().getDouble(x0, y1, z1),
|
||||
getTypedSource().getDouble(x0, y1, z2),
|
||||
getTypedSource().getDouble(x0, y1, z3),
|
||||
getTypedSource().getDouble(x1, y1, z0),
|
||||
getTypedSource().getDouble(x1, y1, z1),
|
||||
getTypedSource().getDouble(x1, y1, z2),
|
||||
getTypedSource().getDouble(x1, y1, z3),
|
||||
getTypedSource().getDouble(x2, y1, z0),
|
||||
getTypedSource().getDouble(x2, y1, z1),
|
||||
getTypedSource().getDouble(x2, y1, z2),
|
||||
getTypedSource().getDouble(x2, y1, z3),
|
||||
getTypedSource().getDouble(x3, y1, z0),
|
||||
getTypedSource().getDouble(x3, y1, z1),
|
||||
getTypedSource().getDouble(x3, y1, z2),
|
||||
getTypedSource().getDouble(x3, y1, z3),
|
||||
getTypedSource().getDouble(x0, y2, z0),
|
||||
getTypedSource().getDouble(x0, y2, z1),
|
||||
getTypedSource().getDouble(x0, y2, z2),
|
||||
getTypedSource().getDouble(x0, y2, z3),
|
||||
getTypedSource().getDouble(x1, y2, z0),
|
||||
getTypedSource().getDouble(x1, y2, z1),
|
||||
getTypedSource().getDouble(x1, y2, z2),
|
||||
getTypedSource().getDouble(x1, y2, z3),
|
||||
getTypedSource().getDouble(x2, y2, z0),
|
||||
getTypedSource().getDouble(x2, y2, z1),
|
||||
getTypedSource().getDouble(x2, y2, z2),
|
||||
getTypedSource().getDouble(x2, y2, z3),
|
||||
getTypedSource().getDouble(x3, y2, z0),
|
||||
getTypedSource().getDouble(x3, y2, z1),
|
||||
getTypedSource().getDouble(x3, y2, z2),
|
||||
getTypedSource().getDouble(x3, y2, z3),
|
||||
getTypedSource().getDouble(x0, y3, z0),
|
||||
getTypedSource().getDouble(x0, y3, z1),
|
||||
getTypedSource().getDouble(x0, y3, z2),
|
||||
getTypedSource().getDouble(x0, y3, z3),
|
||||
getTypedSource().getDouble(x1, y3, z0),
|
||||
getTypedSource().getDouble(x1, y3, z1),
|
||||
getTypedSource().getDouble(x1, y3, z2),
|
||||
getTypedSource().getDouble(x1, y3, z3),
|
||||
getTypedSource().getDouble(x2, y3, z0),
|
||||
getTypedSource().getDouble(x2, y3, z1),
|
||||
getTypedSource().getDouble(x2, y3, z2),
|
||||
getTypedSource().getDouble(x2, y3, z3),
|
||||
getTypedSource().getDouble(x3, y3, z0),
|
||||
getTypedSource().getDouble(x3, y3, z1),
|
||||
getTypedSource().getDouble(x3, y3, z2),
|
||||
getTypedSource().getDouble(x3, y3, z3),
|
||||
px, pz, py, tension, bias));
|
||||
getTypedSource().getDouble(x0, y0, z0),
|
||||
getTypedSource().getDouble(x0, y0, z1),
|
||||
getTypedSource().getDouble(x0, y0, z2),
|
||||
getTypedSource().getDouble(x0, y0, z3),
|
||||
getTypedSource().getDouble(x1, y0, z0),
|
||||
getTypedSource().getDouble(x1, y0, z1),
|
||||
getTypedSource().getDouble(x1, y0, z2),
|
||||
getTypedSource().getDouble(x1, y0, z3),
|
||||
getTypedSource().getDouble(x2, y0, z0),
|
||||
getTypedSource().getDouble(x2, y0, z1),
|
||||
getTypedSource().getDouble(x2, y0, z2),
|
||||
getTypedSource().getDouble(x2, y0, z3),
|
||||
getTypedSource().getDouble(x3, y0, z0),
|
||||
getTypedSource().getDouble(x3, y0, z1),
|
||||
getTypedSource().getDouble(x3, y0, z2),
|
||||
getTypedSource().getDouble(x3, y0, z3),
|
||||
getTypedSource().getDouble(x0, y1, z0),
|
||||
getTypedSource().getDouble(x0, y1, z1),
|
||||
getTypedSource().getDouble(x0, y1, z2),
|
||||
getTypedSource().getDouble(x0, y1, z3),
|
||||
getTypedSource().getDouble(x1, y1, z0),
|
||||
getTypedSource().getDouble(x1, y1, z1),
|
||||
getTypedSource().getDouble(x1, y1, z2),
|
||||
getTypedSource().getDouble(x1, y1, z3),
|
||||
getTypedSource().getDouble(x2, y1, z0),
|
||||
getTypedSource().getDouble(x2, y1, z1),
|
||||
getTypedSource().getDouble(x2, y1, z2),
|
||||
getTypedSource().getDouble(x2, y1, z3),
|
||||
getTypedSource().getDouble(x3, y1, z0),
|
||||
getTypedSource().getDouble(x3, y1, z1),
|
||||
getTypedSource().getDouble(x3, y1, z2),
|
||||
getTypedSource().getDouble(x3, y1, z3),
|
||||
getTypedSource().getDouble(x0, y2, z0),
|
||||
getTypedSource().getDouble(x0, y2, z1),
|
||||
getTypedSource().getDouble(x0, y2, z2),
|
||||
getTypedSource().getDouble(x0, y2, z3),
|
||||
getTypedSource().getDouble(x1, y2, z0),
|
||||
getTypedSource().getDouble(x1, y2, z1),
|
||||
getTypedSource().getDouble(x1, y2, z2),
|
||||
getTypedSource().getDouble(x1, y2, z3),
|
||||
getTypedSource().getDouble(x2, y2, z0),
|
||||
getTypedSource().getDouble(x2, y2, z1),
|
||||
getTypedSource().getDouble(x2, y2, z2),
|
||||
getTypedSource().getDouble(x2, y2, z3),
|
||||
getTypedSource().getDouble(x3, y2, z0),
|
||||
getTypedSource().getDouble(x3, y2, z1),
|
||||
getTypedSource().getDouble(x3, y2, z2),
|
||||
getTypedSource().getDouble(x3, y2, z3),
|
||||
getTypedSource().getDouble(x0, y3, z0),
|
||||
getTypedSource().getDouble(x0, y3, z1),
|
||||
getTypedSource().getDouble(x0, y3, z2),
|
||||
getTypedSource().getDouble(x0, y3, z3),
|
||||
getTypedSource().getDouble(x1, y3, z0),
|
||||
getTypedSource().getDouble(x1, y3, z1),
|
||||
getTypedSource().getDouble(x1, y3, z2),
|
||||
getTypedSource().getDouble(x1, y3, z3),
|
||||
getTypedSource().getDouble(x2, y3, z0),
|
||||
getTypedSource().getDouble(x2, y3, z1),
|
||||
getTypedSource().getDouble(x2, y3, z2),
|
||||
getTypedSource().getDouble(x2, y3, z3),
|
||||
getTypedSource().getDouble(x3, y3, z0),
|
||||
getTypedSource().getDouble(x3, y3, z1),
|
||||
getTypedSource().getDouble(x3, y3, z2),
|
||||
getTypedSource().getDouble(x3, y3, z3),
|
||||
px, pz, py, tension, bias));
|
||||
//@done
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class TriStarcastStream<T> extends BasicStream<T> implements Interpolator
|
||||
double m = (360D / checks);
|
||||
double v = 0;
|
||||
|
||||
for (int i = 0; i < 360; i += m) {
|
||||
for(int i = 0; i < 360; i += m) {
|
||||
double sin = Math.sin(Math.toRadians(i));
|
||||
double cos = Math.cos(Math.toRadians(i));
|
||||
double cx = x + ((rad * cos) - (rad * sin));
|
||||
|
||||
@@ -56,74 +56,74 @@ public class TricubicStream<T> extends BasicStream<T> implements Interpolator<T>
|
||||
|
||||
//@builder
|
||||
return getTypedSource().fromDouble(IrisInterpolation.tricubic(
|
||||
getTypedSource().getDouble(x0, y0, z0),
|
||||
getTypedSource().getDouble(x0, y0, z1),
|
||||
getTypedSource().getDouble(x0, y0, z2),
|
||||
getTypedSource().getDouble(x0, y0, z3),
|
||||
getTypedSource().getDouble(x1, y0, z0),
|
||||
getTypedSource().getDouble(x1, y0, z1),
|
||||
getTypedSource().getDouble(x1, y0, z2),
|
||||
getTypedSource().getDouble(x1, y0, z3),
|
||||
getTypedSource().getDouble(x2, y0, z0),
|
||||
getTypedSource().getDouble(x2, y0, z1),
|
||||
getTypedSource().getDouble(x2, y0, z2),
|
||||
getTypedSource().getDouble(x2, y0, z3),
|
||||
getTypedSource().getDouble(x3, y0, z0),
|
||||
getTypedSource().getDouble(x3, y0, z1),
|
||||
getTypedSource().getDouble(x3, y0, z2),
|
||||
getTypedSource().getDouble(x3, y0, z3),
|
||||
getTypedSource().getDouble(x0, y0, z0),
|
||||
getTypedSource().getDouble(x0, y0, z1),
|
||||
getTypedSource().getDouble(x0, y0, z2),
|
||||
getTypedSource().getDouble(x0, y0, z3),
|
||||
getTypedSource().getDouble(x1, y0, z0),
|
||||
getTypedSource().getDouble(x1, y0, z1),
|
||||
getTypedSource().getDouble(x1, y0, z2),
|
||||
getTypedSource().getDouble(x1, y0, z3),
|
||||
getTypedSource().getDouble(x2, y0, z0),
|
||||
getTypedSource().getDouble(x2, y0, z1),
|
||||
getTypedSource().getDouble(x2, y0, z2),
|
||||
getTypedSource().getDouble(x2, y0, z3),
|
||||
getTypedSource().getDouble(x3, y0, z0),
|
||||
getTypedSource().getDouble(x3, y0, z1),
|
||||
getTypedSource().getDouble(x3, y0, z2),
|
||||
getTypedSource().getDouble(x3, y0, z3),
|
||||
|
||||
getTypedSource().getDouble(x0, y1, z0),
|
||||
getTypedSource().getDouble(x0, y1, z1),
|
||||
getTypedSource().getDouble(x0, y1, z2),
|
||||
getTypedSource().getDouble(x0, y1, z3),
|
||||
getTypedSource().getDouble(x1, y1, z0),
|
||||
getTypedSource().getDouble(x1, y1, z1),
|
||||
getTypedSource().getDouble(x1, y1, z2),
|
||||
getTypedSource().getDouble(x1, y1, z3),
|
||||
getTypedSource().getDouble(x2, y1, z0),
|
||||
getTypedSource().getDouble(x2, y1, z1),
|
||||
getTypedSource().getDouble(x2, y1, z2),
|
||||
getTypedSource().getDouble(x2, y1, z3),
|
||||
getTypedSource().getDouble(x3, y1, z0),
|
||||
getTypedSource().getDouble(x3, y1, z1),
|
||||
getTypedSource().getDouble(x3, y1, z2),
|
||||
getTypedSource().getDouble(x3, y1, z3),
|
||||
getTypedSource().getDouble(x0, y1, z0),
|
||||
getTypedSource().getDouble(x0, y1, z1),
|
||||
getTypedSource().getDouble(x0, y1, z2),
|
||||
getTypedSource().getDouble(x0, y1, z3),
|
||||
getTypedSource().getDouble(x1, y1, z0),
|
||||
getTypedSource().getDouble(x1, y1, z1),
|
||||
getTypedSource().getDouble(x1, y1, z2),
|
||||
getTypedSource().getDouble(x1, y1, z3),
|
||||
getTypedSource().getDouble(x2, y1, z0),
|
||||
getTypedSource().getDouble(x2, y1, z1),
|
||||
getTypedSource().getDouble(x2, y1, z2),
|
||||
getTypedSource().getDouble(x2, y1, z3),
|
||||
getTypedSource().getDouble(x3, y1, z0),
|
||||
getTypedSource().getDouble(x3, y1, z1),
|
||||
getTypedSource().getDouble(x3, y1, z2),
|
||||
getTypedSource().getDouble(x3, y1, z3),
|
||||
|
||||
getTypedSource().getDouble(x0, y2, z0),
|
||||
getTypedSource().getDouble(x0, y2, z1),
|
||||
getTypedSource().getDouble(x0, y2, z2),
|
||||
getTypedSource().getDouble(x0, y2, z3),
|
||||
getTypedSource().getDouble(x1, y2, z0),
|
||||
getTypedSource().getDouble(x1, y2, z1),
|
||||
getTypedSource().getDouble(x1, y2, z2),
|
||||
getTypedSource().getDouble(x1, y2, z3),
|
||||
getTypedSource().getDouble(x2, y2, z0),
|
||||
getTypedSource().getDouble(x2, y2, z1),
|
||||
getTypedSource().getDouble(x2, y2, z2),
|
||||
getTypedSource().getDouble(x2, y2, z3),
|
||||
getTypedSource().getDouble(x3, y2, z0),
|
||||
getTypedSource().getDouble(x3, y2, z1),
|
||||
getTypedSource().getDouble(x3, y2, z2),
|
||||
getTypedSource().getDouble(x3, y2, z3),
|
||||
getTypedSource().getDouble(x0, y2, z0),
|
||||
getTypedSource().getDouble(x0, y2, z1),
|
||||
getTypedSource().getDouble(x0, y2, z2),
|
||||
getTypedSource().getDouble(x0, y2, z3),
|
||||
getTypedSource().getDouble(x1, y2, z0),
|
||||
getTypedSource().getDouble(x1, y2, z1),
|
||||
getTypedSource().getDouble(x1, y2, z2),
|
||||
getTypedSource().getDouble(x1, y2, z3),
|
||||
getTypedSource().getDouble(x2, y2, z0),
|
||||
getTypedSource().getDouble(x2, y2, z1),
|
||||
getTypedSource().getDouble(x2, y2, z2),
|
||||
getTypedSource().getDouble(x2, y2, z3),
|
||||
getTypedSource().getDouble(x3, y2, z0),
|
||||
getTypedSource().getDouble(x3, y2, z1),
|
||||
getTypedSource().getDouble(x3, y2, z2),
|
||||
getTypedSource().getDouble(x3, y2, z3),
|
||||
|
||||
getTypedSource().getDouble(x0, y3, z0),
|
||||
getTypedSource().getDouble(x0, y3, z1),
|
||||
getTypedSource().getDouble(x0, y3, z2),
|
||||
getTypedSource().getDouble(x0, y3, z3),
|
||||
getTypedSource().getDouble(x1, y3, z0),
|
||||
getTypedSource().getDouble(x1, y3, z1),
|
||||
getTypedSource().getDouble(x1, y3, z2),
|
||||
getTypedSource().getDouble(x1, y3, z3),
|
||||
getTypedSource().getDouble(x2, y3, z0),
|
||||
getTypedSource().getDouble(x2, y3, z1),
|
||||
getTypedSource().getDouble(x2, y3, z2),
|
||||
getTypedSource().getDouble(x2, y3, z3),
|
||||
getTypedSource().getDouble(x3, y3, z0),
|
||||
getTypedSource().getDouble(x3, y3, z1),
|
||||
getTypedSource().getDouble(x3, y3, z2),
|
||||
getTypedSource().getDouble(x3, y3, z3),
|
||||
px, pz, py));
|
||||
getTypedSource().getDouble(x0, y3, z0),
|
||||
getTypedSource().getDouble(x0, y3, z1),
|
||||
getTypedSource().getDouble(x0, y3, z2),
|
||||
getTypedSource().getDouble(x0, y3, z3),
|
||||
getTypedSource().getDouble(x1, y3, z0),
|
||||
getTypedSource().getDouble(x1, y3, z1),
|
||||
getTypedSource().getDouble(x1, y3, z2),
|
||||
getTypedSource().getDouble(x1, y3, z3),
|
||||
getTypedSource().getDouble(x2, y3, z0),
|
||||
getTypedSource().getDouble(x2, y3, z1),
|
||||
getTypedSource().getDouble(x2, y3, z2),
|
||||
getTypedSource().getDouble(x2, y3, z3),
|
||||
getTypedSource().getDouble(x3, y3, z0),
|
||||
getTypedSource().getDouble(x3, y3, z1),
|
||||
getTypedSource().getDouble(x3, y3, z2),
|
||||
getTypedSource().getDouble(x3, y3, z3),
|
||||
px, pz, py));
|
||||
//@done
|
||||
}
|
||||
|
||||
|
||||
@@ -50,15 +50,15 @@ public class TrilinearStream<T> extends BasicStream<T> implements Interpolator<T
|
||||
|
||||
//@builder
|
||||
return getTypedSource().fromDouble(IrisInterpolation.trilerp(
|
||||
getTypedSource().getDouble(x1, y1, z1),
|
||||
getTypedSource().getDouble(x2, y1, z1),
|
||||
getTypedSource().getDouble(x1, y1, z2),
|
||||
getTypedSource().getDouble(x2, y1, z2),
|
||||
getTypedSource().getDouble(x1, y2, z1),
|
||||
getTypedSource().getDouble(x2, y2, z1),
|
||||
getTypedSource().getDouble(x1, y2, z2),
|
||||
getTypedSource().getDouble(x2, y2, z2),
|
||||
px, pz, py));
|
||||
getTypedSource().getDouble(x1, y1, z1),
|
||||
getTypedSource().getDouble(x2, y1, z1),
|
||||
getTypedSource().getDouble(x1, y1, z2),
|
||||
getTypedSource().getDouble(x2, y1, z2),
|
||||
getTypedSource().getDouble(x1, y2, z1),
|
||||
getTypedSource().getDouble(x2, y2, z1),
|
||||
getTypedSource().getDouble(x1, y2, z2),
|
||||
getTypedSource().getDouble(x2, y2, z2),
|
||||
px, pz, py));
|
||||
//@done
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public class NullSafeStream<T> extends BasicStream<T> implements ProceduralStrea
|
||||
public T get(double x, double z) {
|
||||
T t = stream.get(x, z);
|
||||
|
||||
if (t == null) {
|
||||
if(t == null) {
|
||||
return ifNull;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class NullSafeStream<T> extends BasicStream<T> implements ProceduralStrea
|
||||
public T get(double x, double y, double z) {
|
||||
T t = stream.get(x, y, z);
|
||||
|
||||
if (t == null) {
|
||||
if(t == null) {
|
||||
return ifNull;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
public static void print(Consumer<String> printer, ProceduralStream<?> stream) {
|
||||
KList<ProfiledTail> tails = getTails(stream);
|
||||
int ind = tails.size();
|
||||
for (ProfiledTail i : tails) {
|
||||
for(ProfiledTail i : tails) {
|
||||
printer.accept(Form.repeat(" ", ind) + i);
|
||||
ind--;
|
||||
}
|
||||
@@ -54,11 +54,11 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
KList<ProceduralStream<?>> v = new KList<>();
|
||||
ProceduralStream<?> cursor = s;
|
||||
|
||||
for (int i = 0; i < 32; i++) {
|
||||
for(int i = 0; i < 32; i++) {
|
||||
v.add(cursor);
|
||||
cursor = nextChuld(cursor);
|
||||
|
||||
if (cursor == null) {
|
||||
if(cursor == null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
}
|
||||
|
||||
private static ProfiledTail getTail(ProceduralStream<?> t) {
|
||||
if (t instanceof ProfiledStream<?> s) {
|
||||
if(t instanceof ProfiledStream<?> s) {
|
||||
|
||||
return new ProfiledTail(s.getId(), s.getMetrics(), s.getClass().getSimpleName().replaceAll("\\QStream\\E", ""));
|
||||
}
|
||||
@@ -83,15 +83,15 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
private static KList<ProfiledTail> getTails(ProceduralStream<?> t) {
|
||||
KList<ProfiledTail> tails = new KList<>();
|
||||
|
||||
for (ProceduralStream<?> v : getAllChildren(t)) {
|
||||
for(ProceduralStream<?> v : getAllChildren(t)) {
|
||||
ProfiledTail p = getTail(v);
|
||||
|
||||
if (p != null) {
|
||||
if(p != null) {
|
||||
tails.add(p);
|
||||
}
|
||||
}
|
||||
|
||||
if (tails.isEmpty()) {
|
||||
if(tails.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
KList<ProfiledTail> tailx = new KList<>();
|
||||
tailx.add(cursor);
|
||||
|
||||
while (tails.isNotEmpty()) {
|
||||
while(tails.isNotEmpty()) {
|
||||
tailx.add(cursor);
|
||||
ProfiledTail parent = tails.popLast();
|
||||
parent.setChild(cursor);
|
||||
@@ -130,7 +130,7 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
T t = getTypedSource().get(x, z);
|
||||
try {
|
||||
metrics.put(p.getMilliseconds());
|
||||
} catch (Throwable e) {
|
||||
} catch(Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class ProfiledStream<T> extends BasicStream<T> {
|
||||
T t = getTypedSource().get(x, y, z);
|
||||
try {
|
||||
metrics.put(p.getMilliseconds());
|
||||
} catch (Throwable e) {
|
||||
} catch(Throwable e) {
|
||||
Iris.reportError(e);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,14 +43,14 @@ public class SemaphoreStream<T> extends BasicStream<T> {
|
||||
|
||||
@Override
|
||||
public T get(double x, double z) {
|
||||
synchronized (getTypedSource()) {
|
||||
synchronized(getTypedSource()) {
|
||||
return getTypedSource().get(x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public T get(double x, double y, double z) {
|
||||
synchronized (getTypedSource()) {
|
||||
synchronized(getTypedSource()) {
|
||||
return getTypedSource().get(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,14 +38,14 @@ public class SynchronizedStream<T> extends BasicStream<T> {
|
||||
|
||||
@Override
|
||||
public T get(double x, double z) {
|
||||
synchronized (getTypedSource()) {
|
||||
synchronized(getTypedSource()) {
|
||||
return getTypedSource().get(x, z);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public T get(double x, double y, double z) {
|
||||
synchronized (getTypedSource()) {
|
||||
synchronized(getTypedSource()) {
|
||||
return getTypedSource().get(x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user