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 35ebbaa9 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

comment and refactoring of the EikMesh-library.

parent daac5376
......@@ -27,10 +27,10 @@ import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.util.potential.CellGrid;
import org.vadere.util.potential.CellState;
import org.vadere.util.potential.PathFindingTag;
import org.vadere.util.triangulation.adaptive.DistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.DistanceFunction;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.util.triangulation.adaptive.MeshPoint;
import org.vadere.util.triangulation.improver.PPSMeshing;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.util.geometry.mesh.triangulation.improver.PEikMesh;
import org.vadere.util.voronoi.VoronoiDiagram;
import java.awt.*;
......@@ -87,7 +87,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
public T config;
private ITriangulation<MeshPoint, PVertex<MeshPoint>, PHalfEdge<MeshPoint>, PFace<MeshPoint>> triangulation;
private ITriangulation<EikMeshPoint, PVertex<EikMeshPoint>, PHalfEdge<EikMeshPoint>, PFace<EikMeshPoint>> triangulation;
private Collection<VTriangle> triangles;
......@@ -557,7 +557,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
0.3,
bound, getTopography().getObstacles().stream().map(obs -> obs.getShape()).collect(Collectors.toList()));*/
PPSMeshing meshImprover = new PPSMeshing(
PEikMesh meshImprover = new PEikMesh(
distanceFunc,
p -> Math.min(1.0 + Math.max(approxDistance.apply(p)*approxDistance.apply(p), 0)*0.3, 5.0),
0.35,
......@@ -584,7 +584,7 @@ public abstract class DefaultModel<T extends DefaultConfig> extends Observable i
notifyObservers();
}
//meshImprover.improve();
Function<PFace<MeshPoint>, Color> colorFunction = f -> {
Function<PFace<EikMeshPoint>, Color> colorFunction = f -> {
float grayScale = (float) meshImprover.faceToQuality(f);
return triangulation.isValid(f) ? new Color(grayScale, grayScale, grayScale) : Color.RED;
};
......
......@@ -7,20 +7,15 @@ import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.mesh.gen.AFace;
import org.vadere.util.geometry.mesh.gen.AHalfEdge;
import org.vadere.util.geometry.mesh.gen.AVertex;
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.shapes.VCircle;
import org.vadere.util.geometry.shapes.VDisc;
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.triangulation.adaptive.DistanceFunction;
import org.vadere.util.triangulation.adaptive.MeshPoint;
import org.vadere.util.triangulation.adaptive.PSMeshingPanel;
import org.vadere.util.triangulation.improver.APSMeshing;
import org.vadere.util.triangulation.improver.PPSMeshing;
import org.vadere.util.geometry.mesh.triangulation.adaptive.DistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPanel;
import org.vadere.util.geometry.mesh.triangulation.improver.AEikMesh;
import java.awt.*;
import java.io.IOException;
......@@ -48,25 +43,25 @@ public class RecordTriangulationMovie {
DistanceFunction distanceFunction = new DistanceFunction(boundary, Arrays.asList(disc));
//obstacleShapes.add(rect);
APSMeshing meshImprover = new APSMeshing(
AEikMesh meshImprover = new AEikMesh(
distanceFunction,
p -> 1.0 + 10*Math.max(0, -distanceFunction.apply(p)),
0.05,
bbound,
obstacleShapes);
Function<AFace<MeshPoint>, Color> colorFunction1 = f -> {
Function<AFace<EikMeshPoint>, Color> colorFunction1 = f -> {
float q = Math.max(0.0f, Math.min(1.0f, (float) meshImprover.faceToQuality(f)));
return new Color(q, q, q);
};
Function<AFace<MeshPoint>, Color> colorFunction2 = f -> {
Function<AFace<EikMeshPoint>, Color> colorFunction2 = f -> {
return ColorHelper.numberToHurColor((float)f.getId() / meshImprover.getMesh().getNumberOfFaces());
};
//ColorHelper.numberToHurColor((float)f.getId() / meshImprover.getMesh().getNumberOfFaces());
//new ColorHelper(meshImprover.getMesh().getNumberOfFaces()).numberToColor(f.getId());
PSMeshingPanel<MeshPoint, AVertex<MeshPoint>, AHalfEdge<MeshPoint>, AFace<MeshPoint>> distmeshPanel = new PSMeshingPanel<>(
EikMeshPanel<EikMeshPoint, AVertex<EikMeshPoint>, AHalfEdge<EikMeshPoint>, AFace<EikMeshPoint>> distmeshPanel = new EikMeshPanel<>(
meshImprover.getMesh(), f -> false, bbound.getWidth()*1000, bbound.getHeight()*1000, bbound, colorFunction1);
JFrame frame = distmeshPanel.display();
......@@ -119,7 +114,7 @@ public class RecordTriangulationMovie {
}
public static void addPictures(Recorder recorder,
PSMeshingPanel<MeshPoint, AVertex<MeshPoint>, AHalfEdge<MeshPoint>, AFace<MeshPoint>> distmeshPanel,
EikMeshPanel<EikMeshPoint, AVertex<EikMeshPoint>, AHalfEdge<EikMeshPoint>, AFace<EikMeshPoint>> distmeshPanel,
int frames) throws IOException {
for(int i = 0; i < frames; i++) {
......
......@@ -30,10 +30,10 @@ import org.vadere.util.potential.calculators.cartesian.EikonalSolverFMM;
import org.vadere.util.potential.calculators.cartesian.EikonalSolverFSM;
import org.vadere.util.potential.calculators.mesh.EikonalSolverFMMTriangulation;
import org.vadere.util.potential.timecost.ITimeCostFunction;
import org.vadere.util.triangulation.adaptive.DistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.DistanceFunction;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.util.triangulation.adaptive.MeshPoint;
import org.vadere.util.triangulation.improver.PPSMeshing;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.util.geometry.mesh.triangulation.improver.PEikMesh;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
......@@ -152,7 +152,7 @@ public interface IPotentialField {
/**
* Generate the mesh, we use the pointer based implementation here.
*/
PPSMeshing meshGenerator = new PPSMeshing(distanceFunc, p -> 1.0, 3.0, bbox, holes);
PEikMesh meshGenerator = new PEikMesh(distanceFunc, p -> 1.0, 3.0, bbox, holes);
meshGenerator.generate();
ITimeCostFunction timeCost = TimeCostFunctionFactory.create(
......@@ -163,9 +163,9 @@ public interface IPotentialField {
//TODO [refactoring]: this attribute value is used in an not intuitive way, we should introduce an extra attribute value!
1.0 / attributesPotential.getPotentialFieldResolution());
ITriangulation<MeshPoint, PVertex<MeshPoint>, PHalfEdge<MeshPoint>, PFace<MeshPoint>> triangulation = meshGenerator.getTriangulation();
ITriangulation<EikMeshPoint, PVertex<EikMeshPoint>, PHalfEdge<EikMeshPoint>, PFace<EikMeshPoint>> triangulation = meshGenerator.getTriangulation();
List<PVertex<MeshPoint>> targetVertices = triangulation.getMesh().getBoundaryVertices().stream().collect(Collectors.toList());
List<PVertex<EikMeshPoint>> targetVertices = triangulation.getMesh().getBoundaryVertices().stream().collect(Collectors.toList());
eikonalSolver = new EikonalSolverFMMTriangulation(
timeCost,
......
......@@ -19,11 +19,11 @@ import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.potential.CellGrid;
import org.vadere.util.potential.CellState;
import org.vadere.util.potential.PathFindingTag;
import org.vadere.util.triangulation.adaptive.DistanceFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.DistanceFunction;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.util.triangulation.adaptive.MeshPoint;
import org.vadere.util.triangulation.adaptive.PSDistmesh;
import org.vadere.util.triangulation.improver.PSMeshing;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.util.geometry.mesh.triangulation.improver.distmesh.Distmesh;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMesh;
import java.io.IOException;
import java.util.Collection;
......@@ -517,12 +517,12 @@ public class RealWorldPlot {
Function<IPoint, Double> interpolationFunction = cellGrid.getInterpolationFunction();
IDistanceFunction approxDistance = p -> interpolationFunction.apply(p);
PSMeshing<MeshPoint, AVertex<MeshPoint>, AHalfEdge<MeshPoint>, AFace<MeshPoint>> meshGenerator = new PSMeshing<>(
EikMesh<EikMeshPoint, AVertex<EikMeshPoint>, AHalfEdge<EikMeshPoint>, AFace<EikMeshPoint>> meshGenerator = new EikMesh<>(
approxDistance,
p -> Math.min(1.0 + Math.max(approxDistance.apply(p)*approxDistance.apply(p), 0)*0.3, 5.0),
0.35,
bound,topography.getObstacles().stream().map(obs -> obs.getShape()).collect(Collectors.toList()),
() -> new AMesh<>((x, y) -> new MeshPoint(x, y, false)));
() -> new AMesh<>((x, y) -> new EikMeshPoint(x, y, false)));
/*PSMeshingPanel<MeshPoint, AVertex<MeshPoint>, AHalfEdge<MeshPoint>, AFace<MeshPoint>> distmeshPanel = new PSMeshingPanel<>(meshGenerator.getMesh(),
f -> false, 1000, 800, bound);
......@@ -596,7 +596,7 @@ public class RealWorldPlot {
Function<IPoint, Double> interpolationFunction = cellGrid.getInterpolationFunction();
IDistanceFunction approxDistance = p -> interpolationFunction.apply(p);
PSDistmesh meshGenerator = new PSDistmesh(
Distmesh meshGenerator = new Distmesh(
approxDistance,
p -> Math.min(1.0 + Math.max(approxDistance.apply(p)*approxDistance.apply(p), 0)*0.3, 5.0),
0.18,
......
......@@ -4,8 +4,8 @@ import org.vadere.util.debug.gui.canvas.SimpleTriCanvas;
import org.vadere.util.geometry.mesh.inter.ITriangulation;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.triangulation.IPointConstructor;
import org.vadere.util.triangulation.adaptive.MeshPoint;
import org.vadere.util.geometry.mesh.inter.IPointConstructor;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPoint;
import java.util.HashSet;
import java.util.Set;
......@@ -26,7 +26,7 @@ public class TestUniform {
private void tri() {
Set<MeshPoint> meshPoints = generateGridPoints(bbox, initialEdgeLen);
Set<EikMeshPoint> meshPoints = generateGridPoints(bbox, initialEdgeLen);
IPointConstructor<VPoint> pointConstructor = (x, y) -> new VPoint(x, y);
ITriangulation tri = ITriangulation.createVPTriangulation(bbox);
System.out.print(meshPoints.size());
......@@ -42,21 +42,21 @@ public class TestUniform {
/**
* Generates the starting points of the algorithm.
*/
private Set<MeshPoint> generateGridPoints(VRectangle bound, double initialEdgeLen) {
private Set<EikMeshPoint> generateGridPoints(VRectangle bound, double initialEdgeLen) {
int elementsInCol = (int) Math.ceil((bound.getWidth()) / initialEdgeLen + 1);
int elementsInRow = (int) Math.ceil((bound.getHeight()) / (initialEdgeLen * Math.sqrt(3) / 2));
double startX = bound.getX();
double startY = bound.getY();
Set<MeshPoint> generatedPoints = new HashSet<>(elementsInRow * elementsInCol);
Set<EikMeshPoint> generatedPoints = new HashSet<>(elementsInRow * elementsInCol);
double sqrt3 = Math.sqrt(3);
for (int j = 0; j < elementsInRow; j++) {
for (int i = 0; i < elementsInCol; i++) {
MeshPoint point;
EikMeshPoint point;
if (j != 0 && j % 2 != 0) {
point = new MeshPoint(startX + i * initialEdgeLen + initialEdgeLen / 2, startY + j * initialEdgeLen * sqrt3 / 2, false);
point = new EikMeshPoint(startX + i * initialEdgeLen + initialEdgeLen / 2, startY + j * initialEdgeLen * sqrt3 / 2, false);
} else {
point = new MeshPoint(startX + i * initialEdgeLen, startY + j * initialEdgeLen * sqrt3 / 2, false);
point = new EikMeshPoint(startX + i * initialEdgeLen, startY + j * initialEdgeLen * sqrt3 / 2, false);
}
generatedPoints.add(point);
}
......
......@@ -3,7 +3,7 @@ package org.vadere.util.geometry;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VLine;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.triangulation.IPointConstructor;
import org.vadere.util.geometry.mesh.inter.IPointConstructor;
import java.awt.geom.PathIterator;
import java.util.Collection;
......
......@@ -270,6 +270,21 @@ public class GeometryUtils {
}
/**
*
* @param x1
* @param y1
* @param x2
* @param y2
* @param xq
* @param yq
* @return
*/
public static boolean isRightOf(final double x1, final double y1, final double x2, final double y2, final double xq, final double yq) {
return isCW(x1, y1, x2, y2, xq, yq);
}
/**
* Returns true if q is right of the oriented-line defined by (p1, p2).
* @param p1
......@@ -305,6 +320,10 @@ public class GeometryUtils {
return isCW(p1.getX(), p1.getY(), p2.getX(), p2.getY(), x, y);
}
public static boolean isLeftOf(final double x1, final double y1, final double x2, final double y2, final double xq, final double yq) {
return isCCW(x1, y1, x2, y2, xq, yq);
}
public static boolean isLeftOf(final IPoint p1, final IPoint p2, final double x, final double y) {
return isCCW(p1.getX(), p1.getY(), p2.getX(), p2.getY(), x, y);
}
......
......@@ -3,7 +3,7 @@ package org.vadere.util.geometry;
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.triangulation.IPointConstructor;
import org.vadere.util.geometry.mesh.inter.IPointConstructor;
import java.util.ArrayList;
import java.util.Iterator;
......
package org.vadere.util.geometry.jts;
import org.vadere.util.geometry.shapes.VRectangle;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Polygon;
import com.vividsolutions.jts.util.GeometricShapeFactory;
public class ShapeConverter {
public Polygon rectangleToPoylgon(final VRectangle rectangle) {
GeometricShapeFactory gsf = new GeometricShapeFactory();
gsf.setBase(new Coordinate(rectangle.getX(), rectangle.getY()));
gsf.setWidth(rectangle.getWidth());
gsf.setWidth(rectangle.getHeight());
return gsf.createRectangle();
}
}
......@@ -4,18 +4,15 @@ 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.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
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.mesh.inter.IVertex;
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.geometry.shapes.VRectangle;
import org.vadere.util.math.SpaceFillingCurve;
import org.vadere.util.triangulation.IPointConstructor;
import org.vadere.util.geometry.mesh.inter.IPointConstructor;
import java.util.*;
import java.util.function.Predicate;
......
......@@ -44,7 +44,7 @@ public class BasePointLocator<P extends IPoint, V extends IVertex<P>, E extends
public void postInsertEvent(V vertex) {}
@Override
public F locatePoint(final P point, boolean insertion) {
public F locatePoint(final P point) {
//return triConnectivity.getMesh().getFace(triConnectivity.locateNearestNeighbour(point));
return triConnectivity.locateFace(point.getX(), point.getY()).get();
/*if(insertion) {
......
package org.vadere.util.triangulation;
package org.vadere.util.geometry.mesh.gen;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
......@@ -11,7 +11,8 @@ import org.vadere.util.geometry.shapes.VPoint;
import java.util.*;
/**
* Created by bzoennchen on 16.01.18.
* unfinished!
* @author Benedikt Zoennchen
*/
public class ConstrainedTriangulation<P extends IPoint, V extends IVertex<P>, E extends IHalfEdge<P>, F extends IFace<P>> extends IncrementalTriangulation<P, V, E, F> {
......
......@@ -271,7 +271,7 @@ public class DelaunayHierarchy<P extends IPoint, V extends IVertex<P>, E extends
}
@Override
public F locatePoint(P point, boolean insertion) {
public F locatePoint(@NotNull final P point) {
Optional<F> optFace = locate(point);
if(optFace.isPresent()) {
return optFace.get();
......
......@@ -17,6 +17,17 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
/**
* An implementation of the so called Delaunay Tree which does not suppport deletion of points from the
* triangulation {@link ITriangulation<P, V, E, F>}.
*
* The Delaunay Tree see Computational Geometry: Algorithms and Applications (berg-2008) page 191.
*
* @param <P> the type of the points (containers)
* @param <V> the type of the vertices
* @param <E> the type of the half-edges
* @param <F> the type of the faces
*/
public class DelaunayTree<P extends IPoint, V extends IVertex<P>, E extends IHalfEdge<P>, F extends IFace<P>> implements IPointLocator<P, V, E, F> {
private DAG<DAGElement<P, F>> dag;
private final HashMap<F, DAG<DAGElement<P, F>>> map;
......@@ -41,7 +52,7 @@ public class DelaunayTree<P extends IPoint, V extends IVertex<P>, E extends IHal
}
@Override
public F locatePoint(final P point, final boolean insertion) {
public F locatePoint(final P point) {
checkRoot();
Set<DAG<DAGElement<P, F>>> leafs = new HashSet<>();
......@@ -69,7 +80,7 @@ public class DelaunayTree<P extends IPoint, V extends IVertex<P>, E extends IHal
@Override
public Optional<F> locate(final P point) {
checkRoot();
return Optional.of(locatePoint(point, false));
return Optional.of(locatePoint(point));
}
@Override
......
package org.vadere.util.triangulation;
package org.vadere.util.geometry.mesh.gen;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.vadere.util.debug.gui.DebugGui;
import org.vadere.util.geometry.GeometryUtils;
import org.vadere.util.geometry.mesh.gen.*;
import org.vadere.util.geometry.mesh.inter.ITriConnectivity;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.mesh.iterators.FaceIterator;
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.triangulation.BowyerWatsonSlow;
import org.vadere.util.geometry.mesh.inter.IPointConstructor;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VLine;
......@@ -21,11 +21,8 @@ import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VTriangle;
import org.vadere.util.geometry.mesh.inter.IPointLocator;
import org.vadere.util.geometry.mesh.inter.ITriangulation;
import org.vadere.util.debug.gui.canvas.SimpleTriCanvas;
import org.vadere.util.tex.TexGraphBuilder;
import java.awt.*;
import java.awt.geom.Arc2D;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
......@@ -330,7 +327,7 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
* 2) point lies on an edge of a face => split the edge
* 3) point lies in the interior of the face => split the face (this should be the main case)
*/
if(isMember(point.getX(), point.getY(), face, edgeCoincidenceTolerance)) {
if(isClose(point.getX(), point.getY(), face, edgeCoincidenceTolerance)) {
log.info("ignore insertion point, since the point " + point + " already exists or it is too close to another point!");
return edge;
}
......@@ -364,7 +361,7 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
@Override
public E insert(P point) {
if(contains(point)) {
F face = this.pointLocator.locatePoint(point, true);
F face = this.pointLocator.locatePoint(point);
return insert(point, face);
}
else {
......@@ -418,13 +415,15 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
// we have to use other halfedges than he1 and he2 since they might be deleted
// if we deleteBoundaryFace he0!
for(V virtualPoint : virtualVertices) {
if(!mesh.isDestroyed(virtualPoint)) {
List<F> faces1 = mesh.getFaces(virtualPoint);
faces1.removeIf(f -> mesh.isBoundary(f));
faces1.forEach(f -> removeFaceAtBorder(f, true));
}
}
if(!useMeshForBound) {
for(V virtualPoint : virtualVertices) {
if(!mesh.isDestroyed(virtualPoint)) {
List<F> faces1 = mesh.getFaces(virtualPoint);
faces1.removeIf(f -> mesh.isBoundary(f));
faces1.forEach(f -> removeFaceAtBorder(f, true));
}
}
}
/*if(!mesh.isDestroyed(p1)) {
List<F> faces2 = mesh.getFaces(p1);
......@@ -565,10 +564,12 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
/**
* Checks if the edge xy of the triangle xyz is illegal with respect to a point p, which is the case if:
* There is a point p and a triangle yxp and p is in the circumscribed cycle of xyz. The assumption is
* that the triangle yxp exists.
* The the circumscribed cycle of the triangle triangle xyz contains p.
*
* Assumption: p = point(next(edge)).
*
* @param edge the edge that might be illegal
* @param p point(next(edge))
* @return true if the edge with respect to p is illegal, otherwise false
*/
@Override
......@@ -756,8 +757,8 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
// TODO: the following code can be deleted, this is only for visual checks
public static void main(String[] args) {
// TODO Auto-generated method stub
int height = 700;
int width = 700;
int height = 1000;
int width = 1000;
int max = Math.max(height, width);
Set<VPoint> points = new HashSet<>();
......@@ -766,8 +767,8 @@ public class IncrementalTriangulation<P extends IPoint, V extends IVertex<P>, E
points.add(new VPoint(75,53));
points.add(new VPoint(80,70));*/
Random r = new Random();
for(int i=0; i< 200; i++) {
Random r = new Random(1);
for(int i=0; i<100; i++) {
VPoint point = new VPoint(width*r.nextDouble(), height*r.nextDouble());
points.add(point);
}
......
......@@ -53,7 +53,7 @@ public class JumpAndWalk<P extends IPoint, V extends IVertex<P>, E extends IHalf
}
@Override
public F locatePoint(P point, boolean insertion) {
public F locatePoint(P point) {
return locate(point).get();
}
......
......@@ -7,7 +7,7 @@ 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.IPoint;
import org.vadere.util.triangulation.IPointConstructor;
import org.vadere.util.geometry.mesh.inter.IPointConstructor;
import java.util.*;
import java.util.function.Predicate;
......
package org.vadere.util.triangulation;
package org.vadere.util.geometry.mesh.gen;
import org.vadere.util.geometry.mesh.gen.PFace;
import org.vadere.util.geometry.mesh.gen.PHalfEdge;
......
......@@ -2,7 +2,7 @@ package org.vadere.util.geometry.mesh.impl;
import org.jetbrains.annotations.NotNull;
import org.vadere.util.geometry.mesh.inter.IPointLocator;
import org.vadere.util.triangulation.IncrementalTriangulation;
import org.vadere.util.geometry.mesh.gen.IncrementalTriangulation;
import org.vadere.util.geometry.mesh.gen.PFace;
import org.vadere.util.geometry.mesh.gen.PHalfEdge;
import org.vadere.util.geometry.mesh.gen.PVertex;
......
......@@ -3,13 +3,12 @@ package org.vadere.util.geometry.mesh.impl;
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.ITriangulation;
import org.vadere.util.triangulation.ITriangulationSupplier;
import org.vadere.util.triangulation.triangulator.UniformRefinementTriangulator;
import org.vadere.util.geometry.mesh.inter.ITriangulationSupplier;
import org.vadere.util.geometry.mesh.triangulation.triangulator.UniformRefinementTriangulator;
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.triangulation.adaptive.IEdgeLengthFunction;
import org.vadere.util.geometry.mesh.triangulation.adaptive.IEdgeLengthFunction;
import java.util.Collection;
......
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