diff --git a/.gitignore b/.gitignore index 5bac3a149357073f245d05fd13c3ec9d50918642..c02185b9afe50b33f8fea327c838389b8dc6fc64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,17 @@ **/target -*.iml + +# From directories, ignore... + +### Idea: .idea/ -codestyle.xml \ No newline at end of file +.idea_modules/ +/out/ + +### Maven template +target/ + +### Eclipse template +bin/ +tmp/ +.settings/ + diff --git a/.gitignore.orig b/.gitignore.orig new file mode 100644 index 0000000000000000000000000000000000000000..8f9acedc9b119cabbd7691d0423fb3f4a60867fa --- /dev/null +++ b/.gitignore.orig @@ -0,0 +1,23 @@ +**/target +<<<<<<< HEAD +*.iml +.idea/ +codestyle.xml +======= + +# From directories, ignore... + +### Idea: +.idea/ +.idea_modules/ +/out/ + +### Maven template +target/ + +### Eclipse template +bin/ +tmp/ +.settings/ + +>>>>>>> origin/master diff --git a/Comparison/pom.xml b/Comparison/pom.xml index 41f73633d3c857fd9be91c0201cf68d7463352db..b49b10b4ca291ff8a0bc39d768f3e493d9de03ae 100644 --- a/Comparison/pom.xml +++ b/Comparison/pom.xml @@ -1,64 +1,84 @@ -<?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> -</project> \ No newline at end of file +<?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> +</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/symmetry/AproxSymmetryPlane.java b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/AproxSymmetryPlane.java new file mode 100644 index 0000000000000000000000000000000000000000..6ddae7b0d4dcbd1e3e1bdfefb2495105dc732ed2 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/AproxSymmetryPlane.java @@ -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/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 b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/Config.java new file mode 100644 index 0000000000000000000000000000000000000000..ed08d5aa943f9ce117d84e3bb8863f27c900bcc2 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/Config.java @@ -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/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/Plane.java b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/Plane.java new file mode 100644 index 0000000000000000000000000000000000000000..cb9cfaa3db6c98feb84d7b5b976d0c65f971f781 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/Plane.java @@ -0,0 +1,101 @@ +package cz.fidentis.analyst.symmetry; + +import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.core.MeshFacetImpl; +import cz.fidentis.analyst.mesh.core.MeshPointImpl; +import javax.vecmath.Vector3d; + +/** + * + * @author Natália Bebjaková + * + * Representation of the symmetry plane + */ +public class Plane { + public double a; + public double b; + public double c; + public double d; + private static MeshFacet facet; + + /** + * Creates new plane + * + * @param a a coordinate + * @param b b coordinate + * @param c c coordinate + * @param d d coordinate + */ + public Plane(double a, double b, double c, double d) { + this.a = a; + this.b = b; + this.c = c; + this.d = d; + } + + /** + * Normalize the plane + */ + public void normalize() { + double normalLength = Math.sqrt(a * a + b * b + c * c); + + a /= normalLength; + b /= normalLength; + c /= normalLength; + d /= normalLength; + } + + /** + * Returns plane that is represented by mesh which can be merged with model + * + * @param centroid middle point of the plane + * @param a a coordinate + * @param b b coordinate + * @param scale distance of points given by bounding box + * @return plane represented as mesh + */ + public static SymmetryEstimator createPlaneMesh(Vector3d centroid, Vector3d a, Vector3d b, double scale) { + Vector3d[] points = new Vector3d[4]; + + Vector3d aScaled = new Vector3d(a); + Vector3d bScaled = new Vector3d(b); + aScaled.scale(scale); + bScaled.scale(scale); + + points[0] = new Vector3d(centroid); + points[0].sub(aScaled); + points[0].sub(bScaled); + + points[1] = new Vector3d(centroid); + points[1].sub(aScaled); + points[1].add(bScaled); + + points[2] = new Vector3d(centroid); + points[2].add(aScaled); + points[2].add(bScaled); + + points[3] = new Vector3d(centroid); + points[3].add(aScaled); + points[3].sub(bScaled); + + facet = new MeshFacetImpl(); + for (Vector3d point : points) { + facet.addVertex(new MeshPointImpl(point, null, null)); + } + facet.calculateVertexNormals(); + + SymmetryEstimator planeMesh = new SymmetryEstimator(facet, Config.getDefault()); + + return planeMesh; + } + + /** + * Returns string description of the plane + * + * @return description of the plane + */ + @Override + public String toString(){ + return "APPROXIMATE PLANE:\n" + a + "\n" + b + "\n" + c + "\n" + d + "\n"; + } +} diff --git a/Comparison/src/main/java/cz/fidentis/analyst/symmetry/SymmetryEstimator.java b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/SymmetryEstimator.java new file mode 100644 index 0000000000000000000000000000000000000000..50e9f043b3d572ea22ce7d7ac486c295fcabd574 --- /dev/null +++ b/Comparison/src/main/java/cz/fidentis/analyst/symmetry/SymmetryEstimator.java @@ -0,0 +1,694 @@ +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; +import javax.swing.ProgressMonitor; +import javax.swing.UIManager; +import javax.vecmath.Vector3d; + +/** + * + * @author Natália Bebjaková + * + * Main class for computing approximate plane of symmetry of the 3D model. + * For computing the symmetry, for every + * Default values of the configuration are given due to the best results on tested objects. + * On many different 3D models, it exists other values of config that will have better impact on result. + * + */ +public class SymmetryEstimator { + /** + * Facet of the model on which symmetry is computed + */ + private final MeshFacet facet; + /** + * Representation for areas of Voronoi region of triangles + */ + private TriangleVertexAreas[] areas; + /** + * Represent min-max box. It is automatically maintained by given point array. + */ + private BoundingBox boundingBox; + /** + * Helping array of triangles computed from corner table + */ + private List<MeshTriangle> triangles; + + /** + * panel for configuration of symmetry counting + */ + private JPanel panel; + + private final Config config; + + /** + * + * @return configuration of optional parameters of the algorithm + */ + public Config getConfig() { + return config; + } + + /** + * + * @return panel for configuration of symmetry counting + */ + public JPanel getPanel() { + return panel; + } + + /** + * + * @param panel new panel for configuration of symmetry counting + */ + public void setPanel(JPanel panel) { + this.panel = panel; + } + + + /** + * + * @return Facet of the model on which symmetry is computed + */ + public MeshFacet getFacet() { + return facet; + } + + /** + * Creates new class for computing symmetry + * + * @param f facet on which symmetry will be computed + * @param config configuration of optional parameters of the algorithm + */ + public SymmetryEstimator(MeshFacet f, Config config) { + this.facet = f; + this.config = config; + + this.triangles = f.asTriangles(); + + this.areas = new TriangleVertexAreas[triangles.size()]; + for (int i = 0; i < areas.length; i++) { + areas[i] = computeTriangleVertexAreas(triangles.get(i)); + } + + boundingBox = facet.getBoundingBox(); + } + + /** + * If bounding box is not created yet, it creates new one. + * + * @return Represent min-max box of the boundries of the model. + */ + public BoundingBox getBoundingBox() { + if (boundingBox == null) { + boundingBox = facet.getBoundingBox(); + } + return boundingBox; + } + + /** + * Representation of areas of Voronoi region of triangles + * used for computing Gaussian curvature + * + * @author Natália Bebjaková + */ + private class TriangleVertexAreas { + public double v1Area; + public double v2Area; + public double v3Area; + } + + /** + * + * @param pointIndex index of point for which we are searching traingles in its neighborhood + * @return triangle neighbours of given index of vertex + */ + protected List<Integer> getNeighbours(int pointIndex) { + return facet.getCornerTable().getTriangleIndexesByVertexIndex(pointIndex); + } + + /** + * Return area of Voronoi region of triangle + * + * @param t triangle of which area is computed + * @return area of Voronoi region + */ + private TriangleVertexAreas computeTriangleVertexAreas(MeshTriangle t) { + double a = (t.vertex2.subtractPosition(t.vertex3)).abs(); + double b = (t.vertex3.subtractPosition(t.vertex1)).abs(); + double c = (t.vertex2.subtractPosition(t.vertex1)).abs(); + + double d1 = a * a * (b * b + c * c - a * a); + double d2 = b * b * (c * c + a * a - b * b); + double d3 = c * c * (a * a + b * b - c * c); + double dSum = d1 + d2 + d3; + + d1 /= dSum; + d2 /= dSum; + d3 /= dSum; + + MeshPoint v1Half = (t.vertex2.addPosition(t.vertex3)).dividePosition(2); + MeshPoint v2Half = (t.vertex1.addPosition(t.vertex3)).dividePosition(2); + MeshPoint v3Half = (t.vertex2.addPosition(t.vertex1)).dividePosition(2); + + + TriangleVertexAreas area = new TriangleVertexAreas(); + + if (d1 < 0) { + area.v3Area = ((v2Half.subtractPosition(t.vertex3)).crossProduct(v1Half.subtractPosition(t.vertex3))).abs() / 2.0; + area.v2Area = ((v3Half.subtractPosition(t.vertex2)).crossProduct(v1Half.subtractPosition(t.vertex2))).abs() / 2.0; + area.v1Area = (((v1Half.subtractPosition(t.vertex1)).crossProduct(v3Half.subtractPosition(t.vertex1))).abs() / 2.0) + + (((v1Half.subtractPosition(t.vertex1)).crossProduct(v2Half.subtractPosition(t.vertex1))).abs() / 2.0); + return area; + } + if (d2 < 0) { + area.v1Area = ((v3Half.subtractPosition(t.vertex1)).crossProduct(v2Half.subtractPosition(t.vertex1))).abs() / 2.0; + area.v3Area = ((v1Half.subtractPosition(t.vertex3)).crossProduct(v2Half.subtractPosition(t.vertex3))).abs() / 2.0; + area.v2Area = (((v2Half.subtractPosition(t.vertex2)).crossProduct(v1Half.subtractPosition(t.vertex2))).abs() / 2.0) + + (((v2Half.subtractPosition(t.vertex2)).crossProduct(v3Half.subtractPosition(t.vertex2))).abs() / 2.0); + return area; + } + if (d3 < 0) { + area.v2Area = ((v1Half.subtractPosition(t.vertex2)).crossProduct(v3Half.subtractPosition(t.vertex2))).abs() / 2.0; + area.v1Area = ((v2Half.subtractPosition(t.vertex1)).crossProduct(v3Half.subtractPosition(t.vertex1))).abs() / 2.0; + area.v3Area = (((v3Half.subtractPosition(t.vertex3)).crossProduct(v2Half.subtractPosition(t.vertex3))).abs() / 2.0) + + (((v3Half.subtractPosition(t.vertex3)).crossProduct(v1Half.subtractPosition(t.vertex3))).abs() / 2.0); + return area; + } + + MeshPoint circumcenter = t.vertex1.multiplyPosition(d1).addPosition(t.vertex2.multiplyPosition(d2).addPosition(t.vertex3.multiplyPosition(d3))); + + area.v1Area = (((v2Half.subtractPosition(t.vertex1)).crossProduct(circumcenter.subtractPosition(t.vertex1))).abs() / 2.0) + + (((v3Half.subtractPosition(t.vertex1)).crossProduct(circumcenter.subtractPosition(t.vertex1))).abs() / 2.0); + + area.v2Area = (((v3Half.subtractPosition(t.vertex2)).crossProduct(circumcenter.subtractPosition(t.vertex2))).abs() / 2.0) + + (((v1Half.subtractPosition(t.vertex2)).crossProduct(circumcenter.subtractPosition(t.vertex2))).abs() / 2.0); + + area.v3Area = (((v1Half.subtractPosition(t.vertex3)).crossProduct(circumcenter.subtractPosition(t.vertex3))).abs() / 2.0) + + (((v2Half.subtractPosition(t.vertex3)).crossProduct(circumcenter.subtractPosition(t.vertex3))).abs() / 2.0); + return area; + } + + /** + * Calculates angle of the triangle according to center point + * + * @param centerPoint center point + * @param t triangle + * @return angle + */ + private double calculateTriangleAlfa(MeshPoint centerPoint, MeshTriangle t) { + double alfaCos = 0; + + if (t.vertex1 == centerPoint) { + MeshPoint e1 = t.vertex1.subtractPosition(t.vertex3); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = t.vertex2.subtractPosition(t.vertex3); + e2 = e2.dividePosition(e2.abs()); + + alfaCos = e1.dotProduct(e2); + } else if (t.vertex2 == centerPoint) { + MeshPoint e1 = t.vertex2.subtractPosition(t.vertex1); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = t.vertex3.subtractPosition(t.vertex1); + e2 = e2.dividePosition(e2.abs()); + + alfaCos = e1.dotProduct(e2); + } else if (t.vertex3 == centerPoint){ + MeshPoint e1 = t.vertex3.subtractPosition(t.vertex2); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = t.vertex1.subtractPosition(t.vertex2); + e2 = e2.dividePosition(e2.abs()); + + alfaCos = e1.dotProduct(e2); + } + double alfa = Math.acos(alfaCos); + return 1 / Math.tan(alfa); + } + + /** + * Calculates angle of the triangle according to center point + * + * @param centerPoint center point + * @param t triangle + * @return angle + */ + private double calculateTriangleBeta(MeshPoint centerPoint, MeshTriangle t) { + double betaCos = 0; + + if (t.vertex1 == centerPoint) { + MeshPoint e1 = t.vertex1.subtractPosition(t.vertex2); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = t.vertex3.subtractPosition(t.vertex2); + e2 = e2.dividePosition(e2.abs()); + + betaCos = e1.dotProduct(e2); + } else if (t.vertex2 == centerPoint) { + MeshPoint e1 = t.vertex2.subtractPosition(t.vertex3); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = t.vertex1.subtractPosition(t.vertex3); + e2 = e2.dividePosition(e2.abs()); + + betaCos = e1.dotProduct(e2); + } else if (t.vertex3 == centerPoint){ + MeshPoint e1 = t.vertex3.subtractPosition(t.vertex1); + e1 = e1.dividePosition(e1.abs()); + + MeshPoint e2 = t.vertex2.subtractPosition(t.vertex1); + e2 = e2.dividePosition(e2.abs()); + + betaCos = e1.dotProduct(e2); + } + double beta = Math.acos(betaCos); + return 1 / Math.tan(beta); + } + + /** + * Calculates Laplacian + * + * @param centerIndex centerIndex + * @return laplacian + */ + private Vector3d calculateLaplacian(int centerIndex) { + List<Integer> trianglesNeighbours = getNeighbours(centerIndex); + + if (trianglesNeighbours.isEmpty()) { + return new Vector3d(); + } + + double areaSum = 0; + Vector3d pointSum = new Vector3d(); + for (int i = 0; i < trianglesNeighbours.size(); i++) { + MeshTriangle t = triangles.get(trianglesNeighbours.get(i)); + MeshTriangle tNext = triangles.get(trianglesNeighbours.get((i + 1) % trianglesNeighbours.size())); + double area = 0; + + //MeshPoint tVertex1 = facet.getVertices().get(t.vertex1); + //MeshPoint tVertex2 = facet.getVertices().get(t.vertex2); + //MeshPoint tVertex3 = facet.getVertices().get(t.vertex3); + MeshPoint centerPoint = facet.getVertices().get(centerIndex); + + Vector3d aux = new Vector3d(); + if (t.vertex1 == facet.getVertex(centerIndex)) { + area = areas[trianglesNeighbours.get(i)].v1Area; + aux = new Vector3d(t.vertex2.getPosition()); + } else if (t.vertex2 == facet.getVertex(centerIndex)) { + area = areas[trianglesNeighbours.get(i)].v2Area; + aux = new Vector3d(t.vertex3.getPosition()); + } else if (t.vertex3 == facet.getVertex(centerIndex)) { + area = areas[trianglesNeighbours.get(i)].v3Area; + aux = new Vector3d(t.vertex1.getPosition()); + } + aux.sub(centerPoint.getPosition()); + aux.scale((calculateTriangleAlfa(centerPoint, t) + calculateTriangleBeta(centerPoint, tNext)) / 2.0); + pointSum.add(aux); + areaSum += area; + } + pointSum.scale(1.0/areaSum); + return pointSum; + } + + /** + * Gaussian curvature in a vertex of a triangle mesh. + * It can only be estimated because triangle mesh is not a continuous + * but discrete representation of surface. + * + * @param centerIndex index of vertex in which gaussian curvature is computed + * @return Gaussian curvature in given vertex + */ + private double getGaussianCurvature(int centerIndex) { + + List<Integer> triangleNeighbours = this.getNeighbours(centerIndex); + + if (triangleNeighbours.isEmpty()) { + return Double.NaN; + } + double sum = 2 * Math.PI; + double areaSum = 0; + + for (int i = 0; i < triangleNeighbours.size(); i++) { + Vector3d v1 = new Vector3d(); + Vector3d v2 = new Vector3d(); + MeshTriangle t = triangles.get(triangleNeighbours.get(i)); + + double area = 0; + if (t.vertex1 == facet.getVertex(centerIndex)) { + v1 = new Vector3d(t.vertex2.getPosition()); + v2 = new Vector3d(t.vertex3.getPosition()); + v1.sub(t.vertex1.getPosition()); + v2.sub(t.vertex1.getPosition()); + + area = areas[triangleNeighbours.get(i)].v1Area; + } else if (t.vertex2 == facet.getVertex(centerIndex)) { + v1 = new Vector3d(t.vertex1.getPosition()); + v2 = new Vector3d(t.vertex3.getPosition()); + v1.sub(t.vertex2.getPosition()); + v2.sub(t.vertex2.getPosition()); + + area = areas[triangleNeighbours.get(i)].v2Area; + } else if (t.vertex3 == facet.getVertex(centerIndex)) { + v1 = new Vector3d(t.vertex2.getPosition()); + v2 = new Vector3d(t.vertex1.getPosition()); + v1.sub(t.vertex3.getPosition()); + v2.sub(t.vertex3.getPosition()); + + area = areas[triangleNeighbours.get(i)].v3Area; + } + + areaSum += area; + v1.normalize(); + v2.normalize(); + + sum -= Math.acos(v1.dot(v2)); + } + double value = sum * (1.0 / areaSum); + return value; + } + + /** + * + * @param centerIndex center index + * @return mean curvature + */ + private double getMeanCurvature(int centerIndex) { + return calculateLaplacian(centerIndex).length(); + } + + /** + * + * @param centerIndex center index + * @return max curvature + */ + private double getMaxCurvature(int centerIndex) { + double gaussianCurvature = getGaussianCurvature(centerIndex); + if (Double.isNaN(gaussianCurvature)) { + return Double.NaN; + } + double meanCurvature = getMeanCurvature(centerIndex); + double meanCurvatureSqr = meanCurvature * meanCurvature; + if (meanCurvatureSqr <= gaussianCurvature) { + return meanCurvature; + } + return meanCurvature + Math.sqrt(meanCurvatureSqr - gaussianCurvature); + } + + /** + * Computes votes for given plane + * + * @param plane Plane for which votes are computed + * @param curvatures significant curvatures chosen for computing + * @param points significant points chosen for computing + * @param minCurvRatio optional parameter from configuration + * @param minAngleCos optional parameter from configuration + * @param minNormAngleCos optional parameter from configuration + * @param maxDist optional parameter from configuration + * @return total votes given to plane while computing the symmetry + */ + private int getVotes(Plane plane, + ArrayList<Double> curvatures, + ArrayList<Integer> points, + double minCurvRatio, + double minAngleCos, + double minNormAngleCos, + double maxDist) { + + plane.normalize(); + + Vector3d normal = new Vector3d(plane.a, plane.b, plane.c); + double d = plane.d; + double maxCurvRatio = 1.0 / minCurvRatio; + int votes = 0; + //List<Vector3d> normals = calculateNormals(); + + if (!facet.hasVertexNormals()) { + facet.calculateVertexNormals(); + } + + for (int i = 0; i < curvatures.size(); i++) { + for (int j = 0; j < curvatures.size(); j++) { + if (i != j && (curvatures.get(i) / curvatures.get(j) >= minCurvRatio + && curvatures.get(i) / curvatures.get(j) <= maxCurvRatio)) { + + Vector3d vec = new Vector3d(facet.getVertices().get(points.get(i)).getPosition()); + vec.sub(facet.getVertices().get(points.get(j)).getPosition()); + vec.normalize(); + double cos = vec.dot(normal); + + Vector3d ni = new Vector3d(facet.getVertex(points.get(i)).getNormal()); + Vector3d nj = new Vector3d(facet.getVertex(points.get(j)).getNormal()); + ni.normalize(); + nj.normalize(); + + Vector3d normVec = ni; + normVec.sub(nj); + normVec.normalize(); + double normCos = normVec.dot(normal); + + if (Math.abs(cos) >= minAngleCos && Math.abs(normCos) >= minNormAngleCos) { + Vector3d avrg = new Vector3d(facet.getVertices().get(points.get(i)).getPosition()); + Vector3d aux = new Vector3d(facet.getVertices().get(points.get(i)).getPosition()); + avrg.add(aux); + avrg.scale(0.5); + + double dist = normal.x * avrg.x + normal.y * avrg.y + normal.z * avrg.z + d; + + dist = Math.abs(dist); + + if (dist <= maxDist) { + votes++; + } + } + } + } + } + return votes; + } + + /** + * + * + * @return approximate plane of symmtetry + */ + public Plane getAproxSymmetryPlane() { + + UIManager.put("ProgressMonitor.progressText", "Counting symmetry..."); + + ArrayList<AproxSymmetryPlane> planes = new ArrayList<>(); + //List<Vector3d> normals = calculateNormals(); + if (!facet.hasVertexNormals()) { + facet.calculateVertexNormals(); + } + double[] curvatures = new double[facet.getNumberOfVertices()]; + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + if (facet.getNumberOfVertices() == 2500) { + curvatures[i] = this.getMaxCurvature(i); + } else { + curvatures[i] = this.getGaussianCurvature(i); + } + if (Double.isNaN(curvatures[i])){ + curvatures[i] = Double.MIN_VALUE; + } + } + ArrayList<Double> sortedCurvatures = new ArrayList<>(); + for (int i = 0; i < curvatures.length; i++) { + sortedCurvatures.add(curvatures[i]); + } + Collections.sort(sortedCurvatures); + + if(config.getSignificantPointCount() > facet.getNumberOfVertices()) { + config.setSignificantPointCount((facet.getNumberOfVertices()) - 1); + } + double bottomCurvature = sortedCurvatures.get(sortedCurvatures.size() - 1 - config.getSignificantPointCount()); + + ArrayList<Integer> significantPoints = new ArrayList<>(); + ArrayList<Double> significantCurvatures = new ArrayList<>(); + + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + if (curvatures[i] >= bottomCurvature) { + significantCurvatures.add(curvatures[i]); + significantPoints.add(i); + } + } + + Plane plane = new Plane(0, 0, 0, 0); + int lastVotes = 0; + + ProgressMonitor progressMonitor; + progressMonitor = new ProgressMonitor(panel, "Cunting...", + "Steps", 0, significantPoints.size()); + + double onePercent = significantCurvatures.size() / 100.0; + double percentsPerStep = 1 / onePercent; + for (int i = 0; i < significantPoints.size(); i++) { + for (int j = 0; j < significantPoints.size(); j++) { + if (i != j) { + double minRatio = config.getMinCurvRatio(); + double maxRatio = 1.0 / minRatio; + if (significantCurvatures.get(i) / significantCurvatures.get(j) >= minRatio && significantCurvatures.get(i) / + significantCurvatures.get(j) <= maxRatio) { + + Vector3d p1 = new Vector3d(facet.getVertex(significantPoints.get(i)).getPosition()); + Vector3d p2 = new Vector3d(facet.getVertex(significantPoints.get(j)).getPosition()); + + Vector3d avrg = new Vector3d(p1); + avrg.add(p2); + avrg.scale(0.5); + + Vector3d normal = new Vector3d(p1); + normal.sub(p2); + normal.normalize(); + + double d = -(normal.x * avrg.x) - (normal.y * avrg.y) - (normal.z * avrg.z); + + Vector3d ni = new Vector3d(facet.getVertex(significantPoints.get(i)).getNormal()); + Vector3d nj = new Vector3d(facet.getVertex(significantPoints.get(j)).getNormal()); + ni.normalize(); + nj.normalize(); + + Vector3d normVec = ni; + normVec.sub(nj); + normVec.normalize(); + double normCos = normVec.dot(normal); + + if (Math.abs(normCos) >= config.getMinNormAngleCos()) { + Plane newPlane = new Plane(normal.x, normal.y, normal.z, d); + int currentVotes = getVotes(newPlane, + significantCurvatures, + significantPoints, + config.getMinCurvRatio(), + config.getMinAngleCos(), + config.getMinNormAngleCos(), + boundingBox.getMaxDiag() * config.getMaxRelDistance()); + + planes.add(new AproxSymmetryPlane(newPlane, currentVotes)); + + if (currentVotes > lastVotes) { + lastVotes = currentVotes; + plane = newPlane; + } + } + + } + } + } + progressMonitor.setNote("Task step: " + (int) ((i + 1) * percentsPerStep)); + progressMonitor.setProgress(i); + } + + Collections.sort(planes); + ArrayList<AproxSymmetryPlane> finalPlanes = new ArrayList<>(); + for (int i = 0; i < planes.size(); i++) { + if (planes.get(i).votes == lastVotes){ + finalPlanes.add(planes.get(i)); + } + } + Plane finalPlane = new Plane(0, 0, 0, 0); + Vector3d refDir = new Vector3d(finalPlanes.get(0).a, finalPlanes.get(0).b, finalPlanes.get(0).c); + for (int i = 0; i < finalPlanes.size(); i++) { + Vector3d normDir = new Vector3d(finalPlanes.get(i).a, finalPlanes.get(i).b, finalPlanes.get(i).c); + if (normDir.dot(refDir) < 0) { + finalPlane.a -= finalPlanes.get(i).a; + finalPlane.b -= finalPlanes.get(i).b; + finalPlane.c -= finalPlanes.get(i).c; + finalPlane.d -= finalPlanes.get(i).d; + } else { + finalPlane.a += finalPlanes.get(i).a; + finalPlane.b += finalPlanes.get(i).b; + finalPlane.c += finalPlanes.get(i).c; + finalPlane.d += finalPlanes.get(i).d; + } + } + finalPlane.normalize(); + if (config.isAveraging()){ + plane = finalPlane; + } + JOptionPane.showMessageDialog(panel, "Symmetry estimate done.", "Done", 0, + new ImageIcon(getClass().getResource("/cz/fidentis/analyst/gui/resources/exportedModel.png"))); + + progressMonitor.close(); + return plane; + } + + /** + * + * @param plane Plane computed as symmetry plane + * @return mesh that represents facet with computed plane of approximate symmetry + */ + public SymmetryEstimator mergeWithPlane(Plane plane) { + Vector3d normal = new Vector3d(plane.a, plane.b, plane.c); + Vector3d midPoint = boundingBox.getMidPoint().getPosition(); + + double alpha = -((plane.a * midPoint.x) + + (plane.b * midPoint.y) + (plane.c * midPoint.z) + + plane.d) / (normal.dot(normal)); + + Vector3d midPointOnPlane = new Vector3d(midPoint); + Vector3d nn = new Vector3d(normal); + nn.scale(alpha); + midPointOnPlane.add(nn); + + double val = plane.a * midPointOnPlane.x + plane.b * + midPointOnPlane.y + plane.c * + midPointOnPlane.z + plane.d; + + Vector3d a = new Vector3d(); + if (Math.abs(normal.dot(new Vector3d(0.0, 1.0, 0.0))) > Math.abs(normal.dot(new Vector3d (1.0, 0.0, 0.0)))) { + a.cross(normal, new Vector3d(1.0, 0.0, 0.0)); + } else { + a.cross(normal, new Vector3d(0.0, 1.0, 0.0)); + } + a.normalize(); + + Vector3d b = new Vector3d(); + b.cross(normal,a); + b.normalize(); + + SymmetryEstimator planeMesh = Plane.createPlaneMesh(midPointOnPlane, a, b, + (boundingBox.getMaxPoint().subtractPosition(boundingBox.getMinPoint())).getPosition().x); + + return mergeMeshWith(planeMesh); + } + + /** + * + * @param s mesh that will be merged + * @return mesh with merged vertices from both meshes + */ + public SymmetryEstimator mergeMeshWith(SymmetryEstimator s) { + CornerTableRow row1 = new CornerTableRow(facet.getNumberOfVertices(), -1); + CornerTableRow row2 = new CornerTableRow(facet.getNumberOfVertices() + 1, facet.getNumberOfVertices() + 3); + CornerTableRow row3 = new CornerTableRow(facet.getNumberOfVertices() + 2, -1); + CornerTableRow row4 = new CornerTableRow(facet.getNumberOfVertices() + 2, -1); + CornerTableRow row5 = new CornerTableRow(facet.getNumberOfVertices() + 3, facet.getNumberOfVertices() + 1); + CornerTableRow row6 = new CornerTableRow(facet.getNumberOfVertices(), -1); + + facet.getCornerTable().addRow(row1); + facet.getCornerTable().addRow(row2); + facet.getCornerTable().addRow(row3); + facet.getCornerTable().addRow(row4); + facet.getCornerTable().addRow(row5); + facet.getCornerTable().addRow(row6); + + for(int n = 0; n < 4; n++) { + facet.addVertex(s.getFacet().getVertices().get(n)); + } + return this; + } +} diff --git a/Comparison/src/main/nbm/manifest.mf b/Comparison/src/main/nbm/manifest.mf new file mode 100644 index 0000000000000000000000000000000000000000..316179fa5311954f0e7119ce00ba9d8c6457ee4e --- /dev/null +++ b/Comparison/src/main/nbm/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +OpenIDE-Module-Localizing-Bundle: cz/findetis/comparison/Bundle.properties + diff --git a/Comparison/src/main/resources/cz/findetis/comparison/Bundle.properties b/Comparison/src/main/resources/cz/findetis/comparison/Bundle.properties new file mode 100644 index 0000000000000000000000000000000000000000..200d019b247e9dca057c1542d71e2cb59b3d2ff5 --- /dev/null +++ b/Comparison/src/main/resources/cz/findetis/comparison/Bundle.properties @@ -0,0 +1,6 @@ +#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= +#Mon May 11 15:08:59 CEST 2020 diff --git a/GUI/GUI.iml b/GUI/GUI.iml new file mode 100644 index 0000000000000000000000000000000000000000..c8d17b0fcc3fd5901b27b5ab278bf6834713b660 --- /dev/null +++ b/GUI/GUI.iml @@ -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/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 704b5e6fe0e711659ed6335215307ed72571e82b..257f71cbf5791bff83c2ac4c0973eab5eb09655d 100644 --- a/GUI/pom.xml +++ b/GUI/pom.xml @@ -56,8 +56,49 @@ <artifactId>org-netbeans-api-annotations-common</artifactId> <version>${netbeans.version}</version> </dependency> + <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> </dependencies> <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 b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.form new file mode 100644 index 0000000000000000000000000000000000000000..45e7ae464fa91504631c23830fee4e4b73dfcefd --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.form @@ -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.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 b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java new file mode 100644 index 0000000000000000000000000000000000000000..d43db88663c60bfdeec8cb6cb4e5eb461bdb5a05 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/Canvas.java @@ -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/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 b/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java new file mode 100644 index 0000000000000000000000000000000000000000..94acd8f1e1a00b199ba054a539cb4eecbca9d256 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/GeneralGLEventListener.java @@ -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/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/HelloWorldActionListener.java b/GUI/src/main/java/cz/fidentis/analyst/gui/HelloWorldActionListener.java new file mode 100644 index 0000000000000000000000000000000000000000..aeb1477b6cf15d9bf97d7a2bc5c6253cfdcc8643 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/HelloWorldActionListener.java @@ -0,0 +1,34 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package cz.fidentis.analyst.gui; + +/** + * Demo listener for testing. + * + * @author oslejsek + */ +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import org.openide.DialogDisplayer; +import org.openide.NotifyDescriptor; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionRegistration; +import org.openide.util.NbBundle.Messages; + +@ActionID(category = "Window", +id = "com.mycompany.mavenproject2.HelloWorldActionListener") +@ActionRegistration(displayName = "#CTL_HelloWorldActionListener") +@ActionReference(path = "Menu/Window", position = 0) +@Messages("CTL_HelloWorldActionListener=Hello World") +public final class HelloWorldActionListener implements ActionListener { + + public void actionPerformed(ActionEvent e) { + NotifyDescriptor d = new NotifyDescriptor.Message("hello..."); + DialogDisplayer.getDefault().notify(d); + } + +} \ No newline at end of file diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form new file mode 100644 index 0000000000000000000000000000000000000000..65d045392839a2d7c63dd98b9731e7518c2821a6 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.form @@ -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.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 b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.java new file mode 100644 index 0000000000000000000000000000000000000000..2a9889fe2734364490585a4744783e2dcece20bf --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/SymmetryPanel.java @@ -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/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 b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.form new file mode 100644 index 0000000000000000000000000000000000000000..7961bb6d2967cbb73214d51876ff43d3c4dae96b --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.form @@ -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.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 b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.java new file mode 100644 index 0000000000000000000000000000000000000000..b28c86ae0994dd28027c21b429c776e4270cb906 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/UserInterface.java @@ -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/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/angle.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/angle.png new file mode 100644 index 0000000000000000000000000000000000000000..a71d54c818db463afe8bd6eb558dff5c60de4629 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/angle.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png new file mode 100644 index 0000000000000000000000000000000000000000..bece4b869e31b64d58c4bcaf62ee749dc7fed49e Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/close.png 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/compareTwoFaces.svg b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoFaces.svg new file mode 100644 index 0000000000000000000000000000000000000000..358839af9d92ee564b9e1c0e98cfa5e825630740 --- /dev/null +++ b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/compareTwoFaces.svg @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + viewBox="0 0 141.7 141.7" style="enable-background:new 0 0 141.7 141.7;" xml:space="preserve"> +<style type="text/css"> + .st0{fill:#147269;} + .st1{enable-background:new ;} + .st2{fill:#FFFFFF;} + .st3{clip-path:url(#SVGID_2_);fill:#FFFFFF;} + .st4{clip-path:url(#SVGID_4_);fill:#FFFFFF;} + .st5{fill:none;} +</style> +<g> + <rect x="5.4" y="5.4" class="st0" width="131" height="131"/> + <g class="st1"> + <path class="st2" d="M35.7,111.7h-0.9c-0.1-0.9-0.7-1.5-1.7-1.5c-1.2,0-1.9,1-1.9,2.6s0.7,2.6,1.9,2.6c1,0,1.6-0.6,1.7-1.6h0.9 + c-0.1,1.4-1.1,2.3-2.6,2.3c-1.7,0-2.8-1.3-2.8-3.3c0-2.1,1.1-3.3,2.8-3.3C34.7,109.4,35.6,110.4,35.7,111.7z"/> + <path class="st2" d="M42.4,112.8c0,2-1.1,3.3-2.9,3.3s-2.9-1.3-2.9-3.3s1.1-3.3,2.9-3.3S42.4,110.7,42.4,112.8z M37.4,112.8 + c0,1.6,0.8,2.6,2,2.6c1.3,0,2-1,2-2.6s-0.8-2.6-2-2.6C38.2,110.2,37.4,111.2,37.4,112.8z"/> + <path class="st2" d="M49.5,116v-3.3c0-0.8,0-1.6,0-2.4h0c-0.3,0.8-0.6,1.6-0.9,2.4l-1.2,3.3h-1l-1.2-3.3c-0.3-0.8-0.6-1.6-0.9-2.4 + h0c0,0.8,0,1.6,0,2.4v3.3h-0.8v-6.4H45l1.2,3.2c0.3,0.8,0.6,1.6,0.8,2.5h0c0.3-0.8,0.6-1.6,0.8-2.5l1.2-3.2h1.3v6.4H49.5z"/> + <path class="st2" d="M54.2,109.6c1.5,0,2.2,0.8,2.2,1.9c0,1.2-0.8,1.9-2.2,1.9h-1.4v2.5H52v-6.4H54.2z M52.9,112.7h1.3 + c1,0,1.4-0.5,1.4-1.2c0-0.8-0.5-1.2-1.4-1.2h-1.3V112.7z"/> + <path class="st2" d="M57.8,114.1l-0.7,1.9h-0.9l2.4-6.4h1.1l2.4,6.4h-0.9l-0.7-1.9H57.8z M60.1,112.8c-0.3-0.9-0.6-1.7-0.9-2.6h0 + c-0.3,0.9-0.6,1.7-0.9,2.6l-0.2,0.6h2.3L60.1,112.8z"/> + <path class="st2" d="M64.9,109.6c1.5,0,2.3,0.6,2.3,1.7c0,0.8-0.5,1.4-1.2,1.6v0c0.5,0.1,0.7,0.4,1,1.2l0.7,1.8h-0.9l-0.6-1.7 + c-0.3-0.8-0.6-1-1.2-1h-1.1v2.7h-0.8v-6.4H64.9z M63.7,112.6h1.2c1,0,1.4-0.5,1.4-1.2c0-0.7-0.5-1.1-1.5-1.1h-1.1V112.6z"/> + <path class="st2" d="M69.5,110.3v2h3.1v0.7h-3.1v2.2h3.4v0.7h-4.2v-6.4h4.1v0.7H69.5z"/> + <path class="st2" d="M79.9,111.5c0,1.1-0.7,1.6-1.7,2.1c-1.2,0.7-1.5,1.1-1.5,1.7H80v0.7h-4.2c0-0.1,0-0.1,0-0.2 + c0-1.2,0.3-1.8,1.8-2.7c0.9-0.5,1.4-0.9,1.4-1.6c0-0.6-0.4-1-1.1-1c-0.8,0-1.1,0.4-1.2,1.2h-0.8c0-1.2,0.8-1.9,2-1.9 + C79.1,109.8,79.9,110.5,79.9,111.5z"/> + <path class="st2" d="M84.2,110.3v2.2h3v0.7h-3v2.7h-0.8v-6.4h4v0.7H84.2z"/> + <path class="st2" d="M88.8,114.1l-0.7,1.9h-0.9l2.4-6.4h1.1l2.4,6.4h-0.9l-0.7-1.9H88.8z M91.1,112.8c-0.3-0.9-0.6-1.7-0.9-2.6h0 + c-0.3,0.9-0.6,1.7-0.9,2.6l-0.2,0.6h2.3L91.1,112.8z"/> + <path class="st2" d="M98.8,111.7h-0.9c-0.1-0.9-0.7-1.5-1.7-1.5c-1.2,0-1.9,1-1.9,2.6s0.7,2.6,1.9,2.6c1,0,1.6-0.6,1.7-1.6h0.9 + c-0.1,1.4-1.1,2.3-2.6,2.3c-1.7,0-2.8-1.3-2.8-3.3c0-2.1,1.1-3.3,2.8-3.3C97.8,109.4,98.7,110.4,98.8,111.7z"/> + <path class="st2" d="M100.9,110.3v2h3.1v0.7h-3.1v2.2h3.4v0.7h-4.2v-6.4h4.1v0.7H100.9z"/> + <path class="st2" d="M109.6,111.5h-0.8c0-0.9-0.5-1.4-1.5-1.4c-0.8,0-1.3,0.4-1.3,1c0,0.7,0.5,0.9,1.5,1.1 + c1.2,0.3,2.2,0.6,2.2,1.9c0,1.2-0.9,1.9-2.3,1.9c-1.5,0-2.4-0.8-2.4-2.3h0.9c0,1.1,0.6,1.5,1.5,1.5c0.9,0,1.4-0.4,1.4-1.1 + c0-0.7-0.5-0.9-1.6-1.2c-1.2-0.3-2.2-0.6-2.2-1.9c0-1,0.8-1.8,2.1-1.8C108.8,109.4,109.6,110.2,109.6,111.5z"/> + </g> + <g> + <g> + <g> + <defs> + <ellipse id="SVGID_1_" cx="49.1" cy="62.4" rx="23.8" ry="29.7"/> + </defs> + <clipPath id="SVGID_2_"> + <use xlink:href="#SVGID_1_" style="overflow:visible;"/> + </clipPath> + <path class="st3" d="M65.4,68.5c-0.2,0.5-0.5,0.9-0.8,1.3s-0.7,0.6-1.2,0.6c-0.5-0.1-0.9,0.2-1,0.7c-0.1,0.3-0.1,0.7-0.2,1.1 + c-0.2,3.4-1.4,6.4-3.9,8.8c-0.3,0.3-0.5,0.6-0.5,1.1c0.1,1.9,0,3.8,0.1,5.8c0.1,1.9,0.7,3.5,1.8,4.6c-0.6,0.5-1.3,1-2.1,1.4 + c-0.2,0.1-0.3,0.1-0.5,0.2c-0.9,0.2-1.8,0.4-2.6,0.5c-1.9,0.1-3.8,0.1-5.7,0c-1.1,0-2.3-0.1-3.4-0.1c-0.7-0.1-1.3-0.1-2-0.3 + c-1.7-0.3-3.4-0.9-4.8-1.9c0.5-0.6,0.9-1.2,1.2-2s0.4-1.7,0.4-2.6c0.1-1.9,0.1-3.8,0.2-5.8c0-0.2-0.1-0.5-0.3-0.6 + c-1.6-1.7-2.9-3.6-3.5-5.8c-0.3-1-0.4-2.1-0.6-3.1c-0.1-0.4-0.1-0.8-0.2-1.2c-0.1-0.5-0.5-0.8-1-0.7c-0.7,0.1-1.2-0.3-1.5-0.8 + c-0.5-0.8-0.9-1.7-1.2-2.5c-0.5-1.4-0.6-2.9-0.5-4.4c0.1-0.8,0.4-1.1,1.2-1.1c0.2,0,0.5-0.1,0.7-0.1c0.9-0.3,0.9-0.5,0.8-1.3 + c-0.2-2.3-0.5-4.6-0.6-6.9c-0.3-5.4,2.2-9.4,6.7-12.2c6.8-4.3,16.1-2.7,21,3.5c2,2.5,2.9,5.3,2.7,8.5c-0.1,2.3-0.4,4.6-0.6,6.9 + c-0.1,1.1,0.2,1.4,1.3,1.6c1.2,0.1,1.4,0.4,1.5,1.5C66.5,64.9,66.2,66.7,65.4,68.5z M49.2,50.4c-5.7,0-10.3,6.3-10.3,14.1 + s4.6,14.1,10.3,14.1s10.3-6.3,10.3-14.1S54.9,50.4,49.2,50.4z"/> + </g> + </g> + <g> + <g> + <defs> + <ellipse id="SVGID_3_" cx="92.8" cy="62.4" rx="23.8" ry="29.7"/> + </defs> + <clipPath id="SVGID_4_"> + <use xlink:href="#SVGID_3_" style="overflow:visible;"/> + </clipPath> + <path class="st4" d="M109.1,68.5c-0.2,0.5-0.5,0.9-0.8,1.3s-0.7,0.6-1.2,0.6c-0.5-0.1-0.9,0.2-1,0.7c-0.1,0.3-0.1,0.7-0.2,1.1 + c-0.2,3.4-1.4,6.4-3.9,8.8c-0.3,0.3-0.5,0.6-0.5,1.1c0.1,1.9,0,3.8,0.1,5.8c0.1,1.9,0.7,3.5,1.8,4.6c-0.6,0.5-1.3,1-2.1,1.4 + c-0.2,0.1-0.3,0.1-0.5,0.2c-0.9,0.2-1.8,0.4-2.6,0.5c-1.9,0.1-3.8,0.1-5.7,0c-1.1,0-2.3-0.1-3.4-0.1c-0.7-0.1-1.3-0.1-2-0.3 + c-1.7-0.3-3.4-0.9-4.8-1.9c0.5-0.6,0.9-1.2,1.2-2c0.3-0.8,0.4-1.7,0.4-2.6c0.1-1.9,0.1-3.8,0.2-5.8c0-0.2-0.1-0.5-0.3-0.6 + c-1.6-1.7-2.9-3.6-3.5-5.8c-0.3-1-0.4-2.1-0.6-3.1c-0.1-0.4-0.1-0.8-0.2-1.2c-0.1-0.5-0.5-0.8-1-0.7c-0.7,0.1-1.2-0.3-1.5-0.8 + c-0.5-0.8-0.9-1.7-1.2-2.5c-0.5-1.4-0.6-2.9-0.5-4.4c0.1-0.8,0.4-1.1,1.2-1.1c0.2,0,0.5-0.1,0.7-0.1c0.9-0.3,0.9-0.5,0.8-1.3 + c-0.2-2.3-0.5-4.6-0.6-6.9c-0.3-5.4,2.2-9.4,6.7-12.2c6.8-4.3,16.1-2.7,21,3.5c2,2.5,2.9,5.3,2.7,8.5c-0.1,2.3-0.4,4.6-0.6,6.9 + c-0.1,1.1,0.2,1.4,1.3,1.6c1.2,0.1,1.4,0.4,1.5,1.5C110.2,64.9,109.9,66.8,109.1,68.5z M92.9,50.4c-5.7,0-10.3,6.3-10.3,14.1 + s4.6,14.1,10.3,14.1s10.3-6.3,10.3-14.1S98.6,50.4,92.9,50.4z"/> + </g> + </g> + <path class="st5" d="M38.4,60.9h72.2H38.4z"/> + <rect x="38.4" y="63.7" class="st2" width="68.7" height="3.3"/> + </g> +</g> +</svg> diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/curvature.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/curvature.png new file mode 100644 index 0000000000000000000000000000000000000000..c19d8f2dfe9ddd708ee75b102dd3f913c1d3bada Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/curvature.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/distance.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/distance.png new file mode 100644 index 0000000000000000000000000000000000000000..6c31475bd90db4bc0c4deeeef48eaf05256314d4 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/distance.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/home.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/home.png new file mode 100644 index 0000000000000000000000000000000000000000..59c019144b4eaf2f737b4234052143586c77d27f Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/home.png 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/info.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/info.png new file mode 100644 index 0000000000000000000000000000000000000000..0a1bd5107153871284fb876b4bda54f1bafc0f8a Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/info.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/info2.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/info2.png new file mode 100644 index 0000000000000000000000000000000000000000..d7f22dbeb4eb56fb7b9b7b9fd9650f094c21e421 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/info2.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize2.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize2.png new file mode 100644 index 0000000000000000000000000000000000000000..22d4076e421401ca5da769a129b79c0afb850a5c Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/minimize2.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigationBackground.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigationBackground.png new file mode 100644 index 0000000000000000000000000000000000000000..5c432124583a2fd332c0b3e59a65860362dd830e Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/navigationBackground.png 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/newP.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/newP.png new file mode 100644 index 0000000000000000000000000000000000000000..611e3282a43bb46c6b4583c9689f086f7427dcc9 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/newP.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project_opened.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/new_project_opened.png 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 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/points.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/points.png new file mode 100644 index 0000000000000000000000000000000000000000..ae2d15472049301b20749ba8085bec7babcacbda Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/points.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/save.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/save.png new file mode 100644 index 0000000000000000000000000000000000000000..5b48efd200d2a740f65066ba59af377f83c2f930 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/save.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/show.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/show.png new file mode 100644 index 0000000000000000000000000000000000000000..b4f8369e688f9e43e8e9c59b17dad800bb445674 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/show.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/show2.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/show2.png new file mode 100644 index 0000000000000000000000000000000000000000..df03fc3580d3becc5d74644bf5ceeac4e7b74100 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/show2.png differ diff --git a/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe2.png b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe2.png new file mode 100644 index 0000000000000000000000000000000000000000..40be817688e82594ba6ae92510324c6d9538c500 Binary files /dev/null and b/GUI/src/main/java/cz/fidentis/analyst/gui/resources/wireframe2.png differ diff --git a/MeshModel/MeshModel.iml b/MeshModel/MeshModel.iml new file mode 100644 index 0000000000000000000000000000000000000000..80a28bc560f1f11818d2264d101264ece491fcca --- /dev/null +++ b/MeshModel/MeshModel.iml @@ -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/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 b/MeshModel/pom.xml index c12d5375ce4ef79c47c2b912b8f9e678a1539c4c..d440dda45e4d3592806c68ae9d97b0a38f7be3f2 100644 --- a/MeshModel/pom.xml +++ b/MeshModel/pom.xml @@ -10,17 +10,18 @@ <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> @@ -63,15 +64,6 @@ </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> @@ -92,32 +84,31 @@ <!-- https://github.com/mokiat/java-data-front --> <dependency> <groupId>com.github.mokiat</groupId> - <artifactId>java-data-front</artifactId> - <version>v2.0.0</version> + <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>1.5.2</version> + <version>${version.javax.vecmath}</version> </dependency> <!-- https://mvnrepository.com/artifact/junit/junit --> <dependency> - <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> <scope>test</scope> </dependency> - <dependency> + <!--<dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> - <version>7.0.0</version> + <version>7.1.0</version> <scope>test</scope> - </dependency> + </dependency>--> </dependencies> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> - </project> 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 b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/BoundingBox.java new file mode 100644 index 0000000000000000000000000000000000000000..97d990ef85e49d4e64dc6cc81f199cdccabf9091 --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/BoundingBox.java @@ -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/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/CornerTable.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java index f7960da57ffca8b9cc5f6530b2bcf2afe3528fe7..7fac0315a81a591edd26aaea2a8d95b68cd54beb 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/CornerTable.java @@ -5,7 +5,8 @@ import java.util.List; import java.util.stream.Collectors; /** - * Representation of mesh in memory using corner table + * Representation of mesh in memory using corner table. + * Face = triangle. * * @author Matej Lukes */ @@ -201,9 +202,10 @@ public class CornerTable { .map(corner -> getIndexOfFace(rows.indexOf(corner))) .collect(Collectors.toList()); } - + /** * returns indexes of vertices of triangle + * * @param triangleIndex index of triangle * @return list of indexes */ 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 98629221f2568b91080d15eaf42df215c11b9d46..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,96 +1,71 @@ package cz.fidentis.analyst.mesh.core; -import java.util.ArrayList; import java.util.List; /** - * MashFacet + * An ancapsulated mesh plate (with shared vertices). * * @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); - } - - +public interface MeshFacet { + /** * 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; - } + MeshPoint getVertex(int index); /** - * returns list of vertices in triangle + * adds vertex to MeshFacet * - * @param triangleIndex index of triangle - * @return list of vertices + * @param point new vertex */ - 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; - } + void addVertex(MeshPoint point); /** * returns number of vertices in MeshFacet * * @return number of vertices */ - public int getNumberOfVertices() { - return vertices.size(); - } + int getNumberOfVertices(); /** - * adds vertex to MeshFacet + * returns list of vertices in MeshFacet * - * @param point new vertex + * @return list if vertices */ - public void addVertex(MeshPoint point) { - vertices.add(point); - } + List<MeshPoint> getVertices(); /** * returns Corner Table representing MeshFacet * * @return corner table */ - public CornerTable getCornerTable() { - return cornerTable; - } + 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/MeshFacetImpl.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacetImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..f0c12ab8bbd2aeb0b9b790d89a46a91b79acccaf --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshFacetImpl.java @@ -0,0 +1,115 @@ +package cz.fidentis.analyst.mesh.core; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.vecmath.Vector3d; + +/** + * MashFacet + * + * @author Matej Lukes + */ +public class MeshFacetImpl implements MeshFacet { + + private List<MeshPoint> vertices = new ArrayList<>(); + private CornerTable cornerTable; + + /** + * Constructor of MeshFacet + */ + public MeshFacetImpl() { + cornerTable = new CornerTable(); + } + + /** + * Copy constructor of MeshFacet + * + * @param facet copied MeshFacet + */ + public MeshFacetImpl(MeshFacet facet) { + vertices.addAll(facet.getVertices()); // encapsulation preserved - vertices MeshPoints are immutable) + cornerTable = new CornerTable(facet.getCornerTable()); + } + + @Override + public MeshPoint getVertex(int index) { + return vertices.get(index); + } + + @Override + public void addVertex(MeshPoint point) { + vertices.add(point); + } + + @Override + public int getNumberOfVertices() { + return vertices.size(); + } + + @Override + public List<MeshPoint> getVertices() { + return Collections.unmodifiableList(vertices); + } + + @Override + public CornerTable getCornerTable() { + return cornerTable; + } + + @Override + public List<MeshTriangle> asTriangles() { + List<MeshTriangle> ret = new ArrayList<>(); + for (int i = 0; i < cornerTable.getSize(); i += 3) { + ret.add(new MeshTriangle( + vertices.get(cornerTable.getRow(i + 0).getVertexIndex()), + vertices.get(cornerTable.getRow(i + 1).getVertexIndex()), + vertices.get(cornerTable.getRow(i + 2).getVertexIndex()))); + } + return ret; + } + + @Override + public BoundingBox getBoundingBox() { + return new BoundingBox(this.vertices); + } + + @Override + public boolean hasVertexNormals() { + return !this.vertices.isEmpty() && this.vertices.get(0).getNormal() != null; + } + + /** + * REPLACE WITH BETTER IMPLEMENTATION + * @throws RuntimeException if there are duplicate meth points in the mesh facet + */ + @Override + public void calculateVertexNormals() { + Map<Vector3d, Vector3d> normalMap = new HashMap<>(); // key = mesh point, value = normal + + // init normals: + for (MeshPoint point: vertices) { + if (normalMap.put(point.getPosition(), new Vector3d(0, 0, 0)) != null) { + throw new RuntimeException("Duplicate mesh point in the MeshFacet: " + point); + } + } + + // calculate normals from corresponding triangles + for (MeshTriangle t : asTriangles()) { + Vector3d triangleNormal = + (t.vertex3.subtractPosition(t.vertex1)).crossProduct(t.vertex2.subtractPosition(t.vertex1)).getPosition(); + normalMap.get(t.vertex1).add(triangleNormal); + normalMap.get(t.vertex2).add(triangleNormal); + normalMap.get(t.vertex3).add(triangleNormal); + } + + // normalize normals: + for (Vector3d normal: normalMap.values()) { + normal.normalize(); + } + } + +} + diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshModel.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshModel.java index 1f22bb850298923e44df81fef96a40ffb33cfd71..9ab6d00ce755367b76da0f4562f8d298021c0d6d 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshModel.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshModel.java @@ -24,9 +24,8 @@ public class MeshModel { * @param meshModel copied MeshModel */ public MeshModel(MeshModel meshModel) { - for (MeshFacet facet : - meshModel.facets) { - facets.add(new MeshFacet(facet)); + for (MeshFacet facet: meshModel.facets) { + facets.add(new MeshFacetImpl(facet)); } } 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 c14f126e3eb7a18feebe9615b1b621f8b5676794..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 @@ -3,82 +3,26 @@ package cz.fidentis.analyst.mesh.core; import javax.vecmath.Vector3d; /** - * @author Matej Lukeš + * MeshPoint represents a point with position, normal, and texture coordinates + * + * @author Matej Lukes */ -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); - } - } - +public interface MeshPoint { + /** * @return normal */ - public Vector3d getNormal() { - return new Vector3d(normal); - } + Vector3d getNormal(); /** * @return position */ - public Vector3d getPosition() { - return new Vector3d(position); - } + Vector3d getPosition(); /** * @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(); - } + Vector3d getTexCoord(); /** * returns new instance of MeshPoint with subtracted position @@ -86,9 +30,7 @@ public class MeshPoint { * @param subtrahend position to be subtracted * @return subtracted MeshPoint */ - public MeshPoint subtractPosition(MeshPoint subtrahend) { - return MeshPoint.this.subtractPosition(subtrahend.position); - } + MeshPoint subtractPosition(MeshPoint subtrahend); /** * returns new instance of MeshPoint with subtracted position @@ -96,17 +38,7 @@ public class MeshPoint { * @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); - } + MeshPoint subtractPosition(Vector3d subtrahend); /** * returns new instance of MeshPoint with added position @@ -114,9 +46,7 @@ public class MeshPoint { * @param addend position to be added * @return added MeshPoint */ - public MeshPoint addPosition(MeshPoint addend) { - return MeshPoint.this.addPosition(addend.position); - } + MeshPoint addPosition(MeshPoint addend); /** * returns new instance of MeshPoint with added position @@ -124,100 +54,77 @@ public class MeshPoint { * @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); - } + MeshPoint addPosition(Vector3d addend); /** * 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); - } + MeshPoint multiplyPosition(double number); /** * 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); - } - + 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. */ - public MeshPoint crossProduct(MeshPoint meshPoint) { - Vector3d newPosition = new Vector3d(); - newPosition.cross(position, meshPoint.position); - - return new MeshPoint(newPosition, new Vector3d(normal), new Vector3d(texCoord)); - } + 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 + * @return dot product of two instances of MeshPoint + */ + double dotProduct(MeshPoint meshPoint); + + /** + * returns absolute value of MeshPoint + * + * @return absolute value of MeshPoint */ - public double dotProduct(MeshPoint meshPoint) { - return position.dot(meshPoint.position); - } + double abs(); /** - * returns the dot product of two points + * 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 vector Second argument of the dot product operation - * @return dot product of two instances of MeshPoint + * @param subtrahend normal to be subtracted + * @return subtracted MeshPoint */ - public double dotProduct(Vector3d vector) { - return position.dot(vector); - } + 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 absolute value of MeshPoint + * returns new instance of MeshPoint with added normal * - * @return absolute value of MeshPoint + * @param addend normal to be added + * @return added 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); - } + 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/core/MeshPointImpl.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPointImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..8284ac9a209f679198abdfdff8ce2a645b09c270 --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPointImpl.java @@ -0,0 +1,200 @@ +package cz.fidentis.analyst.mesh.core; + +import javax.vecmath.Vector3d; + +/** + * MeshPoint represents a point with position, normal, and texture coordinates. + * + * @author Matej Lukes + */ +public class MeshPointImpl implements MeshPoint { + + private final Vector3d position, normal, texCoord; + + /** + * constructor of meshPoint + * + * @param position position of MeshPoint + * @param normal normal of MeshPoint + * @param texCoord coordinates in texture + */ + public MeshPointImpl(Vector3d position, Vector3d normal, Vector3d texCoord) { + if (position == null) { + throw new NullPointerException("position cannot be null"); + } + + this.position = new Vector3d(position); + this.normal = new Vector3d(normal); + this.texCoord = new Vector3d(texCoord); + } + + /** + * copy constructor of meshPoint + * + * @param meshPoint copied meshPoint + */ + public MeshPointImpl(MeshPoint meshPoint) { + this(meshPoint.getPosition(), meshPoint.getNormal(), meshPoint.getTexCoord()); + + } + + @Override + public Vector3d getNormal() { + return normal; + } + + @Override + public Vector3d getPosition() { + return position; + } + + @Override + public Vector3d getTexCoord() { + return texCoord; + } + + @Override + public MeshPoint subtractPosition(MeshPoint subtrahend) { + return subtractPosition(subtrahend.getPosition()); + } + + @Override + public MeshPoint subtractPosition(Vector3d subtrahend) { + Vector3d newPosition = new Vector3d(position); + newPosition.sub(subtrahend); + return new MeshPointImpl(new Vector3d(newPosition), normal, new Vector3d(texCoord)); + } + + @Override + public MeshPoint addPosition(MeshPoint addend) { + return addPosition(addend.getPosition()); + } + + @Override + public MeshPoint addPosition(Vector3d addend) { + Vector3d newPosition = new Vector3d(position); + newPosition.add(addend); + return new MeshPointImpl(new Vector3d(newPosition), normal, new Vector3d(texCoord)); + } + + @Override + public MeshPoint multiplyPosition(double number) { + if (normal != null) { + if (texCoord != null) { + return new MeshPointImpl(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + new Vector3d(normal), new Vector3d(texCoord)); + } else { + return new MeshPointImpl(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + new Vector3d(normal), null); + } + } + return new MeshPointImpl(new Vector3d(this.getPosition().x * number, + this.getPosition().y * number, this.getPosition().z * number), + null, null); + } + + @Override + public MeshPoint dividePosition(double number) { + if (normal != null) { + if (texCoord != null) { + return new MeshPointImpl(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), new Vector3d(normal), new Vector3d(texCoord)); + } else { + return new MeshPointImpl(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), new Vector3d(normal), null); + } + } + return new MeshPointImpl(new Vector3d(this.getPosition().x / number, this.getPosition().y / number, + this.getPosition().z / number), null, null); + } + + @Override + public MeshPoint crossProduct(MeshPoint meshPoint) { + if (normal != null) { + if (texCoord != null) { + return new MeshPointImpl(new Vector3d + (this.position.y * meshPoint.getPosition().z - this.position.z * meshPoint.getPosition().y, + this.position.z * meshPoint.getPosition().x - this.position.x * meshPoint.getPosition().z, + this.position.x * meshPoint.getPosition().y - this.position.y * meshPoint.getPosition().x), + new Vector3d(normal), new Vector3d(texCoord)); + } else { + return new MeshPointImpl(new Vector3d + (this.position.y * meshPoint.getPosition().z - this.position.z * meshPoint.getPosition().y, + this.position.z * meshPoint.getPosition().x - this.position.x * meshPoint.getPosition().z, + this.position.x * meshPoint.getPosition().y - this.position.y * meshPoint.getPosition().x), + new Vector3d(normal), null); + } + } + return new MeshPointImpl(new Vector3d + (this.position.y * meshPoint.getPosition().z - this.position.z * meshPoint.getPosition().y, + this.position.z * meshPoint.getPosition().x - this.position.x * meshPoint.getPosition().z, + this.position.x * meshPoint.getPosition().y - this.position.y * meshPoint.getPosition().x), + null, null); + } + + @Override + public double dotProduct(MeshPoint meshPoint) { + return (this.position.x * meshPoint.getPosition().x + this.position.y * meshPoint.getPosition().y + this.position.z * meshPoint.getPosition().z); + } + + @Override + public double abs() { + return Math.sqrt(this.getPosition().x * this.getPosition().x + + this.getPosition().y * this.getPosition().y + this.getPosition().z * this.getPosition().z); + } + + @Override + public MeshPoint subtractNormal(MeshPoint subtrahend) { + return subtractNormal(subtrahend.getNormal()); + } + + @Override + public MeshPoint subtractNormal(Vector3d subtrahend) { + Vector3d newNormal = new Vector3d(normal); + newNormal.sub(subtrahend); + newNormal.normalize(); + return new MeshPointImpl(new Vector3d(position), newNormal, new Vector3d(texCoord)); + } + + @Override + public MeshPoint addNormal(MeshPoint addend) { + return addNormal(addend.getNormal()); + } + + @Override + public MeshPoint addNormal(Vector3d addend) { + Vector3d newNormal = new Vector3d(normal); + newNormal.add(addend); + newNormal.normalize(); + return new MeshPointImpl(new Vector3d(position), newNormal, 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 MeshPointImpl)) { + return false; + } + + MeshPointImpl meshPointObj = (MeshPointImpl) obj; + return this.position.equals(meshPointObj.position) + && this.normal.equals(meshPointObj.normal) + && this.texCoord.equals(meshPointObj.texCoord); + } + + /** + * returns hash of MeshPoint + * + * @return hash + */ + @Override + public int hashCode() { + return position.hashCode() + normal.hashCode() + texCoord.hashCode(); + } + +} diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshTriangle.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshTriangle.java new file mode 100644 index 0000000000000000000000000000000000000000..ce92a48824f25a7198a025dfd7773ab8077e93e2 --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshTriangle.java @@ -0,0 +1,30 @@ +package cz.fidentis.analyst.mesh.core; + +/** + * + * @author Natália Bebjaková + * + * Adapter for the corner table representing a single triangle of the @code{MeshFacet}. + */ + +public class MeshTriangle { + + public final MeshPoint vertex1; + public final MeshPoint vertex2; + public final MeshPoint vertex3; + + /** + * Creates new triangle + * + * @param v1 first vertex + * @param v2 second vertex + * @param v3 third vertex + */ + public MeshTriangle(MeshPoint v1, MeshPoint v2, MeshPoint v3) { + this.vertex1 = v1; + this.vertex2 = v2; + this.vertex3 = v3; + } + + +} diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshModelExporter.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshModelExporter.java deleted file mode 100644 index a7e93a34cac9bb11fe63c8b213eb801a142158a8..0000000000000000000000000000000000000000 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshModelExporter.java +++ /dev/null @@ -1,219 +0,0 @@ -package cz.fidentis.analyst.mesh.io; -/** - * @author Natália Bebjaková - * <p> - * Creates new directory and exports model to .obj file in this created directory - * Exports model's vertices and normals, if there are some - */ - -import cz.fidentis.analyst.mesh.core.MeshFacet; -import cz.fidentis.analyst.mesh.core.MeshModel; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.text.DecimalFormat; -import java.text.DecimalFormatSymbols; -import java.util.Locale; - -/** - * @author Natalia Bebjakova - */ -public class MeshModelExporter { - /** - * Helping representation of triangle in symmetry estimate - * - * @author Natalia Bebjakova - */ - private class Triangle { - private int vertex1; - private int vertex2; - private int vertex3; - - /** - * Creates new triangle - * - * @param v1 first vertex - * @param v2 second vertex - * @param v3 third vertex - */ - Triangle(int v1, int v2, int v3) { - this.vertex1 = v1; - this.vertex2 = v2; - this.vertex3 = v3; - } - - /** - * @return first vertex of triangle - */ - public int getVertex1() { - return vertex1; - } - - /** - * @param vertex1 new vertex - */ - public void setVertex1(int vertex1) { - this.vertex1 = vertex1; - } - - /** - * @return second vertex of triangle - */ - public int getVertex2() { - return vertex2; - } - - /** - * @param vertex2 new vertex - */ - public void setVertex2(int vertex2) { - this.vertex2 = vertex2; - } - - /** - * @return third vertex of triangle - */ - public int getVertex3() { - return vertex3; - } - - /** - * @param vertex3 new vertex - */ - public void setVertex3(int vertex3) { - this.vertex3 = vertex3; - } - - /** - * Triangles are same if they have same vertices - * - * @param obj other triangle - * @return true if two triangles are same - */ - @Override - public boolean equals(Object obj) { - if (!(obj instanceof Triangle)) { - return false; - } - Triangle t = (Triangle) obj; - return ((this.vertex1 == t.vertex1) || (this.vertex1 == t.vertex2) || (this.vertex1 == t.vertex3)) && - ((this.vertex2 == t.vertex1) || (this.vertex2 == t.vertex2) || (this.vertex2 == t.vertex3)) && - ((this.vertex3 == t.vertex1) || (this.vertex3 == t.vertex2) || (this.vertex3 == t.vertex3)); - } - - /** - * @return hascode of the triangle - */ - @Override - public int hashCode() { - return (this.vertex1 * 100 ^ this.vertex2 * 100 ^ this.vertex3); - } - } - - /** - * Model to be exported - */ - private MeshModel model; - - /** - * @param model model to be exported. - */ - public MeshModelExporter(MeshModel model) { - this.model = model; - } - - /** - * @param exportFile exported file name - * @throws IOException Error - */ - public void exportModelToObj(File exportFile) throws IOException { - for (MeshFacet facet : model.getFacets()) { - exportFacetToObj(facet, exportFile); - } - } - - /** - * Export model to OBJ file. - * - * @param facet Facet of the model to be exported, so far every model has one - * @param exportFile file for exporting. - * @throws IOException Error - */ - public void exportFacetToObj(MeshFacet facet, File exportFile) throws IOException { - int formatIndex = exportFile.getName().lastIndexOf("."); - String fileName; //name that is writen to file - - if (formatIndex < 0) { - fileName = exportFile.getName(); - } else { - fileName = exportFile.getName().substring(0, formatIndex); - } - - File exportDirectory = new File(exportFile.getParent() + File.separator + fileName); - exportDirectory.mkdir(); //creates new directory - - exportFile = new File(exportDirectory + File.separator + fileName + ".obj"); - - try (BufferedWriter out = new BufferedWriter(new FileWriter(exportFile))) { - - out.write("mtllib " + fileName + ".mtl" + "\n"); - - DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault()); - otherSymbols.setDecimalSeparator('.'); //dot as separator for decimal numbers - DecimalFormat df = new DecimalFormat("#.####", otherSymbols); - - //writes vertices of the facet to file - for (int j = 0; j < facet.getNumberOfVertices(); j++) { - out.write("v " + df.format(facet.getVertices().get(j).getPosition().x) + " " - + df.format(facet.getVertices().get(j).getPosition().y) + " " - + df.format(facet.getVertices().get(j).getPosition().z) + "\n"); - } - out.write("#" + facet.getNumberOfVertices() + " vertices" + "\n"); - - //detects if first vertex has normal - boolean hasAllNormals = facet.getVertices().get(0).getNormal() != null; - - //writes normals if there are any - for (int i = 0; i < facet.getNumberOfVertices(); i++) { - if (facet.getVertex(i).getNormal() != null) { - out.write("vn " + df.format(facet.getVertices().get(i).getNormal().x) + " " - + df.format(facet.getVertices().get(i).getNormal().y) + " " - + df.format(facet.getVertices().get(i).getNormal().z) + "\n"); - } - } - - //computes triangles of facet - Triangle[] triangles = new Triangle[facet.getCornerTable().getSize() / 3]; - for (int i = 0; i < facet.getCornerTable().getSize(); i += 3) { - Triangle t = new Triangle(facet.getCornerTable().getRow(i).getVertexIndex(), - facet.getCornerTable().getRow(i + 1).getVertexIndex(), - facet.getCornerTable().getRow(i + 2).getVertexIndex()); - triangles[(i / 3)] = t; - } - - //writes triangles of facet - writeTrianglesOfFacet(triangles, out, facet, hasAllNormals); - out.write("\n"); - } - } - - private void writeTrianglesOfFacet(Triangle[] triangles, - BufferedWriter out, - MeshFacet facet, - boolean hasAllNormals) throws IOException { - for (Triangle triangle : triangles) { - out.write("f "); - if (facet.getVertex(triangle.getVertex1()).getNormal() != null && hasAllNormals) { - out.write((triangle.getVertex1() + 1) + "//" + (triangle.getVertex1() + 1) + " " - + (triangle.getVertex2() + 1) + "//" + (triangle.getVertex2() + 1) + " " - + (triangle.getVertex3() + 1) + "//" + (triangle.getVertex3() + 1) + "\n"); - } else { - out.write((triangle.getVertex1() + 1) + " " + (triangle.getVertex2() + 1) + - " " + (triangle.getVertex3() + 1) + "\n"); - } - } - } -} - 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 new file mode 100644 index 0000000000000000000000000000000000000000..e518c9adee25c1e061d031795743492c7e5dcf10 --- /dev/null +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjExporter.java @@ -0,0 +1,141 @@ +package cz.fidentis.analyst.mesh.io; + +import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.core.MeshModel; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.util.Locale; + +/** + * Utility class for exporting model to .obj file (vertices, normals and triangles) + * + * @author Natalia Bebjakova + */ +public class MeshObjExporter { + /** + * Model to be exported + */ + private MeshModel model; + + /** + * + * @param model model to be exported. + */ + public MeshObjExporter(MeshModel model) { + this.model = model; + } + + /** + * Exports all facets of the model to .obj file + * + * @param exportFile File to which model is exported + * @throws IOException + */ + public void exportModelToObj(File exportFile) throws IOException { + for(MeshFacet facet : model.getFacets()) { + exportFacetToObj(facet, exportFile); + } + } + + /** + * Exports facet to OBJ file. + * It writes vertices, normals and triangles to file + * + * @param facet Facet of the model to be exported, so far every model has one + * @param exportFile file for exporting. + * @throws java.io.IOException + */ + public void exportFacetToObj(MeshFacet facet, File exportFile) throws IOException { + int formatIndex = exportFile.getName().lastIndexOf("."); + String fileName; //name that is writen to file + + if (formatIndex < 0) { + fileName = exportFile.getName(); + } else { + fileName = exportFile.getName().substring(0, formatIndex); + } + + exportFile = new File(exportFile.getParent() + File.separator + fileName + ".obj"); + + try (BufferedWriter out = new BufferedWriter(new FileWriter(exportFile))) { + + DecimalFormatSymbols otherSymbols = new DecimalFormatSymbols(Locale.getDefault()); + otherSymbols.setDecimalSeparator('.'); //dot as separator for decimal numbers + DecimalFormat df = new DecimalFormat("#.####", otherSymbols); + + //writes vertices of the facet to file + for (int j = 0; j < facet.getNumberOfVertices(); j++) { + out.write("v " + df.format(facet.getVertices().get(j).getPosition().x) + " " + + df.format(facet.getVertices().get(j).getPosition().y) + " " + + df.format(facet.getVertices().get(j).getPosition().z)); + out.newLine(); + } + + //detects if first vertex has normal + boolean hasAllNormals = facet.getVertices().get(0).getNormal() != null; + + //writes normals if there are any + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + if(facet.getVertex(i).getNormal() != null) { + out.write("vn " + df.format(facet.getVertices().get(i).getNormal().x) + " " + + df.format(facet.getVertices().get(i).getNormal().y) + " " + + df.format(facet.getVertices().get(i).getNormal().z)); + out.newLine(); + } + } + + for (int i = 0; i < facet.getCornerTable().getSize(); i += 3) { + int v1i = facet.getCornerTable().getRow(i).getVertexIndex(); + int v2i = facet.getCornerTable().getRow(i + 1).getVertexIndex(); + int v3i = facet.getCornerTable().getRow(i + 2).getVertexIndex(); + + out.write("f "); + if (facet.getVertex(v1i).getNormal() != null && hasAllNormals) { + out.write((v1i + 1) + "//" + (v1i + 1) + " " + + (v2i + 1) + "//" + (v2i + 1) + " " + + (v3i + 1) + "//" + (v3i + 1)); + out.newLine(); + } else { + out.write((v1i + 1) + " " + (v2i + 1) + " " + (v3i + 1)); + out.newLine(); + } + } + + out.write("#" + facet.getCornerTable().getSize() / 3 + " triangles"); + out.newLine(); + + /* + //computes triangles of facet + Triangle[] triangles = new Triangle[facet.getCornerTable().getSize() / 3]; + for (int i = 0; i < facet.getCornerTable().getSize(); i += 3) { + Triangle t = new Triangle(facet.getCornerTable().getRow(i).getVertexIndex(), + facet.getCornerTable().getRow(i + 1).getVertexIndex(), + facet.getCornerTable().getRow(i + 2).getVertexIndex()); + triangles[(i / 3)] = t; + } + + //writes triangles of facet + for (Triangle triangle : triangles) { + out.write("f "); + if (facet.getVertex(triangle.getVertex1()).getNormal() != null && hasAllNormals) { + out.write((triangle.getVertex1() + 1) + "//" + (triangle.getVertex1() + 1) + " " + + (triangle.getVertex2() + 1) + "//" + (triangle.getVertex2() + 1) + " " + + (triangle.getVertex3() + 1) + "//" + (triangle.getVertex3() + 1) + "\n"); + } else { + out.write((triangle.getVertex1() + 1) + " " + (triangle.getVertex2() + 1) + + " " + (triangle.getVertex3() + 1) + "\n"); + } + } + out.write("#" + triangles.length + " triangles" + "\n"); + out.write("\n"); + out.close(); + fstream.close(); + */ + } + } +} + diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjLoader.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjLoader.java index 12ef65c44b81a258c918368b250925240a628e94..210616d4f472673037af0ce2d981ee75a514a5bd 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjLoader.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/MeshObjLoader.java @@ -12,8 +12,10 @@ import com.mokiat.data.front.parser.OBJTexCoord; import com.mokiat.data.front.parser.OBJVertex; import cz.fidentis.analyst.mesh.core.CornerTableRow; import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.core.MeshFacetImpl; import cz.fidentis.analyst.mesh.core.MeshModel; import cz.fidentis.analyst.mesh.core.MeshPoint; +import cz.fidentis.analyst.mesh.core.MeshPointImpl; import javax.vecmath.Vector3d; import java.io.File; @@ -90,7 +92,7 @@ public class MeshObjLoader { * @throws IOException Data are corrupted */ private static MeshFacet parseMeshToFacet(OBJModel model, OBJMesh mesh) throws IOException { - MeshFacet meshFacet = new MeshFacet(); + MeshFacet meshFacet = new MeshFacetImpl(); Map<MeshPoint, Integer> vertices = new HashMap(); Map<Edge, Integer> edges = new HashMap(); @@ -178,7 +180,7 @@ public class MeshObjLoader { final OBJTexCoord texCoord = model.getTexCoord(reference); texCoords = new Vector3d(texCoord.u, texCoord.v, texCoord.w); } - result.add(new MeshPoint(coords, norm, texCoords)); + result.add(new MeshPointImpl(coords, norm, texCoords)); } if (result.size() != 3) { throw new IOException("Mesh contains non-triangular face"); diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/ModelFileFilter.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/ModelFileFilter.java index 7eec1eff5db74a426a9f4157b8231211a7650ad7..17a5f729bcf869daaa0225876d6c3d57a31d9f44 100644 --- a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/ModelFileFilter.java +++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/io/ModelFileFilter.java @@ -1,20 +1,21 @@ package cz.fidentis.analyst.mesh.io; -import java.io.File; import javax.swing.filechooser.FileFilter; +import java.io.File; /** - * @author Natalia Bebjakova - * <p> - * Enables to choose just extensions we want in the filechooser + * @author Natália Bebjaková + * + * Class that enables to choose just extensions we want in the filechooser */ public class ModelFileFilter extends FileFilter { private final String[] extension; private final String description; - + /** - * @param extension Extentions of files + * + * @param extension Extentions of files * @param description Description */ public ModelFileFilter(String[] extension, String description) { @@ -23,21 +24,23 @@ public class ModelFileFilter extends FileFilter { } /** - * @param f File - * @return Whether file has chosen extension or not + * + * @param f File + * @return Whether file has chosen extension or not */ @Override public boolean accept(File f) { boolean accepted = false; - for (int i = 0; i < extension.length; i++) { - if (f.isDirectory() || f.getName().endsWith(extension[i])) { + for (String extension1 : extension) { + if (f.isDirectory() || f.getName().endsWith(extension1)) { accepted = true; } } return accepted; } - + /** + * * @return description */ @Override diff --git a/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java index afcff82b767398844635ab1143ece16207029e69..e6be5856e648e24bc68c2c47a2597140bde564da 100644 --- a/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java +++ b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableRowTest.java @@ -1,8 +1,12 @@ package cz.fidentis.analyst.mesh.core; -import org.testng.annotations.Test; +//import org.testng.annotations.Test; -import static org.testng.AssertJUnit.assertEquals; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; + + +//import static org.testng.AssertJUnit.assertEquals; /** * Unit test for cornerTableRow @@ -13,7 +17,7 @@ public class CornerTableRowTest { * unit test for getVertex */ @Test - public void getVertexIndex() { + void getVertexIndex() { CornerTableRow row = new CornerTableRow(42, -1); assertEquals(42, row.getVertexIndex()); } @@ -22,7 +26,7 @@ public class CornerTableRowTest { * Unit test for getOppositeCornerIndex */ @Test - public void getOppositeCornerIndex() { + void getOppositeCornerIndex() { CornerTableRow row = new CornerTableRow(0, 42); assertEquals(42, row.getOppositeCornerIndex()); } @@ -31,10 +35,10 @@ public class CornerTableRowTest { * Unit test for setOppositeCornerIndex */ @Test - public void setOppositeCornerIndex() { + void setOppositeCornerIndex() { CornerTableRow row = new CornerTableRow(0, 42); assertEquals(42, row.getOppositeCornerIndex()); row.setOppositeCornerIndex(21); assertEquals(21, row.getOppositeCornerIndex()); } -} \ No newline at end of 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 b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableTest.java index 8aac931664956722ac54ed246038f69314ba01f8..69f0f4b8e5d04fc3df9bc3baa73d82663f26a4bb 100644 --- a/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableTest.java +++ b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/core/CornerTableTest.java @@ -1,8 +1,8 @@ package cz.fidentis.analyst.mesh.core; -import org.testng.annotations.Test; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; -import static org.testng.AssertJUnit.assertEquals; /** * Unit tests for CornerTable @@ -13,7 +13,7 @@ public class CornerTableTest { * Unit test for getIndexOfFace */ @Test - public void getIndexOfFace() { + void getIndexOfFace() { CornerTable table = new CornerTable(); for (int i = 0; i < 10; i++) { table.addRow(new CornerTableRow(i, -1)); @@ -28,7 +28,7 @@ public class CornerTableTest { * Unit test for getIndexOfFaceNegativeIndex with negative index */ @Test - public void getIndexOfFaceNegativeIndex() { + void getIndexOfFaceNegativeIndex() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-2, table.getIndexOfFace(-1)); @@ -38,7 +38,7 @@ public class CornerTableTest { * Unit test for getIndexOfFaceNegativeIndex with index out of range */ @Test - public void getIndexOfFaceIndexOutOfRange() { + void getIndexOfFaceIndexOutOfRange() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-2, table.getIndexOfFace(2)); @@ -48,7 +48,7 @@ public class CornerTableTest { * Unit test for getIndexOfOppositeCorner */ @Test - public void getIndexOfOppositeCorner() { + void getIndexOfOppositeCorner() { CornerTable table = new CornerTable(); for (int i = 0; i < 10; i++) { table.addRow(new CornerTableRow(i, i - 1)); @@ -63,7 +63,7 @@ public class CornerTableTest { * Unit test for getIndexOfOppositeCorner without opposite corner */ @Test - public void getIndexOfOppositeCornerNoOppositeCorner() { + void getIndexOfOppositeCornerNoOppositeCorner() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-1, table.getIndexOfOppositeCorner(0)); @@ -73,7 +73,7 @@ public class CornerTableTest { * Unit test for getIndexOfOppositeCorner with negative index of corner */ @Test - public void getIndexOfOppositeCornerNegativeIndex() { + void getIndexOfOppositeCornerNegativeIndex() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-2, table.getIndexOfOppositeCorner(-1)); @@ -83,7 +83,7 @@ public class CornerTableTest { * Unit test for getIndexOfOppositeCorner with index of corner out of range */ @Test - public void getIndexOfOppositeCornerOutOfRange() { + void getIndexOfOppositeCornerOutOfRange() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-2, table.getIndexOfOppositeCorner(2)); @@ -93,7 +93,7 @@ public class CornerTableTest { * Unit test for getIndexOfNextCornerInFace */ @Test - public void getIndexOfNextCornerInFaceFirstTriangle() { + void getIndexOfNextCornerInFaceFirstTriangle() { CornerTable table = new CornerTable(); for (int i = 0; i < 9; i++) { table.addRow(new CornerTableRow(i, -1)); @@ -108,7 +108,7 @@ public class CornerTableTest { * Unit test for getIndexOfNextCornerInFace */ @Test - public void getIndexOfNextCornerInFaceMiddleTriangle() { + void getIndexOfNextCornerInFaceMiddleTriangle() { CornerTable table = new CornerTable(); for (int i = 0; i < 9; i++) { table.addRow(new CornerTableRow(i, -1)); @@ -123,7 +123,7 @@ public class CornerTableTest { * Unit test for getIndexOfNextCornerInFace */ @Test - public void getIndexOfNextCornerInFaceLastTriangle() { + void getIndexOfNextCornerInFaceLastTriangle() { CornerTable table = new CornerTable(); for (int i = 0; i < 9; i++) { table.addRow(new CornerTableRow(i, -1)); @@ -138,7 +138,7 @@ public class CornerTableTest { * Unit test for getIndexOfNextCornerInFace with negative index of corner */ @Test - public void getIndexOfNextCornerInFaceNegativeIndex() { + void getIndexOfNextCornerInFaceNegativeIndex() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-2, table.getIndexOfNextCornerInFace(-1)); @@ -148,7 +148,7 @@ public class CornerTableTest { * Unit test for getIndexOfNextCornerInFace with index of corner out of range */ @Test - public void getIndexOfNextCornerInFaceOutOfRange() { + void getIndexOfNextCornerInFaceOutOfRange() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-2, table.getIndexOfNextCornerInFace(2)); @@ -158,7 +158,7 @@ public class CornerTableTest { * Unit test for getIndexOfPreviousCornerInFace */ @Test - public void getIndexOfPreviousCornerInFaceFirstTriangle() { + void getIndexOfPreviousCornerInFaceFirstTriangle() { CornerTable table = new CornerTable(); for (int i = 0; i < 9; i++) { table.addRow(new CornerTableRow(i, -1)); @@ -173,7 +173,7 @@ public class CornerTableTest { * Unit test for getIndexOfPreviousCornerInFace */ @Test - public void getIndexOfPreviousCornerInFaceMiddleTriangle() { + void getIndexOfPreviousCornerInFaceMiddleTriangle() { CornerTable table = new CornerTable(); for (int i = 0; i < 9; i++) { table.addRow(new CornerTableRow(i, -1)); @@ -188,7 +188,7 @@ public class CornerTableTest { * Unit test for getIndexOfPreviousCornerInFace */ @Test - public void getIndexOfPreviousCornerInFaceLastTriangle() { + void getIndexOfPreviousCornerInFaceLastTriangle() { CornerTable table = new CornerTable(); for (int i = 0; i < 9; i++) { table.addRow(new CornerTableRow(i, -1)); @@ -203,7 +203,7 @@ public class CornerTableTest { * Unit test for getIndexOfPreviousCornerInFace with negative index of corner */ @Test - public void getIndexOfPreviousCornerInFaceNegativeIndex() { + void getIndexOfPreviousCornerInFaceNegativeIndex() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-2, table.getIndexOfPreviousCornerInFace(-1)); @@ -213,7 +213,7 @@ public class CornerTableTest { * Unit test for getIndexOfPreviousCornerInFace with index of corner out of range */ @Test - public void getIndexOfPreviousCornerInFaceOutOfRange() { + void getIndexOfPreviousCornerInFaceOutOfRange() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); assertEquals(-2, table.getIndexOfPreviousCornerInFace(2)); @@ -223,7 +223,7 @@ public class CornerTableTest { * Unit test for getIndexOfTipCornerOnLeft */ @Test - public void getIndexOfTipCornerOnLeft() { + void getIndexOfTipCornerOnLeft() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -239,7 +239,7 @@ public class CornerTableTest { * Unit test for getIndexOfTipCornerOnLeft with no left corner */ @Test - public void getIndexOfTipCornerOnLeftNoLeftCorner() { + void getIndexOfTipCornerOnLeftNoLeftCorner() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -255,7 +255,7 @@ public class CornerTableTest { * Unit test for getIndexOfTipCornerOnLeft with negative index of corner */ @Test - public void getIndexOfTipCornerOnLeftNegativeIndex() { + void getIndexOfTipCornerOnLeftNegativeIndex() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -271,7 +271,7 @@ public class CornerTableTest { * Unit test for getIndexOfTipCornerOnLeft with index of corner out of range */ @Test - public void getIndexOfTipCornerOnLeftOutOfRange() { + void getIndexOfTipCornerOnLeftOutOfRange() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -287,7 +287,7 @@ public class CornerTableTest { * Unit test for getIndexOfTipCornerOnRight */ @Test - public void getIndexOfTipCornerOnRight() { + void getIndexOfTipCornerOnRight() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -303,7 +303,7 @@ public class CornerTableTest { * Unit test for getIndexOfTipCornerOnRight with no right corner */ @Test - public void getIndexOfTipCornerOnLeftNoRightCorner() { + void getIndexOfTipCornerOnLeftNoRightCorner() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -319,7 +319,7 @@ public class CornerTableTest { * Unit test for getIndexOfTipCornerOnRight with negative index of corner */ @Test - public void getIndexOfTipCornerOnRightNegativeIndex() { + void getIndexOfTipCornerOnRightNegativeIndex() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -335,7 +335,7 @@ public class CornerTableTest { * Unit test for getIndexOfTipCornerOnRight with index of corner out of range */ @Test - public void getIndexOfTipCornerOnRightOutOfRange() { + void getIndexOfTipCornerOnRightOutOfRange() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -351,7 +351,7 @@ public class CornerTableTest { * Unit test for getNextAroundCorner */ @Test - public void getNextAroundCorner() { + void getNextAroundCorner() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -367,7 +367,7 @@ public class CornerTableTest { * Unit test for getNextAroundCorner with no corner on around position */ @Test - public void getNextAroundCornerNoAroundCorner() { + void getNextAroundCornerNoAroundCorner() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -383,7 +383,7 @@ public class CornerTableTest { * Unit test for getNextAroundCorner with negative index of corner */ @Test - public void getNextAroundCornerNegativeIndex() { + void getNextAroundCornerNegativeIndex() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -399,7 +399,7 @@ public class CornerTableTest { * Unit test for getNextAroundCorner with index of corner out of range */ @Test - public void getNextAroundCornerOutOfRange() { + void getNextAroundCornerOutOfRange() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -415,7 +415,7 @@ public class CornerTableTest { * Unit test for addRow */ @Test - public void addRow() { + void addRow() { CornerTable table = new CornerTable(); assertEquals(0, table.getSize()); table.addRow(new CornerTableRow(0, -1)); @@ -426,7 +426,7 @@ public class CornerTableTest { * Unit test for replaceRow */ @Test - public void replaceRow() { + void replaceRow() { CornerTable table = new CornerTable(); table.addRow(new CornerTableRow(0, -1)); table.addRow(new CornerTableRow(1, -1)); @@ -446,7 +446,7 @@ public class CornerTableTest { * Unit test for getSize */ @Test - public void getSize() { + void getSize() { CornerTable table = new CornerTable(); assertEquals(0, table.getSize()); @@ -462,7 +462,7 @@ public class CornerTableTest { * Unit test for getRow */ @Test - public void getRow() { + void getRow() { CornerTable table = new CornerTable(); for (int i = 0; i < 9; i++) { table.addRow(new CornerTableRow(i, -1)); @@ -472,4 +472,4 @@ public class CornerTableTest { assertEquals(i, table.getRow(i).getVertexIndex()); } } -} \ No newline at end of file +} 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/MeshModel/src/test/java/cz/fidentis/analyst/mesh/io/MeshObjLoaderTest.java b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/io/MeshObjLoaderTest.java new file mode 100644 index 0000000000000000000000000000000000000000..c6df9b5ad44b3f161bad6ec8b5fb1f61c39b5091 --- /dev/null +++ b/MeshModel/src/test/java/cz/fidentis/analyst/mesh/io/MeshObjLoaderTest.java @@ -0,0 +1,199 @@ +package cz.fidentis.analyst.mesh.io; + +import com.mokiat.data.front.parser.IOBJParser; +import com.mokiat.data.front.parser.OBJDataReference; +import com.mokiat.data.front.parser.OBJFace; +import com.mokiat.data.front.parser.OBJMesh; +import com.mokiat.data.front.parser.OBJModel; +import com.mokiat.data.front.parser.OBJNormal; +import com.mokiat.data.front.parser.OBJObject; +import com.mokiat.data.front.parser.OBJParser; +import com.mokiat.data.front.parser.OBJTexCoord; +import com.mokiat.data.front.parser.OBJVertex; +import cz.fidentis.analyst.mesh.core.MeshFacet; +import cz.fidentis.analyst.mesh.core.MeshModel; +import cz.fidentis.analyst.mesh.core.MeshPoint; +import cz.fidentis.analyst.mesh.core.MeshPointImpl; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.HashSet; +import java.util.Set; +import javax.vecmath.Vector3d; + +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + +/** + * Tests for {@link cz.fidentis.analyst.mesh.io.MeshObjLoader} + * @author Marek Barinka; 456295 + */ +public class MeshObjLoaderTest { + + Path testFileDirectory = Paths.get("src", "test", "resources", "cz", "fidentis", "analyst", "mesh", "io"); + + @Test + void nullFileTest() throws IOException { + Exception ex = assertThrows(NullPointerException.class, () -> MeshObjLoader.read((File) null)); + } + + @Test + void nullStreamTest() throws IOException { + Exception ex = assertThrows(NullPointerException.class, () -> MeshObjLoader.read((InputStream) null)); + } + + @Test() + void emptyFileTest() throws IOException { + File empty = new File(testFileDirectory.toFile(), "Empty.obj"); + Exception ex = assertThrows(IOException.class, () -> MeshObjLoader.read(empty)); + assertTrue(ex.getMessage().contains("File doesn't contain any model")); + } + + @Test + void moreObjectFileTest() { //TODO: Not testing in loader + File moreObjects = new File(testFileDirectory.toFile(), "MoreObjects.obj"); + Exception ex = assertThrows(IOException.class, () -> MeshObjLoader.read(moreObjects)); + } + + @Test + void nonTriangularFaceAloneTest() { + File plane = new File(testFileDirectory.toFile(), "Plane.obj"); + Exception ex = assertThrows(IOException.class, () -> MeshObjLoader.read(plane)); + assertTrue(ex.getMessage().contains("Mesh contains non-triangular face")); + } + + @Test + void nonTriangularFaceInTriangularModelTest() { + File icoSphereQuad = new File(testFileDirectory.toFile(), "IcoSphere-withQuad.obj"); + Exception ex = assertThrows(IOException.class, () -> MeshObjLoader.read(icoSphereQuad)); + assertTrue(ex.getMessage().contains("Mesh contains non-triangular face")); + } + + @Test + void validFileIcoSphereTest() throws IOException { + File icoSphere = new File(testFileDirectory.toFile(), "IcoSphere-Triangles.obj"); + MeshModel m = MeshObjLoader.read(icoSphere); + assertEquals(m.getFacets().get(0).getCornerTable().getSize(), 240); + assertEquals(m.getFacets().get(0).getNumberOfVertices(), 240); + assertEquals(m.getFacets().size(), 1); + + OBJModel model; + final IOBJParser parser = new OBJParser(); + try (InputStream is = new FileInputStream(icoSphere)) { + model = parser.parse(is); + } + + OBJObject object = model.getObjects().get(0); + Set<MeshPoint> points = getPointsInObject(model, object); + + MeshFacet facet = m.getFacets().get(0); + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + MeshPoint p = facet.getVertex(i); + assertTrue(points.contains(p)); + } + } + + @Test + void validStreamTest() throws FileNotFoundException, IOException { + File icoSphere = new File(testFileDirectory.toFile(), "IcoSphere-Triangles.obj"); + MeshModel m; + try(InputStream is = new FileInputStream(icoSphere)) { + m = MeshObjLoader.read(is); + } + assertEquals(m.getFacets().get(0).getCornerTable().getSize(), 240); + assertEquals(m.getFacets().get(0).getNumberOfVertices(), 240); + assertEquals(m.getFacets().size(), 1); + + OBJModel model; + final IOBJParser parser = new OBJParser(); + try (InputStream is = new FileInputStream(icoSphere)) { + model = parser.parse(is); + } + + OBJObject object = model.getObjects().get(0); + Set<MeshPoint> points = getPointsInObject(model, object); + + MeshFacet facet = m.getFacets().get(0); + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + MeshPoint p = facet.getVertex(i); + assertTrue(points.contains(p)); + } + } + + @Test + void validFileTetrahedronTest() throws IOException { + File tetrahedron = new File(testFileDirectory.toFile(), "Tetrahedron.obj"); + MeshModel m = MeshObjLoader.read(tetrahedron); + assertEquals(m.getFacets().get(0).getCornerTable().getSize(), 12); + assertEquals(m.getFacets().get(0).getNumberOfVertices(), 12); + assertEquals(m.getFacets().size(), 1); + + OBJModel model; + final IOBJParser parser = new OBJParser(); + try (InputStream is = new FileInputStream(tetrahedron)) { + model = parser.parse(is); + } + + OBJObject object = model.getObjects().get(0); + Set<MeshPoint> points = getPointsInObject(model, object); + + MeshFacet facet = m.getFacets().get(0); + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + MeshPoint p = facet.getVertex(i); + assertTrue(points.contains(p)); + } + } + + + @Test + void validFileIco20Test() throws IOException { + File ico20 = new File(testFileDirectory.toFile(), "IcoSphere-20.obj"); + MeshModel m = MeshObjLoader.read(ico20); + assertEquals(m.getFacets().get(0).getCornerTable().getSize(), 60); + assertEquals(m.getFacets().get(0).getNumberOfVertices(), 60); + assertEquals(m.getFacets().size(), 1); + + OBJModel model; + final IOBJParser parser = new OBJParser(); + try (InputStream is = new FileInputStream(ico20)) { + model = parser.parse(is); + } + + OBJObject object = model.getObjects().get(0); + Set<MeshPoint> points = getPointsInObject(model, object); + + MeshFacet facet = m.getFacets().get(0); + for (int i = 0; i < facet.getNumberOfVertices(); i++) { + MeshPoint p = facet.getVertex(i); + assertTrue(points.contains(p)); + } + } + + private Set<MeshPoint> getPointsInObject(OBJModel model, OBJObject object) { + Set<MeshPoint> points = new HashSet(); + for (OBJMesh mesh : object.getMeshes()) { + for (OBJFace face : mesh.getFaces()) { + for (OBJDataReference reference : face.getReferences()) { + final OBJVertex vertex = model.getVertex(reference); + Vector3d coords = new Vector3d(vertex.x, vertex.y, vertex.z); + Vector3d norm = null; + Vector3d texCoords = null; + if (reference.hasNormalIndex()) { + final OBJNormal normal = model.getNormal(reference); + norm = new Vector3d(normal.x, normal.y, normal.z); + } + if (reference.hasTexCoordIndex()) { + final OBJTexCoord texCoord = model.getTexCoord(reference); + texCoords = new Vector3d(texCoord.u, texCoord.v, texCoord.w); + } + points.add(new MeshPointImpl(coords, norm, texCoords)); + } + } + } + return points; + } +} diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/BeveledCube.mtl b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/BeveledCube.mtl new file mode 100644 index 0000000000000000000000000000000000000000..f231bdf4c1534431b9322220b4d534db03594d80 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/BeveledCube.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/BeveledCube.obj b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/BeveledCube.obj new file mode 100644 index 0000000000000000000000000000000000000000..dde80c5480a2bd30a9fd0b0a46be43d39b59f9d6 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/BeveledCube.obj @@ -0,0 +1,514 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib BeveledCube.mtl +o Cube_Cube.001 +v -1.000000 -1.000000 1.000000 +v -1.000000 1.000000 1.000000 +v -1.000000 -1.000000 -1.000000 +v -1.000000 1.000000 -1.000000 +v 1.000000 -1.000000 1.000000 +v 1.000000 1.000000 1.000000 +v -1.000000 -1.000000 -1.000000 +v 1.000000 -1.000000 1.000000 +v -0.960236 -1.000000 -0.999605 +v -0.920487 -1.000000 -0.998419 +v -0.880770 -1.000000 -0.996443 +v -0.841100 -1.000000 -0.993678 +v -0.801492 -1.000000 -0.990124 +v -0.761964 -1.000000 -0.985784 +v -0.722529 -1.000000 -0.980659 +v -0.683204 -1.000000 -0.974751 +v -0.644004 -1.000000 -0.968062 +v -0.604945 -1.000000 -0.960595 +v -0.566042 -1.000000 -0.952353 +v -0.527311 -1.000000 -0.943339 +v -0.488767 -1.000000 -0.933556 +v -0.450424 -1.000000 -0.923010 +v -0.412299 -1.000000 -0.911703 +v -0.374407 -1.000000 -0.899640 +v -0.336761 -1.000000 -0.886827 +v -0.299378 -1.000000 -0.873267 +v -0.262272 -1.000000 -0.858967 +v -0.225458 -1.000000 -0.843932 +v -0.188949 -1.000000 -0.828168 +v -0.152762 -1.000000 -0.811681 +v -0.116909 -1.000000 -0.794478 +v -0.081405 -1.000000 -0.776565 +v -0.046265 -1.000000 -0.757950 +v -0.011502 -1.000000 -0.738641 +v 0.022871 -1.000000 -0.718643 +v 0.056839 -1.000000 -0.697967 +v 0.090389 -1.000000 -0.676619 +v 0.123509 -1.000000 -0.654608 +v 0.156184 -1.000000 -0.631943 +v 0.188402 -1.000000 -0.608633 +v 0.220150 -1.000000 -0.584687 +v 0.251416 -1.000000 -0.560115 +v 0.282187 -1.000000 -0.534925 +v 0.312451 -1.000000 -0.509129 +v 0.342197 -1.000000 -0.482736 +v 0.371412 -1.000000 -0.455758 +v 0.400084 -1.000000 -0.428203 +v 0.428203 -1.000000 -0.400084 +v 0.455758 -1.000000 -0.371412 +v 0.482736 -1.000000 -0.342197 +v 0.509129 -1.000000 -0.312451 +v 0.534925 -1.000000 -0.282187 +v 0.560115 -1.000000 -0.251416 +v 0.584687 -1.000000 -0.220150 +v 0.608633 -1.000000 -0.188402 +v 0.631943 -1.000000 -0.156184 +v 0.654608 -1.000000 -0.123509 +v 0.676619 -1.000000 -0.090389 +v 0.697967 -1.000000 -0.056839 +v 0.718643 -1.000000 -0.022871 +v 0.738641 -1.000000 0.011502 +v 0.757950 -1.000000 0.046265 +v 0.776565 -1.000000 0.081405 +v 0.794478 -1.000000 0.116909 +v 0.811681 -1.000000 0.152762 +v 0.828168 -1.000000 0.188949 +v 0.843932 -1.000000 0.225458 +v 0.858967 -1.000000 0.262272 +v 0.873267 -1.000000 0.299378 +v 0.886827 -1.000000 0.336761 +v 0.899640 -1.000000 0.374407 +v 0.911703 -1.000000 0.412299 +v 0.923010 -1.000000 0.450424 +v 0.933556 -1.000000 0.488767 +v 0.943339 -1.000000 0.527311 +v 0.952353 -1.000000 0.566042 +v 0.960595 -1.000000 0.604945 +v 0.968062 -1.000000 0.644004 +v 0.974751 -1.000000 0.683204 +v 0.980659 -1.000000 0.722529 +v 0.985784 -1.000000 0.761964 +v 0.990124 -1.000000 0.801492 +v 0.993678 -1.000000 0.841100 +v 0.996443 -1.000000 0.880770 +v 0.998419 -1.000000 0.920487 +v 0.999605 -1.000000 0.960236 +v 1.000000 1.000000 1.000000 +v -1.000000 1.000000 -1.000000 +v 0.999605 1.000000 0.960236 +v 0.998419 1.000000 0.920487 +v 0.996443 1.000000 0.880770 +v 0.993678 1.000000 0.841100 +v 0.990124 1.000000 0.801492 +v 0.985784 1.000000 0.761964 +v 0.980659 1.000000 0.722529 +v 0.974751 1.000000 0.683204 +v 0.968062 1.000000 0.644004 +v 0.960595 1.000000 0.604945 +v 0.952353 1.000000 0.566042 +v 0.943339 1.000000 0.527311 +v 0.933556 1.000000 0.488767 +v 0.923010 1.000000 0.450424 +v 0.911703 1.000000 0.412299 +v 0.899640 1.000000 0.374407 +v 0.886827 1.000000 0.336761 +v 0.873267 1.000000 0.299378 +v 0.858967 1.000000 0.262272 +v 0.843932 1.000000 0.225458 +v 0.828168 1.000000 0.188949 +v 0.811681 1.000000 0.152762 +v 0.794478 1.000000 0.116909 +v 0.776565 1.000000 0.081405 +v 0.757950 1.000000 0.046265 +v 0.738641 1.000000 0.011502 +v 0.718643 1.000000 -0.022871 +v 0.697967 1.000000 -0.056839 +v 0.676619 1.000000 -0.090389 +v 0.654608 1.000000 -0.123509 +v 0.631943 1.000000 -0.156184 +v 0.608633 1.000000 -0.188402 +v 0.584687 1.000000 -0.220150 +v 0.560115 1.000000 -0.251416 +v 0.534925 1.000000 -0.282187 +v 0.509129 1.000000 -0.312451 +v 0.482736 1.000000 -0.342197 +v 0.455758 1.000000 -0.371412 +v 0.428203 1.000000 -0.400084 +v 0.400084 1.000000 -0.428203 +v 0.371412 1.000000 -0.455758 +v 0.342197 1.000000 -0.482736 +v 0.312451 1.000000 -0.509129 +v 0.282187 1.000000 -0.534925 +v 0.251416 1.000000 -0.560115 +v 0.220150 1.000000 -0.584687 +v 0.188402 1.000000 -0.608633 +v 0.156184 1.000000 -0.631943 +v 0.123509 1.000000 -0.654608 +v 0.090389 1.000000 -0.676619 +v 0.056839 1.000000 -0.697967 +v 0.022871 1.000000 -0.718643 +v -0.011502 1.000000 -0.738641 +v -0.046265 1.000000 -0.757950 +v -0.081405 1.000000 -0.776565 +v -0.116909 1.000000 -0.794478 +v -0.152762 1.000000 -0.811681 +v -0.188949 1.000000 -0.828168 +v -0.225458 1.000000 -0.843932 +v -0.262272 1.000000 -0.858967 +v -0.299378 1.000000 -0.873267 +v -0.336761 1.000000 -0.886827 +v -0.374407 1.000000 -0.899640 +v -0.412299 1.000000 -0.911703 +v -0.450424 1.000000 -0.923010 +v -0.488767 1.000000 -0.933556 +v -0.527311 1.000000 -0.943339 +v -0.566042 1.000000 -0.952353 +v -0.604945 1.000000 -0.960595 +v -0.644004 1.000000 -0.968062 +v -0.683204 1.000000 -0.974751 +v -0.722529 1.000000 -0.980659 +v -0.761964 1.000000 -0.985784 +v -0.801492 1.000000 -0.990124 +v -0.841100 1.000000 -0.993678 +v -0.880770 1.000000 -0.996443 +v -0.920487 1.000000 -0.998419 +v -0.960236 1.000000 -0.999605 +vt 0.375000 0.000000 +vt 0.625000 0.000000 +vt 0.625000 0.250000 +vt 0.375000 0.250000 +vt 0.375000 0.750000 +vt 0.625000 0.750000 +vt 0.625000 0.750000 +vt 0.375000 0.750000 +vt 0.625016 0.745029 +vt 0.625066 0.740061 +vt 0.625148 0.735096 +vt 0.625263 0.730138 +vt 0.625412 0.725187 +vt 0.625592 0.720245 +vt 0.625806 0.715316 +vt 0.626052 0.710401 +vt 0.626331 0.705500 +vt 0.626642 0.700618 +vt 0.626985 0.695755 +vt 0.627361 0.690914 +vt 0.627769 0.686096 +vt 0.628208 0.681303 +vt 0.628679 0.676537 +vt 0.629182 0.671801 +vt 0.629716 0.667095 +vt 0.630281 0.662422 +vt 0.630876 0.657784 +vt 0.631503 0.653182 +vt 0.632160 0.648619 +vt 0.632847 0.644095 +vt 0.633563 0.639614 +vt 0.634310 0.635176 +vt 0.635085 0.630783 +vt 0.635890 0.626438 +vt 0.636723 0.622141 +vt 0.637585 0.617895 +vt 0.638474 0.613701 +vt 0.639391 0.609561 +vt 0.640336 0.605477 +vt 0.641307 0.601450 +vt 0.642305 0.597481 +vt 0.643329 0.593573 +vt 0.644378 0.589727 +vt 0.645453 0.585944 +vt 0.646553 0.582225 +vt 0.647677 0.578574 +vt 0.648825 0.574989 +vt 0.649997 0.473832 +vt 0.651191 0.470294 +vt 0.652408 0.466736 +vt 0.653648 0.463157 +vt 0.654909 0.459560 +vt 0.656191 0.455947 +vt 0.657494 0.452317 +vt 0.658817 0.448674 +vt 0.660159 0.445018 +vt 0.661520 0.441350 +vt 0.662900 0.437673 +vt 0.664298 0.433988 +vt 0.665714 0.430296 +vt 0.667146 0.426598 +vt 0.668594 0.422897 +vt 0.670059 0.419193 +vt 0.671538 0.415488 +vt 0.673032 0.411783 +vt 0.674540 0.408081 +vt 0.676061 0.404381 +vt 0.677595 0.400687 +vt 0.679141 0.396999 +vt 0.680698 0.393319 +vt 0.682267 0.389648 +vt 0.683846 0.385987 +vt 0.685434 0.382339 +vt 0.687032 0.378705 +vt 0.688638 0.375085 +vt 0.690252 0.371482 +vt 0.691873 0.367896 +vt 0.693500 0.364330 +vt 0.695133 0.360785 +vt 0.696772 0.357262 +vt 0.698415 0.353762 +vt 0.700062 0.350287 +vt 0.701712 0.346838 +vt 0.703365 0.343417 +vt 0.705020 0.340025 +vt 0.706676 0.336663 +vt 0.875000 0.500000 +vt 0.875000 0.500000 +vt 0.875000 0.750000 +vt 0.625000 1.000000 +vt 0.375000 1.000000 +vt 0.625000 0.250000 +vt 0.375000 0.250000 +vt 0.374984 0.745029 +vt 0.374934 0.740061 +vt 0.374852 0.735096 +vt 0.374737 0.730138 +vt 0.374588 0.725187 +vt 0.374408 0.720245 +vt 0.374194 0.715316 +vt 0.373948 0.710401 +vt 0.373669 0.705500 +vt 0.373358 0.700618 +vt 0.373015 0.695755 +vt 0.372639 0.690914 +vt 0.372232 0.686096 +vt 0.371792 0.681303 +vt 0.371321 0.676537 +vt 0.370818 0.671801 +vt 0.370284 0.667095 +vt 0.369719 0.662422 +vt 0.369124 0.657784 +vt 0.368497 0.653182 +vt 0.367840 0.648619 +vt 0.367153 0.644095 +vt 0.366437 0.639614 +vt 0.365690 0.635176 +vt 0.364915 0.630783 +vt 0.364110 0.626438 +vt 0.363277 0.622141 +vt 0.362415 0.617895 +vt 0.361526 0.613701 +vt 0.360609 0.609561 +vt 0.359664 0.605477 +vt 0.358693 0.601450 +vt 0.357695 0.597481 +vt 0.356671 0.593573 +vt 0.355622 0.589727 +vt 0.354547 0.585944 +vt 0.353447 0.582225 +vt 0.352323 0.578574 +vt 0.351175 0.574989 +vt 0.350004 0.473832 +vt 0.348809 0.470294 +vt 0.347592 0.466736 +vt 0.346352 0.463157 +vt 0.345091 0.459560 +vt 0.343809 0.455947 +vt 0.342506 0.452317 +vt 0.341183 0.448674 +vt 0.339841 0.445018 +vt 0.338480 0.441350 +vt 0.337100 0.437673 +vt 0.335702 0.433988 +vt 0.334286 0.430296 +vt 0.332854 0.426598 +vt 0.331406 0.422897 +vt 0.329941 0.419193 +vt 0.328462 0.415488 +vt 0.326968 0.411783 +vt 0.325460 0.408081 +vt 0.323939 0.404381 +vt 0.322405 0.400687 +vt 0.320859 0.396999 +vt 0.319302 0.393319 +vt 0.317733 0.389648 +vt 0.316154 0.385987 +vt 0.314566 0.382339 +vt 0.312968 0.378705 +vt 0.311362 0.375085 +vt 0.309748 0.371482 +vt 0.308127 0.367896 +vt 0.306500 0.364330 +vt 0.304866 0.360785 +vt 0.303228 0.357262 +vt 0.301585 0.353762 +vt 0.299938 0.350287 +vt 0.298288 0.346838 +vt 0.296635 0.343417 +vt 0.294980 0.340025 +vt 0.293324 0.336663 +vt 0.125000 0.500000 +vt 0.125000 0.500000 +vt 0.125000 0.750000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 1.0000 -0.0000 +vn 1.0000 0.0000 -0.0099 +vn 0.9996 0.0000 -0.0298 +vn 0.9988 0.0000 -0.0497 +vn 0.9976 0.0000 -0.0695 +vn 0.9960 0.0000 -0.0894 +vn 0.9940 0.0000 -0.1091 +vn 0.9917 0.0000 -0.1289 +vn 0.9889 0.0000 -0.1486 +vn 0.9858 0.0000 -0.1682 +vn 0.9822 0.0000 -0.1878 +vn 0.9783 0.0000 -0.2073 +vn 0.9740 0.0000 -0.2267 +vn 0.9693 0.0000 -0.2460 +vn 0.9642 0.0000 -0.2652 +vn 0.9587 0.0000 -0.2843 +vn 0.9529 0.0000 -0.3033 +vn 0.9467 0.0000 -0.3222 +vn 0.9401 0.0000 -0.3410 +vn 0.9331 0.0000 -0.3596 +vn 0.9258 0.0000 -0.3781 +vn 0.9181 0.0000 -0.3964 +vn 0.9100 0.0000 -0.4146 +vn 0.9016 0.0000 -0.4326 +vn 0.8928 0.0000 -0.4504 +vn 0.8837 0.0000 -0.4681 +vn 0.8742 0.0000 -0.4856 +vn 0.8644 0.0000 -0.5029 +vn 0.8542 0.0000 -0.5200 +vn 0.8437 0.0000 -0.5368 +vn 0.8328 0.0000 -0.5535 +vn 0.8217 0.0000 -0.5699 +vn 0.8102 0.0000 -0.5862 +vn 0.7984 0.0000 -0.6022 +vn 0.7862 0.0000 -0.6179 +vn 0.7738 0.0000 -0.6334 +vn 0.7611 0.0000 -0.6487 +vn 0.7480 0.0000 -0.6637 +vn 0.7347 0.0000 -0.6784 +vn 0.7210 0.0000 -0.6929 +vn 0.7071 0.0000 -0.7071 +vn 0.6929 0.0000 -0.7210 +vn 0.6784 0.0000 -0.7347 +vn 0.6637 0.0000 -0.7480 +vn 0.6487 0.0000 -0.7611 +vn 0.6334 0.0000 -0.7738 +vn 0.6179 0.0000 -0.7862 +vn 0.6022 0.0000 -0.7984 +vn 0.5862 0.0000 -0.8102 +vn 0.5699 0.0000 -0.8217 +vn 0.5535 0.0000 -0.8328 +vn 0.5368 0.0000 -0.8437 +vn 0.5200 0.0000 -0.8542 +vn 0.5029 0.0000 -0.8644 +vn 0.4856 0.0000 -0.8742 +vn 0.4681 0.0000 -0.8837 +vn 0.4504 0.0000 -0.8928 +vn 0.4326 0.0000 -0.9016 +vn 0.4146 0.0000 -0.9100 +vn 0.3964 0.0000 -0.9181 +vn 0.3781 0.0000 -0.9258 +vn 0.3596 0.0000 -0.9331 +vn 0.3410 0.0000 -0.9401 +vn 0.3222 0.0000 -0.9467 +vn 0.3033 0.0000 -0.9529 +vn 0.2843 0.0000 -0.9587 +vn 0.2652 0.0000 -0.9642 +vn 0.2460 0.0000 -0.9693 +vn 0.2267 0.0000 -0.9740 +vn 0.2073 0.0000 -0.9783 +vn 0.1878 0.0000 -0.9822 +vn 0.1682 0.0000 -0.9858 +vn 0.1486 0.0000 -0.9889 +vn 0.1289 0.0000 -0.9917 +vn 0.1091 0.0000 -0.9940 +vn 0.0894 0.0000 -0.9960 +vn 0.0695 0.0000 -0.9976 +vn 0.0497 0.0000 -0.9988 +vn 0.0298 0.0000 -0.9996 +vn 0.0099 0.0000 -1.0000 +vn 0.0000 -1.0000 0.0000 +usemtl None +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 8/5/2 87/6/2 6/7/2 5/8/2 +f 87/6/3 89/9/3 90/10/3 91/11/3 92/12/3 93/13/3 94/14/3 95/15/3 96/16/3 97/17/3 98/18/3 99/19/3 100/20/3 101/21/3 102/22/3 103/23/3 104/24/3 105/25/3 106/26/3 107/27/3 108/28/3 109/29/3 110/30/3 111/31/3 112/32/3 113/33/3 114/34/3 115/35/3 116/36/3 117/37/3 118/38/3 119/39/3 120/40/3 121/41/3 122/42/3 123/43/3 124/44/3 125/45/3 126/46/3 127/47/3 128/48/3 129/49/3 130/50/3 131/51/3 132/52/3 133/53/3 134/54/3 135/55/3 136/56/3 137/57/3 138/58/3 139/59/3 140/60/3 141/61/3 142/62/3 143/63/3 144/64/3 145/65/3 146/66/3 147/67/3 148/68/3 149/69/3 150/70/3 151/71/3 152/72/3 153/73/3 154/74/3 155/75/3 156/76/3 157/77/3 158/78/3 159/79/3 160/80/3 161/81/3 162/82/3 163/83/3 164/84/3 165/85/3 166/86/3 88/87/3 4/88/3 2/89/3 6/7/3 +f 5/8/2 6/7/2 2/90/2 1/91/2 +f 3/4/2 4/3/2 88/92/2 7/93/2 +f 87/6/4 8/5/4 86/94/4 89/9/4 +f 89/9/5 86/94/5 85/95/5 90/10/5 +f 90/10/6 85/95/6 84/96/6 91/11/6 +f 91/11/7 84/96/7 83/97/7 92/12/7 +f 92/12/8 83/97/8 82/98/8 93/13/8 +f 93/13/9 82/98/9 81/99/9 94/14/9 +f 94/14/10 81/99/10 80/100/10 95/15/10 +f 95/15/11 80/100/11 79/101/11 96/16/11 +f 96/16/12 79/101/12 78/102/12 97/17/12 +f 97/17/13 78/102/13 77/103/13 98/18/13 +f 98/18/14 77/103/14 76/104/14 99/19/14 +f 99/19/15 76/104/15 75/105/15 100/20/15 +f 100/20/16 75/105/16 74/106/16 101/21/16 +f 101/21/17 74/106/17 73/107/17 102/22/17 +f 102/22/18 73/107/18 72/108/18 103/23/18 +f 103/23/19 72/108/19 71/109/19 104/24/19 +f 104/24/20 71/109/20 70/110/20 105/25/20 +f 105/25/21 70/110/21 69/111/21 106/26/21 +f 106/26/22 69/111/22 68/112/22 107/27/22 +f 107/27/23 68/112/23 67/113/23 108/28/23 +f 108/28/24 67/113/24 66/114/24 109/29/24 +f 109/29/25 66/114/25 65/115/25 110/30/25 +f 110/30/26 65/115/26 64/116/26 111/31/26 +f 111/31/27 64/116/27 63/117/27 112/32/27 +f 112/32/28 63/117/28 62/118/28 113/33/28 +f 113/33/29 62/118/29 61/119/29 114/34/29 +f 114/34/30 61/119/30 60/120/30 115/35/30 +f 115/35/31 60/120/31 59/121/31 116/36/31 +f 116/36/32 59/121/32 58/122/32 117/37/32 +f 117/37/33 58/122/33 57/123/33 118/38/33 +f 118/38/34 57/123/34 56/124/34 119/39/34 +f 119/39/35 56/124/35 55/125/35 120/40/35 +f 120/40/36 55/125/36 54/126/36 121/41/36 +f 121/41/37 54/126/37 53/127/37 122/42/37 +f 122/42/38 53/127/38 52/128/38 123/43/38 +f 123/43/39 52/128/39 51/129/39 124/44/39 +f 124/44/40 51/129/40 50/130/40 125/45/40 +f 125/45/41 50/130/41 49/131/41 126/46/41 +f 126/46/42 49/131/42 48/132/42 127/47/42 +f 127/47/43 48/132/43 47/133/43 128/48/43 +f 128/48/44 47/133/44 46/134/44 129/49/44 +f 129/49/45 46/134/45 45/135/45 130/50/45 +f 130/50/46 45/135/46 44/136/46 131/51/46 +f 131/51/47 44/136/47 43/137/47 132/52/47 +f 132/52/48 43/137/48 42/138/48 133/53/48 +f 133/53/49 42/138/49 41/139/49 134/54/49 +f 134/54/50 41/139/50 40/140/50 135/55/50 +f 135/55/51 40/140/51 39/141/51 136/56/51 +f 136/56/52 39/141/52 38/142/52 137/57/52 +f 137/57/53 38/142/53 37/143/53 138/58/53 +f 138/58/54 37/143/54 36/144/54 139/59/54 +f 139/59/55 36/144/55 35/145/55 140/60/55 +f 140/60/56 35/145/56 34/146/56 141/61/56 +f 141/61/57 34/146/57 33/147/57 142/62/57 +f 142/62/58 33/147/58 32/148/58 143/63/58 +f 143/63/59 32/148/59 31/149/59 144/64/59 +f 144/64/60 31/149/60 30/150/60 145/65/60 +f 145/65/61 30/150/61 29/151/61 146/66/61 +f 146/66/62 29/151/62 28/152/62 147/67/62 +f 147/67/63 28/152/63 27/153/63 148/68/63 +f 148/68/64 27/153/64 26/154/64 149/69/64 +f 149/69/65 26/154/65 25/155/65 150/70/65 +f 150/70/66 25/155/66 24/156/66 151/71/66 +f 151/71/67 24/156/67 23/157/67 152/72/67 +f 152/72/68 23/157/68 22/158/68 153/73/68 +f 153/73/69 22/158/69 21/159/69 154/74/69 +f 154/74/70 21/159/70 20/160/70 155/75/70 +f 155/75/71 20/160/71 19/161/71 156/76/71 +f 156/76/72 19/161/72 18/162/72 157/77/72 +f 157/77/73 18/162/73 17/163/73 158/78/73 +f 158/78/74 17/163/74 16/164/74 159/79/74 +f 159/79/75 16/164/75 15/165/75 160/80/75 +f 160/80/76 15/165/76 14/166/76 161/81/76 +f 161/81/77 14/166/77 13/167/77 162/82/77 +f 162/82/78 13/167/78 12/168/78 163/83/78 +f 163/83/79 12/168/79 11/169/79 164/84/79 +f 164/84/80 11/169/80 10/170/80 165/85/80 +f 165/85/81 10/170/81 9/171/81 166/86/81 +f 166/86/82 9/171/82 7/93/82 88/92/82 +f 3/172/83 7/173/83 9/171/83 10/170/83 11/169/83 12/168/83 13/167/83 14/166/83 15/165/83 16/164/83 17/163/83 18/162/83 19/161/83 20/160/83 21/159/83 22/158/83 23/157/83 24/156/83 25/155/83 26/154/83 27/153/83 28/152/83 29/151/83 30/150/83 31/149/83 32/148/83 33/147/83 34/146/83 35/145/83 36/144/83 37/143/83 38/142/83 39/141/83 40/140/83 41/139/83 42/138/83 43/137/83 44/136/83 45/135/83 46/134/83 47/133/83 48/132/83 49/131/83 50/130/83 51/129/83 52/128/83 53/127/83 54/126/83 55/125/83 56/124/83 57/123/83 58/122/83 59/121/83 60/120/83 61/119/83 62/118/83 63/117/83 64/116/83 65/115/83 66/114/83 67/113/83 68/112/83 69/111/83 70/110/83 71/109/83 72/108/83 73/107/83 74/106/83 75/105/83 76/104/83 77/103/83 78/102/83 79/101/83 80/100/83 81/99/83 82/98/83 83/97/83 84/96/83 85/95/83 86/94/83 8/5/83 5/8/83 1/174/83 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Empty.mtl b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Empty.mtl new file mode 100644 index 0000000000000000000000000000000000000000..5b165d4a3bd487f97e4296303e7f92549f229720 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Empty.mtl @@ -0,0 +1,2 @@ +# Blender MTL File: 'None' +# Material Count: 0 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Empty.obj b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Empty.obj new file mode 100644 index 0000000000000000000000000000000000000000..8e3f9227fb6028498273d34e14367bc1efc7168b --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Empty.obj @@ -0,0 +1,3 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib Empty.mtl diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-20.mtl b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-20.mtl new file mode 100644 index 0000000000000000000000000000000000000000..f231bdf4c1534431b9322220b4d534db03594d80 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-20.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-20.obj b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-20.obj new file mode 100644 index 0000000000000000000000000000000000000000..12bd1f52c9619f8814f1dce5c918c9f13cf234bc --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-20.obj @@ -0,0 +1,80 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib IcoSphere-20.mtl +o Icosphere +v 0.000000 -1.000000 0.000000 +v 0.723600 -0.447215 0.525720 +v -0.276385 -0.447215 0.850640 +v -0.894425 -0.447215 0.000000 +v -0.276385 -0.447215 -0.850640 +v 0.723600 -0.447215 -0.525720 +v 0.276385 0.447215 0.850640 +v -0.723600 0.447215 0.525720 +v -0.723600 0.447215 -0.525720 +v 0.276385 0.447215 -0.850640 +v 0.894425 0.447215 0.000000 +v 0.000000 1.000000 0.000000 +vt 0.818181 0.000000 +vt 0.727272 0.157461 +vt 0.909090 0.157461 +vt 0.636363 0.000000 +vt 0.545454 0.157461 +vt 0.090909 0.000000 +vt 0.000000 0.157461 +vt 0.181818 0.157461 +vt 0.272727 0.000000 +vt 0.363636 0.157461 +vt 0.454545 0.000000 +vt 0.636363 0.314921 +vt 0.818181 0.314921 +vt 0.090909 0.314921 +vt 0.272727 0.314921 +vt 0.454545 0.314921 +vt 1.000000 0.314921 +vt 0.727272 0.472382 +vt 0.909090 0.472382 +vt 0.181818 0.472382 +vt 0.363636 0.472382 +vt 0.545454 0.472382 +vn 0.1876 -0.7947 0.5774 +vn 0.6071 -0.7947 0.0000 +vn -0.4911 -0.7947 0.3568 +vn -0.4911 -0.7947 -0.3568 +vn 0.1876 -0.7947 -0.5774 +vn 0.9822 -0.1876 0.0000 +vn 0.3035 -0.1876 0.9342 +vn -0.7946 -0.1876 0.5774 +vn -0.7946 -0.1876 -0.5774 +vn 0.3035 -0.1876 -0.9342 +vn 0.7946 0.1876 0.5774 +vn -0.3035 0.1876 0.9342 +vn -0.9822 0.1876 0.0000 +vn -0.3035 0.1876 -0.9342 +vn 0.7946 0.1876 -0.5774 +vn 0.4911 0.7947 0.3568 +vn -0.1876 0.7947 0.5774 +vn -0.6071 0.7947 0.0000 +vn -0.1876 0.7947 -0.5774 +vn 0.4911 0.7947 -0.3568 +usemtl None +s off +f 1/1/1 2/2/1 3/3/1 +f 2/2/2 1/4/2 6/5/2 +f 1/6/3 3/7/3 4/8/3 +f 1/9/4 4/8/4 5/10/4 +f 1/11/5 5/10/5 6/5/5 +f 2/2/6 6/5/6 11/12/6 +f 3/3/7 2/2/7 7/13/7 +f 4/8/8 3/7/8 8/14/8 +f 5/10/9 4/8/9 9/15/9 +f 6/5/10 5/10/10 10/16/10 +f 2/2/11 11/12/11 7/13/11 +f 3/3/12 7/13/12 8/17/12 +f 4/8/13 8/14/13 9/15/13 +f 5/10/14 9/15/14 10/16/14 +f 6/5/15 10/16/15 11/12/15 +f 7/13/16 11/12/16 12/18/16 +f 8/17/17 7/13/17 12/19/17 +f 9/15/18 8/14/18 12/20/18 +f 10/16/19 9/15/19 12/21/19 +f 11/12/20 10/16/20 12/22/20 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-Triangles.mtl b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-Triangles.mtl new file mode 100644 index 0000000000000000000000000000000000000000..f231bdf4c1534431b9322220b4d534db03594d80 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-Triangles.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-Triangles.obj b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-Triangles.obj new file mode 100644 index 0000000000000000000000000000000000000000..263afb47eff4ea951e683498b81f3ac0b5073ca8 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-Triangles.obj @@ -0,0 +1,271 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib IcoSphere-Triangles.mtl +o Icosphere +v 0.000000 -1.000000 0.000000 +v 0.723607 -0.447220 0.525725 +v -0.276388 -0.447220 0.850649 +v -0.894426 -0.447216 0.000000 +v -0.276388 -0.447220 -0.850649 +v 0.723607 -0.447220 -0.525725 +v 0.276388 0.447220 0.850649 +v -0.723607 0.447220 0.525725 +v -0.723607 0.447220 -0.525725 +v 0.276388 0.447220 -0.850649 +v 0.894426 0.447216 0.000000 +v 0.000000 1.000000 0.000000 +v -0.162456 -0.850654 0.499995 +v 0.425323 -0.850654 0.309011 +v 0.262869 -0.525738 0.809012 +v 0.850648 -0.525736 0.000000 +v 0.425323 -0.850654 -0.309011 +v -0.525730 -0.850652 0.000000 +v -0.688189 -0.525736 0.499997 +v -0.162456 -0.850654 -0.499995 +v -0.688189 -0.525736 -0.499997 +v 0.262869 -0.525738 -0.809012 +v 0.951058 0.000000 0.309013 +v 0.951058 0.000000 -0.309013 +v 0.000000 0.000000 1.000000 +v 0.587786 0.000000 0.809017 +v -0.951058 0.000000 0.309013 +v -0.587786 0.000000 0.809017 +v -0.587786 0.000000 -0.809017 +v -0.951058 0.000000 -0.309013 +v 0.587786 0.000000 -0.809017 +v 0.000000 0.000000 -1.000000 +v 0.688189 0.525736 0.499997 +v -0.262869 0.525738 0.809012 +v -0.850648 0.525736 0.000000 +v -0.262869 0.525738 -0.809012 +v 0.688189 0.525736 -0.499997 +v 0.162456 0.850654 0.499995 +v 0.525730 0.850652 0.000000 +v -0.425323 0.850654 0.309011 +v -0.425323 0.850654 -0.309011 +v 0.162456 0.850654 -0.499995 +vt 0.818181 0.000000 +vt 0.772726 0.078731 +vt 0.863635 0.078731 +vt 0.727272 0.157461 +vt 0.681818 0.078731 +vt 0.636363 0.157461 +vt 0.090909 0.000000 +vt 0.045454 0.078731 +vt 0.136363 0.078731 +vt 0.272727 0.000000 +vt 0.227273 0.078731 +vt 0.318182 0.078731 +vt 0.454545 0.000000 +vt 0.409090 0.078731 +vt 0.500000 0.078731 +vt 0.681818 0.236191 +vt 0.909090 0.157461 +vt 0.818181 0.157461 +vt 0.863635 0.236191 +vt 0.181818 0.157461 +vt 0.090909 0.157461 +vt 0.136363 0.236191 +vt 0.363636 0.157461 +vt 0.272727 0.157461 +vt 0.318182 0.236191 +vt 0.545454 0.157461 +vt 0.454545 0.157461 +vt 0.500000 0.236191 +vt 0.772726 0.236191 +vt 0.954545 0.236191 +vt 0.227273 0.236191 +vt 0.409090 0.236191 +vt 0.590909 0.236191 +vt 0.818181 0.314921 +vt 0.727272 0.314921 +vt 0.772726 0.393651 +vt 1.000000 0.314921 +vt 0.909091 0.314921 +vt 0.954545 0.393651 +vt 0.272727 0.314921 +vt 0.181818 0.314921 +vt 0.227273 0.393651 +vt 0.454545 0.314921 +vt 0.363636 0.314921 +vt 0.409090 0.393651 +vt 0.636363 0.314921 +vt 0.545454 0.314921 +vt 0.590909 0.393651 +vt 0.500000 0.393651 +vt 0.545454 0.472382 +vt 0.318182 0.393651 +vt 0.363636 0.472382 +vt 0.136363 0.393651 +vt 0.181818 0.472382 +vt 0.090909 0.314921 +vt 0.863635 0.393651 +vt 0.909090 0.472382 +vt 0.681818 0.393651 +vt 0.727272 0.472382 +vt 0.045454 0.236191 +vt 0.000000 0.157461 +vt 0.590909 0.078731 +vt 0.636363 0.000000 +vn 0.1024 -0.9435 0.3151 +vn 0.7002 -0.6617 0.2680 +vn -0.2680 -0.9435 0.1947 +vn -0.2680 -0.9435 -0.1947 +vn 0.1024 -0.9435 -0.3151 +vn 0.9050 -0.3304 0.2680 +vn 0.0247 -0.3304 0.9435 +vn -0.8897 -0.3304 0.3151 +vn -0.5746 -0.3304 -0.7488 +vn 0.5346 -0.3304 -0.7779 +vn 0.8026 -0.1256 0.5831 +vn -0.3066 -0.1256 0.9435 +vn -0.9921 -0.1256 0.0000 +vn -0.3066 -0.1256 -0.9435 +vn 0.8026 -0.1256 -0.5831 +vn 0.4089 0.6617 0.6284 +vn -0.4713 0.6617 0.5831 +vn -0.7002 0.6617 -0.2680 +vn 0.0385 0.6617 -0.7488 +vn 0.7240 0.6617 -0.1947 +vn 0.2680 0.9435 -0.1947 +vn 0.4911 0.7947 -0.3568 +vn 0.4089 0.6617 -0.6284 +vn -0.1024 0.9435 -0.3151 +vn -0.1876 0.7947 -0.5773 +vn -0.4713 0.6617 -0.5831 +vn -0.3313 0.9435 0.0000 +vn -0.6071 0.7947 0.0000 +vn -0.7002 0.6617 0.2680 +vn -0.1024 0.9435 0.3151 +vn -0.1876 0.7947 0.5773 +vn 0.0385 0.6617 0.7488 +vn 0.2680 0.9435 0.1947 +vn 0.4911 0.7947 0.3568 +vn 0.7240 0.6617 0.1947 +vn 0.8897 0.3304 -0.3151 +vn 0.7947 0.1876 -0.5773 +vn 0.5746 0.3304 -0.7488 +vn -0.0247 0.3304 -0.9435 +vn -0.3035 0.1876 -0.9342 +vn -0.5346 0.3304 -0.7779 +vn -0.9050 0.3304 -0.2680 +vn -0.9822 0.1876 0.0000 +vn -0.9050 0.3304 0.2680 +vn -0.5346 0.3304 0.7779 +vn -0.3035 0.1876 0.9342 +vn -0.0247 0.3304 0.9435 +vn 0.5746 0.3304 0.7488 +vn 0.7947 0.1876 0.5773 +vn 0.8897 0.3304 0.3151 +vn 0.3066 0.1256 -0.9435 +vn 0.3035 -0.1876 -0.9342 +vn 0.0247 -0.3304 -0.9435 +vn -0.8026 0.1256 -0.5831 +vn -0.7947 -0.1876 -0.5773 +vn -0.8897 -0.3304 -0.3151 +vn -0.8026 0.1256 0.5831 +vn -0.7947 -0.1876 0.5773 +vn -0.5746 -0.3304 0.7488 +vn 0.3066 0.1256 0.9435 +vn 0.3035 -0.1876 0.9342 +vn 0.5346 -0.3304 0.7779 +vn 0.9921 0.1256 0.0000 +vn 0.9822 -0.1876 0.0000 +vn 0.9050 -0.3304 -0.2680 +vn 0.4713 -0.6617 -0.5831 +vn 0.1876 -0.7947 -0.5773 +vn -0.0385 -0.6617 -0.7488 +vn -0.4089 -0.6617 -0.6284 +vn -0.4911 -0.7947 -0.3568 +vn -0.7240 -0.6617 -0.1947 +vn -0.7240 -0.6617 0.1947 +vn -0.4911 -0.7947 0.3568 +vn -0.4089 -0.6617 0.6284 +vn 0.7002 -0.6617 -0.2680 +vn 0.6071 -0.7947 0.0000 +vn 0.3313 -0.9435 0.0000 +vn -0.0385 -0.6617 0.7488 +vn 0.1876 -0.7947 0.5773 +vn 0.4713 -0.6617 0.5831 +usemtl None +s off +f 1/1/1 14/2/1 13/3/1 +f 2/4/2 14/5/2 16/6/2 +f 1/7/3 13/8/3 18/9/3 +f 1/10/4 18/11/4 20/12/4 +f 1/13/5 20/14/5 17/15/5 +f 2/4/6 16/6/6 23/16/6 +f 3/17/7 15/18/7 25/19/7 +f 4/20/8 19/21/8 27/22/8 +f 5/23/9 21/24/9 29/25/9 +f 6/26/10 22/27/10 31/28/10 +f 2/4/11 23/16/11 26/29/11 +f 3/17/12 25/19/12 28/30/12 +f 4/20/13 27/22/13 30/31/13 +f 5/23/14 29/25/14 32/32/14 +f 6/26/15 31/28/15 24/33/15 +f 7/34/16 33/35/16 38/36/16 +f 8/37/17 34/38/17 40/39/17 +f 9/40/18 35/41/18 41/42/18 +f 10/43/19 36/44/19 42/45/19 +f 11/46/20 37/47/20 39/48/20 +f 39/48/21 42/49/21 12/50/21 +f 39/48/22 37/47/22 42/49/22 +f 37/47/23 10/43/23 42/49/23 +f 42/45/24 41/51/24 12/52/24 +f 42/45/25 36/44/25 41/51/25 +f 36/44/26 9/40/26 41/51/26 +f 41/42/27 40/53/27 12/54/27 +f 41/42/28 35/41/28 40/53/28 +f 35/41/29 8/55/29 40/53/29 +f 40/39/30 38/56/30 12/57/30 +f 40/39/31 34/38/31 38/56/31 +f 34/38/32 7/34/32 38/56/32 +f 38/36/33 39/58/33 12/59/33 +f 38/36/34 33/35/34 39/58/34 +f 33/35/35 11/46/35 39/58/35 +f 24/33/36 37/47/36 11/46/36 +f 24/33/37 31/28/37 37/47/37 +f 31/28/38 10/43/38 37/47/38 +f 32/32/39 36/44/39 10/43/39 +f 32/32/40 29/25/40 36/44/40 +f 29/25/41 9/40/41 36/44/41 +f 30/31/42 35/41/42 9/40/42 +f 30/31/43 27/22/43 35/41/43 +f 27/22/44 8/55/44 35/41/44 +f 28/30/45 34/38/45 8/37/45 +f 28/30/46 25/19/46 34/38/46 +f 25/19/47 7/34/47 34/38/47 +f 26/29/48 33/35/48 7/34/48 +f 26/29/49 23/16/49 33/35/49 +f 23/16/50 11/46/50 33/35/50 +f 31/28/51 32/32/51 10/43/51 +f 31/28/52 22/27/52 32/32/52 +f 22/27/53 5/23/53 32/32/53 +f 29/25/54 30/31/54 9/40/54 +f 29/25/55 21/24/55 30/31/55 +f 21/24/56 4/20/56 30/31/56 +f 27/22/57 28/60/57 8/55/57 +f 27/22/58 19/21/58 28/60/58 +f 19/21/59 3/61/59 28/60/59 +f 25/19/60 26/29/60 7/34/60 +f 25/19/61 15/18/61 26/29/61 +f 15/18/62 2/4/62 26/29/62 +f 23/16/63 24/33/63 11/46/63 +f 23/16/64 16/6/64 24/33/64 +f 16/6/65 6/26/65 24/33/65 +f 17/15/66 22/27/66 6/26/66 +f 17/15/67 20/14/67 22/27/67 +f 20/14/68 5/23/68 22/27/68 +f 20/12/69 21/24/69 5/23/69 +f 20/12/70 18/11/70 21/24/70 +f 18/11/71 4/20/71 21/24/71 +f 18/9/72 19/21/72 4/20/72 +f 18/9/73 13/8/73 19/21/73 +f 13/8/74 3/61/74 19/21/74 +f 16/6/75 17/62/75 6/26/75 +f 16/6/76 14/5/76 17/62/76 +f 14/5/77 1/63/77 17/62/77 +f 13/3/78 15/18/78 3/17/78 +f 13/3/79 14/2/79 15/18/79 +f 14/2/80 2/4/80 15/18/80 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-withQuad.mtl b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-withQuad.mtl new file mode 100644 index 0000000000000000000000000000000000000000..f231bdf4c1534431b9322220b4d534db03594d80 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-withQuad.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-withQuad.obj b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-withQuad.obj new file mode 100644 index 0000000000000000000000000000000000000000..2cb50f7dad6bf6f5c79cbebfffabc9e73bad6dbc --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/IcoSphere-withQuad.obj @@ -0,0 +1,269 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib IcoSphere-withQuad.mtl +o Icosphere +v 0.000000 -1.000000 0.000000 +v 0.723607 -0.447220 0.525725 +v -0.276388 -0.447220 0.850649 +v -0.894426 -0.447216 0.000000 +v -0.276388 -0.447220 -0.850649 +v 0.723607 -0.447220 -0.525725 +v 0.276388 0.447220 0.850649 +v -0.723607 0.447220 0.525725 +v -0.723607 0.447220 -0.525725 +v 0.276388 0.447220 -0.850649 +v 0.894426 0.447216 0.000000 +v 0.000000 1.000000 0.000000 +v -0.162456 -0.850654 0.499995 +v 0.425323 -0.850654 0.309011 +v 0.262869 -0.525738 0.809012 +v 0.850648 -0.525736 0.000000 +v 0.425323 -0.850654 -0.309011 +v -0.525730 -0.850652 0.000000 +v -0.688189 -0.525736 0.499997 +v -0.162456 -0.850654 -0.499995 +v -0.688189 -0.525736 -0.499997 +v 0.262869 -0.525738 -0.809012 +v 0.951058 0.000000 0.309013 +v 0.951058 0.000000 -0.309013 +v 0.000000 0.000000 1.000000 +v 0.587786 0.000000 0.809017 +v -0.951058 0.000000 0.309013 +v -0.587786 0.000000 0.809017 +v -0.587786 0.000000 -0.809017 +v -0.951058 0.000000 -0.309013 +v 0.587786 0.000000 -0.809017 +v 0.000000 0.000000 -1.000000 +v 0.688189 0.525736 0.499997 +v -0.262869 0.525738 0.809012 +v -0.850648 0.525736 0.000000 +v -0.262869 0.525738 -0.809012 +v 0.688189 0.525736 -0.499997 +v 0.162456 0.850654 0.499995 +v 0.525730 0.850652 0.000000 +v -0.425323 0.850654 0.309011 +v -0.425323 0.850654 -0.309011 +v 0.162456 0.850654 -0.499995 +vt 0.818181 0.000000 +vt 0.772726 0.078731 +vt 0.863635 0.078731 +vt 0.727272 0.157461 +vt 0.681818 0.078731 +vt 0.636363 0.157461 +vt 0.090909 0.000000 +vt 0.045454 0.078731 +vt 0.136363 0.078731 +vt 0.272727 0.000000 +vt 0.227273 0.078731 +vt 0.318182 0.078731 +vt 0.454545 0.000000 +vt 0.409090 0.078731 +vt 0.500000 0.078731 +vt 0.681818 0.236191 +vt 0.909090 0.157461 +vt 0.818181 0.157461 +vt 0.863635 0.236191 +vt 0.181818 0.157461 +vt 0.090909 0.157461 +vt 0.136363 0.236191 +vt 0.363636 0.157461 +vt 0.272727 0.157461 +vt 0.318182 0.236191 +vt 0.545454 0.157461 +vt 0.454545 0.157461 +vt 0.500000 0.236191 +vt 0.772726 0.236191 +vt 0.954545 0.236191 +vt 0.227273 0.236191 +vt 0.409090 0.236191 +vt 0.590909 0.236191 +vt 0.818181 0.314921 +vt 0.727272 0.314921 +vt 0.772726 0.393651 +vt 1.000000 0.314921 +vt 0.909091 0.314921 +vt 0.954545 0.393651 +vt 0.272727 0.314921 +vt 0.181818 0.314921 +vt 0.227273 0.393651 +vt 0.454545 0.314921 +vt 0.363636 0.314921 +vt 0.409090 0.393651 +vt 0.636363 0.314921 +vt 0.545454 0.314921 +vt 0.590909 0.393651 +vt 0.500000 0.393651 +vt 0.545454 0.472382 +vt 0.318182 0.393651 +vt 0.363636 0.472382 +vt 0.136363 0.393651 +vt 0.181818 0.472382 +vt 0.090909 0.314921 +vt 0.863635 0.393651 +vt 0.909090 0.472382 +vt 0.681818 0.393651 +vt 0.727272 0.472382 +vt 0.045454 0.236191 +vt 0.000000 0.157461 +vt 0.590909 0.078731 +vt 0.636363 0.000000 +vn 0.1024 -0.9435 0.3151 +vn 0.7002 -0.6617 0.2680 +vn -0.2680 -0.9435 0.1947 +vn -0.2680 -0.9435 -0.1947 +vn 0.1024 -0.9435 -0.3151 +vn 0.9050 -0.3304 0.2680 +vn 0.0247 -0.3304 0.9435 +vn -0.8897 -0.3304 0.3151 +vn -0.5746 -0.3304 -0.7488 +vn 0.5346 -0.3304 -0.7779 +vn 0.8026 -0.1256 0.5831 +vn -0.3066 -0.1256 0.9435 +vn -0.9921 -0.1256 0.0000 +vn -0.3066 -0.1256 -0.9435 +vn 0.8026 -0.1256 -0.5831 +vn 0.4089 0.6617 0.6284 +vn -0.4713 0.6617 0.5831 +vn -0.7002 0.6617 -0.2680 +vn 0.0385 0.6617 -0.7488 +vn 0.7240 0.6617 -0.1947 +vn 0.2680 0.9435 -0.1947 +vn 0.4911 0.7947 -0.3568 +vn 0.4089 0.6617 -0.6284 +vn -0.1024 0.9435 -0.3151 +vn -0.1876 0.7947 -0.5773 +vn -0.4713 0.6617 -0.5831 +vn -0.3313 0.9435 0.0000 +vn -0.6071 0.7947 0.0000 +vn -0.7002 0.6617 0.2680 +vn -0.1024 0.9435 0.3151 +vn -0.1876 0.7947 0.5773 +vn 0.0385 0.6617 0.7488 +vn 0.2680 0.9435 0.1947 +vn 0.8897 0.3304 -0.3151 +vn 0.7947 0.1876 -0.5773 +vn 0.5746 0.3304 -0.7488 +vn -0.0247 0.3304 -0.9435 +vn -0.3035 0.1876 -0.9342 +vn -0.5346 0.3304 -0.7779 +vn -0.9050 0.3304 -0.2680 +vn -0.9822 0.1876 0.0000 +vn -0.9050 0.3304 0.2680 +vn -0.5346 0.3304 0.7779 +vn -0.3035 0.1876 0.9342 +vn -0.0247 0.3304 0.9435 +vn 0.5746 0.3304 0.7488 +vn 0.7947 0.1876 0.5773 +vn 0.8897 0.3304 0.3151 +vn 0.3066 0.1256 -0.9435 +vn 0.3035 -0.1876 -0.9342 +vn 0.0247 -0.3304 -0.9435 +vn -0.8026 0.1256 -0.5831 +vn -0.7947 -0.1876 -0.5773 +vn -0.8897 -0.3304 -0.3151 +vn -0.8026 0.1256 0.5831 +vn -0.7947 -0.1876 0.5773 +vn -0.5746 -0.3304 0.7488 +vn 0.3066 0.1256 0.9435 +vn 0.3035 -0.1876 0.9342 +vn 0.5346 -0.3304 0.7779 +vn 0.9921 0.1256 0.0000 +vn 0.9822 -0.1876 0.0000 +vn 0.9050 -0.3304 -0.2680 +vn 0.4713 -0.6617 -0.5831 +vn 0.1876 -0.7947 -0.5773 +vn -0.0385 -0.6617 -0.7488 +vn -0.4089 -0.6617 -0.6284 +vn -0.4911 -0.7947 -0.3568 +vn -0.7240 -0.6617 -0.1947 +vn -0.7240 -0.6617 0.1947 +vn -0.4911 -0.7947 0.3568 +vn -0.4089 -0.6617 0.6284 +vn 0.7002 -0.6617 -0.2680 +vn 0.6071 -0.7947 0.0000 +vn 0.3313 -0.9435 0.0000 +vn -0.0385 -0.6617 0.7488 +vn 0.1876 -0.7947 0.5773 +vn 0.4713 -0.6617 0.5831 +vn 0.6050 0.7430 0.2862 +usemtl None +s off +f 1/1/1 14/2/1 13/3/1 +f 2/4/2 14/5/2 16/6/2 +f 1/7/3 13/8/3 18/9/3 +f 1/10/4 18/11/4 20/12/4 +f 1/13/5 20/14/5 17/15/5 +f 2/4/6 16/6/6 23/16/6 +f 3/17/7 15/18/7 25/19/7 +f 4/20/8 19/21/8 27/22/8 +f 5/23/9 21/24/9 29/25/9 +f 6/26/10 22/27/10 31/28/10 +f 2/4/11 23/16/11 26/29/11 +f 3/17/12 25/19/12 28/30/12 +f 4/20/13 27/22/13 30/31/13 +f 5/23/14 29/25/14 32/32/14 +f 6/26/15 31/28/15 24/33/15 +f 7/34/16 33/35/16 38/36/16 +f 8/37/17 34/38/17 40/39/17 +f 9/40/18 35/41/18 41/42/18 +f 10/43/19 36/44/19 42/45/19 +f 11/46/20 37/47/20 39/48/20 +f 39/48/21 42/49/21 12/50/21 +f 39/48/22 37/47/22 42/49/22 +f 37/47/23 10/43/23 42/49/23 +f 42/45/24 41/51/24 12/52/24 +f 42/45/25 36/44/25 41/51/25 +f 36/44/26 9/40/26 41/51/26 +f 41/42/27 40/53/27 12/54/27 +f 41/42/28 35/41/28 40/53/28 +f 35/41/29 8/55/29 40/53/29 +f 40/39/30 38/56/30 12/57/30 +f 40/39/31 34/38/31 38/56/31 +f 34/38/32 7/34/32 38/56/32 +f 38/36/33 39/58/33 12/59/33 +f 24/33/34 37/47/34 11/46/34 +f 24/33/35 31/28/35 37/47/35 +f 31/28/36 10/43/36 37/47/36 +f 32/32/37 36/44/37 10/43/37 +f 32/32/38 29/25/38 36/44/38 +f 29/25/39 9/40/39 36/44/39 +f 30/31/40 35/41/40 9/40/40 +f 30/31/41 27/22/41 35/41/41 +f 27/22/42 8/55/42 35/41/42 +f 28/30/43 34/38/43 8/37/43 +f 28/30/44 25/19/44 34/38/44 +f 25/19/45 7/34/45 34/38/45 +f 26/29/46 33/35/46 7/34/46 +f 26/29/47 23/16/47 33/35/47 +f 23/16/48 11/46/48 33/35/48 +f 31/28/49 32/32/49 10/43/49 +f 31/28/50 22/27/50 32/32/50 +f 22/27/51 5/23/51 32/32/51 +f 29/25/52 30/31/52 9/40/52 +f 29/25/53 21/24/53 30/31/53 +f 21/24/54 4/20/54 30/31/54 +f 27/22/55 28/60/55 8/55/55 +f 27/22/56 19/21/56 28/60/56 +f 19/21/57 3/61/57 28/60/57 +f 25/19/58 26/29/58 7/34/58 +f 25/19/59 15/18/59 26/29/59 +f 15/18/60 2/4/60 26/29/60 +f 23/16/61 24/33/61 11/46/61 +f 23/16/62 16/6/62 24/33/62 +f 16/6/63 6/26/63 24/33/63 +f 17/15/64 22/27/64 6/26/64 +f 17/15/65 20/14/65 22/27/65 +f 20/14/66 5/23/66 22/27/66 +f 20/12/67 21/24/67 5/23/67 +f 20/12/68 18/11/68 21/24/68 +f 18/11/69 4/20/69 21/24/69 +f 18/9/70 19/21/70 4/20/70 +f 18/9/71 13/8/71 19/21/71 +f 13/8/72 3/61/72 19/21/72 +f 16/6/73 17/62/73 6/26/73 +f 16/6/74 14/5/74 17/62/74 +f 14/5/75 1/63/75 17/62/75 +f 13/3/76 15/18/76 3/17/76 +f 13/3/77 14/2/77 15/18/77 +f 14/2/78 2/4/78 15/18/78 +f 33/35/79 11/46/79 39/58/79 38/36/79 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/MoreObjects.mtl b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/MoreObjects.mtl new file mode 100644 index 0000000000000000000000000000000000000000..f231bdf4c1534431b9322220b4d534db03594d80 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/MoreObjects.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/MoreObjects.obj b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/MoreObjects.obj new file mode 100644 index 0000000000000000000000000000000000000000..e593ad481a458a78f873a18f30ca6f119da507ed --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/MoreObjects.obj @@ -0,0 +1,318 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib MoreObjects.mtl +o Cube_Cube.002 +v -2.551072 -0.949820 4.449853 +v -2.551072 1.050180 4.449853 +v -2.551072 -0.949820 2.449853 +v -2.551072 1.050180 2.449853 +v -0.551072 -0.949820 4.449853 +v -0.551072 1.050180 4.449853 +v -0.551072 -0.949820 2.449853 +v -0.551072 1.050180 2.449853 +vt 0.375000 0.000000 +vt 0.625000 0.000000 +vt 0.625000 0.250000 +vt 0.375000 0.250000 +vt 0.625000 0.500000 +vt 0.375000 0.500000 +vt 0.625000 0.750000 +vt 0.375000 0.750000 +vt 0.625000 1.000000 +vt 0.375000 1.000000 +vt 0.125000 0.500000 +vt 0.125000 0.750000 +vt 0.875000 0.500000 +vt 0.875000 0.750000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 1.0000 0.0000 +usemtl None +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 3/4/2 4/3/2 8/5/2 7/6/2 +f 7/6/3 8/5/3 6/7/3 5/8/3 +f 5/8/4 6/7/4 2/9/4 1/10/4 +f 3/11/5 7/6/5 5/8/5 1/12/5 +f 8/5/6 4/13/6 2/14/6 6/7/6 +o Cylinder +v 0.944014 -0.250547 -4.061050 +v 0.944014 1.749453 -4.061050 +v 1.139104 -0.250547 -4.041836 +v 1.139104 1.749453 -4.041836 +v 1.326697 -0.250547 -3.984930 +v 1.326697 1.749453 -3.984930 +v 1.499584 -0.250547 -3.892520 +v 1.499584 1.749453 -3.892520 +v 1.651121 -0.250547 -3.768157 +v 1.651121 1.749453 -3.768157 +v 1.775484 -0.250547 -3.616621 +v 1.775484 1.749453 -3.616621 +v 1.867893 -0.250547 -3.443734 +v 1.867893 1.749453 -3.443734 +v 1.924799 -0.250547 -3.256141 +v 1.924799 1.749453 -3.256141 +v 1.944014 -0.250547 -3.061051 +v 1.944014 1.749453 -3.061051 +v 1.924799 -0.250547 -2.865960 +v 1.924799 1.749453 -2.865960 +v 1.867893 -0.250547 -2.678367 +v 1.867893 1.749453 -2.678367 +v 1.775484 -0.250547 -2.505481 +v 1.775484 1.749453 -2.505481 +v 1.651121 -0.250547 -2.353944 +v 1.651121 1.749453 -2.353944 +v 1.499584 -0.250547 -2.229581 +v 1.499584 1.749453 -2.229581 +v 1.326697 -0.250547 -2.137171 +v 1.326697 1.749453 -2.137171 +v 1.139104 -0.250547 -2.080265 +v 1.139104 1.749453 -2.080265 +v 0.944014 -0.250547 -2.061051 +v 0.944014 1.749453 -2.061051 +v 0.748923 -0.250547 -2.080266 +v 0.748923 1.749453 -2.080266 +v 0.561330 -0.250547 -2.137171 +v 0.561330 1.749453 -2.137171 +v 0.388443 -0.250547 -2.229581 +v 0.388443 1.749453 -2.229581 +v 0.236907 -0.250547 -2.353944 +v 0.236907 1.749453 -2.353944 +v 0.112544 -0.250547 -2.505481 +v 0.112544 1.749453 -2.505481 +v 0.020134 -0.250547 -2.678368 +v 0.020134 1.749453 -2.678368 +v -0.036771 -0.250547 -2.865961 +v -0.036771 1.749453 -2.865961 +v -0.055986 -0.250547 -3.061052 +v -0.055986 1.749453 -3.061052 +v -0.036771 -0.250547 -3.256142 +v -0.036771 1.749453 -3.256142 +v 0.020135 -0.250547 -3.443735 +v 0.020135 1.749453 -3.443735 +v 0.112545 -0.250547 -3.616622 +v 0.112545 1.749453 -3.616622 +v 0.236908 -0.250547 -3.768158 +v 0.236908 1.749453 -3.768158 +v 0.388445 -0.250547 -3.892521 +v 0.388445 1.749453 -3.892521 +v 0.561332 -0.250547 -3.984931 +v 0.561332 1.749453 -3.984931 +v 0.748925 -0.250547 -4.041836 +v 0.748925 1.749453 -4.041836 +vt 1.000000 0.500000 +vt 1.000000 1.000000 +vt 0.968750 1.000000 +vt 0.968750 0.500000 +vt 0.937500 1.000000 +vt 0.937500 0.500000 +vt 0.906250 1.000000 +vt 0.906250 0.500000 +vt 0.875000 1.000000 +vt 0.875000 0.500000 +vt 0.843750 1.000000 +vt 0.843750 0.500000 +vt 0.812500 1.000000 +vt 0.812500 0.500000 +vt 0.781250 1.000000 +vt 0.781250 0.500000 +vt 0.750000 1.000000 +vt 0.750000 0.500000 +vt 0.718750 1.000000 +vt 0.718750 0.500000 +vt 0.687500 1.000000 +vt 0.687500 0.500000 +vt 0.656250 1.000000 +vt 0.656250 0.500000 +vt 0.625000 1.000000 +vt 0.625000 0.500000 +vt 0.593750 1.000000 +vt 0.593750 0.500000 +vt 0.562500 1.000000 +vt 0.562500 0.500000 +vt 0.531250 1.000000 +vt 0.531250 0.500000 +vt 0.500000 1.000000 +vt 0.500000 0.500000 +vt 0.468750 1.000000 +vt 0.468750 0.500000 +vt 0.437500 1.000000 +vt 0.437500 0.500000 +vt 0.406250 1.000000 +vt 0.406250 0.500000 +vt 0.375000 1.000000 +vt 0.375000 0.500000 +vt 0.343750 1.000000 +vt 0.343750 0.500000 +vt 0.312500 1.000000 +vt 0.312500 0.500000 +vt 0.281250 1.000000 +vt 0.281250 0.500000 +vt 0.250000 1.000000 +vt 0.250000 0.500000 +vt 0.218750 1.000000 +vt 0.218750 0.500000 +vt 0.187500 1.000000 +vt 0.187500 0.500000 +vt 0.156250 1.000000 +vt 0.156250 0.500000 +vt 0.125000 1.000000 +vt 0.125000 0.500000 +vt 0.093750 1.000000 +vt 0.093750 0.500000 +vt 0.062500 1.000000 +vt 0.062500 0.500000 +vt 0.296822 0.485388 +vt 0.250000 0.490000 +vt 0.203179 0.485389 +vt 0.158156 0.471731 +vt 0.116663 0.449553 +vt 0.080295 0.419706 +vt 0.050447 0.383337 +vt 0.028269 0.341844 +vt 0.014612 0.296822 +vt 0.010000 0.250000 +vt 0.014611 0.203179 +vt 0.028269 0.158156 +vt 0.050447 0.116663 +vt 0.080294 0.080294 +vt 0.116663 0.050447 +vt 0.158156 0.028269 +vt 0.203178 0.014612 +vt 0.250000 0.010000 +vt 0.296822 0.014612 +vt 0.341844 0.028269 +vt 0.383337 0.050447 +vt 0.419706 0.080294 +vt 0.449553 0.116663 +vt 0.471731 0.158156 +vt 0.485388 0.203178 +vt 0.490000 0.250000 +vt 0.485388 0.296822 +vt 0.471731 0.341844 +vt 0.449553 0.383337 +vt 0.419706 0.419706 +vt 0.383337 0.449553 +vt 0.341844 0.471731 +vt 0.031250 1.000000 +vt 0.031250 0.500000 +vt 0.000000 1.000000 +vt 0.000000 0.500000 +vt 0.750000 0.490000 +vt 0.796822 0.485388 +vt 0.841844 0.471731 +vt 0.883337 0.449553 +vt 0.919706 0.419706 +vt 0.949553 0.383337 +vt 0.971731 0.341844 +vt 0.985388 0.296822 +vt 0.990000 0.250000 +vt 0.985388 0.203178 +vt 0.971731 0.158156 +vt 0.949553 0.116663 +vt 0.919706 0.080294 +vt 0.883337 0.050447 +vt 0.841844 0.028269 +vt 0.796822 0.014612 +vt 0.750000 0.010000 +vt 0.703178 0.014612 +vt 0.658156 0.028269 +vt 0.616663 0.050447 +vt 0.580294 0.080294 +vt 0.550447 0.116663 +vt 0.528269 0.158156 +vt 0.514611 0.203179 +vt 0.510000 0.250000 +vt 0.514612 0.296822 +vt 0.528269 0.341844 +vt 0.550447 0.383337 +vt 0.580295 0.419706 +vt 0.616663 0.449553 +vt 0.658156 0.471731 +vt 0.703179 0.485389 +vn 0.0980 0.0000 -0.9952 +vn 0.2903 0.0000 -0.9569 +vn 0.4714 0.0000 -0.8819 +vn 0.6344 0.0000 -0.7730 +vn 0.7730 0.0000 -0.6344 +vn 0.8819 0.0000 -0.4714 +vn 0.9569 0.0000 -0.2903 +vn 0.9952 0.0000 -0.0980 +vn 0.9952 0.0000 0.0980 +vn 0.9569 0.0000 0.2903 +vn 0.8819 0.0000 0.4714 +vn 0.7730 0.0000 0.6344 +vn 0.6344 0.0000 0.7730 +vn 0.4714 0.0000 0.8819 +vn 0.2903 0.0000 0.9569 +vn 0.0980 0.0000 0.9952 +vn -0.0980 0.0000 0.9952 +vn -0.2903 0.0000 0.9569 +vn -0.4714 0.0000 0.8819 +vn -0.6344 0.0000 0.7730 +vn -0.7730 0.0000 0.6344 +vn -0.8819 0.0000 0.4714 +vn -0.9569 0.0000 0.2903 +vn -0.9952 0.0000 0.0980 +vn -0.9952 0.0000 -0.0980 +vn -0.9569 0.0000 -0.2903 +vn -0.8819 0.0000 -0.4714 +vn -0.7730 0.0000 -0.6344 +vn -0.6344 0.0000 -0.7730 +vn -0.4714 0.0000 -0.8819 +vn 0.0000 1.0000 0.0000 +vn -0.2903 0.0000 -0.9569 +vn -0.0980 0.0000 -0.9952 +vn 0.0000 -1.0000 -0.0000 +usemtl None +s off +f 9/15/7 10/16/7 12/17/7 11/18/7 +f 11/18/8 12/17/8 14/19/8 13/20/8 +f 13/20/9 14/19/9 16/21/9 15/22/9 +f 15/22/10 16/21/10 18/23/10 17/24/10 +f 17/24/11 18/23/11 20/25/11 19/26/11 +f 19/26/12 20/25/12 22/27/12 21/28/12 +f 21/28/13 22/27/13 24/29/13 23/30/13 +f 23/30/14 24/29/14 26/31/14 25/32/14 +f 25/32/15 26/31/15 28/33/15 27/34/15 +f 27/34/16 28/33/16 30/35/16 29/36/16 +f 29/36/17 30/35/17 32/37/17 31/38/17 +f 31/38/18 32/37/18 34/39/18 33/40/18 +f 33/40/19 34/39/19 36/41/19 35/42/19 +f 35/42/20 36/41/20 38/43/20 37/44/20 +f 37/44/21 38/43/21 40/45/21 39/46/21 +f 39/46/22 40/45/22 42/47/22 41/48/22 +f 41/48/23 42/47/23 44/49/23 43/50/23 +f 43/50/24 44/49/24 46/51/24 45/52/24 +f 45/52/25 46/51/25 48/53/25 47/54/25 +f 47/54/26 48/53/26 50/55/26 49/56/26 +f 49/56/27 50/55/27 52/57/27 51/58/27 +f 51/58/28 52/57/28 54/59/28 53/60/28 +f 53/60/29 54/59/29 56/61/29 55/62/29 +f 55/62/30 56/61/30 58/63/30 57/64/30 +f 57/64/31 58/63/31 60/65/31 59/66/31 +f 59/66/32 60/65/32 62/67/32 61/68/32 +f 61/68/33 62/67/33 64/69/33 63/70/33 +f 63/70/34 64/69/34 66/71/34 65/72/34 +f 65/72/35 66/71/35 68/73/35 67/74/35 +f 67/74/36 68/73/36 70/75/36 69/76/36 +f 12/77/37 10/78/37 72/79/37 70/80/37 68/81/37 66/82/37 64/83/37 62/84/37 60/85/37 58/86/37 56/87/37 54/88/37 52/89/37 50/90/37 48/91/37 46/92/37 44/93/37 42/94/37 40/95/37 38/96/37 36/97/37 34/98/37 32/99/37 30/100/37 28/101/37 26/102/37 24/103/37 22/104/37 20/105/37 18/106/37 16/107/37 14/108/37 +f 69/76/38 70/75/38 72/109/38 71/110/38 +f 71/110/39 72/109/39 10/111/39 9/112/39 +f 9/113/40 11/114/40 13/115/40 15/116/40 17/117/40 19/118/40 21/119/40 23/120/40 25/121/40 27/122/40 29/123/40 31/124/40 33/125/40 35/126/40 37/127/40 39/128/40 41/129/40 43/130/40 45/131/40 47/132/40 49/133/40 51/134/40 53/135/40 55/136/40 57/137/40 59/138/40 61/139/40 63/140/40 65/141/40 67/142/40 69/143/40 71/144/40 +o Plane_Plane.001 +v -1.000000 0.000000 1.000000 +v 1.000000 0.000000 1.000000 +v -1.000000 0.000000 -1.000000 +v 1.000000 0.000000 -1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vn 0.0000 1.0000 0.0000 +usemtl None +s off +f 73/145/41 74/146/41 76/147/41 75/148/41 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Plane.mtl b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Plane.mtl new file mode 100644 index 0000000000000000000000000000000000000000..f231bdf4c1534431b9322220b4d534db03594d80 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Plane.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Plane.obj b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Plane.obj new file mode 100644 index 0000000000000000000000000000000000000000..ecdd5875968c419607baaf67d715d9bb16ddf32e --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Plane.obj @@ -0,0 +1,16 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib Plane.mtl +o Plane +v -1.000000 0.000000 1.000000 +v 1.000000 0.000000 1.000000 +v -1.000000 0.000000 -1.000000 +v 1.000000 0.000000 -1.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vn 0.0000 1.0000 0.0000 +usemtl None +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Tetrahedron.mtl b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Tetrahedron.mtl new file mode 100644 index 0000000000000000000000000000000000000000..f231bdf4c1534431b9322220b4d534db03594d80 --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Tetrahedron.mtl @@ -0,0 +1,10 @@ +# Blender MTL File: 'None' +# Material Count: 1 + +newmtl None +Ns 500 +Ka 0.8 0.8 0.8 +Kd 0.8 0.8 0.8 +Ks 0.8 0.8 0.8 +d 1 +illum 2 diff --git a/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Tetrahedron.obj b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Tetrahedron.obj new file mode 100644 index 0000000000000000000000000000000000000000..f7543deb0a66663fe9af08d46c607d407984392b --- /dev/null +++ b/MeshModel/src/test/resources/cz/fidentis/analyst/mesh/io/Tetrahedron.obj @@ -0,0 +1,26 @@ +# Blender v2.82 (sub 7) OBJ File: '' +# www.blender.org +mtllib Tetrahedron.mtl +o Cube_Cube.001 +v -1.000000 -1.000000 1.000000 +v -1.000000 -1.000000 -1.000000 +v -1.000000 1.000000 -1.000000 +v 1.000000 -1.000000 -1.000000 +vt 0.375000 0.000000 +vt 0.625000 0.250000 +vt 0.375000 0.250000 +vt 0.375000 0.500000 +vt 0.875000 0.500000 +vt 0.375000 1.000000 +vt 0.125000 0.500000 +vt 0.125000 0.750000 +vn -1.0000 0.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.5774 0.5774 0.5774 +vn 0.0000 -1.0000 0.0000 +usemtl None +s off +f 1/1/1 3/2/1 2/3/1 +f 2/3/2 3/2/2 4/4/2 +f 3/5/3 1/6/3 4/4/3 +f 2/7/4 4/4/4 1/8/4 diff --git a/README.md b/README.md index 13178b4bfba112b72d76d5e4857a21ac504e8dfe..c4011cab0c12ac4022b457e26c7ea3f51371fc84 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ Software for processing and analysis of human faces. Re-implementation of [FIDENTIS Analyst](https://github.com/Fidentis/Analyst). -This project is being developed at Masaryk University, Brno as collaborative project between Human Computer Interaction Laboratory at Faculty of Informatics and Department of Anthropology at Faculty of Science. +This project is being developed at Masaryk University, Brno, as collaborative project between the Human Computer Interaction Laboratory at Faculty of Informatics and the Department of Anthropology at Faculty of Science. ## Requirements -* Java SE 8+ +* Java SE 13+ * [Maven](https://www.mkyong.com/maven/how-to-install-maven-in-windows/) for compilation * IDE for development, e.g. NetBeans or IntelliJ IDEA @@ -17,5 +17,13 @@ This project is being developed at Masaryk University, Brno as collaborative pro * **MeshModel:** The core model for triangle meshes. * **Renderer:** Rendering code. * **GUI:** GUI of the application. +* **Comparison:** Application logic for the comparison of human faces. + +## Installation and running + +* To build the application from scratch, run `mvn clean install`. +* To run the application + * go to the `application` directory`, + * either execute a binary file located in the `target/fidentisanalyst/bin/` or run `mvn nbm:run-platform` diff --git a/application/FIDENTIS-Analyst-app.iml b/application/FIDENTIS-Analyst-app.iml new file mode 100644 index 0000000000000000000000000000000000000000..f7dd0b482444d05c44bdb970a6886abacb5d6d5b --- /dev/null +++ b/application/FIDENTIS-Analyst-app.iml @@ -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/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/application/pom.xml b/application/pom.xml index b698ed85ec1a87a255d6aba88527d725d7416d4b..1e63205f171f36d859bf7b4ac17fc49f720a3e62 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -30,7 +30,7 @@ <artifactId>FIDENTIS-Analyst-branding</artifactId> <version>${project.version}</version> </dependency> - <!-- NbModuleSuite functional in RELEASE70 or later: --> + <!-- https://mvnrepository.com/artifact/org.netbeans.api/org-netbeans-modules-nbjunit --> <dependency> <groupId>org.netbeans.api</groupId> <artifactId>org-netbeans-modules-nbjunit</artifactId> @@ -60,6 +60,11 @@ <artifactId>GUI</artifactId> <version>${project.version}</version> </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>Comparison</artifactId> + <version>${project.version}</version> + </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> @@ -86,6 +91,14 @@ </systemPropertyVariables> </configuration> </plugin> + <!-- <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>9</source> + <target>9</target> + </configuration> + </plugin> --> </plugins> </build> diff --git a/codestyle.xml b/codestyle.xml index 65801a55ca4bd1f1913fdef7dad05c855b174cf0..e8cd9d82de24f5f0053519da0e7aef771b8bba9a 100644 --- a/codestyle.xml +++ b/codestyle.xml @@ -1,100 +1,106 @@ -<?xml version="1.0"?> -<!DOCTYPE module PUBLIC - "-//Puppy Crawl//DTD Check Configuration 1.3//EN" - "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> - -<module name="Checker"> - <!--<property name="fileExtensions" value="java, xml, properties"/>--> - - <!-- Checks for whitespace --> - <!-- See http://checkstyle.sf.net/config_whitespace.html --> - <module name="FileTabCharacter"/> - - <module name="TreeWalker"> - <!-- Checks for Javadoc comments. --> - <!-- See http://checkstyle.sf.net/config_javadoc.html --> - <module name="JavadocMethod"> - <property name="scope" value="public"/> - <property name="allowMissingPropertyJavadoc" value="true"/> - </module> - <module name="JavadocType"> - <property name="scope" value="public"/> - </module> - <module name="JavadocStyle"> - <property name="scope" value="public"/> - <property name="checkFirstSentence" value="false"/> - </module> - <module name="WriteTag"> - <property name="tag" value="@author"/> - <property name="tagFormat" value="..* ..*"/> - <!-- What to do if the tag does not exists? --> - <property name="severity" value="error"/> - <!-- What to do if the tag exists? --> - <property name="tagSeverity" value="ignore"/> - </module> - - <!-- Checks for Naming Conventions. --> - <!-- See http://checkstyle.sf.net/config_naming.html --> - <module name="ConstantName"/> - <module name="LocalFinalVariableName"/> - <module name="LocalVariableName"/> - <module name="MemberName"/> - <module name="MethodName"/> - <module name="PackageName"/> - <module name="ParameterName"/> - <module name="StaticVariableName"/> - <module name="TypeName"/> - - <!-- Checks for imports --> - <!-- See http://checkstyle.sf.net/config_import.html --> - <module name="AvoidStarImport"/> - <module name="IllegalImport"/> <!-- defaults to sun.* packages --> - <module name="RedundantImport"/> - <module name="UnusedImports"/> - - <!-- Checks for Size Violations. --> - <!-- See http://checkstyle.sf.net/config_sizes.html --> - <module name="LineLength"> - <property name="max" value="120"/> - </module> - <module name="MethodLength"> - <property name="max" value="50"/> - <property name="countEmpty" value="false"/> - </module> - <module name="ParameterNumber"/> - - <!-- Modifier Checks --> - <!-- See http://checkstyle.sf.net/config_modifier.html --> - <module name="ModifierOrder"/> - <module name="RedundantModifier"/> - - <!-- Checks for blocks. You know, those {}'s --> - <!-- See http://checkstyle.sf.net/config_blocks.html --> - <module name="AvoidNestedBlocks"/> - <module name="LeftCurly"> - <property name="option" value="eol"/> - </module> - <module name="NeedBraces"> - <property name="allowSingleLineStatement" value="false"/> - </module> - <module name="RightCurly"/> - - <!-- Checks for common coding problems --> - <!-- See http://checkstyle.sf.net/config_coding.html --> - <module name="EmptyStatement"/> - <module name="EqualsHashCode"/> - <module name="MissingSwitchDefault"/> - <module name="SimplifyBooleanExpression"/> - <module name="SimplifyBooleanReturn"/> - - <!-- Checks for class design --> - <!-- See http://checkstyle.sf.net/config_design.html --> - <module name="FinalClass"/> - <module name="InterfaceIsType"/> - <module name="VisibilityModifier"/> - - <!-- Miscellaneous other checks. --> - <!-- See http://checkstyle.sf.net/config_misc.html --> - <module name="ArrayTypeStyle"/> - </module> -</module> +<?xml version="1.0"?> +<!DOCTYPE module PUBLIC + "-//Puppy Crawl//DTD Check Configuration 1.3//EN" + "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> + +<module name="Checker"> + <!--<property name="fileExtensions" value="java, xml, properties"/>--> + + <!-- Checks for whitespace --> + <!-- See http://checkstyle.sf.net/config_whitespace.html --> + <module name="FileTabCharacter"/> + + <module name="TreeWalker"> + <!-- Checks for Javadoc comments. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html --> + <module name="MissingJavadocMethodCheck"> + <property name="scope" value="public"/> + <property name="allowMissingPropertyJavadoc" value="true"/> + </module> + <!--<module name="JavadocMethod"> + <property name="scope" value="public"/> + <property name="allowMissingPropertyJavadoc" value="true"/> + </module>--> + <module name="JavadocType"> + <property name="scope" value="public"/> + </module> + <module name="JavadocStyle"> + <property name="scope" value="public"/> + <property name="checkFirstSentence" value="false"/> + </module> + <module name="WriteTag"> + <property name="tag" value="@author"/> + <property name="tagFormat" value="..* ..*"/> + <!-- What to do if the tag does not exists? --> + <property name="severity" value="error"/> + <!-- What to do if the tag exists? --> + <property name="tagSeverity" value="ignore"/> + </module> + + <!-- Checks for Naming Conventions. --> + <!-- See http://checkstyle.sf.net/config_naming.html --> + <module name="ConstantName"/> + <module name="LocalFinalVariableName"/> + <module name="LocalVariableName"/> + <module name="MemberName"/> + <module name="MethodName"/> + <module name="PackageName"/> + <module name="ParameterName"/> + <module name="StaticVariableName"/> + <module name="TypeName"/> + + <!-- Checks for imports --> + <!-- See http://checkstyle.sf.net/config_import.html --> + <module name="AvoidStarImport"/> + <module name="IllegalImport"/> <!-- defaults to sun.* packages --> + <module name="RedundantImport"/> + <module name="UnusedImports"/> + + <!-- Checks for Size Violations. --> + <!-- See http://checkstyle.sf.net/config_sizes.html --> + <!--<module name="LineLength"> + <property name="max" value="220"/> + </module>--> + <module name="MethodLength"> + <property name="max" value="50"/> + <property name="countEmpty" value="false"/> + </module> + <module name="ParameterNumber"/> + + <!-- Modifier Checks --> + <!-- See http://checkstyle.sf.net/config_modifier.html --> + <module name="ModifierOrder"/> + <module name="RedundantModifier"/> + + <!-- Checks for blocks. You know, those {}'s --> + <!-- See http://checkstyle.sf.net/config_blocks.html --> + <module name="AvoidNestedBlocks"/> + <module name="LeftCurly"> + <property name="option" value="eol"/> + </module> + <module name="NeedBraces"> + <property name="allowSingleLineStatement" value="false"/> + </module> + <module name="RightCurly"/> + + <!-- Checks for common coding problems --> + <!-- See http://checkstyle.sf.net/config_coding.html --> + <module name="EmptyStatement"/> + <module name="EqualsHashCode"/> + <module name="MissingSwitchDefault"/> + <module name="SimplifyBooleanExpression"/> + <module name="SimplifyBooleanReturn"/> + + <!-- Checks for class design --> + <!-- See http://checkstyle.sf.net/config_design.html --> + <module name="FinalClass"/> + <module name="InterfaceIsType"/> + <module name="VisibilityModifier"> + <property name="allowPublicFinalFields" value="true"/> + </module> + + <!-- Miscellaneous other checks. --> + <!-- See http://checkstyle.sf.net/config_misc.html --> + <module name="ArrayTypeStyle"/> + </module> +</module> diff --git a/codestyle.xml.orig b/codestyle.xml.orig new file mode 100644 index 0000000000000000000000000000000000000000..9a47d724a7c7521b8c96ea80fe9a7495eadb855b --- /dev/null +++ b/codestyle.xml.orig @@ -0,0 +1,209 @@ +<<<<<<< HEAD +<?xml version="1.0"?> +<!DOCTYPE module PUBLIC + "-//Puppy Crawl//DTD Check Configuration 1.3//EN" + "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> + +<module name="Checker"> + <!--<property name="fileExtensions" value="java, xml, properties"/>--> + + <!-- Checks for whitespace --> + <!-- See http://checkstyle.sf.net/config_whitespace.html --> + <module name="FileTabCharacter"/> + + <module name="TreeWalker"> + <!-- Checks for Javadoc comments. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html --> + <module name="JavadocMethod"> + <property name="scope" value="public"/> + <property name="allowMissingPropertyJavadoc" value="true"/> + </module> + <module name="JavadocType"> + <property name="scope" value="public"/> + </module> + <module name="JavadocStyle"> + <property name="scope" value="public"/> + <property name="checkFirstSentence" value="false"/> + </module> + <module name="WriteTag"> + <property name="tag" value="@author"/> + <property name="tagFormat" value="..* ..*"/> + <!-- What to do if the tag does not exists? --> + <property name="severity" value="error"/> + <!-- What to do if the tag exists? --> + <property name="tagSeverity" value="ignore"/> + </module> + + <!-- Checks for Naming Conventions. --> + <!-- See http://checkstyle.sf.net/config_naming.html --> + <module name="ConstantName"/> + <module name="LocalFinalVariableName"/> + <module name="LocalVariableName"/> + <module name="MemberName"/> + <module name="MethodName"/> + <module name="PackageName"/> + <module name="ParameterName"/> + <module name="StaticVariableName"/> + <module name="TypeName"/> + + <!-- Checks for imports --> + <!-- See http://checkstyle.sf.net/config_import.html --> + <module name="AvoidStarImport"/> + <module name="IllegalImport"/> <!-- defaults to sun.* packages --> + <module name="RedundantImport"/> + <module name="UnusedImports"/> + + <!-- Checks for Size Violations. --> + <!-- See http://checkstyle.sf.net/config_sizes.html --> + <module name="LineLength"> + <property name="max" value="120"/> + </module> + <module name="MethodLength"> + <property name="max" value="50"/> + <property name="countEmpty" value="false"/> + </module> + <module name="ParameterNumber"/> + + <!-- Modifier Checks --> + <!-- See http://checkstyle.sf.net/config_modifier.html --> + <module name="ModifierOrder"/> + <module name="RedundantModifier"/> + + <!-- Checks for blocks. You know, those {}'s --> + <!-- See http://checkstyle.sf.net/config_blocks.html --> + <module name="AvoidNestedBlocks"/> + <module name="LeftCurly"> + <property name="option" value="eol"/> + </module> + <module name="NeedBraces"> + <property name="allowSingleLineStatement" value="false"/> + </module> + <module name="RightCurly"/> + + <!-- Checks for common coding problems --> + <!-- See http://checkstyle.sf.net/config_coding.html --> + <module name="EmptyStatement"/> + <module name="EqualsHashCode"/> + <module name="MissingSwitchDefault"/> + <module name="SimplifyBooleanExpression"/> + <module name="SimplifyBooleanReturn"/> + + <!-- Checks for class design --> + <!-- See http://checkstyle.sf.net/config_design.html --> + <module name="FinalClass"/> + <module name="InterfaceIsType"/> + <module name="VisibilityModifier"/> + + <!-- Miscellaneous other checks. --> + <!-- See http://checkstyle.sf.net/config_misc.html --> + <module name="ArrayTypeStyle"/> + </module> +</module> +======= +<?xml version="1.0"?> +<!DOCTYPE module PUBLIC + "-//Puppy Crawl//DTD Check Configuration 1.3//EN" + "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> + +<module name="Checker"> + <!--<property name="fileExtensions" value="java, xml, properties"/>--> + + <!-- Checks for whitespace --> + <!-- See http://checkstyle.sf.net/config_whitespace.html --> + <module name="FileTabCharacter"/> + + <module name="TreeWalker"> + <!-- Checks for Javadoc comments. --> + <!-- See http://checkstyle.sf.net/config_javadoc.html --> + <module name="MissingJavadocMethodCheck"> + <property name="scope" value="public"/> + <property name="allowMissingPropertyJavadoc" value="true"/> + </module> + <!--<module name="JavadocMethod"> + <property name="scope" value="public"/> + <property name="allowMissingPropertyJavadoc" value="true"/> + </module>--> + <module name="JavadocType"> + <property name="scope" value="public"/> + </module> + <module name="JavadocStyle"> + <property name="scope" value="public"/> + <property name="checkFirstSentence" value="false"/> + </module> + <module name="WriteTag"> + <property name="tag" value="@author"/> + <property name="tagFormat" value="..* ..*"/> + <!-- What to do if the tag does not exists? --> + <property name="severity" value="error"/> + <!-- What to do if the tag exists? --> + <property name="tagSeverity" value="ignore"/> + </module> + + <!-- Checks for Naming Conventions. --> + <!-- See http://checkstyle.sf.net/config_naming.html --> + <module name="ConstantName"/> + <module name="LocalFinalVariableName"/> + <module name="LocalVariableName"/> + <module name="MemberName"/> + <module name="MethodName"/> + <module name="PackageName"/> + <module name="ParameterName"/> + <module name="StaticVariableName"/> + <module name="TypeName"/> + + <!-- Checks for imports --> + <!-- See http://checkstyle.sf.net/config_import.html --> + <module name="AvoidStarImport"/> + <module name="IllegalImport"/> <!-- defaults to sun.* packages --> + <module name="RedundantImport"/> + <module name="UnusedImports"/> + + <!-- Checks for Size Violations. --> + <!-- See http://checkstyle.sf.net/config_sizes.html --> + <!--<module name="LineLength"> + <property name="max" value="220"/> + </module>--> + <module name="MethodLength"> + <property name="max" value="50"/> + <property name="countEmpty" value="false"/> + </module> + <module name="ParameterNumber"/> + + <!-- Modifier Checks --> + <!-- See http://checkstyle.sf.net/config_modifier.html --> + <module name="ModifierOrder"/> + <module name="RedundantModifier"/> + + <!-- Checks for blocks. You know, those {}'s --> + <!-- See http://checkstyle.sf.net/config_blocks.html --> + <module name="AvoidNestedBlocks"/> + <module name="LeftCurly"> + <property name="option" value="eol"/> + </module> + <module name="NeedBraces"> + <property name="allowSingleLineStatement" value="false"/> + </module> + <module name="RightCurly"/> + + <!-- Checks for common coding problems --> + <!-- See http://checkstyle.sf.net/config_coding.html --> + <module name="EmptyStatement"/> + <module name="EqualsHashCode"/> + <module name="MissingSwitchDefault"/> + <module name="SimplifyBooleanExpression"/> + <module name="SimplifyBooleanReturn"/> + + <!-- Checks for class design --> + <!-- See http://checkstyle.sf.net/config_design.html --> + <module name="FinalClass"/> + <module name="InterfaceIsType"/> + <module name="VisibilityModifier"> + <property name="allowPublicFinalFields" value="true"/> + </module> + + <!-- Miscellaneous other checks. --> + <!-- See http://checkstyle.sf.net/config_misc.html --> + <module name="ArrayTypeStyle"/> + </module> +</module> +>>>>>>> origin/master diff --git a/pom.xml b/pom.xml index 3cb8410524f7d6b6806b0d012c2042b9d758ff17..fbcad2aa74603b97e349c51ba55f9bc81222d94e 100644 --- a/pom.xml +++ b/pom.xml @@ -11,11 +11,12 @@ <name>FIDENTIS-Analyst-2</name> <properties> - <netbeans.version>RELEASE82</netbeans.version> + <netbeans.version>RELEASE113</netbeans.version> <brandingToken>fidentisanalyst</brandingToken> - <version.maven.plugin.checkstyle>2.17</version.maven.plugin.checkstyle> + <version.maven.plugin.checkstyle>3.1.1</version.maven.plugin.checkstyle> <version.plugin.checkstyle>8.5</version.plugin.checkstyle> <version.plugin.source>2.4</version.plugin.source> + <version.javax.vecmath>1.5.2</version.javax.vecmath> <checkstyle.fail>false</checkstyle.fail> <checkstyle.severity>warning</checkstyle.severity> </properties> @@ -53,20 +54,25 @@ <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> - <source>1.7</source> - <target>1.7</target> + <source>1.8</source> + <target>1.8</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> - <version>2.19.1</version> + <version>2.22.2</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.22.0</version> + </plugin> </plugins> </pluginManagement> </build>