24.09., 9:00 - 11:00: Due to updates GitLab will be unavailable for some minutes between 09:00 and 11:00.

Commit 1dec0b35 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen

rename geo utils class and remove the old GeometryUtils.

parent 0d0a4a27
......@@ -30,8 +30,8 @@ public class ComparablePoint extends VPoint implements
*/
@Override
public int compareTo(ComparablePoint p) {
if (Math.abs(this.x - p.x) < Utils.DOUBLE_EPS) {
if (Math.abs(this.y - p.y) < Utils.DOUBLE_EPS) {
if (Math.abs(this.x - p.x) < GeometryUtils.DOUBLE_EPS) {
if (Math.abs(this.y - p.y) < GeometryUtils.DOUBLE_EPS) {
return 0;
} else {
if (this.y > p.y) {
......
......@@ -21,11 +21,11 @@ import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VShape;
import org.vadere.geometry.shapes.VTriangle;
import static org.vadere.geometry.Utils.Orientation.CCW;
import static org.vadere.geometry.Utils.Orientation.COLLINEAR;
import static org.vadere.geometry.Utils.Orientation.CW;
import static org.vadere.geometry.GeometryUtils.Orientation.CCW;
import static org.vadere.geometry.GeometryUtils.Orientation.COLLINEAR;
import static org.vadere.geometry.GeometryUtils.Orientation.CW;
public class Utils {
public class GeometryUtils {
enum Orientation {
CCW,
......@@ -33,13 +33,13 @@ public class Utils {
COLLINEAR;
}
/**
/**T
* Constant for comparison of double values. Everything below this is
* considered equal.
*/
public static final double DOUBLE_EPS = 1e-8;
public static final Logger log = LogManager.getLogger(Utils.class);
public static final Logger log = LogManager.getLogger(GeometryUtils.class);
/**
* Interpolates between start and end with the given factor.
......@@ -500,9 +500,9 @@ public class Utils {
*/
public static boolean triangleContains(final IPoint p1, final IPoint p2, final IPoint p3, final IPoint r) {
boolean b1, b2, b3;
double d1 = Utils.ccw(r, p1, p2);
double d2 = Utils.ccw(r, p2, p3);
double d3 = Utils.ccw(r, p3, p1);
double d1 = GeometryUtils.ccw(r, p1, p2);
double d2 = GeometryUtils.ccw(r, p2, p3);
double d3 = GeometryUtils.ccw(r, p3, p1);
b1 = d1 < 0.0;
b2 = d2 < 0.0;
b3 = d3 < 0.0;
......@@ -836,7 +836,7 @@ public class Utils {
public static boolean isValid(@NotNull final VTriangle triangle) {
List<VPoint> points = triangle.getPoints();
return Utils.isLeftOf(points.get(0), points.get(1), points.get(2));
return GeometryUtils.isLeftOf(points.get(0), points.get(1), points.get(2));
}
public static double qualityOf(@NotNull final VTriangle triangle) {
......@@ -913,7 +913,7 @@ public class Utils {
VPoint q2 = path2.get((jj + 1) % path2.size());
if(intersectLineSegment(p1, p2, q1, q2)) {
VPoint intersectionPoint = Utils.lineIntersectionPoint(p1, p2, q1, q2);
VPoint intersectionPoint = GeometryUtils.lineIntersectionPoint(p1, p2, q1, q2);
intersectionPoints.add(intersectionPoint);
}
}
......@@ -973,7 +973,7 @@ public class Utils {
VPoint p2 = filteredList.get(i);
VPoint p3 = filteredList.get((i + 1) % filteredList.size());
if(p2.equals(p1) || p2.equals(p3) || Utils.distanceToLineSegment(p1, p3, p2) <= eps) {
if(p2.equals(p1) || p2.equals(p3) || GeometryUtils.distanceToLineSegment(p1, p3, p2) <= eps) {
filteredList.remove(i);
removePoint = true;
break;
......
......@@ -30,12 +30,12 @@ public class Vector2D extends VPoint {
public Vector2D normalize(double length) {
double rx, ry;
double vl = distance(ZERO);
if (Math.abs(x) < Utils.DOUBLE_EPS) {
if (Math.abs(x) < GeometryUtils.DOUBLE_EPS) {
rx = 0;
} else {
rx = x / vl * length;
}
if (Math.abs(y) < Utils.DOUBLE_EPS) {
if (Math.abs(y) < GeometryUtils.DOUBLE_EPS) {
ry = 0;
} else {
ry = y / vl * length;
......@@ -71,7 +71,7 @@ public class Vector2D extends VPoint {
* Result is in interval (0,2*PI) according to standard math usage.
*/
public double angleTo(VPoint center) {
return Utils.angleTo(this, center);
return GeometryUtils.angleTo(this, center);
}
public Vector2D add(VPoint p) {
......
......@@ -3,7 +3,7 @@ package org.vadere.geometry.mesh.gen;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.SpaceFillingCurve;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IPointLocator;
......@@ -589,7 +589,7 @@ public class AMesh<P extends IPoint> implements IMesh<P, AVertex<P>, AHalfEdge<P
List<VPoint> centroids = new ArrayList<>(this.numberOfFaces);
for(int i = 0; i < this.faces.size(); i++) {
VPoint incenter = Utils.getCentroid(this.getVertices(faces.get(i)));
VPoint incenter = GeometryUtils.getCentroid(this.getVertices(faces.get(i)));
centroids.add(incenter);
maxX = Math.max(maxX, incenter.getX());
maxY = Math.max(maxY, incenter.getY());
......
......@@ -2,7 +2,7 @@ package org.vadere.geometry.mesh.gen;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.mesh.inter.*;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VLine;
......@@ -73,6 +73,6 @@ public class ConstrainedTriangulation<P extends IPoint, V extends IVertex<P>, E
* @return
*/
private boolean faceIntersectsLine(final F face, IPoint p1, IPoint p2) {
return getMesh().streamEdges(face).anyMatch(edge -> Utils.intersectLine(p1, p2, getMesh().getPoint(edge), getMesh().getPoint(getMesh().getPrev(edge))));
return getMesh().streamEdges(face).anyMatch(edge -> GeometryUtils.intersectLine(p1, p2, getMesh().getPoint(edge), getMesh().getPoint(getMesh().getPrev(edge))));
}
}
......@@ -4,7 +4,7 @@ import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IMesh;
......@@ -378,7 +378,7 @@ public class DelaunayHierarchy<P extends IPoint, V extends IVertex<P>, E extends
E edge = tri.getMesh().closestEdge(face, point.getX(), point.getY());
P p1 = tri.getMesh().getPoint(tri.getMesh().getPrev(edge));
P p2 = tri.getMesh().getPoint(edge);
return Utils.isOnEdge(p1, p2, point, tolerance);
return GeometryUtils.isOnEdge(p1, p2, point, tolerance);
}
@Override
......
......@@ -4,7 +4,7 @@ import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.mesh.inter.ITriConnectivity;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.mesh.iterators.FaceIterator;
......@@ -89,7 +89,7 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
this.mesh = mesh;
this.points = points;
this.illegalPredicate = illegalPredicate;
this.bound = Utils.bound(points, epsilon);
this.bound = GeometryUtils.bound(points, epsilon);
this.finalized = false;
this.initialized = false;
this.mesh = mesh;
......@@ -157,7 +157,7 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
this.mesh = mesh;
this.points = new HashSet<>();
this.illegalPredicate = illegalPredicate;
this.bound = Utils.bound(mesh.getPoints(mesh.getBorder()), epsilon);
this.bound = GeometryUtils.bound(mesh.getPoints(mesh.getBorder()), epsilon);
this.initialized = false;
this.finalized = false;
this.virtualVertices = new ArrayList<>();
......@@ -305,7 +305,7 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
initialized = false;
finalized = false;
points = mesh.getPoints();
bound = Utils.bound(points, epsilon);
bound = GeometryUtils.bound(points, epsilon);
mesh.clear();
setPointLocator(type);
compute();
......@@ -331,7 +331,7 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
log.info("ignore insertion point, since the point " + point + " already exists or it is too close to another point!");
return edge;
}
if(Utils.isOnEdge(p1, p2, point, edgeCoincidenceTolerance)) {
if(GeometryUtils.isOnEdge(p1, p2, point, edgeCoincidenceTolerance)) {
//log.info("splitEdge()");
E newEdge = getAnyEdge(splitEdge(point, edge, true));
insertEvent(newEdge);
......@@ -589,7 +589,7 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
//return Utils.isInCircumscribedCycle(x, y, z, p);
//if(Utils.ccw(z,x,y) > 0) {
return Utils.isInsideCircle(z, x, y, p);
return GeometryUtils.isInsideCircle(z, x, y, p);
//}
//else {
// return Utils.isInsideCircle(x, z, y, p);
......@@ -638,7 +638,7 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
//return Utils.isInCircumscribedCycle(x, y, z, p);
//if(Utils.ccw(z,x,y) > 0) {
return Utils.isInsideCircle(z, x, y, p);
return GeometryUtils.isInsideCircle(z, x, y, p);
//}
//else {
// return Utils.isInsideCircle(x, z, y, p);
......
......@@ -5,7 +5,7 @@ import com.google.common.collect.Lists;
import org.apache.commons.lang3.tuple.Triple;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.mesh.gen.PFace;
import org.vadere.geometry.mesh.gen.PHalfEdge;
import org.vadere.geometry.mesh.gen.PMesh;
......@@ -1720,7 +1720,7 @@ public interface IMesh<P extends IPoint, V extends IVertex<P>, E extends IHalfEd
E result = null;
double minDistance = Double.MAX_VALUE;
for (E edge : getEdgeIt(face)) {
double distance = Utils.distanceToLineSegment(getPoint(getPrev(edge)), getPoint(edge), x, y);
double distance = GeometryUtils.distanceToLineSegment(getPoint(getPrev(edge)), getPoint(edge), x, y);
if(distance < minDistance) {
result = edge;
minDistance = distance;
......
......@@ -3,7 +3,7 @@ package org.vadere.geometry.mesh.inter;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.mesh.gen.IncrementalTriangulation;
import org.vadere.geometry.mesh.iterators.EdgeIterator;
import org.vadere.geometry.shapes.IPoint;
......@@ -750,7 +750,7 @@ public interface IPolyConnectivity<P extends IPoint, V extends IVertex<P>, E ext
default boolean isRightOf(final double x1, final double y1, final E edge) {
V v1 = getMesh().getVertex(getMesh().getPrev(edge));
V v2 = getMesh().getVertex(edge);
return Utils.isRightOf(v1.getX(), v1.getY(), v2.getX(), v2.getY(), x1, y1);
return GeometryUtils.isRightOf(v1.getX(), v1.getY(), v2.getX(), v2.getY(), x1, y1);
}
/**
......@@ -767,7 +767,7 @@ public interface IPolyConnectivity<P extends IPoint, V extends IVertex<P>, E ext
default boolean isLeftOf(final double x1, final double y1, final E edge) {
V v1 = getMesh().getVertex(getMesh().getPrev(edge));
V v2 = getMesh().getVertex(edge);
return Utils.isLeftOf(v1.getX(), v1.getY(), v2.getX(), v2.getY(), x1, y1);
return GeometryUtils.isLeftOf(v1.getX(), v1.getY(), v2.getX(), v2.getY(), x1, y1);
}
/**
......@@ -783,7 +783,7 @@ public interface IPolyConnectivity<P extends IPoint, V extends IVertex<P>, E ext
default boolean intersects(final IPoint p1, final IPoint p2, E edge) {
V v1 = getMesh().getVertex(getMesh().getPrev(edge));
V v2 = getMesh().getVertex(edge);
return Utils.intersectLine(p1.getX(), p1.getY(), p2.getX(), p2.getY(), v1.getX(), v1.getY(), v2.getX(), v2.getY());
return GeometryUtils.intersectLine(p1.getX(), p1.getY(), p2.getX(), p2.getY(), v1.getX(), v1.getY(), v2.getX(), v2.getY());
}
......
......@@ -4,7 +4,7 @@ import org.apache.commons.lang3.tuple.Pair;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VPoint;
......@@ -93,7 +93,7 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
* @param point the new point of the vertex
*/
default void replacePoint(@NotNull final V vertex, @NotNull final P point) {
assert Utils.toPolygon(getMesh().getPoint(vertex)).contains(point);
assert GeometryUtils.toPolygon(getMesh().getPoint(vertex)).contains(point);
getMesh().setPoint(vertex, point);
}
......@@ -565,7 +565,7 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
P p2 = getMesh().getPoint(getMesh().getNext(edge));
P p3 = getMesh().getPoint(getMesh().getPrev(edge));
return Utils.isCCW(p1.getX(), p1.getY(), p2.getX(), p2.getY(), p3.getX(), p3.getY());
return GeometryUtils.isCCW(p1.getX(), p1.getY(), p2.getX(), p2.getY(), p3.getX(), p3.getY());
}
/**
......@@ -798,8 +798,8 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
E prev = getMesh().getPrev(boundaryEdge);
// can we form a triangle
assert Utils.isCCW(getMesh().toPoint(prev), getMesh().toPoint(boundaryEdge), getMesh().toPoint(next))
&& Utils.angle(getMesh().toPoint(prev), getMesh().toPoint(boundaryEdge), getMesh().toPoint(next)) < Math.PI;
assert GeometryUtils.isCCW(getMesh().toPoint(prev), getMesh().toPoint(boundaryEdge), getMesh().toPoint(next))
&& GeometryUtils.angle(getMesh().toPoint(prev), getMesh().toPoint(boundaryEdge), getMesh().toPoint(next)) < Math.PI;
E nnext = getMesh().getNext(next);
......@@ -1141,13 +1141,13 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
// TODO: still required?
default E walkThroughHole(@NotNull VPoint q, @NotNull VPoint p, @NotNull E enteringEdge) {
assert Utils.intersectLine(q, p, getMesh().getPoint(enteringEdge), getMesh().getPoint(getMesh().getPrev(enteringEdge)));
assert GeometryUtils.intersectLine(q, p, getMesh().getPoint(enteringEdge), getMesh().getPoint(getMesh().getPrev(enteringEdge)));
E next = getMesh().getNext(enteringEdge);
while (enteringEdge != next) {
VPoint p1 = getMesh().toPoint(getMesh().getVertex(enteringEdge));
VPoint p2 = getMesh().toPoint(getMesh().getVertex(getMesh().getPrev(enteringEdge)));
if(Utils.intersectLine(q, p, p1, p2)) {
if(GeometryUtils.intersectLine(q, p, p1, p2)) {
return next;
}
......@@ -1291,8 +1291,8 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
VPoint q = getMesh().toPoint(getMesh().getNext(edge));
VPoint r = getMesh().toPoint(getMesh().getPrev(edge));
if(Utils.isCCW(r, p, q)) {
double angle = Utils.angle(r, p, q);
if(GeometryUtils.isCCW(r, p, q)) {
double angle = GeometryUtils.angle(r, p, q);
if(angle < 0.5*Math.PI) {
createFaceAtBoundary(edge);
}
......@@ -1318,8 +1318,8 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
VPoint q = getMesh().toPoint(getMesh().getNext(edge));
VPoint r = getMesh().toPoint(getMesh().getPrev(edge));
if(Utils.isCCW(r, p, q)) {
double angle = Utils.angle(r, p, q);
if(GeometryUtils.isCCW(r, p, q)) {
double angle = GeometryUtils.angle(r, p, q);
if(angle < 0.5*Math.PI) {
createFaceAtBoundary(edge);
}
......@@ -1689,17 +1689,17 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
first = false;
prevFace = face;
if (Utils.isRightOf(v3, v1, x1, y1)) {
if (GeometryUtils.isRightOf(v3, v1, x1, y1)) {
face = getMesh().getTwinFace(e1);
continue;
}
if (Utils.isRightOf(v1, v2, x1, y1)) {
if (GeometryUtils.isRightOf(v1, v2, x1, y1)) {
face = getMesh().getTwinFace(e2);
continue;
}
if (Utils.isRightOf(v2, v3, x1, y1)) {
if (GeometryUtils.isRightOf(v2, v3, x1, y1)) {
face = getMesh().getTwinFace(e3);
continue;
}
......@@ -1707,12 +1707,12 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
if(prevFace == getMesh().getTwinFace(e1)) {
prevFace = face;
if (Utils.isRightOf(v2, v3, x1, y1)) {
if (GeometryUtils.isRightOf(v2, v3, x1, y1)) {
face = getMesh().getTwinFace(e3);
continue;
}
if(Utils.isRightOf(v1, v2, x1, y1)) {
if(GeometryUtils.isRightOf(v1, v2, x1, y1)) {
face = getMesh().getTwinFace(e2);
continue;
}
......@@ -1721,12 +1721,12 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
else if(prevFace == getMesh().getTwinFace(e2)) {
prevFace = face;
if (Utils.isRightOf(v3, v1, x1, y1)) {
if (GeometryUtils.isRightOf(v3, v1, x1, y1)) {
face = getMesh().getTwinFace(e1);
continue;
}
if (Utils.isRightOf(v2, v3, x1, y1)) {
if (GeometryUtils.isRightOf(v2, v3, x1, y1)) {
face = getMesh().getTwinFace(e3);
continue;
}
......@@ -1735,12 +1735,12 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
else {
prevFace = face;
if(Utils.isRightOf(v1, v2, x1, y1)) {
if(GeometryUtils.isRightOf(v1, v2, x1, y1)) {
face = getMesh().getTwinFace(e2);
continue;
}
if (Utils.isRightOf(v3, v1, x1, y1)) {
if (GeometryUtils.isRightOf(v3, v1, x1, y1)) {
face = getMesh().getTwinFace(e1);
continue;
}
......@@ -1751,12 +1751,12 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
if(prevFace == getMesh().getTwinFace(e1)) {
prevFace = face;
if(Utils.isRightOf(v1, v2, x1, y1)) {
if(GeometryUtils.isRightOf(v1, v2, x1, y1)) {
face = getMesh().getTwinFace(e2);
continue;
}
if (Utils.isRightOf(v2, v3, x1, y1)) {
if (GeometryUtils.isRightOf(v2, v3, x1, y1)) {
face = getMesh().getTwinFace(e3);
continue;
}
......@@ -1765,12 +1765,12 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
else if(prevFace == getMesh().getTwinFace(e2)) {
prevFace = face;
if (Utils.isRightOf(v2, v3, x1, y1)) {
if (GeometryUtils.isRightOf(v2, v3, x1, y1)) {
face = getMesh().getTwinFace(e3);
continue;
}
if (Utils.isRightOf(v3, v1, x1, y1)) {
if (GeometryUtils.isRightOf(v3, v1, x1, y1)) {
face = getMesh().getTwinFace(e1);
continue;
}
......@@ -1779,12 +1779,12 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
else {
prevFace = face;
if (Utils.isRightOf(v3, v1, x1, y1)) {
if (GeometryUtils.isRightOf(v3, v1, x1, y1)) {
face = getMesh().getTwinFace(e1);
continue;
}
if(Utils.isRightOf(v1, v2, x1, y1)) {
if(GeometryUtils.isRightOf(v1, v2, x1, y1)) {
face = getMesh().getTwinFace(e2);
continue;
}
......@@ -1858,7 +1858,7 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
V v2 = getMesh().getVertex(e2);
V v3 = getMesh().getVertex(e3);
return Utils.isInsideCircle(v1, v2, v3, x1, y1);
return GeometryUtils.isInsideCircle(v1, v2, v3, x1, y1);
}
/*default boolean contains(F face, double x, double y) {
......@@ -2034,11 +2034,11 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
P p1 = getMesh().getPoint(getMesh().getPrev(edge));
P p2 = getMesh().getPoint(edge);
P p3 = getMesh().getPoint(getMesh().getNext(edge));
boolean valid = Utils.isLeftOf(p1, p2, p3);
boolean valid = GeometryUtils.isLeftOf(p1, p2, p3);
if(!valid) {
log.info(p1 + ", " + p2 + ", " + p3);
}
return Utils.isLeftOf(p1, p2, p3);
return GeometryUtils.isLeftOf(p1, p2, p3);
};
return getMesh().streamFaces().filter(f -> !getMesh().isDestroyed(f)).filter(f -> !getMesh().isBoundary(f)).allMatch(orientationPredicate);
......@@ -2059,7 +2059,7 @@ public interface ITriConnectivity<P extends IPoint, V extends IVertex<P>, E exte
P p1 = getMesh().getPoint(getMesh().getPrev(edge));
P p2 = getMesh().getPoint(edge);
P p3 = getMesh().getPoint(getMesh().getNext(edge));
return Utils.isLeftOf(p1, p2, p3);
return GeometryUtils.isLeftOf(p1, p2, p3);
};
return !getMesh().isBoundary(face) && orientationPredicate.test(face);
......
......@@ -2,7 +2,7 @@ package org.vadere.geometry.mesh.inter;
import org.apache.commons.lang3.RandomUtils;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.mesh.gen.*;
import org.vadere.geometry.mesh.impl.VPTriangulation;
import org.vadere.geometry.shapes.IPoint;
......@@ -121,7 +121,7 @@ public interface ITriangulation<P extends IPoint, V extends IVertex<P>, E extend
final IPointLocator.Type type,
final Collection<P> points,
final IPointConstructor<P> pointConstructor) {
ITriangulation<P, PVertex<P>, PHalfEdge<P>, PFace<P>> triangulation = createPTriangulation(type, Utils.bound(points), pointConstructor);
ITriangulation<P, PVertex<P>, PHalfEdge<P>, PFace<P>> triangulation = createPTriangulation(type, GeometryUtils.bound(points), pointConstructor);
triangulation.insert(points);
return triangulation;
}
......@@ -130,7 +130,7 @@ public interface ITriangulation<P extends IPoint, V extends IVertex<P>, E extend
final IPointLocator.Type type,
final Collection<P> points,
final IPointConstructor<P> pointConstructor) {
ITriangulation<P, AVertex<P>, AHalfEdge<P>, AFace<P>> triangulation = createATriangulation(type, Utils.bound(points), pointConstructor);
ITriangulation<P, AVertex<P>, AHalfEdge<P>, AFace<P>> triangulation = createATriangulation(type, GeometryUtils.bound(points), pointConstructor);
triangulation.insert(points);
return triangulation;
}
......
package org.vadere.geometry.mesh.triangulation;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.mesh.gen.PFace;
import org.vadere.geometry.mesh.gen.PHalfEdge;
import org.vadere.geometry.mesh.gen.PVertex;
......@@ -21,7 +21,7 @@ public class Example {
public static void main(String... args) {
// define a bounding box
VPolygon boundary = Utils.polygonFromPoints2D(
VPolygon boundary = GeometryUtils.polygonFromPoints2D(
new VPoint(0,0),
new VPoint(0, 1),
new VPoint(1, 2),
......
......@@ -3,7 +3,7 @@ package org.vadere.geometry.mesh.triangulation.improver;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.mesh.inter.*;
import org.vadere.geometry.shapes.IPoint;
......@@ -372,7 +372,7 @@ public class EikMesh<P extends EikMeshPoint, V extends IVertex<P>, E extends IHa
VPoint p = getMesh().toPoint(vertex);
VPoint q = getMesh().toPoint(getMesh().getNext(boundaryEdge));
VPoint r = getMesh().toPoint(getMesh().getPrev(boundaryEdge));
double angle = Utils.angle(r, p, q);
double angle = GeometryUtils.angle(r, p, q);
// back projection to the inside i.e. towards the inside of its triangle
if(distance > 0) {
......@@ -384,7 +384,7 @@ public class EikMesh<P extends EikMeshPoint, V extends IVertex<P>, E extends IHa
}
// back projection to the outside
else {
if(angle > Math.PI || (Utils.isLeftOf(r, p, newPosition) && Utils.isLeftOf(p, q, newPosition))) {
if(angle > Math.PI || (GeometryUtils.isLeftOf(r, p, newPosition) && GeometryUtils.isLeftOf(p, q, newPosition))) {
position.subtract(projection);
}
else {
......
package org.vadere.geometry.mesh.triangulation.improver.distmesh;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VTriangle;
......@@ -61,7 +61,7 @@ public class DistmeshPanel extends Canvas {
graphics.fill(triangle);
}
else {
float quality = (float) Utils.qualityOf(triangle);
float quality = (float) GeometryUtils.qualityOf(triangle);
graphics.setColor(new Color(quality, quality, quality));
graphics.fill(triangle);
}
......
package org.vadere.geometry.mesh.triangulation.plots;
import org.apache.commons.lang3.time.StopWatch;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.mesh.gen.PFace;
import org.vadere.geometry.mesh.gen.PHalfEdge;
import org.vadere.geometry.mesh.gen.PVertex;
......@@ -255,7 +255,7 @@ public class RealWorldPlot {
public static void main(String... args) {
VPolygon boundary = Utils.polygonFromPoints2D(
VPolygon boundary = GeometryUtils.polygonFromPoints2D(
new VPoint(0,0),
new VPoint(0, 1),
new VPoint(1, 2),
......
......@@ -3,7 +3,7 @@ package org.vadere.geometry.mesh.triangulation.triangulator;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.geometry.Utils;
import org.vadere.geometry.GeometryUtils;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.mesh.inter.*;
import org.vadere.geometry.shapes.*;
......@@ -546,8 +546,8 @@ public class UniformRefinementTriangulatorSFC<P extends IPoint, V extends IVerte
VPoint q = getMesh().toPoint(getMesh().getNext(edge));
VPoint r = getMesh().toPoint(getMesh().getPrev(edge));
if(Utils.isCCW(r, p, q)) {
double angle = Utils.angle(r, p, q);
if(GeometryUtils.isCCW(r, p, q)) {
double angle = GeometryUtils.angle(r, p, q);