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

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

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

parent 35ebbaa9
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>vadere</artifactId>
<groupId>org.vadere</groupId>
<version>0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>VadereGeometry</name>
<artifactId>geometry</artifactId>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>tests</testSourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>testResources</directory>
</testResource>
<testResource>
<directory>tests</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<!-- Use JaCoCo's Java agents to record coverage data by using on-the-fly class file instrumentation. -->
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<output>file</output>
<destFile>${project.build.directory}/coverage-data/jacoco-unit-tests.coverage</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<!-- Use JaCoCo agent output to create coverage reports in CSV, HTML and XML format. -->
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/coverage-data/jacoco-unit-tests.coverage</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/coverage-reports</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- Maven Surefire is used to execute unit tests. -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19</version>
<configuration>
<argLine>${surefireArgLine}</argLine>
<enableAssertions>true</enableAssertions>
<excludes>
<exclude></exclude>
</excludes>
<failIfNoTests>false</failIfNoTests>
<skipTests>${skip.unit.tests}</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>com.googlecode.mavennatives</groupId>
<artifactId>maven-nativedependencies-plugin</artifactId>
<version>0.0.5</version>
<executions>
<execution>
<id>unpacknatives</id>
<phase>generate-resources</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- generated by lwjgl -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<lwjgl.version>3.1.2</lwjgl.version>
</properties>
<!-- end generated by lwjgl -->
<dependencies>
<!-- utility methods i.e. StopWatch -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>r05</version>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version>
</dependency>
<!-- generated by lwjgl -->
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl.version}</version>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-opencl</artifactId>
<version>${lwjgl.version}</version>
</dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl.version}</version>
<classifier>${lwjgl.natives}</classifier>
<scope>runtime</scope>
</dependency>
</dependencies>
<!-- end generated by lwjgl -->
<profiles>
<profile>
<id>lwjgl-natives-linux</id>
<activation>
<os><family>unix</family></os>
</activation>
<properties>
<lwjgl.natives>natives-linux</lwjgl.natives>
</properties>
</profile>
<profile>
<id>lwjgl-natives-macos</id>
<activation>
<os><family>mac</family></os>
</activation>
<properties>
<lwjgl.natives>natives-macos</lwjgl.natives>
</properties>
</profile>
<profile>
<id>lwjgl-natives-windows</id>
<activation>
<os><family>windows</family></os>
</activation>
<properties>
<lwjgl.natives>natives-windows</lwjgl.natives>
</properties>
</profile>
</profiles>
</project>
\ No newline at end of file
package org.vadere.util.geometry;
package org.vadere.geometry;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VPoint;
/**
* VPoint with implementation of the comparable interface.
......@@ -30,8 +30,8 @@ public class ComparablePoint extends VPoint implements
*/
@Override
public int compareTo(ComparablePoint p) {
if (Math.abs(this.x - p.x) < GeometryUtils.DOUBLE_EPS) {
if (Math.abs(this.y - p.y) < GeometryUtils.DOUBLE_EPS) {
if (Math.abs(this.x - p.x) < Utils.DOUBLE_EPS) {
if (Math.abs(this.y - p.y) < Utils.DOUBLE_EPS) {
return 0;
} else {
if (this.y > p.y) {
......
package org.vadere.util.geometry;
package org.vadere.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.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VLine;
import org.vadere.geometry.shapes.VPoint;
import java.awt.geom.Line2D;
import java.util.Iterator;
......
package org.vadere.util.geometry;
package org.vadere.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.geometry.mesh.inter.IPointConstructor;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VLine;
import org.vadere.geometry.shapes.VShape;
import org.vadere.geometry.mesh.inter.IPointConstructor;
import java.awt.geom.PathIterator;
import java.util.Collection;
......
package org.vadere.util.math;
package org.vadere.geometry;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import org.vadere.util.geometry.shapes.VShape;
import org.vadere.util.geometry.mesh.triangulation.adaptive.DistanceFunction;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.shapes.VShape;
import org.vadere.geometry.mesh.triangulation.adaptive.DistanceFunction;
import java.util.ArrayList;
import java.util.Collection;
......
package org.vadere.util.geometry;
package org.vadere.geometry;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VPoint;
public class IndexedPoint extends VPoint {
/**
......
package org.vadere.util.geometry;
package org.vadere.geometry;
public enum ShapeType {
CIRCLE, POLYGON, RECTANGLE, RING
......
package org.vadere.util.math;
package org.vadere.geometry;
import org.apache.commons.lang3.tuple.Pair;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VRectangle;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VRectangle;
/**
* @author Benedikt Zoennchen
......
package org.vadere.util.geometry;
package org.vadere.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.geometry.mesh.inter.IPointConstructor;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VLine;
import org.vadere.geometry.shapes.VPoint;
import org.vadere.geometry.mesh.inter.IPointConstructor;
import java.util.ArrayList;
import java.util.Iterator;
......
This diff is collapsed.
package org.vadere.util.geometry;
package org.vadere.geometry;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.IPoint;
import org.vadere.geometry.shapes.VPoint;
public class Vector2D extends VPoint {
......@@ -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) < GeometryUtils.DOUBLE_EPS) {
if (Math.abs(x) < Utils.DOUBLE_EPS) {
rx = 0;
} else {
rx = x / vl * length;
}
if (Math.abs(y) < GeometryUtils.DOUBLE_EPS) {
if (Math.abs(y) < Utils.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 GeometryUtils.angleTo(this, center);
return Utils.angleTo(this, center);
}
public Vector2D add(VPoint p) {
......
package org.vadere.util.color;
package org.vadere.geometry.color;
import java.awt.*;
import java.util.ArrayList;
......
package org.vadere.util.debug.gui;
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.util.geometry.shapes.VLine;
package org.vadere.geometry.gui;
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 org.vadere.geometry.shapes.VLine;
import java.awt.*;
import java.util.HashMap;
......
package org.vadere.util.debug.gui;
package org.vadere.geometry.gui;
import org.vadere.util.debug.gui.canvas.TriCanvas;
import org.vadere.util.geometry.mesh.inter.IFace;
import org.vadere.util.geometry.mesh.inter.IHalfEdge;
import org.vadere.util.geometry.mesh.inter.IVertex;
import org.vadere.util.geometry.shapes.IPoint;
import org.vadere.geometry.gui.canvas.TriCanvas;
import org.vadere.geometry.mesh.inter.IFace;
import org.vadere.geometry.mesh.inter.IHalfEdge;
import org.vadere.geometry.mesh.inter.IVertex;
import org.vadere.geometry.shapes.IPoint;
import java.lang.reflect.InvocationTargetException;
......
package org.vadere.util.debug.gui;
package org.vadere.geometry.gui;
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.geometry.mesh.inter.IPointConstructor;
import org.vadere.util.geometry.mesh.triangulation.improver.EikMeshPoint;
import org.vadere.geometry.gui.canvas.SimpleTriCanvas;
import org.vadere.geometry.mesh.inter.ITriangulation;
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.improver.EikMeshPoint;
import java.util.HashSet;
import java.util.Set;
......
package org.vadere.util.debug.gui.canvas;
package org.vadere.geometry.gui.canvas;
import org.jetbrains.annotations.NotNull;
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.util.geometry.shapes.VCircle;
import org.vadere.util.geometry.shapes.VPoint;
import org.vadere.util.geometry.shapes.VPolygon;
import org.vadere.util.geometry.shapes.VRectangle;
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 org.vadere.geometry.shapes.VCircle;
import org.vadere.geometry.shapes.VPoint;
import org.vadere.geometry.shapes.VPolygon;
import org.vadere.geometry.shapes.VRectangle;
import java.awt.*;
import java.util.ArrayList;
......
package org.vadere.util.debug.gui.canvas;
package org.vadere.geometry.gui.canvas;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.vadere.util.debug.gui.ColorFunctions;
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.util.geometry.shapes.VRectangle;
import org.vadere.util.tex.TexGraphBuilder;
import org.vadere.geometry.gui.ColorFunctions;
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 org.vadere.geometry.shapes.VRectangle;
import org.vadere.geometry.tex.TexGraphBuilder;