Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

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

Commit 1c5e5874 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

construct a new module called geometry and extracting the classes from the utils module.

parent 35ebbaa9
package org.vadere.util.geometry.mesh.iterators;
package org.vadere.geometry.mesh.iterators;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.shapes.IPoint;
import java.util.Iterator;
......
package org.vadere.util.geometry.mesh.iterators;
package org.vadere.geometry.mesh.iterators;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.shapes.IPoint;
import java.util.HashSet;
import java.util.Iterator;
......
package org.vadere.util.geometry.mesh.iterators;
package org.vadere.geometry.mesh.iterators;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.shapes.IPoint;
import java.util.Iterator;
......
package org.vadere.util.geometry.mesh.iterators;
package org.vadere.geometry.mesh.iterators;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.shapes.IPoint;
import java.util.Iterator;
......
package org.vadere.util.geometry.mesh.iterators;
package org.vadere.geometry.mesh.iterators;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.shapes.IPoint;
import java.util.Iterator;
......
package org.vadere.util.geometry.mesh.iterators;
package org.vadere.geometry.mesh.iterators;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.shapes.IPoint;
import java.util.Iterator;
......
package org.vadere.util.geometry.mesh.triangulation;
package org.vadere.geometry.mesh.triangulation;
import org.apache.commons.lang3.tuple.ImmutableTriple;
import org.apache.commons.lang3.tuple.Triple;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VLine;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VCircle;
import org.vadere.geometry.shapes.VLine;
import org.vadere.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VTriangle;
import javax.swing.*;
import java.awt.*;
......
package org.vadere.util.geometry.mesh.triangulation;
import org.apache.commons.lang3.time.StopWatch;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.mesh.gen.PFace;
import org.vadere.util.geometry.mesh.gen.PHalfEdge;
import org.vadere.util.geometry.mesh.gen.PVertex;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPanel;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.util.geometry.mesh.triangulation.improver.PEikMesh;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
package org.vadere.geometry.mesh.triangulation;
import org.vadere.geometry.Utils;
import org.vadere.geometry.mesh.gen.PFace;
import org.vadere.geometry.mesh.gen.PHalfEdge;
import org.vadere.geometry.mesh.gen.PVertex;
import org.vadere.geometry.mesh.triangulation.improver.EikMeshPanel;
import org.vadere.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.geometry.mesh.triangulation.improver.PEikMesh;
import org.vadere.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VPolygon;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VShape;
import java.util.ArrayList;
import java.util.List;
......@@ -22,7 +21,7 @@ public class Example {
public static void main(String... args) {
// define a bounding box
VPolygon boundary = GeometryUtils.polygonFromPoints2D(
VPolygon boundary = Utils.polygonFromPoints2D(
new VPoint(0,0),
new VPoint(0, 1),
new VPoint(1, 2),
......
package org.vadere.util.geometry.mesh.triangulation.adaptive;
package org.vadere.geometry.mesh.triangulation.adaptive;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VPolygon;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VShape;
import java.util.Collection;
......
package org.vadere.util.geometry.mesh.triangulation.adaptive;
package org.vadere.geometry.mesh.triangulation.adaptive;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.IPoint;
import java.util.function.Function;
......
package org.vadere.util.geometry.mesh.triangulation.adaptive;
package org.vadere.geometry.mesh.triangulation.adaptive;
import org.apache.commons.lang3.time.StopWatch;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.geometry.mesh.gen.*;
import org.vadere.util.geometry.mesh.inter.IMeshSupplier;
import org.vadere.util.geometry.mesh.inter.ITriangulation;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPanel;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.util.geometry.mesh.inter.IPointConstructor;
import org.vadere.util.geometry.mesh.triangulation.triangulator.UniformRefinementTriangulatorSFC;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.mesh.gen.*;
import org.vadere.geometry.mesh.inter.IMeshSupplier;
import org.vadere.geometry.mesh.inter.ITriangulation;
import org.vadere.geometry.mesh.triangulation.improver.EikMeshPanel;
import org.vadere.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.mesh.inter.IPointConstructor;
import org.vadere.geometry.mesh.triangulation.triangulator.UniformRefinementTriangulatorSFC;
import javax.swing.*;
......
package org.vadere.util.geometry.mesh.triangulation.improver;
package org.vadere.geometry.mesh.triangulation.improver;
import org.jetbrains.annotations.NotNull;
import org.vadere.util.geometry.mesh.gen.AFace;
import org.vadere.util.geometry.mesh.gen.AHalfEdge;
import org.vadere.util.geometry.mesh.gen.AMesh;
import org.vadere.util.geometry.mesh.gen.AVertex;
import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.mesh.gen.AFace;
import org.vadere.geometry.mesh.gen.AHalfEdge;
import org.vadere.geometry.mesh.gen.AMesh;
import org.vadere.geometry.mesh.gen.AVertex;
import org.vadere.geometry.shapes.VPolygon;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VShape;
import org.vadere.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import java.util.Collection;
......
package org.vadere.util.geometry.mesh.triangulation.improver;
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.util.geometry.GeometryUtils;
import org.vadere.util.geometry.mesh.inter.*;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VLine;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.DistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.util.geometry.mesh.triangulation.improver.distmesh.Parameters;
import org.vadere.util.geometry.mesh.triangulation.triangulator.ITriangulator;
import org.vadere.util.geometry.mesh.triangulation.triangulator.UniformRefinementTriangulatorSFC;
import org.vadere.geometry.Utils;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.mesh.inter.*;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VLine;
import org.vadere.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VPolygon;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VShape;
import org.vadere.geometry.shapes.VTriangle;
import org.vadere.geometry.mesh.triangulation.adaptive.DistanceFunction;
import org.vadere.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.geometry.mesh.triangulation.improver.distmesh.Parameters;
import org.vadere.geometry.mesh.triangulation.triangulator.ITriangulator;
import org.vadere.geometry.mesh.triangulation.triangulator.UniformRefinementTriangulatorSFC;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
......@@ -372,19 +372,19 @@ 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 = GeometryUtils.angle(r, p, q);
double angle = Utils.angle(r, p, q);
// back projection to the inside i.e. towards the inside of its triangle
if(distance > 0) {
//if(GeometryUtils.isRightOf(r, p, newPosition)
// && GeometryUtils.isRightOf(p, q, newPosition)
// && GeometryUtils.isRightOf(q, r, newPosition)){
//if(Utils.isRightOf(r, p, newPosition)
// && Utils.isRightOf(p, q, newPosition)
// && Utils.isRightOf(q, r, newPosition)){
position.subtract(projection);
//}
}
// back projection to the outside
else {
if(angle > Math.PI || (GeometryUtils.isLeftOf(r, p, newPosition) && GeometryUtils.isLeftOf(p, q, newPosition))) {
if(angle > Math.PI || (Utils.isLeftOf(r, p, newPosition) && Utils.isLeftOf(p, q, newPosition))) {
position.subtract(projection);
}
else {
......
package org.vadere.util.geometry.mesh.triangulation.improver;
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.util.color.ColorHelper;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.*;
import org.vadere.geometry.color.ColorHelper;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.shapes.*;
import java.awt.*;
import java.awt.image.BufferedImage;
......
package org.vadere.util.geometry.mesh.triangulation.improver;
package org.vadere.geometry.mesh.triangulation.improver;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.MPoint;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.potential.PathFindingTag;
import org.vadere.util.potential.calculators.PotentialPoint;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.MPoint;
import org.vadere.geometry.shapes.VPoint;
public class EikMeshPoint extends MPoint implements PotentialPoint, Cloneable {
public class EikMeshPoint extends MPoint implements Cloneable {
private boolean fixPoint;
private IPoint velocity;
private double absoluteForce;
private double maxTraveldistance;
private IPoint lastPosition;
private double potential;
private PathFindingTag tag;
public EikMeshPoint(final double x, final double y, boolean fixPoint){
super(x, y);
this.fixPoint = fixPoint;
this.potential = Double.MAX_VALUE;
this.velocity = new VPoint(0,0);
this.tag = PathFindingTag.Undefined;
this.maxTraveldistance = 0;
this.lastPosition = new VPoint(x, y);
}
......@@ -89,29 +83,9 @@ public class EikMeshPoint extends MPoint implements PotentialPoint, Cloneable {
return maxTraveldistance;
}
@Override
public double getPotential() {
return potential;
}
@Override
public void setPotential(double potential) {
this.potential = potential;
}
@Override
public void setPathFindingTag(final PathFindingTag tag) {
this.tag = tag;
}
@Override
public PathFindingTag getPathFindingTag() {
return tag;
}
@Override
public String toString() {
return super.toString() + "/" + tag + "/" + potential;
return super.toString() + "/" + fixPoint + "/" + velocity;
}
@Override
......
package org.vadere.util.geometry.mesh.triangulation.improver;
package org.vadere.geometry.mesh.triangulation.improver;
import org.vadere.util.geometry.mesh.inter.*;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VLine;
import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.geometry.mesh.inter.*;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VLine;
import org.vadere.geometry.shapes.VTriangle;
import java.util.Collection;
......
package org.vadere.util.geometry.mesh.triangulation.improver;
package org.vadere.geometry.mesh.triangulation.improver;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.geometry.mesh.gen.PFace;
import org.vadere.util.geometry.mesh.gen.PHalfEdge;
import org.vadere.util.geometry.mesh.gen.PVertex;
import org.vadere.util.geometry.mesh.inter.IMesh;
import org.vadere.util.geometry.mesh.inter.IPointLocator;
import org.vadere.util.geometry.mesh.inter.ITriangulation;
import org.vadere.util.geometry.shapes.*;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.util.geometry.mesh.triangulation.triangulator.RandomPointsSetTriangulator;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.mesh.gen.PFace;
import org.vadere.geometry.mesh.gen.PHalfEdge;
import org.vadere.geometry.mesh.gen.PVertex;
import org.vadere.geometry.mesh.inter.IMesh;
import org.vadere.geometry.mesh.inter.IPointLocator;
import org.vadere.geometry.mesh.inter.ITriangulation;
import org.vadere.geometry.shapes.*;
import org.vadere.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.geometry.mesh.triangulation.triangulator.RandomPointsSetTriangulator;
import java.util.ArrayList;
import java.util.Collection;
......
package org.vadere.util.geometry.mesh.triangulation.improver;
package org.vadere.geometry.mesh.triangulation.improver;
import org.jetbrains.annotations.NotNull;
import org.vadere.util.geometry.mesh.gen.*;
import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.mesh.gen.*;
import org.vadere.geometry.shapes.VPolygon;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VShape;
import org.vadere.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import java.util.Collection;
......@@ -21,7 +21,8 @@ public class PEikMesh extends EikMesh<EikMeshPoint, PVertex<EikMeshPoint>, PHalf
double initialEdgeLen,
@NotNull VRectangle bound,
@NotNull Collection<? extends VShape> obstacleShapes) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound, obstacleShapes,
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound, obstacleShapes,
() -> new PMesh<>((x, y) -> new EikMeshPoint(x, y, false)));
}
......
package org.vadere.util.geometry.mesh.triangulation.improver.distmesh;
package org.vadere.geometry.mesh.triangulation.improver.distmesh;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.GeometryFactory;
......@@ -8,17 +8,17 @@ import com.vividsolutions.jts.triangulate.DelaunayTriangulationBuilder;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.geometry.ConstantLineIterator;
import org.vadere.util.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.MLine;
import org.vadere.util.geometry.shapes.VLine;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.geometry.ConstantLineIterator;
import org.vadere.geometry.IDistanceFunction;
import org.vadere.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.MLine;
import org.vadere.geometry.shapes.VLine;
import org.vadere.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VShape;
import org.vadere.geometry.shapes.VTriangle;
import java.util.*;
import java.util.function.Function;
......
package org.vadere.util.geometry.mesh.triangulation.improver.distmesh;
package org.vadere.geometry.mesh.triangulation.improver.distmesh;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.geometry.Utils;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VTriangle;
import java.awt.*;
import java.awt.image.BufferedImage;
......@@ -61,7 +61,7 @@ public class DistmeshPanel extends Canvas {
graphics.fill(triangle);
}
else {
float quality = (float) GeometryUtils.qualityOf(triangle);
float quality = (float) Utils.qualityOf(triangle);
graphics.setColor(new Color(quality, quality, quality));
graphics.fill(triangle);
}
......
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