diff --git a/Comparison/pom.xml b/Comparison/pom.xml index 60d41a8f0e4066ef57cdf60b7f549cf2028f231c..506ead0b0bef9fea1f3fabbac2fcb270df16375b 100644 --- a/Comparison/pom.xml +++ b/Comparison/pom.xml @@ -59,6 +59,14 @@ <target>8</target> </configuration> </plugin> + <!-- <plugin> + <groupId>org.openjfx</groupId> + <artifactId>javafx-maven-plugin</artifactId> + <version>0.0.4</version> + <configuration> + <mainClass>org.openjfx.App</mainClass> + </configuration> + </plugin> --> </plugins> </build> <dependencies> @@ -77,8 +85,19 @@ <artifactId>vecmath</artifactId> <version>${version.javax.vecmath}</version> </dependency> + <!-- <dependency> + <groupId>org.openjfx</groupId> + <artifactId>javafx-controls</artifactId> + <version>11.0.2</version> + </dependency> --> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.6.0</version> + <scope>test</scope> + </dependency> </dependencies> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> -</project> \ No newline at end of file +</project> diff --git a/Comparison/pom.xml.orig b/Comparison/pom.xml.orig new file mode 100644 index 0000000000000000000000000000000000000000..b056ec640f397a64c461652605321e61289dbff7 --- /dev/null +++ b/Comparison/pom.xml.orig @@ -0,0 +1,150 @@ +<<<<<<< HEAD +<?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"> + <modelVersion>4.0.0</modelVersion> + + <groupId>groupId</groupId> + <artifactId>Comparison</artifactId> + <version>1.0-SNAPSHOT</version> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.3</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.6.0</version> + <configuration> + <source>8</source> + <target>8</target> + </configuration> + </plugin> + </plugins> + </build> + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.3</version> + </plugin> + </plugins> + </reporting> + <dependencies> + <dependency> + <groupId>cz.findetis</groupId> + <artifactId>MeshModel</artifactId> + <version>2.0</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>javax.vecmath</groupId> + <artifactId>vecmath</artifactId> + <version>1.5.2</version> + </dependency> + <dependency> + <groupId>org.javatuples</groupId> + <artifactId>javatuples</artifactId> + <version>1.2</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.2</version> + <scope>test</scope> + </dependency> + </dependencies> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +======= +<?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"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>cz.findetis</groupId> + <artifactId>FIDENTIS-Analyst-parent</artifactId> + <version>2.0</version> + </parent> + <artifactId>Comparison</artifactId> + <packaging>nbm</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <useOSGiDependencies>true</useOSGiDependencies> + <publicPackages> <!-- expose API/packages to other modules --> + <publicPackage>cz.fidentis.analyst.symmetry.*</publicPackage> + </publicPackages> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <useDefaultManifestFile>true</useDefaultManifestFile> + </configuration> + </plugin> + <!-- Check code style --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>${version.maven.plugin.checkstyle}</version> + <executions> + <execution> + <id>validate</id> + <phase>validate</phase> + <configuration> + <configLocation>codestyle.xml</configLocation> + <encoding>UTF-8</encoding> + <consoleOutput>true</consoleOutput> + <failOnViolation>${checkstyle.fail}</failOnViolation> + <violationSeverity>${checkstyle.severity}</violationSeverity> + <includeTestSourceDirectory>false</includeTestSourceDirectory> + </configuration> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>8</source> + <target>8</target> + </configuration> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.netbeans.api</groupId> + <artifactId>org-netbeans-api-annotations-common</artifactId> + <version>${netbeans.version}</version> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>MeshModel</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>javax.vecmath</groupId> + <artifactId>vecmath</artifactId> + <version>${version.javax.vecmath}</version> + </dependency> + </dependencies> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +>>>>>>> origin/master +</project> \ No newline at end of file diff --git a/Comparison/src/main/java/cz/fidentis/analyst/comparison/ClosestVertices.java b/Comparison/src/main/java/cz/fidentis/analyst/comparison/ClosestVertices.java new file mode 100644 index 0000000000000000000000000000000000000000..b088e9925639117b13862f5ff1c7a8b2494f54e6 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/comparison/ClosestVertices.java @@ -0,0 +1,39 @@ +package cz.fidentis.analyst.comparison; + +import cz.fidentis.analyst.mesh.core.MeshPoint; + +/** + * + * @author Matej Lukes + */ +public class ClosestVertices { + + private MeshPoint firstVertex; + private MeshPoint secondVertex; + private double distance; + + /** + * Constructor. + * + * @param firstVertex Firt vertex of the pair + * @param secondVertex Second vertex of the pair + * @param distance Distance + */ + public ClosestVertices(MeshPoint firstVertex, MeshPoint secondVertex, double distance) { + this.firstVertex = firstVertex; + this.secondVertex = secondVertex; + this.distance = distance; + } + + public MeshPoint getFirstVertex() { + return firstVertex; + } + + public MeshPoint getSecondVertex() { + return secondVertex; + } + + public double getDistance() { + return distance; + } +} diff --git a/Comparison/src/main/java/cz/fidentis/analyst/comparison/Comparison.java b/Comparison/src/main/java/cz/fidentis/analyst/comparison/Comparison.java new file mode 100644 index 0000000000000000000000000000000000000000..22a7673bb10a94de9c30b0111f0d2903673996b9 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/comparison/Comparison.java @@ -0,0 +1,95 @@ +package cz.fidentis.analyst.comparison; + +import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.io.MeshObjLoader; + +import java.io.File; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +/** + * @author Matej Lukes + */ +public class Comparison { + private HausdorffDistance hausdorffDistance; + + private MeshFacet mainFacet; + private MeshFacet comparedFacet; + + /** + * Asynchronously loads main meshModel + * + * @param path path to meshModel file + * @return CompletableFuture + */ + public CompletableFuture loadMainModel(String path) { + + return CompletableFuture.runAsync(() -> { + try { + mainFacet = MeshObjLoader.read(new File(path)).getFacets().get(1); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } + + /** + * Asynchronously loads compared meshModel + * + * @param path path to meshModel file + * @return CompletableFuture + */ + public CompletableFuture loadComparedModel(String path) { + return CompletableFuture.runAsync(() -> { + try { + comparedFacet = MeshObjLoader.read(new File(path)).getFacets().get(1); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } + + /** + * Asynchronously registers compared meshFacet to main meshFacet + * + * @param method registration method + * @return CompletableFuture + */ + public CompletableFuture register(RegistrationMethod method) { + return CompletableFuture.runAsync(() -> comparedFacet = Registration + .register(mainFacet, comparedFacet, method)); + } + + /** + * Asynchronously compares MeshFacets from vertices to vertices + * + * @return list containing vertex from first facet, closest vertex to it from second facet, distance + */ + public CompletableFuture<List<ClosestVertices>> compareHausdorffDistanceToVertices() { + hausdorffDistance = new HausdorffDistance(mainFacet, comparedFacet); + return CompletableFuture.supplyAsync(() -> hausdorffDistance.calculateHausdorffDistanceToVertices()); + } + + /** + * Asynchronously compares MeshFacets from vertices to any point on mesh + * + * @return list containing vertex from first facet, closest point to it from second facet, distance + */ + public CompletableFuture<List<ClosestVertices>> compareHausdorffDistanceToMesh() { + hausdorffDistance = new HausdorffDistance(mainFacet, comparedFacet); + return CompletableFuture.supplyAsync(() -> hausdorffDistance.calculateHausdorffDistanceToMesh()); + } + + /** + * returns progress percentage + * + * @return progress percentage + */ + public double getComparisonProgress() { + if (hausdorffDistance == null) { + return -1; + } + return hausdorffDistance.getProgressPercentage(); + } +} diff --git a/Comparison/src/main/java/cz/fidentis/analyst/comparison/HausdorffDistance.java b/Comparison/src/main/java/cz/fidentis/analyst/comparison/HausdorffDistance.java new file mode 100644 index 0000000000000000000000000000000000000000..79f62b67f8dba2e4ac5a7c809fefce8dac0b8f00 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/comparison/HausdorffDistance.java @@ -0,0 +1,355 @@ +package cz.fidentis.analyst.comparison; + +import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.core.MeshPoint; +import cz.fidentis.analyst.mesh.core.MeshPointImpl; +import cz.fidentis.analyst.mesh.core.MeshTriangle; + +import javax.vecmath.Vector3d; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * @author Matej Lukes + */ +public class HausdorffDistance { + + private MeshFacet mainFacet; + private MeshFacet comparedFacet; + + private AtomicInteger progress = new AtomicInteger(); + private int numberOfVertices; + + /** + * @param mainFacet main MeshFacet + * @param comparedFacet compared MeshFacet + */ + public HausdorffDistance(MeshFacet mainFacet, MeshFacet comparedFacet) { + this.mainFacet = mainFacet; + this.comparedFacet = comparedFacet; + this.numberOfVertices = mainFacet.getNumberOfVertices(); + } + + /** + * returns progress percentage + * + * @return progress + */ + public double getProgressPercentage() { + return ((double) progress.get() / numberOfVertices) * 100; + } + + /** + * Finds the nearest vertex on the second facet. + * + * @param vertex vertex from + * @return vertex, nearest vertex from second facet, distance + */ + private ClosestVertices getNearestVertex(MeshPoint vertex) { + Optional<Pair<MeshPoint, Double>> closestVertexAndDistance = comparedFacet.getVertices().parallelStream() + .map((meshPoint) -> new Pair<>(meshPoint, getDistanceBetweenPoints(vertex, meshPoint.getPosition()))) + .max((Comparator.comparingDouble(Pair::getValue))); + return closestVertexAndDistance.map(vector3dDoublePair -> new ClosestVertices(vertex, + vector3dDoublePair.getKey(), + vector3dDoublePair.getValue())).orElse(null); + } + + /** + * returns distance between two points + * + * @param point1 first point + * @param point2 second point + * @return distance + */ + private double getDistanceBetweenPoints(MeshPoint point1, Vector3d point2) { + Vector3d helperVector = new Vector3d(); + helperVector.sub(point1.getPosition(), point2); + return Math.signum(helperVector.dot(point1.getNormal())) * helperVector.length(); + } + + /** + * calculates Hausdorff Distance to the nearest vertex from second facet for each vertex in first facet + * this implementation uses executor + * + * @return list containing vertex from first facet, closest vertex to it from second facet, distance + */ + public List<ClosestVertices> calculateHausdorffDistanceToVertices() { + progress.set(0); + int numberOfVertices = mainFacet.getNumberOfVertices(); + List<Future<ClosestVertices>> closestVerticesFutures = new ArrayList<>(numberOfVertices); + ExecutorService executor = Executors.newCachedThreadPool(); + + for (final MeshPoint vertex : mainFacet.getVertices()) { + closestVerticesFutures.add(executor.submit(() -> { + ClosestVertices result = getNearestVertex(vertex); + progress.addAndGet(1); + return result; + })); + } + + List<ClosestVertices> closestVertices = new ArrayList<>(numberOfVertices); + for (Future<ClosestVertices> future : + closestVerticesFutures) { + executor.submit(() -> { + try { + ClosestVertices result = future.get(); + synchronized (closestVertices) { + closestVertices.add(result); + } + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + }); + } + + executor.shutdown(); + return closestVertices; + } + + /** + * calculates Hausdorff Distance to the nearest vertex from second facet for each vertex in first facet + * this implementation uses parallel streams + * + * @return list containing vertex from first facet, closest vertex to it from second facet, distance + */ + public List<ClosestVertices> calculateHausdorffDistanceToVertices2() { + progress.set(0); + return mainFacet.getVertices().parallelStream() + .map((vertex) -> { + ClosestVertices result = getNearestVertex(vertex); + progress.addAndGet(1); + return result; + }) + .collect(Collectors.toList()); + } + + /** + * calculates Hausdorff Distance to the nearest point on second facet for each vertex + * this implementation uses executor + * + * @return list containing vertex from first facet, closest point to it from second facet, distance + */ + public List<ClosestVertices> calculateHausdorffDistanceToMesh() { + progress.set(0); + int numberOfVertices = mainFacet.getNumberOfVertices(); + List<Future<ClosestVertices>> closestPointsFutures = new ArrayList<>(numberOfVertices); + ExecutorService executor = Executors.newCachedThreadPool(); + + for (final MeshPoint vertex : mainFacet.getVertices()) { + closestPointsFutures.add(executor.submit(() -> { + ClosestVertices result = calculateNearestPointOnMesh(vertex, + comparedFacet.getCornerTable() + .getTriangleIndexesByVertexIndex(comparedFacet.getVertices() + .indexOf(getNearestVertex(vertex) + .getSecondVertex()))); + progress.addAndGet(1); + return result; + })); + } + + List<ClosestVertices> closestVertices = new ArrayList<>(numberOfVertices); + for (Future<ClosestVertices> future : closestPointsFutures) { + executor.submit(() -> { + try { + ClosestVertices result = future.get(); + synchronized (closestVertices) { + closestVertices.add(result); + } + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + }); + } + + executor.shutdown(); + return closestVertices; + } + + /** + * calculates Hausdorff Distance to the nearest point on second facet for each vertex + * this implementation uses parallel streams + * + * @return list containing vertex from first facet, closest point to it from second facet, distance + */ + public List<ClosestVertices> calculateHausdorffDistanceToMesh2() { + progress.set(0); + return mainFacet.getVertices().parallelStream() + .map((meshPoint) -> { + ClosestVertices result = calculateNearestPointOnMesh(meshPoint, + comparedFacet.getCornerTable() + .getTriangleIndexesByVertexIndex(comparedFacet.getVertices() + .indexOf(getNearestVertex(meshPoint) + .getSecondVertex()))); + progress.addAndGet(1); + return result; + }).collect(Collectors.toList()); + } + + /** + * calculates Hausdorff Distance to the nearest point on second facet for vertex + * + * @param vertex vertex from first facet + * @param indicesOfTrianglesOfVertex indices of triangles that contain the nearest vertex on second mesh + * @return vertex from first facet, closest point to it from second facet, distance + */ + private ClosestVertices calculateNearestPointOnMesh(MeshPoint vertex, List<Integer> indicesOfTrianglesOfVertex) { + Vector3d vertexPosition = vertex.getPosition(); + List<Pair<Vector3d, Double>> projections = new ArrayList<>(indicesOfTrianglesOfVertex.size()); + Vector3d helperVector = new Vector3d(); + + List<MeshTriangle> trList = comparedFacet.asTriangles(); + for (int index : indicesOfTrianglesOfVertex) { + List<Vector3d> triangle = new ArrayList<>(); + triangle.add(trList.get(index).vertex1.getPosition()); + triangle.add(trList.get(index).vertex2.getPosition()); + triangle.add(trList.get(index).vertex3.getPosition()); + //List<Vector3d> triangle = comparedFacet.asTriangles()..getVerticesOfTriangle(index).stream() + // .map(MeshPoint::getPosition) + // .collect(Collectors.toList()); + Vector3d projection = getProjectionToTrianglePlane(vertexPosition, triangle); + if (isPointInTriangle(projection, triangle)) { + helperVector.sub(vertexPosition, projection); + projections.add(new Pair<>(projection, helperVector.length())); + } else { + projection = getProjectionToClosestEdge(projection, triangle); + helperVector.sub(vertexPosition, projection); + projections.add(new Pair<>(projection, helperVector.length())); + } + } + + Pair<Vector3d, Double> closestPosition = projections.stream() + .min(Comparator.comparingDouble(Pair::getValue)).orElseGet(() -> new Pair<>(null, Double.MAX_VALUE)); + return new ClosestVertices(vertex, + new MeshPointImpl(closestPosition.getKey(), null, null), + closestPosition.getValue()); + } + + /** + * returns perpendicular projection from vertex to plane of triangle + * + * @param vertex vertex from which the projection is created + * @param triangle triangle that defines the plane + * @return projection to plane of triangle + */ + private Vector3d getProjectionToTrianglePlane(Vector3d vertex, List<Vector3d> triangle) { + Vector3d ab = new Vector3d(); + ab.sub(triangle.get(0), triangle.get(1)); + Vector3d ac = new Vector3d(); + ac.sub(triangle.get(0), triangle.get(2)); + Vector3d normal = new Vector3d(); + normal.cross(ab, ac); + normal.normalize(); + + Vector3d helperVector = new Vector3d(vertex); + helperVector.sub(triangle.get(0)); + double distance = helperVector.dot(normal); + helperVector.scaleAdd(-distance, normal, helperVector); + return helperVector; + } + + /** + * checks if a point in plane of triangle lies within the triangle + * + * @param point checked point + * @param triangle triangle + * @return true if point is in triangle, false otherwise + */ + private boolean isPointInTriangle(Vector3d point, List<Vector3d> triangle) { + List<Vector3d> pointToVertices = triangle.stream() + .map((vertex) -> { + Vector3d v = new Vector3d(vertex); + v.sub(point); + return v; + }).collect(Collectors.toList()); + + double angleSum = 0; + for (int i = 0; i < 3; i++) { + angleSum += pointToVertices.get(i).angle(pointToVertices.get((i + 1) % 3)); + } + angleSum -= Math.PI; + return -0.01 < angleSum && angleSum < 0.01; + } + + /** + * returns projection to to the nearest edge of triangle + * + * @param point point in plane of triangle + * @param triangle triangle + * @return perpendicular projection to the nearest edge + */ + private Vector3d getProjectionToClosestEdge(Vector3d point, List<Vector3d> triangle) { + Vector3d[] projections = new Vector3d[3]; + for (int i = 0; i < 3; i++) { + projections[i] = getProjectionToEdge(point, triangle.get(i), triangle.get((i + 1) % 3)); + } + + double minDistance = Double.MAX_VALUE; + Vector3d closestProjection = null; + Vector3d helperVector = new Vector3d(); + for (Vector3d projection : + projections) { + helperVector.sub(point, projection); + double distance = helperVector.length(); + if (distance < minDistance) { + minDistance = distance; + closestProjection = projection; + } + } + return closestProjection; + } + + /** + * returns projection to edge + * + * @param point point in plane of triangle + * @param edgeVertex1 first vertex of edge + * @param edgeVertex2 second vertex of edge + * @return projection to edge + */ + private Vector3d getProjectionToEdge(Vector3d point, Vector3d edgeVertex1, Vector3d edgeVertex2) { + Vector3d ab = new Vector3d(); + ab.sub(edgeVertex1, edgeVertex2); + Vector3d ap = new Vector3d(); + ap.sub(edgeVertex1, point); + double t = ab.dot(ap) / ab.lengthSquared(); + return new Vector3d(edgeVertex1.x + t * ab.x, edgeVertex1.y + t * ab.y, edgeVertex1.z + t * ab.z); + } + + + /** + * Helper class for pairs. + * + * @param <K> key + * @param <V> value + */ + private class Pair<K,V> { + private K key; + private V value; + + /** + * Constructor. + * @param key key + * @param value value + */ + public Pair(K key, V value) { + this.key = key; + this.value = value; + } + + public K getKey() { + return key; + } + + public V getValue() { + return value; + } + } +} diff --git a/Comparison/src/main/java/cz/fidentis/analyst/comparison/Registration.java b/Comparison/src/main/java/cz/fidentis/analyst/comparison/Registration.java new file mode 100644 index 0000000000000000000000000000000000000000..29385305a7f19ae18df527c0fb8ed1a077560e11 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/comparison/Registration.java @@ -0,0 +1,27 @@ +package cz.fidentis.analyst.comparison; + +import cz.fidentis.analyst.mesh.core.MeshFacet; + +/** + * + * @author Matej Lukes + */ +public class Registration { + + /** + * Heler method - TO DO + * + * @param facet main facet + * @param registeredFacet refistered facet + * @param method registration method + * @return TO DO + */ + public static MeshFacet register(MeshFacet facet, MeshFacet registeredFacet, RegistrationMethod method) { + switch (method) { + case NO_REGISTRATION: + return registeredFacet; + default: + return null; + } + } +} diff --git a/Comparison/src/main/java/cz/fidentis/analyst/comparison/RegistrationMethod.java b/Comparison/src/main/java/cz/fidentis/analyst/comparison/RegistrationMethod.java new file mode 100644 index 0000000000000000000000000000000000000000..3aefbf00eb4cf73dbf13fb08d0c40d597fa526d5 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/comparison/RegistrationMethod.java @@ -0,0 +1,8 @@ +package cz.fidentis.analyst.comparison; + +/** + * @author Matej Lukes + */ +public enum RegistrationMethod { + NO_REGISTRATION +} diff --git a/Comparison/src/main/java/cz/fidentis/analyst/symmetry/AproxSymmetryPlane.java.orig b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/AproxSymmetryPlane.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..6ddae7b0d4dcbd1e3e1bdfefb2495105dc732ed2 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/AproxSymmetryPlane.java.orig @@ -0,0 +1,42 @@ +package cz.fidentis.analyst.symmetry; + +/** + * + * @author Natália Bebjaková + * + * Respresents plane with added atribute - votes, that play role + * in decision about symmetry estimate of the 3D model + */ +public class AproxSymmetryPlane extends Plane implements Comparable<AproxSymmetryPlane> { + public Integer votes; + + /** + * returns number of votes that were given to plane while computing the symmetry + * + * @return Number of votes + */ + public Integer getVotes() { + return votes; + } + + /** + * + * @param plane Original plane without votes + * @param votes number of votes given to the plane + */ + public AproxSymmetryPlane(Plane plane, int votes) { + super(plane.a, plane.b, plane.c, plane.d); + this.votes = votes; + } + + /** + * Enables to compare two approximate planes due to number of votes + * + * @param other plane to be compared + * @return number that decides which plane has more votes + */ + @Override + public int compareTo(AproxSymmetryPlane other) { + return this.votes.compareTo(other.votes); + } +} diff --git a/Comparison/src/main/java/cz/fidentis/analyst/symmetry/Config.java.orig b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/Config.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..ed08d5aa943f9ce117d84e3bb8863f27c900bcc2 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/Config.java.orig @@ -0,0 +1,173 @@ +package cz.fidentis.analyst.symmetry; + +/** + * + * @author Natália Bebjaková + * + * Representation of configuration for symmetry estimate. + * Default numbers are given due to the best results on tested data. + * On many different 3D models, it exists other values of config that will have + * better impact on results in estimate of symmetry. + */ +public class Config { + private static final double DEFAULT_MIN_CURV_RATIO = 0.5; + private static final double DEFAULT_MIN_ANGLE_COS = 0.985; + private static final double DEFAULT_MIN_NORM_ANGLE_COS = 0.985; + private static final double DEFAULT_MAX_REL_DISTANCE = 1.0 / 100.0; + private static final int DEFAULT_SIGNIFICANT_POINT_COUNT = 200; + private static final boolean DEFAULT_AVERAGING = true; + + private double minCurvRatio; + private double minAngleCos; + private double minNormAngleCos; + private double maxRelDistance; + private int significantPointCount; + private boolean averaging; + + /** + * Parameter which denotes how similar the Gaussian curvatures in the two vertices + * must be for this criteria to be satisfied. + * The higher the value is the more similar they must be. + * + * @return minimal similarity of curvatures to satisfy the criteria + */ + public double getMinCurvRatio() { + return minCurvRatio; + } + + /** + * + * @param minCurvRatio new minimal similarity of curvatures to satisfy the criteria + */ + public void setMinCurvRatio(double minCurvRatio) { + this.minCurvRatio = minCurvRatio; + } + + /** + * MinAngleCos â (0,1) + * It is the angle between the vector (xk â’ xl) and the normal vector nij of the plane Ďij + * (which is the vector (xi â’xj)) + * Returns parameter which denotes how large the angle αij can be for this criteria to be satisfied. + * + * @return minimal angle satisfy criteria + */ + public double getMinAngleCos() { + return minAngleCos; + } + + /** + * + * @param minAngleCos new minimal angle to satisfy the criteria + */ + public void setMinAngleCos(double minAngleCos) { + this.minAngleCos = minAngleCos; + } + + /** + * MinNormAngleCos â (0,1) + * It is angle between vectors (xi â’ xj) and (ni â’ nj), where xi, xj are vertices and ni, nj its normals + * Returns parameter which denotes how large the angle αij can be for this criteria to be satisfied. + * + * @return minimal angle to satisfy criteria + */ + public double getMinNormAngleCos() { + return minNormAngleCos; + } + + /** + * + * @param minNormAngleCos new minimal angle to satisfy the criteria + */ + public void setMinNormAngleCos(double minNormAngleCos) { + this.minNormAngleCos = minNormAngleCos; + } + + /** + * Parameter which denotes how far (relatively to the length of the bounding box diagonal) + * the middle point of the two vertices can be from the plane in order to satisfy this criteria. + * + * @return relative distance + */ + public double getMaxRelDistance() { + return maxRelDistance; + } + + /** + * + * @param maxRelDistance new relative distance + */ + public void setMaxRelDistance(double maxRelDistance) { + this.maxRelDistance = maxRelDistance; + } + + /** + * Returns number of vertices with the highest Gaussian curvature. + * + * @return number of significant points for computing the symmetry + */ + public int getSignificantPointCount() { + return significantPointCount; + } + + /** + * + * @param significantPointCount new number of significant points for computing the symmetry + */ + public void setSignificantPointCount(int significantPointCount) { + this.significantPointCount = significantPointCount; + } + + /** + * If there are more planes with the same highest number of votes while computing symmetry, + * we can average them all together. + * Returns parameter that decides whether to average them or not. + * + * @return true if planes will be averaged + */ + public boolean isAveraging() { + return averaging; + } + + /** + * + * @param averaging new averaging flag + */ + public void setAveraging(boolean averaging) { + this.averaging = averaging; + } + + /** + * Creates new configuration with default values + * + * @return configuration with default values + */ + public static Config getDefault() { + Config conf = new Config(); + + conf.minCurvRatio = DEFAULT_MIN_CURV_RATIO; + conf.minAngleCos = DEFAULT_MIN_ANGLE_COS; + conf.minNormAngleCos = DEFAULT_MIN_NORM_ANGLE_COS; + conf.maxRelDistance = DEFAULT_MAX_REL_DISTANCE; + conf.significantPointCount = DEFAULT_SIGNIFICANT_POINT_COUNT; + conf.averaging = DEFAULT_AVERAGING; + + return conf; + } + + /** + * + * @return String representation of configuration + */ + @Override + public String toString() { + String str = "PARAMETERS: "; + str += "\n"; + str += "Min curvature ratio: " + minCurvRatio + "\n"; + str += "Min angle cosine: " + minAngleCos + "\n"; + str += "Min norm angle cosine: " + minNormAngleCos + "\n"; + str += "Max relative distance: " + maxRelDistance + "\n"; + str += "Significant points: " + significantPointCount + "\n"; + str += "Averaging: " + averaging + "\n"; + return str; + } +} \ No newline at end of file diff --git a/Comparison/src/main/java/cz/fidentis/analyst/symmetry/SymmetryEstimator.java b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/SymmetryEstimator.java index 50e9f043b3d572ea22ce7d7ac486c295fcabd574..385f0d4578dd833b351e8fbbdc8c603a642ad1da 100644 --- a/Comparison/src/main/java/cz/fidentis/analyst/symmetry/SymmetryEstimator.java +++ b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/SymmetryEstimator.java @@ -3,15 +3,11 @@ package cz.fidentis.analyst.symmetry; import cz.fidentis.analyst.mesh.core.CornerTableRow; import cz.fidentis.analyst.mesh.core.MeshFacet; import cz.fidentis.analyst.mesh.core.MeshPoint; -import cz.fidentis.analyst.mesh.core.MeshPointImpl; import cz.fidentis.analyst.mesh.core.BoundingBox; import cz.fidentis.analyst.mesh.core.MeshTriangle; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; import javax.swing.ImageIcon; import javax.swing.JOptionPane; import javax.swing.JPanel; diff --git a/Comparison/src/test/java/cz/fidentis/analyst/comparison/ComparisonTest.java b/Comparison/src/test/java/cz/fidentis/analyst/comparison/ComparisonTest.java new file mode 100644 index 0000000000000000000000000000000000000000..101d95a9c435994467c41afeea3b040127644dc4 --- /dev/null +++ b/Comparison/src/test/java/cz/fidentis/analyst/comparison/ComparisonTest.java @@ -0,0 +1,8 @@ +package cz.fidentis.analyst.comparison; + +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + +public class ComparisonTest { + +} \ No newline at end of file diff --git a/FIDENTIS-Analyst-parent.iml b/FIDENTIS-Analyst-parent.iml deleted file mode 100644 index 4fd5057cb905c9883efd97f2b04542e4458d711b..0000000000000000000000000000000000000000 --- a/FIDENTIS-Analyst-parent.iml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5"> - <output url="file://$MODULE_DIR$/target/classes" /> - <output-test url="file://$MODULE_DIR$/target/test-classes" /> - <content url="file://$MODULE_DIR$"> - <excludeFolder url="file://$MODULE_DIR$/target" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - </component> -</module> \ No newline at end of file diff --git a/GUI/GUI.iml.orig b/GUI/GUI.iml.orig new file mode 100644 index 0000000000000000000000000000000000000000..c8d17b0fcc3fd5901b27b5ab278bf6834713b660 --- /dev/null +++ b/GUI/GUI.iml.orig @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7"> + <output url="file://$MODULE_DIR$/target/classes" /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-annotations-common:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.jogamp.jogl:jogl-all:2.0-rc11" level="project" /> + <orderEntry type="module" module-name="MeshModel" /> + <orderEntry type="library" name="Maven: java3d:j3d-core-utils:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: java3d:vecmath:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: java3d:j3d-core:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: com.github.mokiat:java-data-front:v2.0.0" level="project" /> + <orderEntry type="library" name="Maven: javax.vecmath:vecmath:1.5.2" level="project" /> + </component> +</module> diff --git a/GUI/pom.xml b/GUI/pom.xml index efeda357b58b45c71271abf8d544a2b32baae2fb..257f71cbf5791bff83c2ac4c0973eab5eb09655d 100644 --- a/GUI/pom.xml +++ b/GUI/pom.xml @@ -101,4 +101,4 @@ <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> -</project> \ No newline at end of file +</project> diff --git a/GUI/pom.xml.orig b/GUI/pom.xml.orig new file mode 100644 index 0000000000000000000000000000000000000000..2dd78c26ee98914f8c7de9fe531ddcabe054db61 --- /dev/null +++ b/GUI/pom.xml.orig @@ -0,0 +1,107 @@ +<?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"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>cz.findetis</groupId> + <artifactId>FIDENTIS-Analyst-parent</artifactId> + <version>2.0</version> + </parent> + <artifactId>GUI</artifactId> + <packaging>nbm</packaging> + <build> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <useOSGiDependencies>true</useOSGiDependencies> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <useDefaultManifestFile>true</useDefaultManifestFile> + </configuration> + </plugin> + <!-- Check code style --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>${version.maven.plugin.checkstyle}</version> + <executions> + <execution> + <id>validate</id> + <phase>validate</phase> + <configuration> + <configLocation>codestyle.xml</configLocation> + <encoding>UTF-8</encoding> + <consoleOutput>true</consoleOutput> + <failOnViolation>${checkstyle.fail}</failOnViolation> + <violationSeverity>${checkstyle.severity}</violationSeverity> + <includeTestSourceDirectory>false</includeTestSourceDirectory> + </configuration> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>org.netbeans.api</groupId> + <artifactId>org-netbeans-api-annotations-common</artifactId> + <version>${netbeans.version}</version> + </dependency> +<<<<<<< HEAD +======= + <dependency> + <groupId>org.netbeans.api</groupId> + <artifactId>org-openide-util</artifactId> + <version>${netbeans.version}</version> + </dependency> + <dependency> + <groupId>org.netbeans.api</groupId> + <artifactId>org-openide-awt</artifactId> + <version>${netbeans.version}</version> + </dependency> + <dependency> + <groupId>org.netbeans.api</groupId> + <artifactId>org-openide-dialogs</artifactId> + <version>${netbeans.version}</version> + </dependency> + <dependency> + <groupId>org.jogamp.jogl</groupId> + <artifactId>jogl-all</artifactId> + <version>2.3.2</version> + <type>jar</type> + </dependency> + <dependency> + <groupId>org.jogamp.gluegen</groupId> + <artifactId>gluegen-rt-main</artifactId> + <version>2.3.2</version> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>MeshModel</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>Comparison</artifactId> + <version>${project.version}</version> + </dependency> + <dependency> + <groupId>javax.vecmath</groupId> + <artifactId>vecmath</artifactId> + <version>${version.javax.vecmath}</version> + </dependency> +>>>>>>> origin/master + </dependencies> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +</project> \ No newline at end of file diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.form.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.form.orig new file mode 100644 index 0000000000000000000000000000000000000000..45e7ae464fa91504631c23830fee4e4b73dfcefd --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.form.orig @@ -0,0 +1,308 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.9" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="0" type="rgb"/> + </Property> + </Properties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,93,0,0,1,-79"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> + <SubComponents> + <Container class="javax.swing.JLayeredPane" name="jLayeredPane1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="28" green="28" red="28" type="rgb"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="componentResized" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="jLayeredPane1ComponentResized"/> + <EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="jLayeredPane1ComponentShown"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription"> + <BorderConstraints direction="Center"/> + </Constraint> + </Constraints> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="true"/> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="resetButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/resetButton.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Reset position of model"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="resetButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="resetButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="resetButtonMouseExited"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="60" y="40" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="upNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/upButton.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Rotate up"/> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="upNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="upNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="60" y="10" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="leftNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/leftButton.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Rotate left"/> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="leftNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="leftNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="40" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="minusNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/minus.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Zoom out"/> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="minusNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="minusNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="90" y="90" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="downNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/downButton.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Rotate down"/> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="downNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="downNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="60" y="70" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="plusNavigationButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/plus.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Zoom in"/> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="plusNavigationButtonMousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="plusNavigationButtonMouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="90" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/navigBackground.png"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="10" width="90" height="90"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="loadModelButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/loadCanva.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="loadModelButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="loadModelButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="loadModelButtonMouseExited"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="200" y="100" width="210" height="220"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="rightNavigationButton1"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/rightButton.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Rotate right"/> + <Property name="borderPainted" type="boolean" value="false"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="rightNavigationButton1MousePressed"/> + <EventHandler event="mouseReleased" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="rightNavigationButton1MouseReleased"/> + </Events> + <AuxValues> + <AuxValue name="JLayeredPane.layer" type="java.lang.Integer" value="200"/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="90" y="40" width="30" height="30"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="whiteBackroundButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="White backround"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="whiteBackroundButtonMouseClicked"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="50" y="130" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="blackBackroundButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Dark background"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="blackBackroundButtonMouseClicked"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="50" y="190" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="0" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="jPanel1MouseWheelMoved"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> + </Constraint> + </Constraints> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..d43db88663c60bfdeec8cb6cb4e5eb461bdb5a05 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java.orig @@ -0,0 +1,746 @@ +package cz.fidentis.analyst.gui; + +import com.jogamp.opengl.GLCapabilities; +import com.jogamp.opengl.GLEventListener; +import com.jogamp.opengl.GLProfile; +import com.jogamp.opengl.awt.GLCanvas; +import cz.fidentis.analyst.mesh.io.ModelFileFilter; +import cz.fidentis.analyst.mesh.core.MeshModel; +import cz.fidentis.analyst.mesh.io.MeshObjLoader; +import com.jogamp.opengl.util.FPSAnimator; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.io.File; +import java.util.Timer; +import java.util.TimerTask; +import javax.swing.ImageIcon; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; + +/** + * + * @author Natália Bebjaková + * + * Canvas for displaying models containing GLCanvas and navigation. + */ +public class Canvas extends javax.swing.JPanel { + protected GLCanvas glCanvas; + protected long startClickTime = 0; + + protected TimerTask task; + protected Timer timer; + + protected GeneralGLEventListener listener; + + /** + * animator's target frames per second + */ + private static final int FPS = 60; + private final FPSAnimator animator; + + /** + * decides if model is displayed as wire-frame + */ + protected boolean drawWireModel; + + /** + * original model that is loaded from file + */ + protected MeshModel loadedModel; + + protected boolean loaded; + + /** + * + * @return true if model is loaded on canvas, false otherwise + */ + public boolean isLoaded() { + return loaded; + } + + /** + * Creates new form Canva + */ + public Canvas() { + initComponents(); + + // gl version 2 is used + GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2)); + capabilities.setDoubleBuffered(true); + + // creates new glCanvas panel for displaying model + glCanvas = new GLCanvas(capabilities); + jPanel1.add(glCanvas); + glCanvas.setVisible(false); + glCanvas.setBackground(Color.black); + + // enables glCanvas to react to events + glCanvas.requestFocusInWindow(); + glCanvas.setSize(getWidth() - getInsets().left - getInsets().right, getHeight() - getInsets().top - getInsets().bottom); + + // enables animated transition + animator = new FPSAnimator(glCanvas, FPS, true); + animator.start(); + listener = new GeneralGLEventListener(this); + + this.validate(); + } + + /** + * Changing the size of glCanvas + * + * @param d New size of glCanvas + */ + public void resizeCanvas(Dimension d) { + jPanel1.setSize(d); + glCanvas.setSize(d); + this.validate(); + this.repaint(); + loadModelButton.setLocation(this.getWidth() / 2 - 35, this.getHeight() / 2 - 40); + } + + /** + * + * @return Original model that is loaded from dile + */ + public MeshModel getLoadedModel() { + return loadedModel; + } + + /** + * Sets GLListener of the canvas + * + * @param listener GLListener for manipulation with model + */ + public void setListener(GeneralGLEventListener listener) { + this.listener = listener; + } + + + /** + * + * @param drawWire Decides if model is displayed as wife-frame + */ + public void setDrawWired(boolean drawWire) { + drawWireModel = drawWire; + } + /** + * + * @return Returns if model is displayed as wife-frame + */ + public boolean getDrawWired(){ + return drawWireModel; + } + + /** + * + * @param v Decides if button for loading model is visible + */ + public void setImportLabelVisible(Boolean v) { + loadModelButton.setVisible(v); + } + + /** + * Loads model selected in file chooser by user + */ + public void loadModel () { + String[] extensions = new String[2]; + extensions[0] = "obj"; + extensions[1] = "OBJ"; + + //enables to shows just .obj files in file chooser + ModelFileFilter filter = new ModelFileFilter(extensions, "*.obj"); + JFileChooser jFileChooser1 = new JFileChooser(); + jFileChooser1.setPreferredSize(new Dimension (800,500)); + + jFileChooser1.addChoosableFileFilter(filter); + + //file chooser will appear on top of glCanvas + jFileChooser1.showOpenDialog(this); + jFileChooser1.setDialogTitle("Import obj file"); + + File[] fileArray = new File[1]; + //saves selected file by user as first element in array + fileArray[0] = jFileChooser1.getSelectedFile(); + + if (fileArray.length <= 0) { + System.out.print("No file chosen."); + } else { + this.addModel(fileArray[0]); + } + glCanvas.setVisible(true); + } + + /** + * Loads the model in .obj format from file and adds this model to listener for displaying. + * If file does not contain 3D model or model is not correct, shows dialog with message + * + * @param file File from which model will be read + */ + private void addModel (final File file) { + try { + //static class MeshObjLaoder reads .obj file into model + MeshModel model = MeshObjLoader.read(new File (file.getPath())); + loadedModel = MeshObjLoader.read(new File (file.getPath())); + if (model != null) { + // listener enables to manipulate and interact with model + listener.setCameraPosition(0, 0, 300); + glCanvas.addGLEventListener((GLEventListener) listener); + listener.setModel(model); + listener.rotationAndSizeRestart(); + loadModelButton.setVisible(false); + loaded = true; + } + } catch (Exception e) { + System.out.println(e.getMessage()); + JOptionPane.showMessageDialog(this, "File doesn't contain any model", "Model is not loaded.", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/notLoadedModel.png"))); + System.out.println ("File doesn't contain any model"); + loaded = false; + } + } + + /** + * reset position of the displayed model + */ + public void resetPosition(){ + listener.rotationAndSizeRestart(); + } + + /** + * Changes the model to be displayed + * + * @param model New model that will be displayed on canvas + */ + public void changeModel(MeshModel model) { + MeshModel newModel = new MeshModel(model); + listener.setModel(newModel); + } + + /** + * Returns the model which is displayed on canvas + * + * @return Model that is displayed on canvas + */ + public MeshModel getModel() { + return listener.getModel(); + } + + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + * + * Generated code from NetBeans + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLayeredPane1 = new javax.swing.JLayeredPane(); + resetButton = new javax.swing.JLabel(); + upNavigationButton = new javax.swing.JButton(); + leftNavigationButton = new javax.swing.JButton(); + minusNavigationButton = new javax.swing.JButton(); + downNavigationButton = new javax.swing.JButton(); + plusNavigationButton = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + loadModelButton = new javax.swing.JLabel(); + rightNavigationButton1 = new javax.swing.JButton(); + whiteBackroundButton = new javax.swing.JLabel(); + blackBackroundButton = new javax.swing.JLabel(); + jPanel1 = new javax.swing.JPanel(); + + setBackground(new java.awt.Color(0, 0, 0)); + setLayout(new java.awt.BorderLayout()); + + jLayeredPane1.setBackground(new java.awt.Color(40, 40, 40)); + jLayeredPane1.setToolTipText(""); + jLayeredPane1.setOpaque(true); + jLayeredPane1.addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentResized(java.awt.event.ComponentEvent evt) { + jLayeredPane1ComponentResized(evt); + } + public void componentShown(java.awt.event.ComponentEvent evt) { + jLayeredPane1ComponentShown(evt); + } + }); + + resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/resetButton.png"))); // NOI18N + resetButton.setToolTipText("Reset position of model"); + resetButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + resetButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + resetButtonMouseMoved(evt); + } + }); + resetButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + resetButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + resetButtonMouseExited(evt); + } + }); + jLayeredPane1.add(resetButton); + resetButton.setBounds(60, 40, 30, 30); + + upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/upButton.png"))); // NOI18N + upNavigationButton.setToolTipText("Rotate up"); + upNavigationButton.setBorderPainted(false); + upNavigationButton.setContentAreaFilled(false); + upNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + upNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + upNavigationButtonMousePressed(evt); + } + public void mouseReleased(java.awt.event.MouseEvent evt) { + upNavigationButtonMouseReleased(evt); + } + }); + jLayeredPane1.setLayer(upNavigationButton, javax.swing.JLayeredPane.MODAL_LAYER); + jLayeredPane1.add(upNavigationButton); + upNavigationButton.setBounds(60, 10, 30, 30); + + leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/leftButton.png"))); // NOI18N + leftNavigationButton.setToolTipText("Rotate left"); + leftNavigationButton.setBorderPainted(false); + leftNavigationButton.setContentAreaFilled(false); + leftNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + leftNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + leftNavigationButtonMousePressed(evt); + } + public void mouseReleased(java.awt.event.MouseEvent evt) { + leftNavigationButtonMouseReleased(evt); + } + }); + jLayeredPane1.setLayer(leftNavigationButton, javax.swing.JLayeredPane.MODAL_LAYER); + jLayeredPane1.add(leftNavigationButton); + leftNavigationButton.setBounds(30, 40, 30, 30); + + minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/minus.png"))); // NOI18N + minusNavigationButton.setToolTipText("Zoom out"); + minusNavigationButton.setBorderPainted(false); + minusNavigationButton.setContentAreaFilled(false); + minusNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + minusNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + minusNavigationButtonMousePressed(evt); + } + public void mouseReleased(java.awt.event.MouseEvent evt) { + minusNavigationButtonMouseReleased(evt); + } + }); + jLayeredPane1.setLayer(minusNavigationButton, javax.swing.JLayeredPane.MODAL_LAYER); + jLayeredPane1.add(minusNavigationButton); + minusNavigationButton.setBounds(90, 90, 30, 30); + + downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/downButton.png"))); // NOI18N + downNavigationButton.setToolTipText("Rotate down"); + downNavigationButton.setBorderPainted(false); + downNavigationButton.setContentAreaFilled(false); + downNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + downNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + downNavigationButtonMousePressed(evt); + } + public void mouseReleased(java.awt.event.MouseEvent evt) { + downNavigationButtonMouseReleased(evt); + } + }); + jLayeredPane1.setLayer(downNavigationButton, javax.swing.JLayeredPane.MODAL_LAYER); + jLayeredPane1.add(downNavigationButton); + downNavigationButton.setBounds(60, 70, 30, 30); + + plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/plus.png"))); // NOI18N + plusNavigationButton.setToolTipText("Zoom in"); + plusNavigationButton.setBorderPainted(false); + plusNavigationButton.setContentAreaFilled(false); + plusNavigationButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + plusNavigationButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + plusNavigationButtonMousePressed(evt); + } + public void mouseReleased(java.awt.event.MouseEvent evt) { + plusNavigationButtonMouseReleased(evt); + } + }); + jLayeredPane1.setLayer(plusNavigationButton, javax.swing.JLayeredPane.MODAL_LAYER); + jLayeredPane1.add(plusNavigationButton); + plusNavigationButton.setBounds(30, 90, 30, 30); + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/navigBackground.png"))); // NOI18N + jLayeredPane1.add(jLabel1); + jLabel1.setBounds(30, 10, 90, 90); + + loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadCanva.png"))); // NOI18N + loadModelButton.setToolTipText(""); + loadModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + loadModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + loadModelButtonMouseMoved(evt); + } + }); + loadModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + loadModelButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + loadModelButtonMouseExited(evt); + } + }); + jLayeredPane1.add(loadModelButton); + loadModelButton.setBounds(200, 100, 210, 220); + + rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/rightButton.png"))); // NOI18N + rightNavigationButton1.setToolTipText("Rotate right"); + rightNavigationButton1.setBorderPainted(false); + rightNavigationButton1.setContentAreaFilled(false); + rightNavigationButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + rightNavigationButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + rightNavigationButton1MousePressed(evt); + } + public void mouseReleased(java.awt.event.MouseEvent evt) { + rightNavigationButton1MouseReleased(evt); + } + }); + jLayeredPane1.setLayer(rightNavigationButton1, javax.swing.JLayeredPane.MODAL_LAYER); + jLayeredPane1.add(rightNavigationButton1); + rightNavigationButton1.setBounds(90, 40, 30, 30); + + whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png"))); // NOI18N + whiteBackroundButton.setToolTipText("White backround"); + whiteBackroundButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + whiteBackroundButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + whiteBackroundButtonMouseClicked(evt); + } + }); + jLayeredPane1.add(whiteBackroundButton); + whiteBackroundButton.setBounds(50, 130, 56, 56); + + blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png"))); // NOI18N + blackBackroundButton.setToolTipText("Dark background"); + blackBackroundButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + blackBackroundButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + blackBackroundButtonMouseClicked(evt); + } + }); + jLayeredPane1.add(blackBackroundButton); + blackBackroundButton.setBounds(50, 190, 56, 56); + + jPanel1.setBackground(new java.awt.Color(0, 0, 0)); + jPanel1.addMouseWheelListener(new java.awt.event.MouseWheelListener() { + public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) { + jPanel1MouseWheelMoved(evt); + } + }); + jPanel1.setLayout(new java.awt.BorderLayout()); + jLayeredPane1.add(jPanel1); + jPanel1.setBounds(0, 0, 0, 0); + + add(jLayeredPane1, java.awt.BorderLayout.CENTER); + }// </editor-fold>//GEN-END:initComponents + + /** + * + * @param evt Resizing glCanvas cantaining components + */ + private void jLayeredPane1ComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jLayeredPane1ComponentResized + jPanel1.setBounds(0, 0, jLayeredPane1.getWidth(), jLayeredPane1.getHeight()); + glCanvas.setBounds(jLayeredPane1.getX(), jLayeredPane1.getY(), jLayeredPane1.getWidth(), jLayeredPane1.getHeight()); + loadModelButton.setLocation(this.getWidth() / 2 - 35, this.getHeight() / 2 - 40); + }//GEN-LAST:event_jLayeredPane1ComponentResized + + /** + * + * @param evt Showing glCanvas cantaining components + */ + private void jLayeredPane1ComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_jLayeredPane1ComponentShown + jPanel1.setBounds(0, 0, jLayeredPane1.getWidth(), jLayeredPane1.getHeight()); + glCanvas.setBounds(jLayeredPane1.getX(), jLayeredPane1.getY(), jLayeredPane1.getWidth(), jLayeredPane1.getHeight()); + loadModelButton.setLocation(this.getWidth() / 2 - 35, this.getHeight() / 2 - 40); + }//GEN-LAST:event_jLayeredPane1ComponentShown + + /** + * + * @param evt Enables to rotate left the model when left navigation button is pressed + */ + private void leftNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_leftNavigationButtonMousePressed + timer = new Timer(); + startClickTime = System.currentTimeMillis(); + task = new TimerTask() { + @Override + public void run() { + listener.rotateLeft(2); + } + }; + timer.schedule(task, 500, 100); + leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/leftButtonPressed.png"))); + }//GEN-LAST:event_leftNavigationButtonMousePressed + + /** + * + * @param evt Enables to rotate up the model when up navigation button is pressed + */ + private void upNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_upNavigationButtonMousePressed + timer = new Timer(); + startClickTime = System.currentTimeMillis(); + task = new TimerTask() { + @Override + public void run() { + listener.rotateUp(2); + } + }; + timer.schedule(task, 500, 100); + upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/upButtonPressed.png"))); + }//GEN-LAST:event_upNavigationButtonMousePressed + + /** + * + * @param evt Enables to rotate down the model when down navigation button is pressed + */ + private void downNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_downNavigationButtonMousePressed + timer = new Timer(); + startClickTime = System.currentTimeMillis(); + task = new TimerTask() { + @Override + public void run() { + listener.rotateDown(2); + } + }; + timer.schedule(task, 500, 100); + downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/downButtonPressed.png"))); + }//GEN-LAST:event_downNavigationButtonMousePressed + + /** + * + * @param evt Enables to zoom in the model when plus navigation button is pressed + */ + private void plusNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_plusNavigationButtonMousePressed + timer = new Timer(); + startClickTime = System.currentTimeMillis(); + task = new TimerTask() { + @Override + public void run() { + listener.zoomIn(3); + } + }; + timer.schedule(task, 500, 100); + plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/plusPressed.png"))); + }//GEN-LAST:event_plusNavigationButtonMousePressed + + /** + * + * @param evt Enables to zoom out the model when minus navigation button is pressed + */ + private void minusNavigationButtonMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_minusNavigationButtonMousePressed + timer = new Timer(); + startClickTime = System.currentTimeMillis(); + task = new TimerTask() { + @Override + public void run() { + listener.zoomOut(3); + } + }; + timer.schedule(task, 500, 100); + minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/minusPressed.png"))); + }//GEN-LAST:event_minusNavigationButtonMousePressed + + /** + * + * @param evt Stops rotating left + */ + private void leftNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_leftNavigationButtonMouseReleased + timer.cancel(); + if ((System.currentTimeMillis() - startClickTime) < 500) { + listener.rotateLeft(22.5); + } + startClickTime = 0; + leftNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/leftButton.png"))); + }//GEN-LAST:event_leftNavigationButtonMouseReleased + + /** + * + * @param evt Stops rotating up + */ + private void upNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_upNavigationButtonMouseReleased + timer.cancel(); + if ((System.currentTimeMillis() - startClickTime) < 500) { + listener.rotateUp(22.5); + } + startClickTime = 0; + upNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/upButton.png"))); + }//GEN-LAST:event_upNavigationButtonMouseReleased + + /** + * + * @param evt Stops rotating down + */ + private void downNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_downNavigationButtonMouseReleased + timer.cancel(); + if ((System.currentTimeMillis() - startClickTime) < 500) { + listener.rotateDown(22.5); + } + startClickTime = 0; + downNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/downButton.png"))); + }//GEN-LAST:event_downNavigationButtonMouseReleased + + /** + * + * @param evt Stops zooming in + */ + private void plusNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_plusNavigationButtonMouseReleased + timer.cancel(); + if ((System.currentTimeMillis() - startClickTime) < 500) { + listener.zoomIn(30); + } + startClickTime = 0; + plusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/plus.png"))); + }//GEN-LAST:event_plusNavigationButtonMouseReleased + + /** + * + * @param evt Stops zooming out + */ + private void minusNavigationButtonMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_minusNavigationButtonMouseReleased + timer.cancel(); + if ((System.currentTimeMillis() - startClickTime) < 500) { + listener.zoomOut(30); + } + startClickTime = 0; + minusNavigationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/minus.png"))); + }//GEN-LAST:event_minusNavigationButtonMouseReleased + + /** + * + * @param evt Laoding the .obj file when button pressed + */ + private void loadModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadModelButtonMouseClicked + loadModel(); + }//GEN-LAST:event_loadModelButtonMouseClicked + + /** + * + * @param evt Enables to zoom in and out the model by mouse wheeling + */ + private void jPanel1MouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_jPanel1MouseWheelMoved + if (evt.getWheelRotation() > 0) { + listener.zoomIn(-5 * evt.getWheelRotation()); + } else { + listener.zoomOut(5 * evt.getWheelRotation()); + } + }//GEN-LAST:event_jPanel1MouseWheelMoved + + /** + * + * @param evt Design is reacting to mouse movement + */ + private void loadModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadModelButtonMouseMoved + loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadCanvaClicked.png"))); + }//GEN-LAST:event_loadModelButtonMouseMoved + + /** + * + * @param evt Design is reacting to mouse movement + */ + private void loadModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_loadModelButtonMouseExited + loadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadCanva.png"))); + }//GEN-LAST:event_loadModelButtonMouseExited + + /** + * + * @param evt Enables to rotate down the model when down navigation button is pressed + */ + private void rightNavigationButton1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rightNavigationButton1MousePressed + timer = new Timer(); + startClickTime = System.currentTimeMillis(); + task = new TimerTask() { + @Override + public void run() { + listener.rotateRight(2); + } + }; + timer.schedule(task, 500, 100); + rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/rightButtonPressed.png"))); + }//GEN-LAST:event_rightNavigationButton1MousePressed + + /** + * + * @param evt Stops rotating right + */ + private void rightNavigationButton1MouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rightNavigationButton1MouseReleased + timer.cancel(); + if ((System.currentTimeMillis() - startClickTime) < 500) { + listener.rotateRight(22.5); + } + startClickTime = 0; + rightNavigationButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/rightButton.png"))); + }//GEN-LAST:event_rightNavigationButton1MouseReleased + + /** + * + * @param evt Position of model on glCanvas is set to starting position + */ + private void resetButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_resetButtonMouseClicked + listener.rotationAndSizeRestart(); + }//GEN-LAST:event_resetButtonMouseClicked + + /** + * + * @param evt Design is reacting to mouse movement + */ + private void resetButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_resetButtonMouseMoved + resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/resetButtonPressed.png"))); + resetButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + }//GEN-LAST:event_resetButtonMouseMoved + + /** + * + * @param evt Design is reacting to mouse movement + */ + private void resetButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_resetButtonMouseExited + resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/resetButton.png"))); + }//GEN-LAST:event_resetButtonMouseExited + + /** + * + * @param evt Changes backround of the canvas into white color + */ + private void whiteBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_whiteBackroundButtonMouseClicked + listener.setWhiteBackround(true); + whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/whiteBackroundCanvasPressed.png"))); + blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png"))); + }//GEN-LAST:event_whiteBackroundButtonMouseClicked + + /** + * + * @param evt Changes backround of the canvas into dark color + */ + private void blackBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_blackBackroundButtonMouseClicked + listener.setWhiteBackround(false); + whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png"))); + blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/blackBackroundCanvasPressed.png"))); + }//GEN-LAST:event_blackBackroundButtonMouseClicked + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel blackBackroundButton; + private javax.swing.JButton downNavigationButton; + private javax.swing.JLabel jLabel1; + private javax.swing.JLayeredPane jLayeredPane1; + private javax.swing.JPanel jPanel1; + private javax.swing.JButton leftNavigationButton; + private javax.swing.JLabel loadModelButton; + private javax.swing.JButton minusNavigationButton; + private javax.swing.JButton plusNavigationButton; + private javax.swing.JLabel resetButton; + private javax.swing.JButton rightNavigationButton1; + private javax.swing.JButton upNavigationButton; + private javax.swing.JLabel whiteBackroundButton; + // End of variables declaration//GEN-END:variables +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..94acd8f1e1a00b199ba054a539cb4eecbca9d256 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java.orig @@ -0,0 +1,502 @@ +package cz.fidentis.analyst.gui; + +import cz.fidentis.analyst.mesh.core.MeshModel; +import cz.fidentis.analyst.mesh.core.MeshFacet; +import com.jogamp.opengl.GL; +import static com.jogamp.opengl.GL.GL_DEPTH_TEST; +import static com.jogamp.opengl.GL.GL_FRONT_AND_BACK; +import static com.jogamp.opengl.GL.GL_VIEWPORT; +import com.jogamp.opengl.GL2; +import static com.jogamp.opengl.GL2GL3.GL_FILL; +import static com.jogamp.opengl.GL2GL3.GL_LINE; +import com.jogamp.opengl.GLAutoDrawable; +import com.jogamp.opengl.GLEventListener; +import static com.jogamp.opengl.fixedfunc.GLMatrixFunc.GL_MODELVIEW_MATRIX; +import static com.jogamp.opengl.fixedfunc.GLMatrixFunc.GL_PROJECTION_MATRIX; +import com.jogamp.opengl.glu.GLU; +import javax.vecmath.Vector3d; +import javax.vecmath.Vector3f; + +/** + * + * @author Natália Bebjaková + */ +public class GeneralGLEventListener implements GLEventListener { + /** + * MeshModel that is displayed + */ + private MeshModel model = new MeshModel(); + /** + * GLCanvas which listener belongs to + */ + protected Canvas glCanvas; + /** + * GLU object. + */ + protected GLU glu; + /** + * Usage of openGL version 2 + */ + protected GL2 gl; + /** + * The last viewport. + */ + protected int[] viewport = new int[4]; + /** + * The last model matrix. + */ + protected float[] modelViewMatrix = new float[16]; + /** + * The last projection matrix. + */ + protected float[] projectionMatrix = new float[16]; + /** + * The X coordinate of the last known mouse position during the scene rotation. + */ + int mouseX = 0; + /** + * The Y coordinate of the last know mouse position during the scene rotation. + */ + int mouseY = 0; + + protected Vector3f defaultPosition = new Vector3f(0, 0, 300); + protected Vector3f currentPosition = new Vector3f(0, 0, 300); + + protected double zCenter = 0; + protected double xCenter = 0; + protected double yCenter = 0; + + protected double zCameraPosition; + protected double xCameraPosition; + protected double yCameraPosition; + + protected double zUpPosition = 0; + protected double xUpPosition = 0; + protected double yUpPosition = 1; + + /** + * Decides if model is diplayed as wire-frame + */ + protected boolean wireModel = false; + /** + * Decides if the backround will be white + */ + protected boolean whiteBackround = false; + + /** + * + * @return is backround white or not + */ + public boolean isWhiteBackround() { + return whiteBackround; + } + + /** + * + * @return Matrix for model view + */ + public float[] getModelViewMatrix() { + return modelViewMatrix; + } + + /** + * + * @return Matrix for projection + */ + public float[] getProjectionMatrix() { + return projectionMatrix; + } + + /** + * + * @return GlCanvas for displaying + */ + public Canvas getGlCanvas() { + return glCanvas; + } + + /** + * + * @param drawWire Decides if model is displayed as wire-frame + */ + public void setWireMode(boolean drawWire) { + wireModel = drawWire; + } + + /** + * + * @param whiteBackround Is backround white or not + */ + public void setWhiteBackround(boolean whiteBackround) { + this.whiteBackround = whiteBackround; + } + + /** + * Creates new EventListener + * @param canvas GLCanvas which listener belongs to + */ + public GeneralGLEventListener(Canvas canvas) { + this.glCanvas = canvas; + } + + /** + * + * @param model Set model to be displayed + */ + public void setModel(MeshModel model) { + this.model = model; + } + + /** + * + * @return Returns displayed model + */ + public MeshModel getModel() { + return model; + } + + + /** + * Invoked when main frame is created + * @param glad Glad object + */ + @Override + public void init(GLAutoDrawable glad) { + + this.gl = (GL2) glad.getGL(); + glu = new GLU(); + + gl.setSwapInterval(1); + gl.glEnable(GL2.GL_LIGHTING); + gl.glEnable(GL2.GL_LIGHT0); + gl.glEnable(GL2.GL_DEPTH_TEST); + gl.glClearColor(0,0,0,0); // background for GLCanvas + gl.glClear(GL2.GL_COLOR_BUFFER_BIT); + + gl.glShadeModel(GL2.GL_SMOOTH); // use smooth shading + + gl.glDepthFunc(GL2.GL_LESS); + gl.glDepthRange(0.0, 1.0); + gl.glEnable(GL_DEPTH_TEST); + + gl.glEnable(GL2.GL_NORMALIZE); + gl.glDisable(GL2.GL_CULL_FACE); + } + + /** + * Invoked when main frame is closed + * @param glad Glad object + */ + @Override + public void dispose(GLAutoDrawable glad) { + } + + /** + * Invoked every frame. + * @param glad Glad object + */ + @Override + public void display(GLAutoDrawable glad) { + wireModel = glCanvas.getDrawWired(); // is wire-frame or not + if (whiteBackround) { + gl.glClearColor(0.9f,0.9f,0.9f,0); + } else { + gl.glClearColor(0.25f,0.25f,0.25f,0); + } + // background for GLCanvas + gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); + gl.glLoadIdentity(); + + // sets model to proper position + glu.gluLookAt(xCameraPosition, yCameraPosition, zCameraPosition, xCenter, yCenter, zCenter, xUpPosition, yUpPosition, zUpPosition); + + gl.glShadeModel(GL2.GL_SMOOTH); + gl.glGetIntegerv(GL_VIEWPORT, viewport, 0); + gl.glGetFloatv(GL_MODELVIEW_MATRIX, modelViewMatrix, 0); + gl.glGetFloatv(GL_PROJECTION_MATRIX, projectionMatrix, 0); + + //if there is any model, draw + if (model != null) { + if (wireModel) { + gl.glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); //drawn as wire-frame + drawWithoutTextures(model); + } else { + gl.glPolygonMode( GL_FRONT_AND_BACK, GL_FILL); // drawn as full traingles + drawWithoutTextures(model); + } + } + + //gl.glPopMatrix(); + gl.glFlush(); + } + + /** + * Loops through the facets and render each of them + * + * @param model model of the face + */ + public void drawWithoutTextures(MeshModel model) { + for (int i = 0; i < model.getFacets().size(); i++) { + renderFacet(model.getFacets().get(i)); + } + } + + /** + * Loops through the facet and render all the vertices as they are stored in corner table + * + * @param facet facet of model + */ + public void renderFacet(MeshFacet facet) { + gl.glBegin(GL2.GL_TRIANGLES); //vertices are rendered as triangles + + // get the normal and tex coords indicies for face i + for (int v = 0; v < facet.getCornerTable().getSize(); v++) { + // render the normals + Vector3d norm = facet.getVertices().get(facet.getCornerTable().getRow(v).getVertexIndex()).getNormal(); + if(norm != null) { + gl.glNormal3d(norm.x, norm.y, norm.z); + } + // render the vertices + Vector3d vert = facet.getVertices().get(facet.getCornerTable().getRow(v).getVertexIndex()).getPosition(); + gl.glVertex3d(vert.x, vert.y, vert.z); + } + gl.glEnd(); + + } + + /** + * + * @param glad Glad object + * @param x x + * @param y y + * @param width New width + * @param height New height + */ + @Override + public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) { + + if (height == 0) { + height = 1; // to avoid division by 0 in aspect ratio below + } + gl.glViewport(x, y, width, height); // size of drawing area + + float h = (float) height / (float) width; + + gl.glMatrixMode(GL2.GL_PROJECTION); + gl.glLoadIdentity(); + + glu.gluPerspective(65, width / (float) height, 5.0f, 1500.0f); + gl.glMatrixMode(GL2.GL_MODELVIEW); + gl.glLoadIdentity(); + + gl.glTranslatef(0.0f, 0.0f, -40.0f); + } + + /** + * + * @param x New x position + * @param y New y position + * @param z New z position + */ + public void setCameraPosition(float x, float y, float z) { + currentPosition.set(x, y, z); + + setNewCameraPosition(currentPosition); + zCameraPosition = defaultPosition.z; + xCameraPosition = defaultPosition.x; + yCameraPosition = defaultPosition.y; + } + + /** + * + * @param position New position of camera + */ + public void setNewCameraPosition(Vector3f position) { + xCameraPosition = position.x; + yCameraPosition = position.y; + zCameraPosition = position.z; + } + + /** + * + * @param degree degree of rotation + */ + public void rotateUp(double degree) { + rotate(-degree, 0); + } + + /** + * + * @param degree degree of rotation + */ + public void rotateDown(double degree) { + rotate(degree, 0); + } + + /** + * + * @param degree degree of rotation + */ + public void rotateLeft(double degree) { + rotate(0, degree); + } + + /** + * + * @param degree degree of rotation + */ + public void rotateRight(double degree) { + rotate(0, -degree); + } + + /** + * + * @return X axis + */ + private Vector3f getXaxis() { + Vector3f xAxis = new Vector3f( + (float) ((yCameraPosition - yCenter) *zUpPosition - (zCameraPosition - zCenter) * yUpPosition), + (float) ((zCameraPosition - zCenter) * xUpPosition - (xCameraPosition - xCenter) * zUpPosition), + (float) ((xCameraPosition - xCenter) * yUpPosition - xUpPosition * (yCameraPosition - yCenter))); + + float length = (float) Math.sqrt(xAxis.x * xAxis.x + + xAxis.y * xAxis.y + xAxis.z * xAxis.z); + xAxis.set(xAxis.x / length, xAxis.y / length, xAxis.z / length); + return xAxis; + } + + /** + * + * @return Y axis + */ + private Vector3f getYaxis() { + Vector3f yAxis = new Vector3f((float) xUpPosition, (float) yUpPosition, (float) zUpPosition); + float length = (float) Math.sqrt(yAxis.x * yAxis.x + + yAxis.y * yAxis.y + yAxis.z * yAxis.z); + yAxis.set((yAxis.x / length), (yAxis.y / length), (yAxis.z / length)); + return yAxis; + } + + /** + * Rotates object around axes that apear as horizontal and vertical axe on + * screen (paralel to the sceen edges), intersecting at the center of + * screen( i.e head center). + * + * @param xAngle angle around vertical axe on screen + * @param yAngle angle around horizontal axe on screen + */ + public void rotate(double xAngle, double yAngle) { + Vector3f xAxis = getXaxis(); + Vector3f yAxis = getYaxis(); + + Vector3f point = new Vector3f((float) xCameraPosition, + (float) yCameraPosition, (float) zCameraPosition); + + Vector3f camera = rotateAroundAxe(point, xAxis, Math.toRadians(xAngle)); + camera = rotateAroundAxe(camera, yAxis, Math.toRadians(yAngle)); + + point = new Vector3f((float) xUpPosition, (float) yUpPosition, (float) zUpPosition); + + Vector3f up = rotateAroundAxe(point, xAxis, Math.toRadians(xAngle)); + up = rotateAroundAxe(up, yAxis, Math.toRadians(yAngle)); + + xUpPosition = up.x; + yUpPosition = up.y; + zUpPosition = up.z; + + setNewCameraPosition(camera); + } + + /** + * + * @param xShift xShift + * @param yShift yShift + */ + public void move(double xShift, double yShift) { + Vector3f xAxis = getXaxis(); + Vector3f yAxis = getYaxis(); + + Vector3f shift = new Vector3f((float) (xAxis.x * xShift + yAxis.x * yShift), + (float) (xAxis.y * xShift + yAxis.y * yShift), (float) (xAxis.z * xShift + yAxis.z * yShift)); + Vector3f camera = new Vector3f((float) xCameraPosition + shift.x, (float) yCameraPosition + shift.y, + (float) zCameraPosition + shift.z); + xCenter += shift.x; + yCenter += shift.y; + zCenter += shift.z; + + setNewCameraPosition(camera); + } + + /** + * Calculate the new position f point from given angle and rotation axe. + * + * @param point original position + * @param u vector of rotation axe + * @param angle angle of rotation + * @return new position + */ + public Vector3f rotateAroundAxe(Vector3f point, Vector3f u, double angle) { + Vector3f p; + float x = (float) ((Math.cos(angle) + u.x * u.x * (1 - Math.cos(angle))) * point.x + + (u.x * u.y * (1 - Math.cos(angle)) - u.z * Math.sin(angle)) * point.y + + (u.x * u.z * (1 - Math.cos(angle)) + u.y * Math.sin(angle)) * point.z); + float y = (float) ((u.x * u.y * (1 - Math.cos(angle)) + u.z * Math.sin(angle)) * point.x + + (Math.cos(angle) + u.y * u.y * (1 - Math.cos(angle))) * point.y + + (u.y * u.z * (1 - Math.cos(angle)) - u.x * Math.sin(angle)) * point.z); + float z = (float) ((u.x * u.z * (1 - Math.cos(angle)) - u.y * Math.sin(angle)) * point.x + + (u.y * u.z * (1 - Math.cos(angle)) + u.x * Math.sin(angle)) * point.y + + (Math.cos(angle) + u.z * u.z * (1 - Math.cos(angle))) * point.z); + p = new Vector3f(x, y, z); + + return p; + } + + /** + * Sets model to the starting position + */ + public void rotationAndSizeRestart() { + xUpPosition = 0; + yUpPosition = 1; + zUpPosition = 0; + + setNewCameraPosition(defaultPosition); + xCenter = 0; + yCenter = 0; + zCenter = 0; + } + + /** + * + * @param distance Distance to be zoom in + */ + public void zoomIn(double distance) { + double x = xCameraPosition - xCenter; + double y = yCameraPosition - yCenter; + double z = zCameraPosition - zCenter; + double sqrt = Math.sqrt(x * x + y * y + z * z); + + if (sqrt > 0) { + xCameraPosition = xCenter + ((sqrt - distance) * x / sqrt); + yCameraPosition = yCenter + ((sqrt - distance) * y / sqrt); + zCameraPosition = zCenter + ((sqrt - distance) * z / sqrt); + } + } + + /** + * + * @param distance Distance to be zoom out + */ + public void zoomOut(double distance) { + double x = xCameraPosition - xCenter; + double y = yCameraPosition - yCenter; + double z = zCameraPosition - zCenter; + double sqrt = Math.sqrt(x * x + y * y + z * z); + + if (sqrt == 0) { + sqrt = 1; + } + xCameraPosition = xCenter + ((sqrt + distance) * x / sqrt); + yCameraPosition = yCenter + ((sqrt + distance) * y / sqrt); + zCameraPosition = zCenter + ((sqrt + distance) * z / sqrt); + } +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form.orig new file mode 100644 index 0000000000000000000000000000000000000000..65d045392839a2d7c63dd98b9731e7518c2821a6 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form.orig @@ -0,0 +1,505 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="symetrySpecificationPanel" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="symetrySpecificationPanel" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="symetrySpecificationPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e2" green="e6" red="b0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="defaultValues" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="17" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="154" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="showPlaneLabel" min="-2" pref="147" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="originalModelButton" min="-2" pref="181" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + <Component id="minCurvatio8" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="averagingCheckBox" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="symetryButton" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="infoMinAngleCos" min="-2" max="-2" attributes="0"/> + <Component id="infoRelDist" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="infoNormalAngle" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="infoPoints" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="infoMinCurv" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="minCurvatio4" pref="157" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="minCurvatio" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio3" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio2" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="significantPointLabel" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="curavatureSlider" alignment="1" pref="0" max="32767" attributes="0"/> + <Component id="relativeDistanceSlider" alignment="1" pref="0" max="32767" attributes="0"/> + <Component id="significantPointSlider" alignment="1" min="-2" pref="164" max="-2" attributes="0"/> + <Component id="angleCosineSlider" alignment="1" min="-2" pref="164" max="-2" attributes="0"/> + </Group> + <Component id="normalAngleSlider" min="-2" pref="164" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="distanceTextField" max="32767" attributes="0"/> + <Component id="normalTextField" alignment="0" max="32767" attributes="0"/> + <Component id="significantTextField" min="-2" pref="46" max="-2" attributes="0"/> + <Component id="textFieldCurvature" min="-2" pref="46" max="-2" attributes="0"/> + <Component id="textFieldMinCos" min="-2" pref="46" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" alignment="1" groupAlignment="0" attributes="0"> + <Component id="infoPoints" min="-2" max="-2" attributes="0"/> + <Component id="significantPointLabel" min="-2" pref="27" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="1" groupAlignment="0" attributes="0"> + <Component id="significantTextField" min="-2" max="-2" attributes="0"/> + <Component id="significantPointSlider" min="-2" pref="28" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="minCurvatio" min="-2" pref="26" max="-2" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Component id="textFieldCurvature" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="4" max="-2" attributes="0"/> + </Group> + <Component id="infoMinCurv" min="-2" max="-2" attributes="0"/> + <Component id="curavatureSlider" min="-2" pref="26" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="infoMinAngleCos" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio2" alignment="1" min="-2" pref="26" max="-2" attributes="0"/> + <Component id="textFieldMinCos" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="angleCosineSlider" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="normalAngleSlider" max="32767" attributes="0"/> + <Component id="normalTextField" max="32767" attributes="0"/> + </Group> + <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/> + <Component id="distanceTextField" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="minCurvatio4" min="-2" pref="27" max="-2" attributes="0"/> + <Component id="infoNormalAngle" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="infoRelDist" alignment="1" min="-2" max="-2" attributes="0"/> + <Group type="103" alignment="1" groupAlignment="0" attributes="0"> + <Component id="relativeDistanceSlider" min="-2" pref="22" max="-2" attributes="0"/> + <Component id="minCurvatio3" min="-2" pref="26" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="13" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="defaultValues" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="17" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="symetryButton" min="-2" pref="75" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="originalModelButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="averagingCheckBox" min="-2" max="-2" attributes="0"/> + <Component id="minCurvatio8" min="-2" pref="28" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="53" max="32767" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="45" max="-2" attributes="0"/> + <Component id="showPlaneLabel" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="27" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JSlider" name="curavatureSlider"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="fa" green="fa" red="fa" type="rgb"/> + </Property> + <Property name="majorTickSpacing" type="int" value="1"/> + <Property name="minimum" type="int" value="50"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JSlider" name="angleCosineSlider"> + <Properties> + <Property name="minimum" type="int" value="80"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Min. Curvature Ratio"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Min. Angle Cosine"/> + </Properties> + </Component> + <Component class="javax.swing.JSlider" name="normalAngleSlider"> + <Properties> + <Property name="minimum" type="int" value="80"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Relative Distance"/> + </Properties> + </Component> + <Component class="javax.swing.JSlider" name="significantPointSlider"> + <Properties> + <Property name="majorTickSpacing" type="int" value="100"/> + <Property name="maximum" type="int" value="300"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Normal Angle Cosine"/> + </Properties> + </Component> + <Component class="javax.swing.JSlider" name="relativeDistanceSlider"> + <Properties> + <Property name="maximum" type="int" value="5"/> + <Property name="snapToTicks" type="boolean" value="true"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="significantPointLabel"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Significant Points"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="symetryButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/symetryCount.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="symetryButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="symetryButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="symetryButtonMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JCheckBox" name="averagingCheckBox"> + <Properties> + <Property name="selected" type="boolean" value="true"/> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="averagingCheckBoxMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="textFieldCurvature"> + <Properties> + <Property name="text" type="java.lang.String" value="0.5"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="textFieldMinCos"> + <Properties> + <Property name="text" type="java.lang.String" value="0.985"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="normalTextField"> + <Properties> + <Property name="text" type="java.lang.String" value="0.985"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="distanceTextField"> + <Properties> + <Property name="text" type="java.lang.String" value="0.01"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="significantTextField"> + <Properties> + <Property name="text" type="java.lang.String" value="200"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="minCurvatio8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Averaging"/> + <Property name="toolTipText" type="java.lang.String" value="Average planes with highest number of votes"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + </Component> + <Component class="javax.swing.JLabel" name="originalModelButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/originalModel.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="originalModelButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="originalModelButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="originalModelButtonMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="showPlaneLabel"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="16" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/show2.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Show plane"/> + <Property name="toolTipText" type="java.lang.String" value="Show approximate plane of symmetry"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="doubleBuffered" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="showPlaneLabelMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="defaultValues"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="14" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Default values"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="defaultValuesMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="infoPoints"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/info.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Info "/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="infoPointsMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="infoMinAngleCos"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/info.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Info "/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="infoMinAngleCosMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="infoRelDist"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/info.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Info "/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="infoRelDistMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="infoNormalAngle"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/info.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Info "/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="infoNormalAngleMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="infoMinCurv"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/info.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Info "/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="infoMinCurvMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.java.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..2a9889fe2734364490585a4744783e2dcece20bf --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.java.orig @@ -0,0 +1,726 @@ +package cz.fidentis.analyst.gui; + +import static cz.fidentis.analyst.gui.UserInterface.frameMain; +import cz.fidentis.analyst.mesh.core.MeshModel; +import cz.fidentis.analyst.symmetry.Config; +import cz.fidentis.analyst.symmetry.Plane; +import cz.fidentis.analyst.symmetry.SymmetryEstimator; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.swing.JSlider; +import javax.swing.JTextField; +import javax.swing.event.ChangeEvent; + +/** + * + * @author Natália Bebjaková + * + * Panel for estimating approximate symmetry of the model + */ +public final class SymmetryPanel extends javax.swing.JPanel { + /** + * Configuration with optional parameters of the algorithm + */ + private Config config; + /** + * GL Canvas on which model is displayed + */ + private Canvas canvas; + /** + * Class that is responsible for computing the symmetry + */ + private SymmetryEstimator symCounter; + /** + * Computed approximate plane of the symmetry + */ + private Plane finalPlane; + + /** + * + * @return GL canvas for displaying the model + */ + public Canvas getCanvas() { + return canvas; + } + + /** + * Sets canvas for displaying the model + * + * @param canvas GL Canvas + */ + public void setCanvas(Canvas canvas) { + this.canvas = canvas; + } + + /** + * + * @return Configuration for computing symmetry + */ + public Config getConfig() { + return config; + } + + /** + * + * @param config Configuration for computing symmetry + */ + public void setConfig(Config config) { + this.config = config; + } + + + /** + * Sets configuration values according to text fields on panel + * User can change this text fields + */ + public void setConfigParams() { + config.setMaxRelDistance(Double.parseDouble(distanceTextField.getText())); + config.setMinAngleCos(Double.parseDouble(textFieldMinCos.getText())); + config.setMinCurvRatio(Double.parseDouble(textFieldCurvature.getText())); + config.setMinNormAngleCos(Double.parseDouble(normalTextField.getText())); + config.setSignificantPointCount(Integer.parseInt(significantTextField.getText())); + } + + /** + * Sets values in text field according to configuration + */ + public void setTextFieldsDueToConfig() { + distanceTextField.setText(Double.toString(config.getMaxRelDistance())); + textFieldMinCos.setText(Double.toString(config.getMinAngleCos())); + textFieldCurvature.setText(Double.toString(config.getMinCurvRatio())); + normalTextField.setText(Double.toString(config.getMinNormAngleCos())); + significantTextField.setText(Integer.toString(config.getSignificantPointCount())); + } + + /** + * + * @param slider Slider + * @param field text field which belongs to slider + */ + public void setSlider(JSlider slider, JTextField field) { + slider.setValue((int) (Double.parseDouble(field.getText()) * 100)); + + slider.addChangeListener((ChangeEvent ce) -> { + field.setText(""+slider.getValue()/100.0); + defaultValues.setVisible(true); + }); + + } + + /** + * Sets values of the sliders according to textFields + */ + public void setSliders() { + setSlider(relativeDistanceSlider, distanceTextField); + setSlider(curavatureSlider, textFieldCurvature); + setSlider(angleCosineSlider, textFieldMinCos); + setSlider(normalAngleSlider, normalTextField); + + significantPointSlider.setValue((int) (Double.parseDouble(significantTextField.getText()))); + significantPointSlider.addChangeListener((ChangeEvent ce) -> { + significantTextField.setText("" + significantPointSlider.getValue()); + }); + } + + /** + * If plane of symmtery is computed, three new buttons are shown on panel + * + * @param isComputed true if plane is computed and shown on model otherwise false + */ + public void showPlaneButtonsOnPanel(boolean isComputed) { + originalModelButton.setVisible(isComputed); + showPlaneLabel.setVisible(isComputed); + } + + /** + * Creates new form symmetryPanel + */ + public SymmetryPanel() { + initComponents(); + config = Config.getDefault(); + setSliders(); + + showPlaneButtonsOnPanel(false); + } + + /** + * Calculate approxy symmetry of the model + * Accuracy of the symmetry plane is influenced by configuration represented by config + * + * @throws InterruptedException exception can be thrown beacause of progress monitor + */ + private void countSymmetry() throws InterruptedException { + MeshModel model = new MeshModel(); + canvas.changeModel(canvas.getLoadedModel()); + symCounter = new SymmetryEstimator(canvas.getModel().getFacets().get(0), config); + symCounter.setPanel(this); + finalPlane = symCounter.getAproxSymmetryPlane(); + SymmetryEstimator counted = symCounter.mergeWithPlane(finalPlane); + model.addFacet(counted.getFacet()); + + this.canvas.changeModel(model); + } + + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + * + * Code generated by NetBeans + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + symetrySpecificationPanel = new javax.swing.JPanel(); + curavatureSlider = new javax.swing.JSlider(); + angleCosineSlider = new javax.swing.JSlider(); + minCurvatio = new javax.swing.JLabel(); + minCurvatio2 = new javax.swing.JLabel(); + normalAngleSlider = new javax.swing.JSlider(); + minCurvatio3 = new javax.swing.JLabel(); + significantPointSlider = new javax.swing.JSlider(); + minCurvatio4 = new javax.swing.JLabel(); + relativeDistanceSlider = new javax.swing.JSlider(); + significantPointLabel = new javax.swing.JLabel(); + symetryButton = new javax.swing.JLabel(); + averagingCheckBox = new javax.swing.JCheckBox(); + textFieldCurvature = new javax.swing.JTextField(); + textFieldMinCos = new javax.swing.JTextField(); + normalTextField = new javax.swing.JTextField(); + distanceTextField = new javax.swing.JTextField(); + significantTextField = new javax.swing.JTextField(); + minCurvatio8 = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); + originalModelButton = new javax.swing.JLabel(); + showPlaneLabel = new javax.swing.JLabel(); + defaultValues = new javax.swing.JLabel(); + infoPoints = new javax.swing.JLabel(); + infoMinAngleCos = new javax.swing.JLabel(); + infoRelDist = new javax.swing.JLabel(); + infoNormalAngle = new javax.swing.JLabel(); + infoMinCurv = new javax.swing.JLabel(); + + symetrySpecificationPanel.setBackground(new java.awt.Color(176, 230, 226)); + + curavatureSlider.setBackground(new java.awt.Color(250, 250, 250)); + curavatureSlider.setMajorTickSpacing(1); + curavatureSlider.setMinimum(50); + curavatureSlider.setSnapToTicks(true); + curavatureSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + curavatureSlider.setOpaque(false); + + angleCosineSlider.setMinimum(80); + angleCosineSlider.setSnapToTicks(true); + angleCosineSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + angleCosineSlider.setOpaque(false); + + minCurvatio.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N + minCurvatio.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio.setText("Min. Curvature Ratio"); + + minCurvatio2.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N + minCurvatio2.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio2.setText("Min. Angle Cosine"); + + normalAngleSlider.setMinimum(80); + normalAngleSlider.setSnapToTicks(true); + normalAngleSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + normalAngleSlider.setOpaque(false); + + minCurvatio3.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N + minCurvatio3.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio3.setText("Relative Distance"); + + significantPointSlider.setMajorTickSpacing(100); + significantPointSlider.setMaximum(300); + significantPointSlider.setSnapToTicks(true); + significantPointSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + significantPointSlider.setOpaque(false); + + minCurvatio4.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N + minCurvatio4.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio4.setText("Normal Angle Cosine"); + + relativeDistanceSlider.setMaximum(5); + relativeDistanceSlider.setSnapToTicks(true); + relativeDistanceSlider.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + relativeDistanceSlider.setOpaque(false); + + significantPointLabel.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N + significantPointLabel.setForeground(new java.awt.Color(20, 114, 105)); + significantPointLabel.setText("Significant Points"); + + symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryCount.png"))); // NOI18N + symetryButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + symetryButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + symetryButtonMouseMoved(evt); + } + }); + symetryButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + symetryButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + symetryButtonMouseExited(evt); + } + }); + + averagingCheckBox.setSelected(true); + averagingCheckBox.setOpaque(false); + averagingCheckBox.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + averagingCheckBoxMouseClicked(evt); + } + }); + + textFieldCurvature.setText("0.5"); + textFieldCurvature.setToolTipText(""); + + textFieldMinCos.setText("0.985"); + textFieldMinCos.setToolTipText(""); + + normalTextField.setText("0.985"); + normalTextField.setToolTipText(""); + + distanceTextField.setText("0.01"); + distanceTextField.setToolTipText(""); + + significantTextField.setText("200"); + significantTextField.setToolTipText(""); + + minCurvatio8.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N + minCurvatio8.setForeground(new java.awt.Color(20, 114, 105)); + minCurvatio8.setText("Averaging"); + minCurvatio8.setToolTipText("Average planes with highest number of votes"); + + originalModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/originalModel.png"))); // NOI18N + originalModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + originalModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + originalModelButtonMouseMoved(evt); + } + }); + originalModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + originalModelButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + originalModelButtonMouseExited(evt); + } + }); + + showPlaneLabel.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N + showPlaneLabel.setForeground(new java.awt.Color(20, 114, 105)); + showPlaneLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/show2.png"))); // NOI18N + showPlaneLabel.setText("Show plane"); + showPlaneLabel.setToolTipText("Show approximate plane of symmetry"); + showPlaneLabel.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + showPlaneLabel.setDoubleBuffered(true); + showPlaneLabel.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + showPlaneLabelMouseClicked(evt); + } + }); + + defaultValues.setFont(new java.awt.Font("Arial", 0, 14)); // NOI18N + defaultValues.setForeground(new java.awt.Color(20, 114, 105)); + defaultValues.setText("Default values"); + defaultValues.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + defaultValues.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + defaultValuesMouseClicked(evt); + } + }); + + infoPoints.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/info.png"))); // NOI18N + infoPoints.setToolTipText("Info "); + infoPoints.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + infoPoints.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + infoPointsMouseClicked(evt); + } + }); + + infoMinAngleCos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/info.png"))); // NOI18N + infoMinAngleCos.setToolTipText("Info "); + infoMinAngleCos.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + infoMinAngleCos.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + infoMinAngleCosMouseClicked(evt); + } + }); + + infoRelDist.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/info.png"))); // NOI18N + infoRelDist.setToolTipText("Info "); + infoRelDist.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + infoRelDist.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + infoRelDistMouseClicked(evt); + } + }); + + infoNormalAngle.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/info.png"))); // NOI18N + infoNormalAngle.setToolTipText("Info "); + infoNormalAngle.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + infoNormalAngle.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + infoNormalAngleMouseClicked(evt); + } + }); + + infoMinCurv.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/info.png"))); // NOI18N + infoMinCurv.setToolTipText("Info "); + infoMinCurv.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + infoMinCurv.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + infoMinCurvMouseClicked(evt); + } + }); + + javax.swing.GroupLayout symetrySpecificationPanelLayout = new javax.swing.GroupLayout(symetrySpecificationPanel); + symetrySpecificationPanel.setLayout(symetrySpecificationPanelLayout); + symetrySpecificationPanelLayout.setHorizontalGroup( + symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(defaultValues)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(17, 17, 17) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(154, 154, 154) + .addComponent(jLabel1)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addComponent(showPlaneLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(originalModelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addContainerGap() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(minCurvatio8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(averagingCheckBox) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(symetryButton)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(infoMinAngleCos) + .addComponent(infoRelDist) + .addComponent(infoNormalAngle) + .addComponent(infoPoints) + .addComponent(infoMinCurv)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(minCurvatio4, javax.swing.GroupLayout.DEFAULT_SIZE, 157, Short.MAX_VALUE) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(minCurvatio) + .addComponent(minCurvatio3) + .addComponent(minCurvatio2) + .addComponent(significantPointLabel)) + .addGap(0, 0, Short.MAX_VALUE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(curavatureSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addComponent(relativeDistanceSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .addComponent(significantPointSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(angleCosineSlider, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(normalAngleSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(distanceTextField) + .addComponent(normalTextField) + .addComponent(significantTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(textFieldCurvature, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(textFieldMinCos, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)))))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + symetrySpecificationPanelLayout.setVerticalGroup( + symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(infoPoints) + .addComponent(significantPointLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(significantTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(significantPointSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(minCurvatio, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addComponent(textFieldCurvature, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(4, 4, 4)) + .addComponent(infoMinCurv) + .addComponent(curavatureSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(infoMinAngleCos, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(minCurvatio2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(textFieldMinCos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(angleCosineSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(normalAngleSlider, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(normalTextField)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(distanceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(minCurvatio4, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(infoNormalAngle)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(infoRelDist, javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(relativeDistanceSlider, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(minCurvatio3, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(13, 13, 13))) + .addComponent(defaultValues) + .addGap(17, 17, 17) + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addComponent(symetryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(originalModelButton) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(symetrySpecificationPanelLayout.createSequentialGroup() + .addGroup(symetrySpecificationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(averagingCheckBox) + .addComponent(minCurvatio8, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 53, Short.MAX_VALUE) + .addComponent(jLabel1) + .addGap(45, 45, 45) + .addComponent(showPlaneLabel) + .addContainerGap(27, Short.MAX_VALUE)))) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(symetrySpecificationPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(symetrySpecificationPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + }// </editor-fold>//GEN-END:initComponents + + /** + * + * @param evt Final computed plane is shown to user + */ + private void showPlaneLabelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_showPlaneLabelMouseClicked + JOptionPane.showMessageDialog(frameMain, "Approximate plane of symmetry: \n" + finalPlane.a + "\n" + finalPlane.b + "\n" + finalPlane.c + "\n" + + finalPlane.d + "\n", "Final plane.", 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/showPlanePane.png"))); + }//GEN-LAST:event_showPlaneLabelMouseClicked + + /** + * + * @param evt Changes button + */ + private void originalModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_originalModelButtonMouseExited + originalModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/originalModel.png"))); + }//GEN-LAST:event_originalModelButtonMouseExited + + /** + * + * @param evt Original model (without plane) is displayed + */ + private void originalModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_originalModelButtonMouseClicked + canvas.changeModel(canvas.getLoadedModel()); + showPlaneButtonsOnPanel(false); + }//GEN-LAST:event_originalModelButtonMouseClicked + + /** + * + * @param evt Changes button + */ + private void originalModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_originalModelButtonMouseMoved + originalModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/originalModelPressed.png"))); + }//GEN-LAST:event_originalModelButtonMouseMoved + + /** + * + * @param evt Decides if averaging is ON or OFF + */ + private void averagingCheckBoxMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_averagingCheckBoxMouseClicked + if(config.isAveraging()) { + config.setAveraging(false); + } else { + config.setAveraging(true); + } + }//GEN-LAST:event_averagingCheckBoxMouseClicked + + /** + * + * @param evt Changes button + */ + private void symetryButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryButtonMouseExited + symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryCount.png"))); + }//GEN-LAST:event_symetryButtonMouseExited + + /** + * + * @param evt Symmetry is estimated. If model is not loaded, user is warned + */ + private void symetryButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryButtonMouseClicked + setConfigParams(); + if (canvas.getModel().getFacets().isEmpty()){ + JOptionPane.showMessageDialog(frameMain, "You have to load the model.", "Model not loaded", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/notLoadedModel.png"))); + } else { + try { + countSymmetry(); + } catch (InterruptedException ex) { + Logger.getLogger(SymmetryPanel.class.getName()).log(Level.SEVERE, null, ex); + } + showPlaneButtonsOnPanel(true); + } + }//GEN-LAST:event_symetryButtonMouseClicked + + /** + * + * @param evt Changes button + */ + private void symetryButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryButtonMouseMoved + symetryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryCountClicked.png"))); + }//GEN-LAST:event_symetryButtonMouseMoved + + /** + * + * @param evt configuration is set to deafult values + */ + private void defaultValuesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_defaultValuesMouseClicked + config = Config.getDefault(); + setTextFieldsDueToConfig(); + setSliders(); + }//GEN-LAST:event_defaultValuesMouseClicked + + /** + * Shows details about minimum curv ratio parameter + * + * @param evt + */ + private void infoMinCurvMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_infoMinCurvMouseClicked + JOptionPane.showMessageDialog(frameMain, + "Entered number represents how similar the curvature in two vertices must be\n" + + "to take into account these vertices while counting the plane of approximate symmetry.\n" + + "The higher the number is the more similar they must be.\n\n" + + + "Higher number → fewer pairs of vertices satisfy the criterion → shorter calculation, possibly less accurate result.\n" + + "Lower number → more pairs of vertices satisfy the criterion → longer calculation, possibly more accurate result.", + "Minimum curvature ratio", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/curvature.png"))); + }//GEN-LAST:event_infoMinCurvMouseClicked + + /** + * Shows details about maximum relative distance parameter + * + * @param evt + */ + private void infoRelDistMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_infoRelDistMouseClicked + JOptionPane.showMessageDialog(frameMain, + "Entered number represents how far middle point of two vertices can be from candidate plane of symmetry\n" + + "to give this plane vote. Plane with highest number of votes is plane of approximate symmetry.\n\n" + + + "Higher number → more pairs of vertices satisfy the criterion → longer calculation, possibly more accurate result.\n" + + "Lower number → fewer pairs of vertices satisfy the criterion → shorter calculation, possibly less accurate result.", + "Maximum relative distance from plane", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/distance.png"))); + }//GEN-LAST:event_infoRelDistMouseClicked + + /** + * Shows details about significant points parameter + * + * @param evt + */ + private void infoPointsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_infoPointsMouseClicked + JOptionPane.showMessageDialog(frameMain, + "Entered number represents amount of points of the mesh that are taken into account\n" + + "while counting the plane of approximate symmetry.\n\n" + + + "Higher number → longer calculation, possibly more accurate result.\n" + + "Lower number → shorter calculation, possibly less accurate result.", + "Significant points", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/points.png"))); + }//GEN-LAST:event_infoPointsMouseClicked + + /** + * Shows details about minimum angle cosine parameter + * + * @param evt + */ + private void infoMinAngleCosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_infoMinAngleCosMouseClicked + JOptionPane.showMessageDialog(frameMain, + "Entered number represents how large the angle between normal vector of candidate plane and the vector\n" + + "of two vertices can be to take into account these vertices while counting the approximate symmetry.\n\n" + + + "Higher number → fewer pairs of vertices satisfy the criterion → shorter calculation, possibly less accurate result.\n" + + "Lower number → more pairs of vertices satisfy the criterion → longer calculation, possibly more accurate result.", + "Minimum angle", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/angle.png"))); + }//GEN-LAST:event_infoMinAngleCosMouseClicked + + /** + * Shows details about minimum normal angle cosine parameter + * + * @param evt + */ + private void infoNormalAngleMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_infoNormalAngleMouseClicked + JOptionPane.showMessageDialog(frameMain, + "Entered number represents how large the angle between normal vector of candidate plane and vector\n" + + "from subtraction of normal vectors of two vertices can be to take into account these vertices while counting the approximate symmetry.\n\n" + + + "Higher number → fewer pairs of vertices satisfy the criterion → shorter calculation, possibly less accurate result.\n" + + "Lower number → more pairs of vertices satisfy the criterion → longer calculation, possibly more accurate result.", + "Minimum normal angle", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/angle.png"))); + }//GEN-LAST:event_infoNormalAngleMouseClicked + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JSlider angleCosineSlider; + private javax.swing.JCheckBox averagingCheckBox; + private javax.swing.JSlider curavatureSlider; + private javax.swing.JLabel defaultValues; + private javax.swing.JTextField distanceTextField; + private javax.swing.JLabel infoMinAngleCos; + private javax.swing.JLabel infoMinCurv; + private javax.swing.JLabel infoNormalAngle; + private javax.swing.JLabel infoPoints; + private javax.swing.JLabel infoRelDist; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel minCurvatio; + private javax.swing.JLabel minCurvatio2; + private javax.swing.JLabel minCurvatio3; + private javax.swing.JLabel minCurvatio4; + private javax.swing.JLabel minCurvatio8; + private javax.swing.JSlider normalAngleSlider; + private javax.swing.JTextField normalTextField; + private javax.swing.JLabel originalModelButton; + private javax.swing.JSlider relativeDistanceSlider; + private javax.swing.JLabel showPlaneLabel; + private javax.swing.JLabel significantPointLabel; + private javax.swing.JSlider significantPointSlider; + private javax.swing.JTextField significantTextField; + private javax.swing.JLabel symetryButton; + private javax.swing.JPanel symetrySpecificationPanel; + private javax.swing.JTextField textFieldCurvature; + private javax.swing.JTextField textFieldMinCos; + // End of variables declaration//GEN-END:variables +} \ No newline at end of file diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.form.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.form.orig new file mode 100644 index 0000000000000000000000000000000000000000..7961bb6d2967cbb73214d51876ff43d3c4dae96b --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.form.orig @@ -0,0 +1,956 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Default Cursor"/> + </Property> + <Property name="locationByPlatform" type="boolean" value="true"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="true"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="topPanel" max="32767" attributes="0"/> + <Component id="jPanel1" alignment="1" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jPanel1" min="-2" pref="52" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="topPanel" min="-2" pref="239" max="-2" attributes="0"/> + <EmptySpace min="0" pref="565" max="32767" attributes="0"/> + </Group> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Component id="jPanel2" alignment="1" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[1200, 77]"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseDragged" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="jPanel1MouseDragged"/> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jPanel1MousePressed"/> + </Events> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="homeButton" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="newProject" min="-2" pref="149" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="wiredModelButton" min="-2" pref="134" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="wiredModelButton" alignment="0" max="32767" attributes="0"/> + <Component id="newProject" max="32767" attributes="0"/> + <Component id="homeButton" alignment="0" pref="52" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="newProject"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Neue Haas Unica Pro" size="18" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/newP.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="newProjectMouseMoved"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="newProjectMouseExited"/> + <EventHandler event="mousePressed" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="newProjectMousePressed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="wiredModelButton"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/wireframe2.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="wiredModelButtonMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="homeButton"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/home.png"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="Home"/> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="homeButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="homeButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="homeButtonMouseExited"/> + </Events> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="topPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[1200, 266]"/> + </Property> + </Properties> + <AccessibilityProperties> + <Property name="AccessibleContext.accessibleName" type="java.lang.String" value=""/> + </AccessibilityProperties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace pref="99" max="32767" attributes="0"/> + <Component id="compareTwo" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="105" max="-2" attributes="0"/> + <Component id="compareDB" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="94" max="-2" attributes="0"/> + <Component id="batchProcessing" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="94" max="-2" attributes="0"/> + <Component id="symetryEstimator" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="98" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="52" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="symetryEstimator" alignment="1" max="32767" attributes="0"/> + <Component id="compareDB" alignment="1" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="compareTwo" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="batchProcessing" alignment="1" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="compareTwo"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <Component id="jLabel1" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/compareTwoStart.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Default Cursor"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="compareDB"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel3" alignment="1" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel3" alignment="1" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/batchProcessingStart.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Default Cursor"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="batchProcessing"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> + <Component id="jLabel2" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel2" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Default Cursor"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="symetryEstimator"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="69" green="72" red="14" type="rgb"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="symetryEstimatorMouseClicked"/> + </Events> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel4" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="jLabel4" min="-2" pref="137" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="36" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/symetryStartP.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="jLabel4MouseMoved1"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel4MouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jLabel4MouseExited"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Arial" size="13" style="1"/> + </Property> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection component="Form" name="preferredSize" type="property"/> + </Property> + </Properties> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignCardLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="startingPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[0, 0]"/> + </Property> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[1200, 800]"/> + </Property> + <Property name="requestFocusEnabled" type="boolean" value="false"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription"> + <CardConstraints cardName="card3"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace pref="81" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel3" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Component id="logo" min="-2" pref="218" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="400" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="81" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace pref="133" max="32767" attributes="0"/> + <Component id="logo" min="-2" pref="124" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jPanel3" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="136" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="logo"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/logo3.png"/> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/> + <AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/> + </AuxValues> + </Component> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace pref="17" max="32767" attributes="0"/> + <Component id="viewerButton" min="-2" pref="323" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="compareTwoMain" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="compareTwoMain1" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="JLabel8" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="62" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="JLabel9" min="-2" pref="196" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="batchMain" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <EmptySpace min="12" pref="12" max="-2" attributes="0"/> + <Component id="symetryMain" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="42" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" alignment="1" groupAlignment="0" attributes="0"> + <Component id="JLabel8" min="-2" pref="142" max="-2" attributes="0"/> + <Component id="compareTwoMain" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="batchMain" min="-2" pref="173" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="compareTwoMain1" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="symetryMain" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="296" max="-2" attributes="0"/> + <Component id="JLabel9" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="viewerButton" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="41" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="compareTwoMain"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="177" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="170" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + </Container> + <Container class="javax.swing.JPanel" name="compareTwoMain1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="220" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="169" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + </Container> + <Container class="javax.swing.JPanel" name="batchMain"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="JLabel10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Component id="JLabel10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="JLabel10"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/batchProcessingStart.png"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="symetryMain"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="JLabel11" alignment="1" pref="189" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="JLabel11" pref="167" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="JLabel11"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/symetryStart.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="JLabel11MouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="JLabel11MouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="JLabel11MouseExited"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="viewerButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/modelView.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="viewerButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="viewerButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="viewerButtonMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="JLabel8"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/compareTwoStart.png"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="JLabel9"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="symetryPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[1200, 800]"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription"> + <CardConstraints cardName="card3"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace pref="78" max="32767" attributes="0"/> + <Component id="viewerPanel" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="72" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="exportModelButton" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="reloadModelButton" min="-2" max="-2" attributes="0"/> + <Component id="symmetryPanel1" alignment="0" min="-2" pref="461" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Component id="filler1" alignment="1" max="32767" attributes="0"/> + <Component id="filler2" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="filler2" min="-2" pref="58" max="-2" attributes="0"/> + <EmptySpace pref="46" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" attributes="0"> + <Component id="symmetryPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="exportModelButton" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="reloadModelButton" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="viewerPanel" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="filler1" min="-2" pref="51" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="93" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="viewerPanel"> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="canvasSymmetryPanel" pref="553" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="canvasSymmetryPanel" pref="588" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="cz.fidentis.analyst.gui.Canvas" name="canvasSymmetryPanel"> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="reloadModelButton"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/loadModel.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButtonMouseExited"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="exportModelButton"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/exportModel.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="exportModelButtonMouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="exportModelButtonMouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="exportModelButtonMouseExited"/> + </Events> + </Component> + <Component class="cz.fidentis.analyst.gui.SymmetryPanel" name="symmetryPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="e2" green="e6" red="b0" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.Box$Filler" name="filler1"> + <Properties> + <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[0, 32767]"/> + </Property> + </Properties> + <AuxValues> + <AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/> + </AuxValues> + </Component> + <Component class="javax.swing.Box$Filler" name="filler2"> + <Properties> + <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[0, 32767]"/> + </Property> + </Properties> + <AuxValues> + <AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/> + </AuxValues> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="modelViewPanel"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[1200, 800]"/> + </Property> + </Properties> + <AccessibilityProperties> + <Property name="AccessibleContext.accessibleName" type="java.lang.String" value=""/> + </AccessibilityProperties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignCardLayout" value="org.netbeans.modules.form.compat2.layouts.DesignCardLayout$CardConstraintsDescription"> + <CardConstraints cardName="card4"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="filler3" alignment="1" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="87" max="32767" attributes="0"/> + <Component id="jPanel4" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="reloadModelButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="95" max="32767" attributes="0"/> + </Group> + <Component id="filler4" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="filler3" min="-2" pref="73" max="-2" attributes="0"/> + <EmptySpace pref="87" max="32767" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jPanel4" min="-2" pref="579" max="-2" attributes="0"/> + <Component id="reloadModelButton1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="filler4" min="-2" pref="31" max="-2" attributes="0"/> + <EmptySpace pref="92" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="reloadModelButton1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a3" green="ae" red="0" type="rgb"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/cz/fidentis/analyst/gui/resources/loadModel.png"/> + </Property> + <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> + <Color id="Hand Cursor"/> + </Property> + <Property name="opaque" type="boolean" value="true"/> + </Properties> + <Events> + <EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButton1MouseMoved"/> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButton1MouseClicked"/> + <EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="reloadModelButton1MouseExited"/> + </Events> + </Component> + <Container class="javax.swing.JPanel" name="jPanel4"> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="canvasModelView" min="-2" pref="795" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="canvasModelView" min="-2" pref="553" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="98" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="cz.fidentis.analyst.gui.Canvas" name="canvasModelView"> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.Box$Filler" name="filler3"> + <Properties> + <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[0, 32767]"/> + </Property> + </Properties> + <AuxValues> + <AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/> + </AuxValues> + </Component> + <Component class="javax.swing.Box$Filler" name="filler4"> + <Properties> + <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[0, 32767]"/> + </Property> + </Properties> + <AuxValues> + <AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.VerticalGlue"/> + </AuxValues> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.java.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..b28c86ae0994dd28027c21b429c776e4270cb906 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.java.orig @@ -0,0 +1,1107 @@ +package cz.fidentis.analyst.gui; + +import cz.fidentis.analyst.mesh.io.MeshObjExporter; +import java.awt.Color; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.ImageIcon; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +/** + * + * @author Natália Bebjaková + * + * Main window of the applicaion + */ + +public class UserInterface extends javax.swing.JFrame { + /** + * Flag for backround color of the new project button + */ + boolean pressedNewProject = false; + /** + * Flag for whether model should be displayed as wire-frame + */ + boolean wiredModelClicked = false; + /** + * Panel that is actualy displayed on the window + */ + private JPanel actualPanel; + /** + * Main frame of the application + */ + public static JFrame frameMain; + /** + * x coordinate of the mouse + */ + int xMouse; + /** + * y coordinate of the mouse + */ + int yMouse; + + /** + * Creates new form Interface + */ + public UserInterface() { + initComponents(); + topPanel.setVisible(false); + actualPanel = startingPanel; + symmetryPanel1.setCanvas(canvasSymmetryPanel); + this.setExtendedState(JFrame.MAXIMIZED_BOTH); + } + + /** + * + * @return JPanel for estimating symmetry of the model + */ + public SymmetryPanel getSymmetryPanel1() { + return symmetryPanel1; + } + + /** + * Enables to switch between panels + * @param panel New panel that will be visible + */ + private void switchPanelOnMainPanel(JPanel panel) { + actualPanel = panel; + jPanel2.removeAll(); + jPanel2.repaint(); + jPanel2.revalidate(); + jPanel2.add(panel); + jPanel2.repaint(); + jPanel2.revalidate(); + panel.add(jPanel1); + jPanel1.setVisible(true); + } + + /** + * Changes backround of labels to darker green color + * @param jl label of which backround changes + */ + public void setLabelBackround(JLabel jl) { + jl.setBackground(new Color(11,56,49)); + } + + /** + * Changes backround of the label back to original + * @param jl label of which backround is return to original + */ + public void resetLabelBackround(JLabel jl) { + jl.setBackground(new Color(20,114,105)); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + * + * Code generated by NetBeans + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jPanel1 = new javax.swing.JPanel(); + newProject = new javax.swing.JLabel(); + wiredModelButton = new javax.swing.JLabel(); + homeButton = new javax.swing.JLabel(); + topPanel = new javax.swing.JPanel(); + compareTwo = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + compareDB = new javax.swing.JPanel(); + jLabel3 = new javax.swing.JLabel(); + batchProcessing = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + symetryEstimator = new javax.swing.JPanel(); + jLabel4 = new javax.swing.JLabel(); + jPanel2 = new javax.swing.JPanel(); + startingPanel = new javax.swing.JPanel(); + javax.swing.JLabel logo = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); + compareTwoMain = new javax.swing.JPanel(); + compareTwoMain1 = new javax.swing.JPanel(); + batchMain = new javax.swing.JPanel(); + JLabel10 = new javax.swing.JLabel(); + symetryMain = new javax.swing.JPanel(); + JLabel11 = new javax.swing.JLabel(); + viewerButton = new javax.swing.JLabel(); + JLabel8 = new javax.swing.JLabel(); + JLabel9 = new javax.swing.JLabel(); + symetryPanel = new javax.swing.JPanel(); + viewerPanel = new javax.swing.JPanel(); + canvasSymmetryPanel = new cz.fidentis.analyst.gui.Canvas(); + reloadModelButton = new javax.swing.JLabel(); + exportModelButton = new javax.swing.JLabel(); + symmetryPanel1 = new cz.fidentis.analyst.gui.SymmetryPanel(); + filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); + filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); + modelViewPanel = new javax.swing.JPanel(); + reloadModelButton1 = new javax.swing.JLabel(); + jPanel4 = new javax.swing.JPanel(); + canvasModelView = new cz.fidentis.analyst.gui.Canvas(); + filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); + filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + setBackground(new java.awt.Color(0, 174, 163)); + setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + setLocationByPlatform(true); + + jPanel1.setBackground(new java.awt.Color(20, 114, 105)); + jPanel1.setPreferredSize(new java.awt.Dimension(1200, 77)); + jPanel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseDragged(java.awt.event.MouseEvent evt) { + jPanel1MouseDragged(evt); + } + }); + jPanel1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mousePressed(java.awt.event.MouseEvent evt) { + jPanel1MousePressed(evt); + } + }); + + newProject.setBackground(new java.awt.Color(20, 114, 105)); + newProject.setFont(new java.awt.Font("Neue Haas Unica Pro", 0, 18)); // NOI18N + newProject.setForeground(new java.awt.Color(255, 255, 255)); + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/newP.png"))); // NOI18N + newProject.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + newProject.setOpaque(true); + newProject.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + newProjectMouseMoved(evt); + } + }); + newProject.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseExited(java.awt.event.MouseEvent evt) { + newProjectMouseExited(evt); + } + public void mousePressed(java.awt.event.MouseEvent evt) { + newProjectMousePressed(evt); + } + }); + + wiredModelButton.setBackground(new java.awt.Color(20, 114, 105)); + wiredModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/wireframe2.png"))); // NOI18N + wiredModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + wiredModelButton.setOpaque(true); + wiredModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + wiredModelButtonMouseClicked(evt); + } + }); + + homeButton.setBackground(new java.awt.Color(20, 114, 105)); + homeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/home.png"))); // NOI18N + homeButton.setToolTipText("Home"); + homeButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + homeButton.setOpaque(true); + homeButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + homeButtonMouseMoved(evt); + } + }); + homeButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + homeButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + homeButtonMouseExited(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(homeButton) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(newProject, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(wiredModelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(wiredModelButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(newProject, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(homeButton, javax.swing.GroupLayout.DEFAULT_SIZE, 52, Short.MAX_VALUE) + ); + + topPanel.setBackground(new java.awt.Color(20, 114, 105)); + topPanel.setPreferredSize(new java.awt.Dimension(1200, 266)); + + compareTwo.setBackground(new java.awt.Color(20, 114, 105)); + compareTwo.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/compareTwoStart.png"))); // NOI18N + jLabel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + + javax.swing.GroupLayout compareTwoLayout = new javax.swing.GroupLayout(compareTwo); + compareTwo.setLayout(compareTwoLayout); + compareTwoLayout.setHorizontalGroup( + compareTwoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(compareTwoLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + compareTwoLayout.setVerticalGroup( + compareTwoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(compareTwoLayout.createSequentialGroup() + .addGap(30, 30, 30) + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGap(28, 28, 28)) + ); + + compareDB.setBackground(new java.awt.Color(20, 114, 105)); + compareDB.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + + jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/batchProcessingStart.png"))); // NOI18N + jLabel3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + + javax.swing.GroupLayout compareDBLayout = new javax.swing.GroupLayout(compareDB); + compareDB.setLayout(compareDBLayout); + compareDBLayout.setHorizontalGroup( + compareDBLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + compareDBLayout.setVerticalGroup( + compareDBLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + batchProcessing.setBackground(new java.awt.Color(20, 114, 105)); + batchProcessing.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + + jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png"))); // NOI18N + jLabel2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); + + javax.swing.GroupLayout batchProcessingLayout = new javax.swing.GroupLayout(batchProcessing); + batchProcessing.setLayout(batchProcessingLayout); + batchProcessingLayout.setHorizontalGroup( + batchProcessingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(batchProcessingLayout.createSequentialGroup() + .addGap(26, 26, 26) + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + batchProcessingLayout.setVerticalGroup( + batchProcessingLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, batchProcessingLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + symetryEstimator.setBackground(new java.awt.Color(20, 114, 105)); + symetryEstimator.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + symetryEstimator.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + symetryEstimatorMouseClicked(evt); + } + }); + + jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStartP.png"))); // NOI18N + jLabel4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + jLabel4.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + jLabel4MouseMoved1(evt); + } + }); + jLabel4.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jLabel4MouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + jLabel4MouseExited(evt); + } + }); + + javax.swing.GroupLayout symetryEstimatorLayout = new javax.swing.GroupLayout(symetryEstimator); + symetryEstimator.setLayout(symetryEstimatorLayout); + symetryEstimatorLayout.setHorizontalGroup( + symetryEstimatorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryEstimatorLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + symetryEstimatorLayout.setVerticalGroup( + symetryEstimatorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryEstimatorLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(36, 36, 36)) + ); + + javax.swing.GroupLayout topPanelLayout = new javax.swing.GroupLayout(topPanel); + topPanel.setLayout(topPanelLayout); + topPanelLayout.setHorizontalGroup( + topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(topPanelLayout.createSequentialGroup() + .addContainerGap(99, Short.MAX_VALUE) + .addComponent(compareTwo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(105, 105, 105) + .addComponent(compareDB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(94, 94, 94) + .addComponent(batchProcessing, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(94, 94, 94) + .addComponent(symetryEstimator, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(98, Short.MAX_VALUE)) + ); + topPanelLayout.setVerticalGroup( + topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(topPanelLayout.createSequentialGroup() + .addGap(52, 52, 52) + .addGroup(topPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(symetryEstimator, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(compareDB, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, topPanelLayout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(compareTwo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(batchProcessing, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + ); + + jPanel2.setBackground(new java.awt.Color(0, 174, 163)); + jPanel2.setFont(new java.awt.Font("Arial", 1, 13)); // NOI18N + jPanel2.setPreferredSize(getPreferredSize()); + jPanel2.setLayout(new java.awt.CardLayout()); + + startingPanel.setBackground(new java.awt.Color(0, 174, 163)); + startingPanel.setToolTipText(""); + startingPanel.setMaximumSize(new java.awt.Dimension(0, 0)); + startingPanel.setPreferredSize(new java.awt.Dimension(1200, 800)); + startingPanel.setRequestFocusEnabled(false); + + logo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/logo3.png"))); // NOI18N + + jPanel3.setBackground(new java.awt.Color(0, 174, 163)); + jPanel3.setToolTipText(""); + + compareTwoMain.setBackground(new java.awt.Color(0, 174, 163)); + + javax.swing.GroupLayout compareTwoMainLayout = new javax.swing.GroupLayout(compareTwoMain); + compareTwoMain.setLayout(compareTwoMainLayout); + compareTwoMainLayout.setHorizontalGroup( + compareTwoMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 177, Short.MAX_VALUE) + ); + compareTwoMainLayout.setVerticalGroup( + compareTwoMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 170, Short.MAX_VALUE) + ); + + compareTwoMain1.setBackground(new java.awt.Color(0, 174, 163)); + + javax.swing.GroupLayout compareTwoMain1Layout = new javax.swing.GroupLayout(compareTwoMain1); + compareTwoMain1.setLayout(compareTwoMain1Layout); + compareTwoMain1Layout.setHorizontalGroup( + compareTwoMain1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 220, Short.MAX_VALUE) + ); + compareTwoMain1Layout.setVerticalGroup( + compareTwoMain1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 169, Short.MAX_VALUE) + ); + + batchMain.setBackground(new java.awt.Color(0, 174, 163)); + + JLabel10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/batchProcessingStart.png"))); // NOI18N + + javax.swing.GroupLayout batchMainLayout = new javax.swing.GroupLayout(batchMain); + batchMain.setLayout(batchMainLayout); + batchMainLayout.setHorizontalGroup( + batchMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(batchMainLayout.createSequentialGroup() + .addContainerGap() + .addComponent(JLabel10) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + batchMainLayout.setVerticalGroup( + batchMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(batchMainLayout.createSequentialGroup() + .addGap(25, 25, 25) + .addComponent(JLabel10) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + symetryMain.setBackground(new java.awt.Color(0, 174, 163)); + + JLabel11.setBackground(new java.awt.Color(0, 174, 163)); + JLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStart.png"))); // NOI18N + JLabel11.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + JLabel11.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + JLabel11MouseMoved(evt); + } + }); + JLabel11.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + JLabel11MouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + JLabel11MouseExited(evt); + } + }); + + javax.swing.GroupLayout symetryMainLayout = new javax.swing.GroupLayout(symetryMain); + symetryMain.setLayout(symetryMainLayout); + symetryMainLayout.setHorizontalGroup( + symetryMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(JLabel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE) + ); + symetryMainLayout.setVerticalGroup( + symetryMainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, symetryMainLayout.createSequentialGroup() + .addContainerGap() + .addComponent(JLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 167, Short.MAX_VALUE)) + ); + + viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/modelView.png"))); // NOI18N + viewerButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + viewerButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + viewerButtonMouseMoved(evt); + } + }); + viewerButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + viewerButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + viewerButtonMouseExited(evt); + } + }); + + JLabel8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/compareTwoStart.png"))); // NOI18N + + JLabel9.setBackground(new java.awt.Color(0, 174, 163)); + JLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png"))); // NOI18N + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap(17, Short.MAX_VALUE) + .addComponent(viewerButton, javax.swing.GroupLayout.PREFERRED_SIZE, 323, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(compareTwoMain, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(compareTwoMain1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(JLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGap(62, 62, 62)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(JLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(batchMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addComponent(symetryMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(42, Short.MAX_VALUE)) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(JLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(compareTwoMain, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(batchMain, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(28, 28, 28))) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(compareTwoMain1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(symetryMain, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(296, 296, 296) + .addComponent(JLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGap(8, 8, 8))) + .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(viewerButton) + .addGap(41, 41, 41)) + ); + + javax.swing.GroupLayout startingPanelLayout = new javax.swing.GroupLayout(startingPanel); + startingPanel.setLayout(startingPanelLayout); + startingPanelLayout.setHorizontalGroup( + startingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(startingPanelLayout.createSequentialGroup() + .addContainerGap(81, Short.MAX_VALUE) + .addGroup(startingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, startingPanelLayout.createSequentialGroup() + .addComponent(logo, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(400, 400, 400))) + .addContainerGap(81, Short.MAX_VALUE)) + ); + startingPanelLayout.setVerticalGroup( + startingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(startingPanelLayout.createSequentialGroup() + .addContainerGap(133, Short.MAX_VALUE) + .addComponent(logo, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(136, Short.MAX_VALUE)) + ); + + jPanel2.add(startingPanel, "card3"); + + symetryPanel.setBackground(new java.awt.Color(0, 174, 163)); + symetryPanel.setPreferredSize(new java.awt.Dimension(1200, 800)); + + javax.swing.GroupLayout viewerPanelLayout = new javax.swing.GroupLayout(viewerPanel); + viewerPanel.setLayout(viewerPanelLayout); + viewerPanelLayout.setHorizontalGroup( + viewerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(viewerPanelLayout.createSequentialGroup() + .addContainerGap() + .addComponent(canvasSymmetryPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 553, Short.MAX_VALUE) + .addContainerGap()) + ); + viewerPanelLayout.setVerticalGroup( + viewerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(viewerPanelLayout.createSequentialGroup() + .addContainerGap() + .addComponent(canvasSymmetryPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 588, Short.MAX_VALUE) + .addContainerGap()) + ); + + reloadModelButton.setBackground(new java.awt.Color(0, 174, 163)); + reloadModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadModel.png"))); // NOI18N + reloadModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + reloadModelButton.setOpaque(true); + reloadModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + reloadModelButtonMouseMoved(evt); + } + }); + reloadModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + reloadModelButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + reloadModelButtonMouseExited(evt); + } + }); + + exportModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportModel.png"))); // NOI18N + exportModelButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + exportModelButton.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + exportModelButtonMouseMoved(evt); + } + }); + exportModelButton.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + exportModelButtonMouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + exportModelButtonMouseExited(evt); + } + }); + + symmetryPanel1.setBackground(new java.awt.Color(176, 230, 226)); + + javax.swing.GroupLayout symetryPanelLayout = new javax.swing.GroupLayout(symetryPanel); + symetryPanel.setLayout(symetryPanelLayout); + symetryPanelLayout.setHorizontalGroup( + symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetryPanelLayout.createSequentialGroup() + .addContainerGap(78, Short.MAX_VALUE) + .addComponent(viewerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(72, 72, 72) + .addGroup(symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(exportModelButton) + .addComponent(reloadModelButton) + .addComponent(symmetryPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 461, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(filler1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(filler2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + symetryPanelLayout.setVerticalGroup( + symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(symetryPanelLayout.createSequentialGroup() + .addComponent(filler2, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE) + .addGroup(symetryPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(symetryPanelLayout.createSequentialGroup() + .addComponent(symmetryPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(exportModelButton) + .addGap(18, 18, 18) + .addComponent(reloadModelButton)) + .addComponent(viewerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(filler1, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(93, 93, 93)) + ); + + jPanel2.add(symetryPanel, "card3"); + + modelViewPanel.setBackground(new java.awt.Color(0, 174, 163)); + modelViewPanel.setToolTipText(""); + modelViewPanel.setPreferredSize(new java.awt.Dimension(1200, 800)); + + reloadModelButton1.setBackground(new java.awt.Color(0, 174, 163)); + reloadModelButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/loadModel.png"))); // NOI18N + reloadModelButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); + reloadModelButton1.setOpaque(true); + reloadModelButton1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { + public void mouseMoved(java.awt.event.MouseEvent evt) { + reloadModelButton1MouseMoved(evt); + } + }); + reloadModelButton1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + reloadModelButton1MouseClicked(evt); + } + public void mouseExited(java.awt.event.MouseEvent evt) { + reloadModelButton1MouseExited(evt); + } + }); + + javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); + jPanel4.setLayout(jPanel4Layout); + jPanel4Layout.setHorizontalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addComponent(canvasModelView, javax.swing.GroupLayout.PREFERRED_SIZE, 795, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel4Layout.setVerticalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(canvasModelView, javax.swing.GroupLayout.PREFERRED_SIZE, 553, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(98, 98, 98)) + ); + + javax.swing.GroupLayout modelViewPanelLayout = new javax.swing.GroupLayout(modelViewPanel); + modelViewPanel.setLayout(modelViewPanelLayout); + modelViewPanelLayout.setHorizontalGroup( + modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(filler3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, modelViewPanelLayout.createSequentialGroup() + .addContainerGap(87, Short.MAX_VALUE) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(reloadModelButton1) + .addContainerGap(95, Short.MAX_VALUE)) + .addComponent(filler4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + modelViewPanelLayout.setVerticalGroup( + modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(modelViewPanelLayout.createSequentialGroup() + .addComponent(filler3, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 87, Short.MAX_VALUE) + .addGroup(modelViewPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 579, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(reloadModelButton1)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(filler4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(92, Short.MAX_VALUE)) + ); + + jPanel2.add(modelViewPanel, "card4"); + modelViewPanel.getAccessibleContext().setAccessibleName(""); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(topPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(topPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 565, Short.MAX_VALUE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + topPanel.getAccessibleContext().setAccessibleName(""); + + pack(); + setLocationRelativeTo(null); + }// </editor-fold>//GEN-END:initComponents + + /** + * + * @param evt Changes the backround of the new project button + */ + private void newProjectMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMouseMoved + setLabelBackround(newProject); + }//GEN-LAST:event_newProjectMouseMoved + + /** + * + * @param evt Changes back the backround of the new project button + */ + private void newProjectMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMouseExited + if (!pressedNewProject) { + resetLabelBackround(newProject); + } + }//GEN-LAST:event_newProjectMouseExited + + /** + * + * @param evt While moved with mouse, symmetry label changes + */ + private void jLabel4MouseMoved1(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel4MouseMoved1 + jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStartPanel.png"))); + }//GEN-LAST:event_jLabel4MouseMoved1 + + /** + * + * @param evt Shows menu with icons for programs of the app + */ + private void newProjectMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_newProjectMousePressed + if(pressedNewProject) { + topPanel.setVisible(false); + pressedNewProject = false; + switchPanelOnMainPanel(actualPanel); + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/newP.png"))); + }else{ + topPanel.setVisible(true); + topPanel.add(jPanel1); + pressedNewProject = true; + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/new_project_opened.png"))); + } + }//GEN-LAST:event_newProjectMousePressed + + + /** + * + * @param evt Switch to symmetry panel + */ + private void JLabel11MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseClicked + switchPanelOnMainPanel(symetryPanel); + }//GEN-LAST:event_JLabel11MouseClicked + + /** + * + * @param evt Switch to symmetry panel + */ + private void symetryEstimatorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_symetryEstimatorMouseClicked + switchPanelOnMainPanel(symetryPanel); + topPanel.setVisible(false); + ImageIcon icon = new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/newP.png")); + + newProject.setIcon(icon); + resetLabelBackround(newProject); + }//GEN-LAST:event_symetryEstimatorMouseClicked + + /** + * + * @param evt Enables to move with the window of the app + */ + private void jPanel1MouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseDragged + int x = evt.getXOnScreen(); + int y = evt.getYOnScreen(); + frameMain.setLocation(x - xMouse, y - yMouse); + }//GEN-LAST:event_jPanel1MouseDragged + + /** + * + * @param evt Enables to move with the window of the app + */ + private void jPanel1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MousePressed + xMouse = evt.getX(); + yMouse = evt.getY(); + }//GEN-LAST:event_jPanel1MousePressed + + /** + * + * @param evt Changes the backround of the reload button + */ + private void reloadModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseMoved + reloadModelButton.setBackground(new Color(176,230,226)); + }//GEN-LAST:event_reloadModelButtonMouseMoved + + /** + * + * @param evt Changes the backround of the reload button + */ + private void reloadModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseExited + reloadModelButton.setBackground(new Color(0,174,163)); + }//GEN-LAST:event_reloadModelButtonMouseExited + + /** + * + * @param evt Loads the model that will be displayed + */ + private void reloadModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButtonMouseClicked + canvasSymmetryPanel.loadModel(); + if (canvasSymmetryPanel.isLoaded()) { + symmetryPanel1.showPlaneButtonsOnPanel(false); + } + }//GEN-LAST:event_reloadModelButtonMouseClicked + + /** + * letting know GLCanva if model will be displayed as wire-frame + */ + private void wiredModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_wiredModelButtonMouseClicked + if (wiredModelClicked) { + resetLabelBackround(wiredModelButton); + wiredModelClicked = false; + canvasSymmetryPanel.setDrawWired(wiredModelClicked); + canvasModelView.setDrawWired(wiredModelClicked); + } else { + setLabelBackround(wiredModelButton); + wiredModelClicked = true; + canvasSymmetryPanel.setDrawWired(wiredModelClicked); + canvasModelView.setDrawWired(wiredModelClicked); + } + }//GEN-LAST:event_wiredModelButtonMouseClicked + + /** + * + * @param evt Changes the backround of the home button + */ + private void homeButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseMoved + setLabelBackround(homeButton); + }//GEN-LAST:event_homeButtonMouseMoved + + /** + * + * @param evt Changes the backround of the home button + */ + private void homeButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseExited + resetLabelBackround(homeButton); + }//GEN-LAST:event_homeButtonMouseExited + + /** + * + * @param evt Returns to home panel of the app + */ + private void homeButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_homeButtonMouseClicked + switchPanelOnMainPanel(startingPanel); + }//GEN-LAST:event_homeButtonMouseClicked + + /** + * + * @param evt Changes the backround of the reload button + */ + private void reloadModelButton1MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseMoved + reloadModelButton1.setBackground(new Color(176,230,226)); + }//GEN-LAST:event_reloadModelButton1MouseMoved + + /** + * + * @param evt Loads the model that will be displayed + */ + private void reloadModelButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseClicked + canvasModelView.loadModel(); + }//GEN-LAST:event_reloadModelButton1MouseClicked + + /** + * + * @param evt Changes the backround of the reload button + */ + private void reloadModelButton1MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_reloadModelButton1MouseExited + reloadModelButton1.setBackground(new Color(0,174,163)); + }//GEN-LAST:event_reloadModelButton1MouseExited + + /** + * + * @param evt Switch to panel for viewing the model + */ + private void viewerButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseClicked + switchPanelOnMainPanel(modelViewPanel); + }//GEN-LAST:event_viewerButtonMouseClicked + + /** + * + * @param evt Changes the backround of the symmetry button + */ + private void JLabel11MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseMoved + JLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStartMoved.png"))); + }//GEN-LAST:event_JLabel11MouseMoved + + /** + * + * @param evt Changes the backround of the viewer panel button + */ + private void viewerButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseMoved + viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/modelViewMoved.png"))); + }//GEN-LAST:event_viewerButtonMouseMoved + + /** + * + * @param evt Changes the backround of the viewer panel button + */ + private void viewerButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_viewerButtonMouseExited + viewerButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/modelView.png"))); + }//GEN-LAST:event_viewerButtonMouseExited + + /** + * + * @param evt Changes the backround of the symmetry button + */ + private void JLabel11MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_JLabel11MouseExited + JLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStart.png"))); + }//GEN-LAST:event_JLabel11MouseExited + + /** + * + * @param evt Switch to panel for symmetry + */ + private void jLabel4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel4MouseClicked + switchPanelOnMainPanel(symetryPanel); + topPanel.setVisible(false); + newProject.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/newP.png"))); + resetLabelBackround(newProject); + }//GEN-LAST:event_jLabel4MouseClicked + + /** + * + * @param evt Changes the backround of the export button + */ + private void exportModelButtonMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exportModelButtonMouseMoved + exportModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportModelPressed.png"))); + }//GEN-LAST:event_exportModelButtonMouseMoved + + /** + * + * @param evt Changes the backround of the export button + */ + private void exportModelButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exportModelButtonMouseExited + exportModelButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportModel.png"))); + }//GEN-LAST:event_exportModelButtonMouseExited + + /** + * When export button pressed, new directory is created and model is exported to it + * If there is not loaded model, user is warned + */ + private void exportModelButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exportModelButtonMouseClicked + if (canvasSymmetryPanel.getModel().getFacets().isEmpty()){ + JOptionPane.showMessageDialog(frameMain, "You have to load the model.", "Model not loaded", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/notLoadedModel.png"))); + } else { + JFileChooser chooser = new JFileChooser(); + chooser.showSaveDialog(symetryPanel); + + MeshObjExporter exporter = new MeshObjExporter(canvasSymmetryPanel.getModel()); + try { + if (chooser.getSelectedFile() != null) { + exporter.exportModelToObj(chooser.getSelectedFile()); + JOptionPane.showMessageDialog(frameMain, "Model exported into: " + + chooser.getCurrentDirectory().toString() + "\\" + chooser.getSelectedFile().getName(), "Model exported", + 0, new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportedModel.png"))); + } + } catch (IOException ex) { + Logger.getLogger(UserInterface.class.getName()).log(Level.SEVERE, null, ex); + } + } + }//GEN-LAST:event_exportModelButtonMouseClicked + + /** + * + * @param evt Changes the backround of the symmetry button + */ + private void jLabel4MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel4MouseExited + jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/symetryStartP.png"))); + }//GEN-LAST:event_jLabel4MouseExited + + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(UserInterface.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + java.awt.EventQueue.invokeLater(() -> { + frameMain = new UserInterface(); + frameMain.setBackground(new Color(49,165,154)); + frameMain.pack(); + frameMain.setVisible(true); + //enables to use design of operating system + try { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + }catch(ClassNotFoundException | IllegalAccessException | InstantiationException | UnsupportedLookAndFeelException ex) { + } + }); + } + + + + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel JLabel10; + private javax.swing.JLabel JLabel11; + private javax.swing.JLabel JLabel8; + private javax.swing.JLabel JLabel9; + private javax.swing.JPanel batchMain; + private javax.swing.JPanel batchProcessing; + private cz.fidentis.analyst.gui.Canvas canvasModelView; + private cz.fidentis.analyst.gui.Canvas canvasSymmetryPanel; + private javax.swing.JPanel compareDB; + private javax.swing.JPanel compareTwo; + private javax.swing.JPanel compareTwoMain; + private javax.swing.JPanel compareTwoMain1; + private javax.swing.JLabel exportModelButton; + private javax.swing.Box.Filler filler1; + private javax.swing.Box.Filler filler2; + private javax.swing.Box.Filler filler3; + private javax.swing.Box.Filler filler4; + private javax.swing.JLabel homeButton; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel4; + private javax.swing.JPanel modelViewPanel; + private javax.swing.JLabel newProject; + private javax.swing.JLabel reloadModelButton; + private javax.swing.JLabel reloadModelButton1; + private javax.swing.JPanel startingPanel; + private javax.swing.JPanel symetryEstimator; + private javax.swing.JPanel symetryMain; + private javax.swing.JPanel symetryPanel; + private cz.fidentis.analyst.gui.SymmetryPanel symmetryPanel1; + private javax.swing.JPanel topPanel; + private javax.swing.JLabel viewerButton; + private javax.swing.JPanel viewerPanel; + private javax.swing.JLabel wiredModelButton; + // End of variables declaration//GEN-END:variables +} diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/backround.jpg b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/backround.jpg deleted file mode 100644 index 05b8c3e4bf85f5c984c54054db05e6f6dc2e73a1..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/backround.jpg and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessing.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessing.png deleted file mode 100644 index 2971c594fb3dbbb057e3352c99bba465e6eea945..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessing.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingGreen.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingGreen.png deleted file mode 100644 index 9ad6faf4e7ccb7d70bbc35d3229a198e5aa114e7..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingGreen.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingStart.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingStart.png deleted file mode 100644 index 9c2512d3525259ce784a8ff845ceb5c25d746b1b..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/batchProcessingStart.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png deleted file mode 100644 index 1ecd6e228c45a7335b0ce7115cbb31316c29ba7c..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvas.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvasPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvasPressed.png deleted file mode 100644 index 79e8e34a2815e9bc38a1dc591033a55435b61671..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/blackBackroundCanvasPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/bottom.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/bottom.png deleted file mode 100644 index 16e4137bab172b811419816559b5bf91e98b0517..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/bottom.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png.orig new file mode 100644 index 0000000000000000000000000000000000000000..bece4b869e31b64d58c4bcaf62ee749dc7fed49e Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png.orig differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwo.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwo.png deleted file mode 100644 index e1ea0bfebe47a95e62fc34db243e94dac80d3836..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwo.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoGreen.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoGreen.png deleted file mode 100644 index 54815487f8ddc9fa9a90a6c0f269aae084aa1e27..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoGreen.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoStart.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoStart.png deleted file mode 100644 index 2b7641dc84f2e5f877cef99e298e26dd4da31599..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoStart.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabase.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabase.png deleted file mode 100644 index f0d913ae58a5f70c3d12be6d32ef2b8d8f259054..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabase.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseGreen.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseGreen.png deleted file mode 100644 index adc6ed64c563a92e2ba4427091f2bb4ea2f46708..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseGreen.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png deleted file mode 100644 index 9a287fd89a0de0f45d2f749a487571b0509f0e63..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/copareWithDatabaseStart.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/divide.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/divide.png deleted file mode 100644 index 5fab565670b529a75edbf308d1261005b57ee2a7..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/divide.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButton.png deleted file mode 100644 index 8eb47099a722558e89ff3da803d806939e676b0a..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButton.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButtonPressed.png deleted file mode 100644 index 05aa27c9c2a51e99264758046f9e091a4cff37a6..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/downButtonPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModel.png deleted file mode 100644 index 95accab2bb096b0b8c8c6bb4ee5af73ff1914a47..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModel.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModelPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModelPressed.png deleted file mode 100644 index 0c950519a3d831d0ab53260146dbce2143ae7e20..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportModelPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportedModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportedModel.png deleted file mode 100644 index 205cc3f16bac17d7dd719768f0585c2ab03a77ae..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/exportedModel.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/home.png.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/home.png.orig new file mode 100644 index 0000000000000000000000000000000000000000..59c019144b4eaf2f737b4234052143586c77d27f Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/home.png.orig differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButton.png deleted file mode 100644 index f587bdb98b6b3b5c63797b50ea5130c213488580..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButton.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButtonPressed.png deleted file mode 100644 index 01c35e36f24aa5e41c5ff9ccbada0c5baf37aaac..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/leftButtonPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanva.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanva.png deleted file mode 100644 index d360ac7701f606fc431474c05b541e6b69c9bbd0..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanva.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanvaClicked.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanvaClicked.png deleted file mode 100644 index aa11ab847494e7d262017e620c817beec68adb05..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadCanvaClicked.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModel.png deleted file mode 100644 index 1addcde3aefcf68f39a421c712e600566701577c..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModel.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModelPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModelPressed.png deleted file mode 100644 index fee6376e20ed3e23b62da7822fb499253891df80..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/loadModelPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo.png deleted file mode 100644 index 6ad0c43fe09b8b676ae6aa7f5c17995367d8988d..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo2.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo2.png deleted file mode 100644 index 9189251257b8893f260401af214865b53a67ccaa..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo2.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo3.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo3.png deleted file mode 100644 index 425eabc747aa8259a75b92519e1205ce04a9958b..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/logo3.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/maximize.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/maximize.png deleted file mode 100644 index 90b7b9c45053cc610bd7d7fddb6511cafc57999e..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/maximize.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize.png deleted file mode 100644 index f755ee7b36e01865fd48853e9de991ad6ef1ab2b..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minus.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minus.png deleted file mode 100644 index 7fb0767bcd876777b4b7a7fdf759c7995001c403..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minus.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minusPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minusPressed.png deleted file mode 100644 index 37f170fdc13dfc393f125f495c1a45a3bac2a2af..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minusPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelView.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelView.png deleted file mode 100644 index 1b86c272720c301cfc948a613429c1895150a211..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelView.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelViewMoved.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelViewMoved.png deleted file mode 100644 index 778ecff09f0e3310bb2389126bff3fd3af804d1b..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/modelViewMoved.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/n.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/n.png deleted file mode 100644 index d8344e399084cba38d533b2296d6eb7096418e1b..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/n.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigBackground.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigBackground.png deleted file mode 100644 index 211771f89a12205cfaadf9ee2278dbcd0d9ba89c..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigBackground.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigationBackground.png.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigationBackground.png.orig new file mode 100644 index 0000000000000000000000000000000000000000..5c432124583a2fd332c0b3e59a65860362dd830e Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigationBackground.png.orig differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.jpg b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.jpg deleted file mode 100644 index 620273dfd806c319076851ac9014c2852669e53a..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.jpg and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.png deleted file mode 100644 index a46c103102dabb9e2d467ce8275633acf38f3d90..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project_opened.png.orig b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project_opened.png.orig new file mode 100644 index 0000000000000000000000000000000000000000..654a545fe4d667f11afd19971b83935d211ed8dc Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project_opened.png.orig differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/notLoadedModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/notLoadedModel.png deleted file mode 100644 index ea10626859ce6772f5a5b5ec82c702662586701a..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/notLoadedModel.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModel.png deleted file mode 100644 index 125fd6fea4dafa1ccf428eec9f45a57e38ba0460..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModel.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModelPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModelPressed.png deleted file mode 100644 index b9e7ca9a2c00e9ecb776df2d99948284923052b3..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/originalModelPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/plus.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/plus.png deleted file mode 100644 index 686de0c85e21a98f5f66509100b0567edf8583f5..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/plus.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/plusPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/plusPressed.png deleted file mode 100644 index 11d4eb18e213d7387af016f7096ec2faeee6060c..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/plusPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButton.png deleted file mode 100644 index bd18d0f9ff27883262aa4700a281afa4a317a0e3..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButton.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButtonPressed.png deleted file mode 100644 index 4eafd61db3d0834b8cd8cc1e22eac1d27998d1c9..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/resetButtonPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightBottom.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightBottom.png deleted file mode 100644 index f346f088a2799690cfc6f07d812e9b6ffae00f7d..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightBottom.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButton.png deleted file mode 100644 index 3058aaed5b61a74854e40f72816b176906d02514..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButton.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButtonPressed.png deleted file mode 100644 index 57dd28c46cd49afed37cd9f17d51588a4d753ddd..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/rightButtonPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/selectPoints.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/selectPoints.png deleted file mode 100644 index f4e6c251c13fee841185bb1d6005015ae3e20a39..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/selectPoints.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlane.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlane.png deleted file mode 100644 index bb223da1ae986d266950254055cad86d5fb96222..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlane.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePane.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePane.png deleted file mode 100644 index 5b233935c9cd88b33810b0fab32abb82b338a323..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePane.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePressed.png deleted file mode 100644 index c92818e64874dd61c0170c19d1be4adab470c486..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/showPlanePressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetry.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetry.png deleted file mode 100644 index bd64a79dec36702f6eca21c9b09fa692c8aee0af..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetry.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCount.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCount.png deleted file mode 100644 index 58864d8fa5b9ab740c3bf9d5c1e77a9bbf76f820..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCount.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCountClicked.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCountClicked.png deleted file mode 100644 index 8d4a9d0303d94c7731a6f5a45d5c31afa0b783b7..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryCountClicked.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryGreen.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryGreen.png deleted file mode 100644 index 18d8e8eed43e3332a89bc86672948ec2e2bc65ee..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryGreen.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStart.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStart.png deleted file mode 100644 index 9423bccd70b3d9bd3002e620851aa3b7973f8dff..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStart.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartMoved.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartMoved.png deleted file mode 100644 index 182a20e18874970e67893f21607c840cf3587af7..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartMoved.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartP.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartP.png deleted file mode 100644 index 5c6b58dd1f579b11290a69a26628ab08a228353e..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartP.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartPanel.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartPanel.png deleted file mode 100644 index 39658d54cc1a8267ef87ab6374eacc82ae4e292a..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/symetryStartPanel.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture.png deleted file mode 100644 index a0b4cd702ca59b2cb2cb76fa4fa61a961c5ea769..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture2.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture2.png deleted file mode 100644 index ce29eaa971730b8f86562567ff5d323d0a372d62..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/texture2.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButton.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButton.png deleted file mode 100644 index 38e5e597f5e7c97b151d1c2d697ba5f7e285a687..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButton.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButtonPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButtonPressed.png deleted file mode 100644 index 270726c75260e4370f5536b3b27313c48158b94f..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/upButtonPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png deleted file mode 100644 index 2392d79948755cb2681db19304b6fc23faf15392..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvas.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvasPressed.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvasPressed.png deleted file mode 100644 index cbf866bba082635034362ab1345cd33d07ffcc2d..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/whiteBackroundCanvasPressed.png and /dev/null differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe.png deleted file mode 100644 index 28efd055ab3380bf32718c9a8392a08367b32945..0000000000000000000000000000000000000000 Binary files a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe.png and /dev/null differ diff --git a/GUI/src/main/nbm/manifest.mf b/GUI/src/main/nbm/manifest.mf deleted file mode 100644 index f87b508b7e5ecf5b4e493a548dc2f647aca6ca46..0000000000000000000000000000000000000000 --- a/GUI/src/main/nbm/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module-Localizing-Bundle: cz/findetis/analyst/gui/Bundle.properties - diff --git a/GUI/src/main/resources/cz/findetis/analyst/gui/Bundle.properties b/GUI/src/main/resources/cz/findetis/analyst/gui/Bundle.properties deleted file mode 100644 index ba69811957880be4fcdd2ffc4034ae0649cbae21..0000000000000000000000000000000000000000 --- a/GUI/src/main/resources/cz/findetis/analyst/gui/Bundle.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Localized module labels. Defaults taken from POM (<name>, <description>, <groupId>) if unset. -#OpenIDE-Module-Name= -#OpenIDE-Module-Short-Description= -#OpenIDE-Module-Long-Description= -#OpenIDE-Module-Display-Category= -#Thu Oct 03 09:09:53 CEST 2019 diff --git a/MeshModel/MeshModel.iml.orig b/MeshModel/MeshModel.iml.orig new file mode 100644 index 0000000000000000000000000000000000000000..80a28bc560f1f11818d2264d101264ece491fcca --- /dev/null +++ b/MeshModel/MeshModel.iml.orig @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> + <output url="file://$MODULE_DIR$/target/classes" /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/../application/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <content url="file://$MODULE_DIR$/../application/src/test/java" /> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.6.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.testng:testng:7.1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: com.beust:jcommander:1.72" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: com.google.inject:guice:no_aop:4.1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: javax.inject:javax.inject:1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: aopalliance:aopalliance:1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: com.google.guava:guava:19.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.yaml:snakeyaml:1.21" level="project" /> + <orderEntry type="library" name="Maven: java3d:j3d-core-utils:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: java3d:vecmath:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: java3d:j3d-core:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-annotations-common:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: com.github.mokiat:java-data-front:v2.0.0" level="project" /> + <orderEntry type="library" name="Maven: javax.vecmath:vecmath:1.5.2" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.6.1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.6.1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.testng:testng:7.1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: com.beust:jcommander:1.72" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: com.google.inject:guice:no_aop:4.1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: javax.inject:javax.inject:1" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: aopalliance:aopalliance:1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: com.google.guava:guava:19.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.yaml:snakeyaml:1.21" level="project" /> + </component> +</module> \ No newline at end of file diff --git a/MeshModel/pom.xml.orig b/MeshModel/pom.xml.orig new file mode 100644 index 0000000000000000000000000000000000000000..99a97ede1d8fd4f107cf0cb2a084e301d1009096 --- /dev/null +++ b/MeshModel/pom.xml.orig @@ -0,0 +1,139 @@ +<?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"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>cz.findetis</groupId> + <artifactId>FIDENTIS-Analyst-parent</artifactId> + <version>2.0</version> + </parent> + <artifactId>MeshModel</artifactId> + <packaging>nbm</packaging> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.3</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>nbm-maven-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <useOSGiDependencies>true</useOSGiDependencies> + <publicPackages> <!-- expose API/packages to other modules --> + <publicPackage>cz.fidentis.analyst.mesh.core.*</publicPackage> + <publicPackage>cz.fidentis.analyst.mesh.io.*</publicPackage> + <!--<publicPackage>cz.fidentis.analyst.mesh.core.MeshFacet</publicPackage>--> + <!--<publicPackage>cz.fidentis.analyst.mesh.core.MeshPoint</publicPackage>--> + </publicPackages> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <configuration> + <useDefaultManifestFile>true</useDefaultManifestFile> + </configuration> + </plugin> + <!-- Check code style --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>${version.maven.plugin.checkstyle}</version> + <executions> + <execution> + <id>validate</id> + <phase>validate</phase> + <configuration> + <configLocation>codestyle.xml</configLocation> + <encoding>UTF-8</encoding> + <consoleOutput>true</consoleOutput> + <failOnViolation>${checkstyle.fail}</failOnViolation> + <violationSeverity>${checkstyle.severity}</violationSeverity> + <includeTestSourceDirectory>false</includeTestSourceDirectory> + </configuration> + <goals> + <goal>check</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>8</source> + <target>8</target> + </configuration> + </plugin> + </plugins> + </build> + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.3</version> + </plugin> + </plugins> + </reporting> + <repositories> + <repository> + <id>jitpack.io</id> + <url>https://jitpack.io</url> + </repository> + </repositories> + <dependencies> + <dependency> + <groupId>java3d</groupId> + <artifactId>j3d-core-utils</artifactId> + <version>1.3.1</version> + </dependency> + <dependency> + <groupId>org.netbeans.api</groupId> + <artifactId>org-netbeans-api-annotations-common</artifactId> + <version>${netbeans.version}</version> + </dependency> + <!-- https://github.com/mokiat/java-data-front --> + <dependency> + <groupId>com.github.mokiat</groupId> + <artifactId>java-data-front</artifactId> + <version>v2.0.0</version> + <type>jar</type> + </dependency> + <!-- https://mvnrepository.com/artifact/javax.vecmath/vecmath --> + <dependency> + <groupId>javax.vecmath</groupId> + <artifactId>vecmath</artifactId> + <version>${version.javax.vecmath}</version> + </dependency> + <!-- https://mvnrepository.com/artifact/junit/junit --> + <dependency> +<<<<<<< HEAD + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> +======= + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter</artifactId> + <version>5.6.0</version> +>>>>>>> origin/master + <scope>test</scope> + </dependency> + <!--<dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> +<<<<<<< HEAD + <version>7.0.0</version> +======= + <version>7.1.0</version> +>>>>>>> origin/master + <scope>test</scope> + </dependency>--> + </dependencies> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + +</project> diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/BoundingBox.java.orig b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/BoundingBox.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..97d990ef85e49d4e64dc6cc81f199cdccabf9091 --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/BoundingBox.java.orig @@ -0,0 +1,109 @@ +package cz.fidentis.analyst.mesh.core; + +import java.util.List; +import javax.vecmath.Vector3d; + +/** + * @author Natália Bebjaková + * + * Represent min-max box. + * It is automatically maintained by given point array of the model. + * + */ + +public class BoundingBox { + private MeshPoint maxPoint; + private MeshPoint minPoint; + private MeshPoint midPoint; + private double maxDiag; + + /** + * Creates bounding box that is automatically maintained with respect to given array. + * @param points array of points, must not be null or pempty + * @throws IllegalArgumentException if the @code{points} param is null or empty + */ + public BoundingBox(List<MeshPoint> points) { + if (points == null || points.isEmpty()) { + throw new IllegalArgumentException("points"); + } + this.computeMinMax(points); + this.computeMidDiag(); + } + + /** + * + * @return max point of the bounding box + */ + public MeshPoint getMaxPoint() { + return maxPoint; + } + + /** + * + * @return middle point of the bounding box + */ + public MeshPoint getMidPoint() { + return midPoint; + } + + /** + * + * @return min point of the bounding box + */ + public MeshPoint getMinPoint() { + return minPoint; + } + + /** + * Return volume diagonal of the bounding box. + * @return maximal diagonal of bounding box + */ + public double getMaxDiag() { + return maxDiag; + } + + /** + * Recomputes the BoundingBox from all points + */ + private void computeMinMax(List<MeshPoint> points) { + minPoint = new MeshPointImpl(new Vector3d(Double.MAX_VALUE,Double.MAX_VALUE,Double.MAX_VALUE), null, null); + maxPoint = new MeshPointImpl(new Vector3d(-100000.0,-100000.0,-100000.0), null, null); + + for (int i = 0; i < points.size(); i++) { + MeshPoint point = points.get(i); + + minPoint.getPosition().x = Math.min(minPoint.getPosition().x, point.getPosition().x); + minPoint.getPosition().y = Math.min(minPoint.getPosition().y, point.getPosition().y); + minPoint.getPosition().z = Math.min(minPoint.getPosition().z, point.getPosition().z); + + maxPoint.getPosition().x = Math.max(maxPoint.getPosition().x, point.getPosition().x); + maxPoint.getPosition().y = Math.max(maxPoint.getPosition().y, point.getPosition().y); + maxPoint.getPosition().z = Math.max(maxPoint.getPosition().z, point.getPosition().z); + } + } + + /** + * Recompute mid-point and max diagonal length. + */ + private void computeMidDiag() { + midPoint = (minPoint.addPosition(maxPoint)).multiplyPosition(0.5); + MeshPoint diag = maxPoint.subtractPosition(minPoint); + this.maxDiag = diag.abs(); + } + + /** + * Returns description of BoundignBox. + * + * @return String representation of the bounding box + */ + @Override + public String toString() { + String str = "BoundingBox: "; + str += System.lineSeparator(); + str += "\t" + "- min point : " + this.minPoint + System.lineSeparator(); + str += "\t" + "- max point : " + this.maxPoint + System.lineSeparator(); + str += "\t" + "- mid point : " + this.midPoint + System.lineSeparator(); + str += "\t" + "- max diag : " + this.maxDiag + System.lineSeparator(); + return str; + } +} \ No newline at end of file diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java index 3a70047917c3b62a2c4d31d76a81b2c5ddf36a8f..9ca5224a4bf997c2bcef957dc2c3e8d270a2a4d7 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java @@ -1,70 +1,71 @@ -package cz.fidentis.analyst.mesh.core; - -import java.util.List; - -/** - * An ancapsulated mesh plate (with shared vertices). - * - * @author Matej Lukes - */ -public interface MeshFacet { - - /** - * returns vertex of specified index - * - * @param index index of vertex - * @return vertex - */ - MeshPoint getVertex(int index); - - /** - * adds vertex to MeshFacet - * - * @param point new vertex - */ - void addVertex(MeshPoint point); - - /** - * returns number of vertices in MeshFacet - * - * @return number of vertices - */ - int getNumberOfVertices(); - - /** - * returns list of vertices in MeshFacet - * - * @return list if vertices - */ - List<MeshPoint> getVertices(); - - /** - * returns Corner Table representing MeshFacet - * - * @return corner table - */ - CornerTable getCornerTable(); - - /** - * Returns the mesh as a list of individial triangles. - * @return the list of individial triangles. - */ - List<MeshTriangle> asTriangles(); - - /** - * Computes and returns bounding box of the mesh facet. - * @return bounding box of the mesh facet. - */ - BoundingBox getBoundingBox(); - - /** - * Returns true if normals of vertices are calculated. - * @return true if normals of vertices are calculated. - */ - boolean hasVertexNormals(); - - /** - * Calculates normals of vertices from normals of triangles. - */ - void calculateVertexNormals(); -} +package cz.fidentis.analyst.mesh.core; + +import java.util.List; + +/** + * An ancapsulated mesh plate (with shared vertices). + * + * @author Matej Lukes + */ +public interface MeshFacet { + + /** + * returns vertex of specified index + * + * @param index index of vertex + * @return vertex + */ + MeshPoint getVertex(int index); + + /** + * adds vertex to MeshFacet + * + * @param point new vertex + */ + void addVertex(MeshPoint point); + + /** + * returns number of vertices in MeshFacet + * + * @return number of vertices + */ + int getNumberOfVertices(); + + /** + * returns list of vertices in MeshFacet + * + * @return list if vertices + */ + List<MeshPoint> getVertices(); + + /** + * returns Corner Table representing MeshFacet + * + * @return corner table + */ + CornerTable getCornerTable(); + + /** + * Returns the mesh as a list of individial triangles. + * @return the list of individial triangles. + */ + List<MeshTriangle> asTriangles(); + + /** + * Computes and returns bounding box of the mesh facet. + * @return bounding box of the mesh facet. + */ + BoundingBox getBoundingBox(); + + /** + * Returns true if normals of vertices are calculated. + * @return true if normals of vertices are calculated. + */ + boolean hasVertexNormals(); + + /** + * Calculates normals of vertices from normals of triangles. + */ + void calculateVertexNormals(); +} + diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java.orig b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..df916226f62af43159af913229aa05869c34b527 --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacet.java.orig @@ -0,0 +1,169 @@ +<<<<<<< HEAD +package cz.fidentis.analyst.mesh.core; + +import java.util.ArrayList; +import java.util.List; + +/** + * MashFacet + * + * @author Matej Lukes + */ +public class MeshFacet { + private List<MeshPoint> vertices = new ArrayList<>(); + private CornerTable cornerTable = new CornerTable(); + + /** + * Constructor of MeshFacet + */ + public MeshFacet() { + cornerTable = new CornerTable(); + } + + /** + * Copy constructor of MeshFacet + * + * @param facet copied MeshFacet + */ + public MeshFacet(MeshFacet facet) { + for (MeshPoint vertex : + facet.vertices) { + vertices.add(new MeshPoint(vertex)); + } + cornerTable = new CornerTable(facet.cornerTable); + } + + + /** + * returns vertex of specified index + * + * @param index index of vertex + * @return vertex + */ + public MeshPoint getVertex(int index) { + return vertices.get(index); + } + + /** + * returns all vertices + * + * @return list of vertices + */ + public List<MeshPoint> getVertices() { + return vertices; + } + + /** + * returns list of vertices in triangle + * + * @param triangleIndex index of triangle + * @return list of vertices + */ + public List<MeshPoint> getVerticesOfTriangle(int triangleIndex) { + List<MeshPoint> vertices = new ArrayList<>(3); + for (int i = 0; i < 3; i++) { + vertices.add(vertices.get(cornerTable.getRow(triangleIndex + i).getVertexIndex())); + } + return vertices; + } + + /** + * returns number of vertices in MeshFacet + * + * @return number of vertices + */ + public int getNumberOfVertices() { + return vertices.size(); + } + + /** + * adds vertex to MeshFacet + * + * @param point new vertex + */ + public void addVertex(MeshPoint point) { + vertices.add(point); + } + + /** + * returns Corner Table representing MeshFacet + * + * @return corner table + */ + public CornerTable getCornerTable() { + return cornerTable; + } +} + +======= +package cz.fidentis.analyst.mesh.core; + +import java.util.List; + +/** + * An ancapsulated mesh plate (with shared vertices). + * + * @author Matej Lukes + */ +public interface MeshFacet { + + /** + * returns vertex of specified index + * + * @param index index of vertex + * @return vertex + */ + MeshPoint getVertex(int index); + + /** + * adds vertex to MeshFacet + * + * @param point new vertex + */ + void addVertex(MeshPoint point); + + /** + * returns number of vertices in MeshFacet + * + * @return number of vertices + */ + int getNumberOfVertices(); + + /** + * returns list of vertices in MeshFacet + * + * @return list if vertices + */ + List<MeshPoint> getVertices(); + + /** + * returns Corner Table representing MeshFacet + * + * @return corner table + */ + CornerTable getCornerTable(); + + /** + * Returns the mesh as a list of individial triangles. + * @return the list of individial triangles. + */ + List<MeshTriangle> asTriangles(); + + /** + * Computes and returns bounding box of the mesh facet. + * @return bounding box of the mesh facet. + */ + BoundingBox getBoundingBox(); + + /** + * Returns true if normals of vertices are calculated. + * @return true if normals of vertices are calculated. + */ + boolean hasVertexNormals(); + + /** + * Calculates normals of vertices from normals of triangles. + */ + void calculateVertexNormals(); +} +>>>>>>> origin/master diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java index 8b5b6252de21eaf5ce27b630311959441b5a9e1d..5dca1fc1a6c3d1fb07b575f5349b994fd8e2b69a 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java @@ -1,130 +1,130 @@ -package cz.fidentis.analyst.mesh.core; - -import javax.vecmath.Vector3d; - -/** - * MeshPoint represents a point with position, normal, and texture coordinates - * - * @author Matej Lukes - */ -public interface MeshPoint { - - /** - * @return normal - */ - Vector3d getNormal(); - - /** - * @return position - */ - Vector3d getPosition(); - - /** - * @return texture coordinates - */ - Vector3d getTexCoord(); - - /** - * returns new instance of MeshPoint with subtracted position - * - * @param subtrahend position to be subtracted - * @return subtracted MeshPoint - */ - MeshPoint subtractPosition(MeshPoint subtrahend); - - /** - * returns new instance of MeshPoint with subtracted position - * - * @param subtrahend position to be subtracted - * @return subtracted MeshPoint - */ - MeshPoint subtractPosition(Vector3d subtrahend); - - /** - * returns new instance of MeshPoint with added position - * - * @param addend position to be added - * @return added MeshPoint - */ - MeshPoint addPosition(MeshPoint addend); - - /** - * returns new instance of MeshPoint with added position - * - * @param addend position to be added - * @return added MeshPoint - */ - MeshPoint addPosition(Vector3d addend); - - /** - * returns new instance of MeshPoint with multiplied position by number - * - * @param number Number for multiplying - * @return multiplied MeshPoint - */ - MeshPoint multiplyPosition(double number); - - /** - * returns new instance of MeshPoint with divided position by number - * - * @param number Number for division - * @return divided MeshPoint - */ - MeshPoint dividePosition(double number); - - /** - * Returns the cross product of two points. - * - * @param meshPoint Second argument of the cross product operation. - * @return MeshPoint representing the resulting vector. - */ - MeshPoint crossProduct(MeshPoint meshPoint); - - /** - * returns the dot product of two points - * - * @param meshPoint Second argument of the dot product operation - * @return dot product of two instances of MeshPoint - */ - double dotProduct(MeshPoint meshPoint); - - /** - * returns absolute value of MeshPoint - * - * @return absolute value of MeshPoint - */ - double abs(); - - /** - * returns new instance of MeshPoint with subtracted normal - * - * @param subtrahend normal to be subtracted - * @return subtracted MeshPoint - */ - MeshPoint subtractNormal(MeshPoint subtrahend); - - /** - * returns new instance of MeshPoint with subtracted normal - * - * @param subtrahend normal to be subtracted - * @return subtracted MeshPoint - */ - MeshPoint subtractNormal(Vector3d subtrahend); - - /** - * returns new instance of MeshPoint with added normal - * - * @param addend normal to be added - * @return added MeshPoint - */ - MeshPoint addNormal(MeshPoint addend); - - /** - * returns new instance of MeshPoint with added normal - * - * @param addend normal to be added - * @return added MeshPoint - */ - MeshPoint addNormal(Vector3d addend); - -} +package cz.fidentis.analyst.mesh.core; + +import javax.vecmath.Vector3d; + +/** + * MeshPoint represents a point with position, normal, and texture coordinates + * + * @author Matej Lukes + */ +public interface MeshPoint { + + /** + * @return normal + */ + Vector3d getNormal(); + + /** + * @return position + */ + Vector3d getPosition(); + + /** + * @return texture coordinates + */ + Vector3d getTexCoord(); + + /** + * returns new instance of MeshPoint with subtracted position + * + * @param subtrahend position to be subtracted + * @return subtracted MeshPoint + */ + MeshPoint subtractPosition(MeshPoint subtrahend); + + /** + * returns new instance of MeshPoint with subtracted position + * + * @param subtrahend position to be subtracted + * @return subtracted MeshPoint + */ + MeshPoint subtractPosition(Vector3d subtrahend); + + /** + * returns new instance of MeshPoint with added position + * + * @param addend position to be added + * @return added MeshPoint + */ + MeshPoint addPosition(MeshPoint addend); + + /** + * returns new instance of MeshPoint with added position + * + * @param addend position to be added + * @return added MeshPoint + */ + MeshPoint addPosition(Vector3d addend); + + /** + * returns new instance of MeshPoint with multiplied position by number + * + * @param number Number for multiplying + * @return multiplied MeshPoint + */ + MeshPoint multiplyPosition(double number); + + /** + * returns new instance of MeshPoint with divided position by number + * + * @param number Number for division + * @return divided MeshPoint + */ + MeshPoint dividePosition(double number); + + /** + * Returns the cross product of two points. + * + * @param meshPoint Second argument of the cross product operation. + * @return MeshPoint representing the resulting vector. + */ + MeshPoint crossProduct(MeshPoint meshPoint); + + /** + * returns the dot product of two points + * + * @param meshPoint Second argument of the dot product operation + * @return dot product of two instances of MeshPoint + */ + double dotProduct(MeshPoint meshPoint); + + /** + * returns absolute value of MeshPoint + * + * @return absolute value of MeshPoint + */ + double abs(); + + /** + * returns new instance of MeshPoint with subtracted normal + * + * @param subtrahend normal to be subtracted + * @return subtracted MeshPoint + */ + MeshPoint subtractNormal(MeshPoint subtrahend); + + /** + * returns new instance of MeshPoint with subtracted normal + * + * @param subtrahend normal to be subtracted + * @return subtracted MeshPoint + */ + MeshPoint subtractNormal(Vector3d subtrahend); + + /** + * returns new instance of MeshPoint with added normal + * + * @param addend normal to be added + * @return added MeshPoint + */ + MeshPoint addNormal(MeshPoint addend); + + /** + * returns new instance of MeshPoint with added normal + * + * @param addend normal to be added + * @return added MeshPoint + */ + MeshPoint addNormal(Vector3d addend); + +} diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java.orig b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..f4931cb1cc039a1224525aff466b01a5fb64723a --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java.orig @@ -0,0 +1,356 @@ +<<<<<<< HEAD +package cz.fidentis.analyst.mesh.core; + +import javax.vecmath.Vector3d; + +/** + * @author Matej Lukeš + */ +public class MeshPoint { + private Vector3d position, normal, texCoord; + + /** + * Constructor of MeshPoint + * + * @param position position of MeshPoint + * @param normal normal of MeshPoint + * @param texCoord texture coordinates of MeshPoint + */ + public MeshPoint(Vector3d position, Vector3d normal, Vector3d texCoord) { + if (position == null) { + throw new NullPointerException("position cannot be null"); + } + + this.position = position; + this.normal = normal; + this.texCoord = texCoord; + } + + /** + * copy constructor of meshPoint + * + * @param meshPoint copied meshPoint + */ + public MeshPoint(MeshPoint meshPoint) { + this.position = new Vector3d(meshPoint.position); + if (meshPoint.normal != null) { + this.normal = new Vector3d(meshPoint.normal); + } + if (meshPoint.texCoord != null) { + this.texCoord = new Vector3d(meshPoint.texCoord); + } + } + + /** + * @return normal + */ + public Vector3d getNormal() { + return new Vector3d(normal); + } + + /** + * @return position + */ + public Vector3d getPosition() { + return new Vector3d(position); + } + + /** + * @return texture coordinates + */ + public Vector3d getTexCoord() { + return new Vector3d(texCoord); + } + + /** + * @param obj compared object + * @return true if positions, normals and texture coordinates are equal, false otherwise + */ + @Override + public boolean equals(Object obj) { + if (!(obj instanceof MeshPoint)) { + return false; + } + + MeshPoint meshPointObj = (MeshPoint) obj; + return this.position.equals(meshPointObj.position); + } + + @Override + public int hashCode() { + return position.hashCode(); + } + + /** + * returns new instance of MeshPoint with subtracted position + * + * @param subtrahend position to be subtracted + * @return subtracted MeshPoint + */ + public MeshPoint subtractPosition(MeshPoint subtrahend) { + return MeshPoint.this.subtractPosition(subtrahend.position); + } + + /** + * returns new instance of MeshPoint with subtracted position + * + * @param subtrahend position to be subtracted + * @return subtracted MeshPoint + */ + public MeshPoint subtractPosition(Vector3d subtrahend) { + Vector3d newPosition = new Vector3d(position); + newPosition.sub(subtrahend); + if (normal != null) { + if (texCoord != null) { + return new MeshPoint(new Vector3d(newPosition), new Vector3d(normal), new Vector3d(texCoord)); + } + return new MeshPoint(new Vector3d(newPosition), new Vector3d(normal), null); + } + return new MeshPoint(new Vector3d(newPosition), null, null); + } + + /** + * returns new instance of MeshPoint with added position + * + * @param addend position to be added + * @return added MeshPoint + */ + public MeshPoint addPosition(MeshPoint addend) { + return MeshPoint.this.addPosition(addend.position); + } + + /** + * returns new instance of MeshPoint with added position + * + * @param addend position to be added + * @return added MeshPoint + */ + public MeshPoint addPosition(Vector3d addend) { + Vector3d newPosition = new Vector3d(position); + newPosition.add(addend); + if (normal != null) { + if (texCoord != null) { + return new MeshPoint(new Vector3d(newPosition), new Vector3d(normal), new Vector3d(texCoord)); + } + return new MeshPoint(new Vector3d(newPosition), new Vector3d(normal), null); + } + return new MeshPoint(new Vector3d(newPosition), null, null); + } + + /** + * returns new instance of MeshPoint with multiplied position by number + * + * @param number Number for multiplying + * @return multiplied MeshPoint + */ + public MeshPoint multiplyPosition(double number) { + if (normal != null) { + if (texCoord != null) { + return new MeshPoint(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + new Vector3d(normal), new Vector3d(texCoord)); + } + return new MeshPoint(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + new Vector3d(normal), null); + } + return new MeshPoint(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + null, null); + } + + /** + * returns new instance of MeshPoint with divided position by number + * + * @param number Number for division + * @return divided MeshPoint + */ + public MeshPoint dividePosition(double number) { + if (normal != null) { + if (texCoord != null) { + return new MeshPoint(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), new Vector3d(normal), new Vector3d(texCoord)); + } + return new MeshPoint(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), new Vector3d(normal), null); + } + return new MeshPoint(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), null, null); + } + + /** + * Returns the cross product of two points. + * + * @param meshPoint Second argument of the cross product operation. + * @return MeshPoint representing the resulting vector. + */ + public MeshPoint crossProduct(MeshPoint meshPoint) { + Vector3d newPosition = new Vector3d(); + newPosition.cross(position, meshPoint.position); + + return new MeshPoint(newPosition, new Vector3d(normal), new Vector3d(texCoord)); + } + + /** + * returns the dot product of two points + * + * @param meshPoint Second argument of the dot product operation + * @return dot product of two instances of MeshPoint + */ + public double dotProduct(MeshPoint meshPoint) { + return position.dot(meshPoint.position); + } + + /** + * returns the dot product of two points + * + * @param vector Second argument of the dot product operation + * @return dot product of two instances of MeshPoint + */ + public double dotProduct(Vector3d vector) { + return position.dot(vector); + } + + + /** + * returns absolute value of MeshPoint + * + * @return absolute value of MeshPoint + */ + public double abs() { + return Math.sqrt(this.getPosition().x * this.getPosition().x + + this.getPosition().y * this.getPosition().y + this.getPosition().z * this.getPosition().z); + } +} +======= +package cz.fidentis.analyst.mesh.core; + +import javax.vecmath.Vector3d; + +/** + * MeshPoint represents a point with position, normal, and texture coordinates + * + * @author Matej Lukes + */ +public interface MeshPoint { + + /** + * @return normal + */ + Vector3d getNormal(); + + /** + * @return position + */ + Vector3d getPosition(); + + /** + * @return texture coordinates + */ + Vector3d getTexCoord(); + + /** + * returns new instance of MeshPoint with subtracted position + * + * @param subtrahend position to be subtracted + * @return subtracted MeshPoint + */ + MeshPoint subtractPosition(MeshPoint subtrahend); + + /** + * returns new instance of MeshPoint with subtracted position + * + * @param subtrahend position to be subtracted + * @return subtracted MeshPoint + */ + MeshPoint subtractPosition(Vector3d subtrahend); + + /** + * returns new instance of MeshPoint with added position + * + * @param addend position to be added + * @return added MeshPoint + */ + MeshPoint addPosition(MeshPoint addend); + + /** + * returns new instance of MeshPoint with added position + * + * @param addend position to be added + * @return added MeshPoint + */ + MeshPoint addPosition(Vector3d addend); + + /** + * returns new instance of MeshPoint with multiplied position by number + * + * @param number Number for multiplying + * @return multiplied MeshPoint + */ + MeshPoint multiplyPosition(double number); + + /** + * returns new instance of MeshPoint with divided position by number + * + * @param number Number for division + * @return divided MeshPoint + */ + MeshPoint dividePosition(double number); + + /** + * Returns the cross product of two points. + * + * @param meshPoint Second argument of the cross product operation. + * @return MeshPoint representing the resulting vector. + */ + MeshPoint crossProduct(MeshPoint meshPoint); + + /** + * returns the dot product of two points + * + * @param meshPoint Second argument of the dot product operation + * @return dot product of two instances of MeshPoint + */ + double dotProduct(MeshPoint meshPoint); + + /** + * returns absolute value of MeshPoint + * + * @return absolute value of MeshPoint + */ + double abs(); + + /** + * returns new instance of MeshPoint with subtracted normal + * + * @param subtrahend normal to be subtracted + * @return subtracted MeshPoint + */ + MeshPoint subtractNormal(MeshPoint subtrahend); + + /** + * returns new instance of MeshPoint with subtracted normal + * + * @param subtrahend normal to be subtracted + * @return subtracted MeshPoint + */ + MeshPoint subtractNormal(Vector3d subtrahend); + + /** + * returns new instance of MeshPoint with added normal + * + * @param addend normal to be added + * @return added MeshPoint + */ + MeshPoint addNormal(MeshPoint addend); + + /** + * returns new instance of MeshPoint with added normal + * + * @param addend normal to be added + * @return added MeshPoint + */ + MeshPoint addNormal(Vector3d addend); + +} +>>>>>>> origin/master diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjExporter.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjExporter.java index e518c9adee25c1e061d031795743492c7e5dcf10..3e5a9da9eb3ca7d63b1db313daf5f73e028bfbb0 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjExporter.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjExporter.java @@ -49,7 +49,7 @@ public class MeshObjExporter { * @param exportFile file for exporting. * @throws java.io.IOException */ - public void exportFacetToObj(MeshFacet facet, File exportFile) throws IOException { + protected void exportFacetToObj(MeshFacet facet, File exportFile) throws IOException { int formatIndex = exportFile.getName().lastIndexOf("."); String fileName; //name that is writen to file diff --git a/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java.orig b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..e1de9f0c2b87aecac2aff87c114d6fbaf7416a0d --- /dev/null +++ b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java.orig @@ -0,0 +1,62 @@ +package cz.fidentis.analyst.mesh.core; + +<<<<<<< HEAD:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java +import org.testng.annotations.Test; + +import static org.testng.AssertJUnit.assertEquals; +======= +//import org.testng.annotations.Test; + +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + + +//import static org.testng.AssertJUnit.assertEquals; +>>>>>>> origin/master:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java + +/** + * Unit test for cornerTableRow + */ +public class CornerTableRowTest { + + /** + * unit test for getVertex + */ + @Test +<<<<<<< HEAD:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java + public void getVertexIndex() { +======= + void getVertexIndex() { +>>>>>>> origin/master:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java + CornerTableRow row = new CornerTableRow(42, -1); + assertEquals(42, row.getVertexIndex()); + } + + /** + * Unit test for getOppositeCornerIndex + */ + @Test +<<<<<<< HEAD:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java + public void getOppositeCornerIndex() { +======= + void getOppositeCornerIndex() { +>>>>>>> origin/master:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java + CornerTableRow row = new CornerTableRow(0, 42); + assertEquals(42, row.getOppositeCornerIndex()); + } + + /** + * Unit test for setOppositeCornerIndex + */ + @Test +<<<<<<< HEAD:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java + public void setOppositeCornerIndex() { +======= + void setOppositeCornerIndex() { +>>>>>>> origin/master:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java + CornerTableRow row = new CornerTableRow(0, 42); + assertEquals(42, row.getOppositeCornerIndex()); + row.setOppositeCornerIndex(21); + assertEquals(21, row.getOppositeCornerIndex()); + } +} diff --git a/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableTest.java.orig b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableTest.java.orig new file mode 100644 index 0000000000000000000000000000000000000000..c1c3231303d9e91db179cd528aab7bffadd4bec9 --- /dev/null +++ b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableTest.java.orig @@ -0,0 +1,481 @@ +package cz.fidentis.analyst.mesh.core; + +<<<<<<< HEAD:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableTest.java +import org.testng.annotations.Test; + +import static org.testng.AssertJUnit.assertEquals; +======= +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + +>>>>>>> origin/master:MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableTest.java + +/** + * Unit tests for CornerTable + */ +public class CornerTableTest { + + /** + * Unit test for getIndexOfFace + */ + @Test + public void getIndexOfFace() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 10; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + for (int i = 0; i < 10; i++) { + assertEquals(i / 3, table.getIndexOfFace(i)); + } + } + + /** + * Unit test for getIndexOfFaceNegativeIndex with negative index + */ + @Test + public void getIndexOfFaceNegativeIndex() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-2, table.getIndexOfFace(-1)); + } + + /** + * Unit test for getIndexOfFaceNegativeIndex with index out of range + */ + @Test + public void getIndexOfFaceIndexOutOfRange() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-2, table.getIndexOfFace(2)); + } + + /** + * Unit test for getIndexOfOppositeCorner + */ + @Test + public void getIndexOfOppositeCorner() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 10; i++) { + table.addRow(new CornerTableRow(i, i - 1)); + } + + for (int i = 1; i < 10; i++) { + assertEquals(i - 1, table.getIndexOfOppositeCorner(i)); + } + } + + /** + * Unit test for getIndexOfOppositeCorner without opposite corner + */ + @Test + public void getIndexOfOppositeCornerNoOppositeCorner() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-1, table.getIndexOfOppositeCorner(0)); + } + + /** + * Unit test for getIndexOfOppositeCorner with negative index of corner + */ + @Test + public void getIndexOfOppositeCornerNegativeIndex() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-2, table.getIndexOfOppositeCorner(-1)); + } + + /** + * Unit test for getIndexOfOppositeCorner with index of corner out of range + */ + @Test + public void getIndexOfOppositeCornerOutOfRange() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-2, table.getIndexOfOppositeCorner(2)); + } + + /** + * Unit test for getIndexOfNextCornerInFace + */ + @Test + public void getIndexOfNextCornerInFaceFirstTriangle() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 9; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + assertEquals(1, table.getIndexOfNextCornerInFace(0)); + assertEquals(2, table.getIndexOfNextCornerInFace(1)); + assertEquals(0, table.getIndexOfNextCornerInFace(2)); + } + + /** + * Unit test for getIndexOfNextCornerInFace + */ + @Test + public void getIndexOfNextCornerInFaceMiddleTriangle() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 9; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + assertEquals(4, table.getIndexOfNextCornerInFace(3)); + assertEquals(5, table.getIndexOfNextCornerInFace(4)); + assertEquals(3, table.getIndexOfNextCornerInFace(5)); + } + + /** + * Unit test for getIndexOfNextCornerInFace + */ + @Test + public void getIndexOfNextCornerInFaceLastTriangle() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 9; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + assertEquals(7, table.getIndexOfNextCornerInFace(6)); + assertEquals(8, table.getIndexOfNextCornerInFace(7)); + assertEquals(6, table.getIndexOfNextCornerInFace(8)); + } + + /** + * Unit test for getIndexOfNextCornerInFace with negative index of corner + */ + @Test + public void getIndexOfNextCornerInFaceNegativeIndex() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-2, table.getIndexOfNextCornerInFace(-1)); + } + + /** + * Unit test for getIndexOfNextCornerInFace with index of corner out of range + */ + @Test + public void getIndexOfNextCornerInFaceOutOfRange() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-2, table.getIndexOfNextCornerInFace(2)); + } + + /** + * Unit test for getIndexOfPreviousCornerInFace + */ + @Test + public void getIndexOfPreviousCornerInFaceFirstTriangle() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 9; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + assertEquals(2, table.getIndexOfPreviousCornerInFace(0)); + assertEquals(0, table.getIndexOfPreviousCornerInFace(1)); + assertEquals(1, table.getIndexOfPreviousCornerInFace(2)); + } + + /** + * Unit test for getIndexOfPreviousCornerInFace + */ + @Test + public void getIndexOfPreviousCornerInFaceMiddleTriangle() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 9; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + assertEquals(5, table.getIndexOfPreviousCornerInFace(3)); + assertEquals(3, table.getIndexOfPreviousCornerInFace(4)); + assertEquals(4, table.getIndexOfPreviousCornerInFace(5)); + } + + /** + * Unit test for getIndexOfPreviousCornerInFace + */ + @Test + public void getIndexOfPreviousCornerInFaceLastTriangle() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 9; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + assertEquals(8, table.getIndexOfPreviousCornerInFace(6)); + assertEquals(6, table.getIndexOfPreviousCornerInFace(7)); + assertEquals(7, table.getIndexOfPreviousCornerInFace(8)); + } + + /** + * Unit test for getIndexOfPreviousCornerInFace with negative index of corner + */ + @Test + public void getIndexOfPreviousCornerInFaceNegativeIndex() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-2, table.getIndexOfPreviousCornerInFace(-1)); + } + + /** + * Unit test for getIndexOfPreviousCornerInFace with index of corner out of range + */ + @Test + public void getIndexOfPreviousCornerInFaceOutOfRange() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(-2, table.getIndexOfPreviousCornerInFace(2)); + } + + /** + * Unit test for getIndexOfTipCornerOnLeft + */ + @Test + public void getIndexOfTipCornerOnLeft() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(5, table.getIndexOfTipCornerOnLeft(0)); + } + + /** + * Unit test for getIndexOfTipCornerOnLeft with no left corner + */ + @Test + public void getIndexOfTipCornerOnLeftNoLeftCorner() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-1, table.getIndexOfTipCornerOnLeft(1)); + } + + /** + * Unit test for getIndexOfTipCornerOnLeft with negative index of corner + */ + @Test + public void getIndexOfTipCornerOnLeftNegativeIndex() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-2, table.getIndexOfTipCornerOnLeft(-1)); + } + + /** + * Unit test for getIndexOfTipCornerOnLeft with index of corner out of range + */ + @Test + public void getIndexOfTipCornerOnLeftOutOfRange() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-2, table.getIndexOfTipCornerOnLeft(6)); + } + + /** + * Unit test for getIndexOfTipCornerOnRight + */ + @Test + public void getIndexOfTipCornerOnRight() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(5, table.getIndexOfTipCornerOnRight(1)); + } + + /** + * Unit test for getIndexOfTipCornerOnRight with no right corner + */ + @Test + public void getIndexOfTipCornerOnLeftNoRightCorner() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-1, table.getIndexOfTipCornerOnRight(0)); + } + + /** + * Unit test for getIndexOfTipCornerOnRight with negative index of corner + */ + @Test + public void getIndexOfTipCornerOnRightNegativeIndex() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-2, table.getIndexOfTipCornerOnRight(-1)); + } + + /** + * Unit test for getIndexOfTipCornerOnRight with index of corner out of range + */ + @Test + public void getIndexOfTipCornerOnRightOutOfRange() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-2, table.getIndexOfTipCornerOnLeft(6)); + } + + /** + * Unit test for getNextAroundCorner + */ + @Test + public void getNextAroundCorner() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(3, table.getNextAroundCorner(0)); + } + + /** + * Unit test for getNextAroundCorner with no corner on around position + */ + @Test + public void getNextAroundCornerNoAroundCorner() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-1, table.getNextAroundCorner(1)); + } + + /** + * Unit test for getNextAroundCorner with negative index of corner + */ + @Test + public void getNextAroundCornerNegativeIndex() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-2, table.getNextAroundCorner(-1)); + } + + /** + * Unit test for getNextAroundCorner with index of corner out of range + */ + @Test + public void getNextAroundCornerOutOfRange() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(-2, table.getNextAroundCorner(6)); + } + + /** + * Unit test for addRow + */ + @Test + public void addRow() { + CornerTable table = new CornerTable(); + assertEquals(0, table.getSize()); + table.addRow(new CornerTableRow(0, -1)); + assertEquals(1, table.getSize()); + } + + /** + * Unit test for replaceRow + */ + @Test + public void replaceRow() { + CornerTable table = new CornerTable(); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(2, 5)); + table.addRow(new CornerTableRow(0, -1)); + table.addRow(new CornerTableRow(1, -1)); + table.addRow(new CornerTableRow(3, 2)); + + assertEquals(6, table.getSize()); + + table.replaceRow(1, new CornerTableRow(table.getRow(1).getVertexIndex(), 42)); + assertEquals(6, table.getSize()); + assertEquals(42, table.getRow(1).getOppositeCornerIndex()); + } + + /** + * Unit test for getSize + */ + @Test + public void getSize() { + CornerTable table = new CornerTable(); + + assertEquals(0, table.getSize()); + + for (int i = 0; i < 9; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + assertEquals(9, table.getSize()); + } + + /** + * Unit test for getRow + */ + @Test + public void getRow() { + CornerTable table = new CornerTable(); + for (int i = 0; i < 9; i++) { + table.addRow(new CornerTableRow(i, -1)); + } + + for (int i = 0; i < 9; i++) { + assertEquals(i, table.getRow(i).getVertexIndex()); + } + } +} diff --git a/Renderer/Renderer.iml b/Renderer/Renderer.iml deleted file mode 100644 index 14061d54f54906514b5fade1f5cb826df069c1f1..0000000000000000000000000000000000000000 --- a/Renderer/Renderer.iml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7"> - <output url="file://$MODULE_DIR$/target/classes" /> - <output-test url="file://$MODULE_DIR$/target/test-classes" /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> - <excludeFolder url="file://$MODULE_DIR$/target" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-annotations-common:RELEASE82" level="project" /> - </component> -</module> \ No newline at end of file diff --git a/Renderer/pom.xml b/Renderer/pom.xml index e0bc5e591e0c9f2ccb4273e1d2fc6e11366a419e..89367df20b2b6fd132e64e4212c69b5c019b4ac6 100644 --- a/Renderer/pom.xml +++ b/Renderer/pom.xml @@ -10,6 +10,11 @@ <packaging>nbm</packaging> <build> <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.3</version> + </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>nbm-maven-plugin</artifactId> @@ -50,6 +55,15 @@ </plugin> </plugins> </build> + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jxr-plugin</artifactId> + <version>2.3</version> + </plugin> + </plugins> + </reporting> <dependencies> <dependency> <groupId>org.netbeans.api</groupId> diff --git a/application/FIDENTIS-Analyst-app.iml.orig b/application/FIDENTIS-Analyst-app.iml.orig new file mode 100644 index 0000000000000000000000000000000000000000..f7dd0b482444d05c44bdb970a6886abacb5d6d5b --- /dev/null +++ b/application/FIDENTIS-Analyst-app.iml.orig @@ -0,0 +1,111 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7"> + <output url="file://$MODULE_DIR$/target/classes" /> + <output-test url="file://$MODULE_DIR$/target/test-classes" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <excludeFolder url="file://$MODULE_DIR$/target" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="library" name="Maven: org.netbeans.external:asm-all-5.0.1:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-filesystems:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-modules:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-util:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-util-lookup:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-bootstrap:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-util-ui:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-libs-asm:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-core-startup-base:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.ow2.asm:asm-all:5.0.1" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:net-java-html-boot-fx:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:net-java-html-boot-script:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:net-java-html-boot:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:net-java-html-geo:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:net-java-html-json:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:net-java-html-sound:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:net-java-html:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:swing-layout-1.0.4:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-libs-javafx:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-awt:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-dialogs:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-windows:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-intent:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-progress:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-progress-nb:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-queries:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-swing-outline:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-actions:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-explorer:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-filesystems-nb:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-io:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-loaders:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-nodes:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-text:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-core:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-core-startup:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-execution:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-core-windows:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-options-api:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-swing-tabcontrol:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-editor-mimelookup:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-libs-jna:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-libs-jna-platform:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-libs-osgi:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-keyring:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-openide-filesystems-compat8:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-io:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-modules-options-keymap:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-swing-plaf:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-sampler:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-spi-quicksearch:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-settings:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:org-netbeans-html-ko4j:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:org-netbeans-html-xhr4j:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.apache.felix:org.apache.felix.main:4.2.1" level="project" /> + <orderEntry type="library" name="Maven: org.apache.felix:org.apache.felix.framework:4.2.1" level="project" /> + <orderEntry type="library" name="Maven: net.java.dev.jna:jna-platform:4.2.2" level="project" /> + <orderEntry type="library" name="Maven: net.java.dev.jna:jna:4.2.2" level="project" /> + <orderEntry type="library" name="Maven: junit:junit:4.12" level="project" /> + <orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:osgi.core-5.0.0:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:osgi.cmpn-4.2:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:testng-6.8.1-dist:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-autoupdate-services:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-sendopts:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:updater:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-core-ui:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-libs-felix:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-modules-autoupdate-cli:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-autoupdate-ui:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-modules-favorites:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-modules-masterfs:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-modules-print:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: javax.help:javahelp:2.0.05" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.modules:org-netbeans-modules-keyring-fallback:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-core-netigso:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.external:org.eclipse.osgi_3.9.1.v20140110-1610:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-htmlui:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-templates:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-lib-uihandler:RELEASE82" level="project" /> + <orderEntry type="module" module-name="FIDENTIS-Analyst-branding" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-annotations-common:RELEASE82" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.netbeans.api:org-netbeans-modules-nbjunit:RELEASE82" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.netbeans.modules:org-netbeans-insane:RELEASE82" level="project" /> + <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-libs-junit4:RELEASE82" level="project" /> + <orderEntry type="module" module-name="MeshModel" /> + <orderEntry type="library" name="Maven: java3d:j3d-core-utils:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: java3d:vecmath:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: java3d:j3d-core:1.3.1" level="project" /> + <orderEntry type="library" name="Maven: com.github.mokiat:java-data-front:v2.0.0" level="project" /> + <orderEntry type="library" name="Maven: javax.vecmath:vecmath:1.5.2" level="project" /> + <orderEntry type="module" module-name="Renderer" /> + <orderEntry type="module" module-name="GUI" /> + <orderEntry type="library" name="Maven: org.jogamp.jogl:jogl-all:2.0-rc11" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" /> + <orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.6.0" level="project" /> + </component> +</module> diff --git a/branding/FIDENTIS-Analyst-branding.iml b/branding/FIDENTIS-Analyst-branding.iml deleted file mode 100644 index 14061d54f54906514b5fade1f5cb826df069c1f1..0000000000000000000000000000000000000000 --- a/branding/FIDENTIS-Analyst-branding.iml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7"> - <output url="file://$MODULE_DIR$/target/classes" /> - <output-test url="file://$MODULE_DIR$/target/test-classes" /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> - <excludeFolder url="file://$MODULE_DIR$/target" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="Maven: org.netbeans.api:org-netbeans-api-annotations-common:RELEASE82" level="project" /> - </component> -</module> \ No newline at end of file diff --git a/pom.xml b/pom.xml index 659231044d85fbb99cb7fb5b1685fbbf2eaf27c7..fbcad2aa74603b97e349c51ba55f9bc81222d94e 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ <packaging>pom</packaging> <name>FIDENTIS-Analyst-2</name> - + <properties> <netbeans.version>RELEASE113</netbeans.version> <brandingToken>fidentisanalyst</brandingToken>