Commit fa530308 authored by BZoennchen's avatar BZoennchen

make examples runable again.

parent c541cfe0
......@@ -3,6 +3,7 @@ package org.vadere.gui.projectview;
import org.apache.commons.lang3.time.StopWatch;
import org.vadere.gui.components.utils.Recorder;
import org.vadere.meshing.mesh.gen.MeshRenderer;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.impl.AEikMesh;
import org.vadere.util.logging.StdOutErrLog;
import org.vadere.util.visualization.ColorHelper;
import org.vadere.util.geometry.GeometryUtils;
......@@ -16,7 +17,6 @@ import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.math.DistanceFunction;
import org.vadere.meshing.mesh.gen.MeshPanel;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.impl.AEikMesh;
import java.awt.*;
import java.io.IOException;
......
......@@ -5,7 +5,7 @@ import org.vadere.meshing.mesh.impl.PMeshPanel;
import org.vadere.meshing.mesh.inter.IPointConstructor;
import org.vadere.meshing.mesh.triangulation.IEdgeLengthFunction;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen.GenEikMesh;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen.PEikMeshGen;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.impl.PEikMesh;
import org.vadere.meshing.mesh.triangulation.triangulator.impl.PDelaunayTriangulator;
import org.vadere.meshing.utils.io.movie.MovRecorder;
import org.vadere.meshing.utils.io.poly.PolyGenerator;
......@@ -16,7 +16,6 @@ import org.vadere.meshing.mesh.gen.PHalfEdge;
import org.vadere.meshing.mesh.gen.PVertex;
import org.vadere.meshing.mesh.gen.MeshPanel;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.EikMeshPoint;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.impl.PEikMesh;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VRectangle;
......@@ -72,7 +71,7 @@ public class EikMeshExamples {
var delaunayTriangulator = new PDelaunayTriangulator(points);
var triangulation = delaunayTriangulator.generate();
var improver = new PEikMeshGen(p -> 1.0, triangulation);
var improver = new PEikMesh(p -> 1.0, triangulation);
var panel = new PMeshPanel(triangulation.getMesh(), 500, 500);
panel.display("A square mesh");
panel.repaint();
......@@ -116,7 +115,7 @@ public class EikMeshExamples {
IDistanceFunction d_r = IDistanceFunction.create(rect);
IDistanceFunction d = IDistanceFunction.substract(d_c, d_r);
double edgeLength = 0.03;
var meshImprover = new PEikMeshGen(
var meshImprover = new PEikMesh(
d,
p -> edgeLength + 0.5 * Math.abs(d.apply(p)),
edgeLength,
......@@ -170,7 +169,7 @@ public class EikMeshExamples {
IDistanceFunction d_union = IDistanceFunction.union(IDistanceFunction.union(d1_c, d_r), d2_c);
IDistanceFunction d = IDistanceFunction.substract(d_b,d_union);
double edgeLength = 0.07;
var meshImprover = new PEikMeshGen(
var meshImprover = new PEikMesh(
d,
p -> edgeLength + 0.3 * Math.abs(d.apply(p)),
edgeLength,
......@@ -266,7 +265,7 @@ public class EikMeshExamples {
// define the EikMesh-Improver
IEdgeLengthFunction h = p -> h0 + 0.3 * Math.abs(d.apply(p));
PEikMeshGen meshImprover = new PEikMeshGen(
PEikMesh meshImprover = new PEikMesh(
d,
h,
Arrays.asList(center),
......@@ -492,7 +491,7 @@ public class EikMeshExamples {
// like before but we have to add the point-constructor to the constructor of EikMesh and we use
// the more generic type PEikMeshGen instead of PEikMes!
PEikMeshGen meshImprover = new PEikMeshGen(
PEikMesh meshImprover = new PEikMesh(
ringDistance,
edgeLengthFunction,
edgeLength,
......
......@@ -6,7 +6,6 @@ import org.vadere.meshing.mesh.impl.PSLG;
import org.vadere.meshing.mesh.inter.IPointConstructor;
import org.vadere.meshing.mesh.triangulation.IEdgeLengthFunction;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.EikMeshPoint;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen.PEikMeshGen;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.impl.PEikMesh;
import org.vadere.meshing.mesh.triangulation.triangulator.impl.PDelaunayTriangulator;
import org.vadere.meshing.mesh.triangulation.triangulator.impl.PRuppertsTriangulator;
......@@ -73,7 +72,7 @@ public class EikMeshPlots {
write(toTexDocument(TexGraphGenerator.toTikz(dt.getMesh(), f-> lightBlue, 1.0f)), "eikmesh_random_before");
VPolygon bound = dt.getMesh().toPolygon(dt.getMesh().getBorder());
var meshImprover = new PEikMeshGen(
var meshImprover = new PEikMesh(
p -> 1.0 + Math.abs(bound.distance(p)),
dt.getTriangulation()
);
......@@ -100,7 +99,7 @@ public class EikMeshPlots {
// (3) use EikMesh to improve the mesh
double h0 = 5.0;
var meshImprover = new PEikMeshGen(
var meshImprover = new PEikMesh(
distanceFunction,
p -> h0 + 0.3 * Math.abs(distanceFunction.apply(p)),
h0,
......@@ -128,7 +127,7 @@ public class EikMeshPlots {
// (3) use EikMesh to improve the mesh
double h0 = 1.0;
var meshImprover = new PEikMeshGen(
var meshImprover = new PEikMesh(
distanceFunction,
p -> h0 + 0.5 * Math.abs(distanceFunction.apply(p)),
h0,
......@@ -174,7 +173,7 @@ public class EikMeshPlots {
IDistanceFunction d_b = IDistanceFunction.create(boundary);
IDistanceFunction d_union = IDistanceFunction.union(IDistanceFunction.union(d1_c, d_r), d2_c);
IDistanceFunction d = IDistanceFunction.substract(d_b,d_union);
var meshImprover = new PEikMeshGen(
var meshImprover = new PEikMesh(
d,
p -> h0 + 0.3 * Math.abs(d.apply(p)),
h0,
......@@ -202,7 +201,7 @@ public class EikMeshPlots {
IDistanceFunction d_c = IDistanceFunction.createDisc(0, 0, 0.5);
IDistanceFunction d_r = IDistanceFunction.create(rect);
IDistanceFunction d = IDistanceFunction.substract(d_c, d_r);
var meshImprover = new PEikMeshGen(
var meshImprover = new PEikMesh(
d,
p -> h0 + 0.3 * Math.abs(d.apply(p)),
h0,
......@@ -230,7 +229,7 @@ public class EikMeshPlots {
IDistanceFunction d_c = IDistanceFunction.createDisc(0, 0, 0.5);
IDistanceFunction d_r = IDistanceFunction.create(rect);
IDistanceFunction d = IDistanceFunction.substract(d_c, d_r);
var meshImprover = new PEikMeshGen(
var meshImprover = new PEikMesh(
d,
p -> h0 + 0.3 * Math.abs(d.apply(p)),
h0,
......@@ -261,7 +260,7 @@ public class EikMeshPlots {
// define the EikMesh-Improver
IEdgeLengthFunction h = p -> h0;
PEikMeshGen meshImprover = new PEikMeshGen(
PEikMesh meshImprover = new PEikMesh(
d,
h,
Arrays.asList(center),
......@@ -341,7 +340,7 @@ public class EikMeshPlots {
panel.repaint();
}
var eikMesh = new PEikMeshGen(h, ruppert.getTriangulation());
var eikMesh = new PEikMesh(h, ruppert.getTriangulation());
while (!eikMesh.isFinished()) {
try {
......
......@@ -10,7 +10,6 @@ import org.vadere.meshing.mesh.inter.IMeshDistanceFunction;
import org.vadere.meshing.mesh.inter.IPointConstructor;
import org.vadere.meshing.mesh.triangulation.IEdgeLengthFunction;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.EikMeshPoint;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen.PEikMeshGen;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.impl.PEikMesh;
import org.vadere.meshing.mesh.triangulation.triangulator.impl.PContrainedDelaunayTriangulator;
import org.vadere.meshing.mesh.triangulation.triangulator.impl.PVoronoiVertexInsertion;
......@@ -63,7 +62,7 @@ public class MeshExamples {
//delaunayTriangulation();
//dirichletRefinment();
// delaunayRefinment();
constrainedDelaunayTriangulation();
//constrainedDelaunayTriangulation();
//eikMeshKaiserslautern();
//eikMeshKaiserslauternApprox();
//eikMeshA();
......@@ -275,7 +274,7 @@ public class MeshExamples {
//panel.display(" Voronoi Vertex Insertion");
VPolygon bound = dt.getMesh().toPolygon(dt.getMesh().getBorder());
var eikMesh = new PEikMeshGen(
var eikMesh = new PEikMesh(
p -> 1.0 + Math.abs(bound.distance(p)),
dt.getTriangulation()
);
......@@ -638,7 +637,7 @@ public class MeshExamples {
// (3) use EikMesh to improve the mesh
double h0 = 5.0;
PEikMeshGen meshImprover = new PEikMeshGen(
PEikMesh meshImprover = new PEikMesh(
distanceFunction,
p -> h0 + 0.3 * Math.abs(distanceFunction.apply(p)),
h0,
......@@ -704,7 +703,7 @@ public class MeshExamples {
// (3) use EikMesh to improve the mesh
double h0 = 5.0;
PEikMeshGen meshImprover = new PEikMeshGen(
PEikMesh meshImprover = new PEikMesh(
distanceFunction,
p -> h0 + 0.3 * Math.abs(distanceFunction.apply(p)),
h0,
......@@ -767,7 +766,7 @@ public class MeshExamples {
}*/
// (3) use EikMesh to improve the mesh
var eikMesh = new PEikMeshGen(
var eikMesh = new PEikMesh(
p -> 1.0 + 0.2*Math.abs(pslg.getSegmentBound().distance(p)),
ruppertsTriangulator.getTriangulation()
);
......
......@@ -101,6 +101,11 @@ public class AMesh implements IMesh<AVertex, AHalfEdge, AFace>, Cloneable {
return vertex.getY();
}
@Override
public void setCoords(@NotNull AVertex vertex, double x, double y) {
throw new UnsupportedOperationException("not jet implemented.");
}
@Override
public AHalfEdge getEdge(@NotNull final AFace face) {
return edges.get(face.getEdge());
......
......@@ -3,6 +3,9 @@ package org.vadere.meshing.mesh.gen;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.inter.IFace;
import java.util.HashMap;
import java.util.Map;
/**
* A Face is a region of a planar separation of the 2-D space, e.g. the region of a Polygon/Triangle and so on.
*
......@@ -12,6 +15,8 @@ public class PFace implements IFace, Cloneable {
private static int MAX_FACE_PRINT_LEN = 100000;
private Map<String, Object> propertyElements;
/**
* One of the half-edges bordering this face.
*/
......@@ -30,6 +35,7 @@ public class PFace implements IFace, Cloneable {
protected PFace(@NotNull final PHalfEdge edge, final boolean boundary) {
this.boundary = boundary;
this.edge = edge;
this.propertyElements = new HashMap<>();
}
/**
......@@ -48,6 +54,7 @@ public class PFace implements IFace, Cloneable {
*/
PFace(boolean boundary) {
this.boundary = boundary;
this.propertyElements = new HashMap<>();
}
PFace() {
......@@ -61,6 +68,7 @@ public class PFace implements IFace, Cloneable {
void destroy() {
setEdge(null);
destroyed = true;
propertyElements.clear();
}
public void setBoundary(boolean border) {
......@@ -120,4 +128,17 @@ public class PFace implements IFace, Cloneable {
throw new InternalError(e.getMessage());
}
}
<T> void setData(final String name, T data) {
propertyElements.put(name, data);
}
<T> T getData(final String name, Class<T> clazz) {
if (propertyElements.containsKey(name)) {
return clazz.cast(propertyElements.get(name));
} else {
return null;
}
}
}
......@@ -5,8 +5,13 @@ import org.vadere.meshing.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.shapes.VLine;
import org.vadere.util.geometry.shapes.VPoint;
import java.util.HashMap;
import java.util.Map;
public class PHalfEdge implements IHalfEdge, Cloneable {
private Map<String, Object> propertyElements;
/**
* point at the end of the half edge.
*/
......@@ -39,12 +44,14 @@ public class PHalfEdge implements IHalfEdge, Cloneable {
this.end = end;
this.face = face;
this.destroyed = false;
this.propertyElements = new HashMap<>();
}
protected PHalfEdge(@NotNull final PVertex end) {
this.end = end;
this.face = null;
this.destroyed = false;
this.propertyElements = new HashMap<>();
}
PFace getFace() {
......@@ -140,6 +147,18 @@ public class PHalfEdge implements IHalfEdge, Cloneable {
}
}
<T> void setData(final String name, T data) {
propertyElements.put(name, data);
}
<T> T getData(final String name, Class<T> clazz) {
if (propertyElements.containsKey(name)) {
return clazz.cast(propertyElements.get(name));
} else {
return null;
}
}
/*
* A half-edge is defined by its end vertex and its face. In a geometry there can not be more than
* one half-edge part of face and ending at end.
......
......@@ -96,6 +96,11 @@ public class PMesh implements IMesh<PVertex, PHalfEdge, PFace> {
return vertex.getY();
}
@Override
public void setCoords(@NotNull final PVertex vertex, double x, double y) {
vertex.setPoint(new VPoint(x, y));
}
@Override
public PHalfEdge getEdge(@NotNull final PFace face) {
return face.getEdge();
......@@ -117,18 +122,33 @@ public class PMesh implements IMesh<PVertex, PHalfEdge, PFace> {
}
@Override
public <CV> void setData(@NotNull PVertex vertex, @NotNull String name, CV data) {
throw new UnsupportedOperationException("not jet implemented");
public <CV> Optional<CV> getData(@NotNull final PVertex vertex, @NotNull final String name, @NotNull final Class<CV> clazz) {
return Optional.ofNullable(vertex.getData(name, clazz));
}
@Override
public <CV> void setData(@NotNull final PVertex vertex, @NotNull final String name, final CV data) {
vertex.setData(name, data);
}
@Override
public <CE> Optional<CE> getData(@NotNull final PHalfEdge edge, @NotNull final String name, @NotNull final Class<CE> clazz) {
return Optional.ofNullable(edge.getData(name, clazz));
}
@Override
public <CE> void setData(@NotNull final PHalfEdge edge, @NotNull final String name, @Nullable final CE data) {
edge.setData(name, data);
}
@Override
public <CE> void setData(@NotNull PHalfEdge edge, @NotNull String name, @Nullable CE data) {
throw new UnsupportedOperationException("not jet implemented");
public <CF> Optional<CF> getData(@NotNull final PFace face, @NotNull final String name, @NotNull final Class<CF> clazz) {
return Optional.ofNullable(face.getData(name, clazz));
}
@Override
public <CF> void setData(@NotNull final PFace face, @NotNull final String name, @Nullable final CF data) {
throw new UnsupportedOperationException("not jet implemented");
face.setData(name, data);
}
@Override
......
......@@ -3,6 +3,8 @@ package org.vadere.meshing.mesh.gen;
import org.vadere.meshing.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
......@@ -13,6 +15,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/
public class PVertex implements IVertex {
private Map<String, Object> propertyElements;
private Lock lock;
private IPoint point;
private PVertex down;
......@@ -24,6 +27,7 @@ public class PVertex implements IVertex {
this.destroyed = false;
this.down = null;
this.lock = new ReentrantLock();
this.propertyElements = new HashMap<>();
}
public void setPoint(final IPoint point) {
......@@ -105,4 +109,16 @@ public class PVertex implements IVertex {
throw new InternalError(e.getMessage());
}
}
<T> void setData(final String name, T data) {
propertyElements.put(name, data);
}
<T> T getData(final String name, Class<T> clazz) {
if (propertyElements.containsKey(name)) {
return clazz.cast(propertyElements.get(name));
} else {
return null;
}
}
}
......@@ -233,9 +233,7 @@ public interface IMesh<V extends IVertex, E extends IHalfEdge, F extends IFace>
double getY(@NotNull V vertex);
default void setCoords(@NotNull V vertex, double x, double y) {
throw new UnsupportedOperationException("not jet implemented");
}
void setCoords(@NotNull V vertex, double x, double y);
/**
* Returns a half-edge of the face this can be any half-edge of this face in O(1).
......@@ -301,16 +299,14 @@ public interface IMesh<V extends IVertex, E extends IHalfEdge, F extends IFace>
*/
IPoint getPoint(@NotNull V vertex);
default <CV> Optional<CV> getData(@NotNull final V vertex, @NotNull final String name, @NotNull final Class<CV> clazz) {
return Optional.empty();
}
<CV> Optional<CV> getData(@NotNull final V vertex, @NotNull final String name, @NotNull final Class<CV> clazz);
default boolean getBooleanData(@NotNull final V vertex, @NotNull final String name) {
return getData(vertex, name, Boolean.class).or(null).get();
return getData(vertex, name, Boolean.class).orElse(false);
}
default double getDoubleData(@NotNull final V vertex, @NotNull final String name) {
return getData(vertex, name, Double.class).or(null).get();
return getData(vertex, name, Double.class).orElse(0.0);
}
<CV> void setData(@NotNull final V vertex, @NotNull final String name, CV data);
......@@ -331,9 +327,7 @@ public interface IMesh<V extends IVertex, E extends IHalfEdge, F extends IFace>
* @param clazz type of the property
* @return the data saved on the half-edge or <tt>Optional.empty()</tt> if there is no data saved
*/
default <CE> Optional<CE> getData(@NotNull E edge, @NotNull final String name, @NotNull final Class<CE> clazz) {
return Optional.empty();
}
<CE> Optional<CE> getData(@NotNull E edge, @NotNull final String name, @NotNull final Class<CE> clazz);
default boolean getBooleanData(@NotNull E edge, @NotNull final String name) {
return getData(edge, name, Boolean.class).or(null).get();
......@@ -367,9 +361,7 @@ public interface IMesh<V extends IVertex, E extends IHalfEdge, F extends IFace>
* @param clazz
* @return the data saved on the face or <tt>Optional.empty()</tt> if there is no data saved
*/
default <CF> Optional<CF> getData(@NotNull F face, @NotNull final String name, @NotNull final Class<CF> clazz) {
return Optional.empty();
}
<CF> Optional<CF> getData(@NotNull F face, @NotNull final String name, @NotNull final Class<CF> clazz);
default boolean getBooleanData(@NotNull F face, @NotNull final String name) {
return getData(face, name, Boolean.class).or(null).get();
......
package org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.gen.AFace;
import org.vadere.meshing.mesh.gen.AHalfEdge;
import org.vadere.meshing.mesh.gen.AMesh;
import org.vadere.meshing.mesh.gen.AVertex;
import org.vadere.meshing.mesh.triangulation.IEdgeLengthFunction;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.EikMeshPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.math.IDistanceFunction;
import java.util.Collection;
public class AEikMeshGen extends GenEikMesh<AVertex, AHalfEdge, AFace> {
public AEikMeshGen(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
double initialEdgeLen,
@NotNull VRectangle bound,
@NotNull Collection<? extends VShape> obstacleShapes) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound, obstacleShapes, () -> new AMesh());
}
public AEikMeshGen(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
double initialEdgeLen,
@NotNull VRectangle bound) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound, () -> new AMesh());
}
public AEikMeshGen(
@NotNull IDistanceFunction distanceFunc,
double initialEdgeLen,
@NotNull VRectangle bound) {
super(distanceFunc, e -> 1.0, initialEdgeLen, bound, () -> new AMesh());
}
}
\ No newline at end of file
......@@ -12,7 +12,6 @@ import org.vadere.meshing.mesh.inter.IVertex;
import org.vadere.meshing.mesh.iterators.EdgeIterator;
import org.vadere.meshing.mesh.triangulation.improver.IMeshImprover;
import org.vadere.meshing.mesh.triangulation.improver.distmesh.Parameters;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.EikMeshPoint;
import org.vadere.meshing.mesh.triangulation.triangulator.gen.GenRivaraRefinement;
import org.vadere.meshing.mesh.triangulation.triangulator.inter.IRefiner;
import org.vadere.meshing.mesh.triangulation.triangulator.inter.ITriangulator;
......
package org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.gen.PFace;
import org.vadere.meshing.mesh.gen.PHalfEdge;
import org.vadere.meshing.mesh.gen.PMesh;
import org.vadere.meshing.mesh.gen.PVertex;
import org.vadere.meshing.mesh.impl.PTriangulation;
import org.vadere.meshing.mesh.inter.IIncrementalTriangulation;
import org.vadere.meshing.mesh.triangulation.IEdgeLengthFunction;
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.math.IDistanceFunction;
import java.util.Collection;
import java.util.Collections;
public class PEikMeshGen extends GenEikMesh<PVertex, PHalfEdge, PFace> {
public PEikMeshGen(@NotNull final IEdgeLengthFunction edgeLengthFunc,
@NotNull final IIncrementalTriangulation<PVertex, PHalfEdge, PFace> triangulation) {
super(edgeLengthFunc, triangulation);
}
public PEikMeshGen(@NotNull final IDistanceFunction distanceFunc,
@NotNull final IEdgeLengthFunction edgeLengthFunc,
final double initialEdgeLen,
@NotNull final IIncrementalTriangulation<PVertex, PHalfEdge, PFace> triangulation) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, triangulation);
}
public PEikMeshGen(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
double initialEdgeLen,
@NotNull PTriangulation triangulation) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, triangulation);
}
public PEikMeshGen(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
double initialEdgeLen,
@NotNull VRectangle bound,
@NotNull Collection<? extends VShape> obstacleShapes) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound, obstacleShapes, () -> new PMesh());
}
public PEikMeshGen(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
@NotNull Collection<VPoint> fixPoints,
double initialEdgeLen,
@NotNull VRectangle bound
) {
super(distanceFunc, edgeLengthFunc, fixPoints, initialEdgeLen, bound, null, Collections.EMPTY_LIST,() -> new PMesh());
}
public PEikMeshGen(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
double initialEdgeLen,
@NotNull VRectangle bound) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound,
() -> new PMesh());
}
public PEikMeshGen(
@NotNull IDistanceFunction distanceFunc,
double initialEdgeLen,
@NotNull VRectangle bound) {
super(distanceFunc, e -> 1.0, initialEdgeLen, bound, () -> new PMesh());
}
public PEikMeshGen(
double initialEdgeLen,
@NotNull VRectangle bound) {
super(p -> 1.0, e -> 1.0, initialEdgeLen, bound, () -> new PMesh());
}
public PEikMeshGen(
@NotNull VPolygon polygon,
double initialEdgeLen,
@NotNull Collection<? extends VShape> obstacleShapes) {
super(polygon, initialEdgeLen, obstacleShapes, () -> new PMesh());
}
}
package org.vadere.meshing.mesh.triangulation.improver.eikmesh.impl;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen.AEikMeshGen;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.meshing.mesh.gen.AFace;
import org.vadere.meshing.mesh.gen.AHalfEdge;
import org.vadere.meshing.mesh.gen.AMesh;
import org.vadere.meshing.mesh.gen.AVertex;
import org.vadere.meshing.mesh.triangulation.IEdgeLengthFunction;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen.GenEikMesh;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.meshing.mesh.triangulation.IEdgeLengthFunction;
import org.vadere.util.math.IDistanceFunction;
import java.util.Collection;
/**
* @author Benedikt Zoennchen
*/
public class AEikMesh extends AEikMeshGen {
public AEikMesh(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
double initialEdgeLen,
@NotNull VRectangle bound,
@NotNull Collection<? extends VShape> obstacleShapes) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound, obstacleShapes
);
}
}
public class AEikMesh extends GenEikMesh<AVertex, AHalfEdge, AFace> {
public AEikMesh(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
double initialEdgeLen,
@NotNull VRectangle bound,
@NotNull Collection<? extends VShape> obstacleShapes) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound, obstacleShapes, () -> new AMesh());
}
public AEikMesh(
@NotNull IDistanceFunction distanceFunc,
@NotNull IEdgeLengthFunction edgeLengthFunc,
double initialEdgeLen,
@NotNull VRectangle bound) {
super(distanceFunc, edgeLengthFunc, initialEdgeLen, bound, () -> new AMesh());
}
public AEikMesh(
@NotNull IDistanceFunction distanceFunc,
double initialEdgeLen,
@NotNull VRectangle bound) {
super(distanceFunc, e -> 1.0, initialEdgeLen, bound, () -> new AMesh());
}
}
\ No newline at end of file
package org.vadere.meshing.mesh.triangulation.improver.eikmesh.impl;
import org.jetbrains.annotations.NotNull;
import org.vadere.meshing.mesh.triangulation.improver.eikmesh.gen.PEikMeshGen;
import org.vadere.util.math.IDistanceFunction;
import org.vadere.meshing.mesh.gen.PFace;
import org.vadere.meshing.mesh.gen.PHalfEdge;
import