Commit 97a65114 authored by Riegel's avatar Riegel
Browse files

Merge branch 'dev' into 'master'

Version 3.15.0

See merge request !8
parents 99c8f6a8 5950ea5f
Pipeline #10106 passed with stage
in 3 minutes and 15 seconds
...@@ -50,15 +50,15 @@ public class Section { ...@@ -50,15 +50,15 @@ public class Section {
private static final AtomicInteger S_COUNTER = new AtomicInteger(0); private static final AtomicInteger S_COUNTER = new AtomicInteger(0);
private Element tocBlock; private final Element tocBlock;
private Element contentBlock; private final Element contentBlock;
private Element headlineBlock; private final Element headlineBlock;
private String linkId; private String linkId;
private List<Section> subSections; private List<Section> subSections;
private int depth; private final int depth;
// attributes for error reporting // attributes for error reporting
private ErrorStatisticsCollector stats; private ErrorStatisticsCollector stats;
......
...@@ -30,13 +30,13 @@ public class Table { ...@@ -30,13 +30,13 @@ public class Table {
private static final String TABLE_HEADER_COLOR = "#58ACFA"; private static final String TABLE_HEADER_COLOR = "#58ACFA";
private Element tableBlock; private final Element tableBlock;
private Element tableHeader; private final Element tableHeader;
private Element tableBody; private final Element tableBody;
private Element tableElement; private final Element tableElement;
private int columns; private final int columns;
public Table(int columns) { public Table(int columns) {
this.columns = columns; this.columns = columns;
...@@ -101,13 +101,13 @@ public class Table { ...@@ -101,13 +101,13 @@ public class Table {
private Element createTableRow(String... content) { private Element createTableRow(String... content) {
Element tableRow = new Element("table-row", PdfReport.FO_NS); Element tableRow = new Element("table-row", PdfReport.FO_NS);
for (int i = 0; i < content.length; i++) { for (String s : content) {
Element tableCell = new Element("table-cell", PdfReport.FO_NS); Element tableCell = new Element("table-cell", PdfReport.FO_NS);
tableRow.addContent(tableCell); tableRow.addContent(tableCell);
tableCell.addContent(PdfReport.createTextElement(content[i])); tableCell.addContent(PdfReport.createTextElement(s));
tableCell.setAttribute("padding", "3pt 3pt 3pt 3pt"); tableCell.setAttribute("padding", "3pt 3pt 3pt 3pt");
PdfReport.applySolidBorder(tableCell); PdfReport.applySolidBorder(tableCell);
} }
return tableRow; return tableRow;
} }
......
...@@ -18,12 +18,6 @@ ...@@ -18,12 +18,6 @@
*/ */
package de.hft.stuttgart.citydoctor2.check; package de.hft.stuttgart.citydoctor2.check;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import org.junit.Test; import org.junit.Test;
...@@ -31,6 +25,13 @@ import org.junit.Test; ...@@ -31,6 +25,13 @@ import org.junit.Test;
import de.hft.stuttgart.citydoctor2.datastructure.FeatureType; import de.hft.stuttgart.citydoctor2.datastructure.FeatureType;
import de.hft.stuttgart.quality.model.enums.RequirementId; import de.hft.stuttgart.quality.model.enums.RequirementId;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
public class ValidationConfigurationTest { public class ValidationConfigurationTest {
@Test @Test
...@@ -70,4 +71,21 @@ public class ValidationConfigurationTest { ...@@ -70,4 +71,21 @@ public class ValidationConfigurationTest {
assertTrue(includeFilter.getTypes().contains(FeatureType.VEGETATION)); assertTrue(includeFilter.getTypes().contains(FeatureType.VEGETATION));
} }
@Test
public void testVulnerableConfig() throws FileNotFoundException{
String file = "src/test/resources/testConfigVulnerability.yml";
ValidationConfiguration config = null;
try {
config = ValidationConfiguration.loadValidationConfig(file);
assertNotNull(config);
fail("Config with Vulnerability should not be successfully loaded");
} catch (FileNotFoundException e){
// Rethrow FNFE
throw e;
} catch (Exception e) {
// Bad config was not loaded
assertNull(config);
}
}
} }
set CLASSPATH=.\target\classes;..\CityDoctorModel\target\classes;..\CityDoctorHealer\target\classes
set PATH="c:\Program Files (x86)\Java\jdk1.8.0_25\bin"
javah -jni de.hft.stuttgart.citydoctor2.connect.edge.AutoPro
javah -jni de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsExport
javah -jni de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsGeneral
javah -jni de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsBool
javah -jni de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsMerge
javah -jni de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsAdvancedSweep
pause
<?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="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.15.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>CityDoctorAutoPro</artifactId>
<name>CityDoctorAutoPro</name>
<description>Automated Simplification Algorithms</description>
<dependencies>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorModel</artifactId>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorValidation</artifactId>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorHealer</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package de.hft.stuttgart.citydoctor2.connect.edge;
import de.hft.stuttgart.citydoctor2.connect.edge.CppFeature;
import de.hft.stuttgart.citydoctor2.connect.edge.CppReferenceHandlingBase;
import de.hft.stuttgart.citydoctor2.connect.edge.NativeException;
import de.hft.stuttgart.citydoctor2.connect.edge.NativePointerCastException;
/**
*
* @author PiR
* @version 1.0
*
*/
public class AutoPro extends CppReferenceHandlingBase
{
// ----- native methods
// create and release stored C++ polygon check object
private native long createCppAutoPro()
throws OutOfMemoryError;
private native void disposeCppAutoPro(long ptrToCppAutoPro)
throws NativePointerCastException;
// native methods
private native boolean addFeature(long ptrToCppAutoPro, long ptrToCppFeature)
throws NativeException, IllegalArgumentException;
private native boolean setSettingsExport(long ptrToCppAutoPro, long ptrToCppSettings)
throws NativeException, IllegalArgumentException;
private native boolean setSettingsGeneral(long ptrToCppAutoPro, long ptrToCppSettings)
throws NativeException, IllegalArgumentException;
private native boolean setSettingsBool(long ptrToCppAutoPro, long ptrToCppSettings)
throws NativeException, IllegalArgumentException;
private native boolean setSettingsMerge(long ptrToCppAutoPro, long ptrToCppSettings)
throws NativeException, IllegalArgumentException;
private native boolean setSettingsAdvancedSweep(long ptrToCppAutoPro, long ptrToCppSettings)
throws NativeException, IllegalArgumentException;
private native boolean applyAutoProMethods(long ptrToCppAutoPro)
throws NativeException, IllegalArgumentException;
public native long getHealResult(long ptrToCppAutoPro, long ptrToCppFeature)
throws NativeException, IllegalArgumentException;
/**
* Constructor that gets a VPDFeature. All check method will be invoked on this feature.
* Remember to use the createCppObject method
* @param feature All check methods will use the data of this feature
*
* @see {@link createCppObject} {@link disposeCppObject}
*/
public AutoPro()
{
}
/**
* Creates an C++ object to use the native methods.
*
* @throws IllegalStateException
* Thrown if the encapsulated "long-Pointer" isn't 0
* @throws NativeOutOfMemoryException
* If there is no more memory on the native side
*
* @see {@link disposeCppObject}
* @see de.hft.stuttgart.citydoctor.connect.edGe.CppReferenceHandlingBase#createCppObject()
*/
public void createCppObject()
throws OutOfMemoryError, IllegalStateException
{
if ( 0L != ptrToCppObject)
{
throw new IllegalStateException("Can't create new C++ object, there is allready one!");
}
// Maybe an exception is thrown and there should be no crap in ptrToCppObject
long tmpPointer = createCppAutoPro();
ptrToCppObject = tmpPointer;
}
@Override
public void disposeCppObject()
throws NativePointerCastException
{
if ( 0L != ptrToCppObject)
{
disposeCppAutoPro(this.ptrToCppObject);
ptrToCppObject = 0x0;
}
}
public void ap_addFeature(CppFeature feature)
throws NativeException, IllegalArgumentException
{
checkNullPointer();
addFeature(ptrToCppObject, feature.ptrToCppObject);
}
public void ap_setSettingsExport(AutoProSettingsExport settings)
throws NativeException, IllegalArgumentException
{
checkNullPointer();
setSettingsExport(ptrToCppObject, settings.ptrToCppObject);
}
public void ap_setSettingsGeneral(AutoProSettingsGeneral settings)
throws NativeException, IllegalArgumentException
{
checkNullPointer();
setSettingsGeneral(ptrToCppObject, settings.ptrToCppObject);
}
public void ap_setSettingsBool(AutoProSettingsBool settings)
throws NativeException, IllegalArgumentException
{
checkNullPointer();
setSettingsBool(ptrToCppObject, settings.ptrToCppObject);
}
public void ap_setSettingsMerge(AutoProSettingsMerge settings)
throws NativeException, IllegalArgumentException
{
checkNullPointer();
setSettingsMerge(ptrToCppObject, settings.ptrToCppObject);
}
public void ap_setSettingsAdvancedSweep(AutoProSettingsAdvancedSweep settings)
throws NativeException, IllegalArgumentException
{
checkNullPointer();
setSettingsAdvancedSweep(ptrToCppObject, settings.ptrToCppObject);
}
public void ap_applyAutoProMethods()
throws NativeException, IllegalArgumentException
{
checkNullPointer();
applyAutoProMethods(ptrToCppObject);
}
public long ap_getHealResult(CppFeature feature) {
checkNullPointer();
return getHealResult(ptrToCppObject, feature.ptrToCppObject);
}
}
package de.hft.stuttgart.citydoctor2.connect.edge;
import de.hft.stuttgart.citydoctor2.connect.edge.CppReferenceHandlingBase;
import de.hft.stuttgart.citydoctor2.connect.edge.NativePointerCastException;
public class AutoProSettingsAdvancedSweep extends CppReferenceHandlingBase {
private native long createCppClass(
boolean advancedSweep_General_printInfo,
boolean advancedSweep_General_printFilterReasonInfo,
boolean advancedSweep_General_exportIntermediateStages,
double advancedSweep_General_minEdgeLength,
double advancedSweep_General_maxEdgeLength,
double advancedSweep_General_minDistToSweep,
boolean advancedSweep_Planarity_Use,
boolean advancedSweep_Planarity_IgnoreMultiplePoints,
double advancedSweep_Planarity_PlanarityTolerance,
boolean advancedSweep_SweepPlane_Use,
boolean advancedSweep_SweepPlane_PushOnly,
boolean advancedSweep_SweepPlane_PullOnly,
boolean advancedSweep_SweepPlane_ShortestEdgeFirst,
boolean advancedSweep_SweepPlane_SmallestFaceFirst,
boolean advancedSweep_SweepPlane_SmallestDistFirst,
boolean advancedSweep_SweepRotate_Use,
double advancedSweep_SweepRotate_maxAngle,
boolean advancedSweep_SweepRotate_SmallestDistFirst,
boolean advancedSweep_SweepRotate_SmallestAngleFirst,
boolean advancedSweep_SweepRotate_SmallestFaceFirst
)
throws OutOfMemoryError;
private native void disposeCppClass(long ptrToCppAutoPro)
throws NativePointerCastException;
private boolean advancedSweep_General_printInfo;
private boolean advancedSweep_General_printFilterReasonInfo;
private boolean advancedSweep_General_exportIntermediateStages;
private double advancedSweep_General_minEdgeLength;
private double advancedSweep_General_maxEdgeLength;
private double advancedSweep_General_minDistToSweep;
private boolean advancedSweep_Planarity_Use;
private boolean advancedSweep_Planarity_IgnoreMultiplePoints;
private double advancedSweep_Planarity_PlanarityTolerance;
private boolean advancedSweep_SweepPlane_Use;
private boolean advancedSweep_SweepPlane_PushOnly;
private boolean advancedSweep_SweepPlane_PullOnly;
private boolean advancedSweep_SweepPlane_ShortestEdgeFirst;
private boolean advancedSweep_SweepPlane_SmallestFaceFirst;
private boolean advancedSweep_SweepPlane_SmallestDistFirst;
private boolean advancedSweep_SweepRotate_Use;
private double advancedSweep_SweepRotate_maxAngle;
private boolean advancedSweep_SweepRotate_SmallestDistFirst;
private boolean advancedSweep_SweepRotate_SmallestAngleFirst;
private boolean advancedSweep_SweepRotate_SmallestFaceFirst;
public AutoProSettingsAdvancedSweep() {
set_advancedSweep_General_printInfo(false);
set_advancedSweep_General_printFilterReasonInfo(false);
set_advancedSweep_General_exportIntermediateStages(false);
set_advancedSweep_General_minEdgeLength(2.0);
set_advancedSweep_General_maxEdgeLength(5.0);
set_advancedSweep_General_minDistToSweep(0);
set_advancedSweep_Planarity_Use(false);
set_advancedSweep_Planarity_IgnoreMultiplePoints(false);
set_advancedSweep_Planarity_PlanarityTolerance(0.001);
set_advancedSweep_SweepPlane_Use(false);
set_advancedSweep_SweepPlane_PushOnly(false);
set_advancedSweep_SweepPlane_PullOnly(false);
set_advancedSweep_SweepPlane_ShortestEdgeFirst(false);
set_advancedSweep_SweepPlane_SmallestFaceFirst(false);
set_advancedSweep_SweepPlane_SmallestDistFirst(false);
set_advancedSweep_SweepRotate_Use(false);
set_advancedSweep_SweepRotate_maxAngle(10);
set_advancedSweep_SweepRotate_SmallestDistFirst(false);
set_advancedSweep_SweepRotate_SmallestAngleFirst(false);
set_advancedSweep_SweepRotate_SmallestFaceFirst(false);
}
/**
* Creates an C++ feature object
*
* @throws IllegalStateException
* Thrown if the encapsulated "long-Pointer" isn't 0
* @throws NativeOutOfMemoryException
* If there is no more memory on the native side
*
* @see {@link disposeCppObject}
* @see de.hft.stuttgart.citydoctor.connect.edGe.CppReferenceHandlingBase#createCppObject()
*/
public void createCppObject() throws IllegalStateException,
OutOfMemoryError {
if (0L != ptrToCppObject) {
throw new IllegalStateException(
"Can't create new C++ object, there is allready one!");
}
// Maybe an exception is thrown
long tmpPointer = createCppClass(
is_advancedSweep_General_printInfo(),
is_advancedSweep_General_printFilterReasonInfo(),
is_advancedSweep_General_exportIntermediateStages(),
get_advancedSweep_General_minEdgeLength(),
get_advancedSweep_General_maxEdgeLength(),
get_advancedSweep_General_minDistToSweep(),
is_advancedSweep_Planarity_Use(),
is_advancedSweep_Planarity_IgnoreMultiplePoints(),
get_advancedSweep_Planarity_PlanarityTolerance(),
is_advancedSweep_SweepPlane_Use(),
is_advancedSweep_SweepPlane_PushOnly(),
is_advancedSweep_SweepPlane_PullOnly(),
is_advancedSweep_SweepPlane_ShortestEdgeFirst(),
is_advancedSweep_SweepPlane_SmallestFaceFirst(),
is_advancedSweep_SweepPlane_SmallestDistFirst(),
is_advancedSweep_SweepRotate_Use(),
get_advancedSweep_SweepRotate_maxAngle(),
is_advancedSweep_SweepRotate_SmallestDistFirst(),
is_advancedSweep_SweepRotate_SmallestAngleFirst(),
is_advancedSweep_SweepRotate_SmallestFaceFirst()
);
ptrToCppObject = tmpPointer;
}
@Override
public void disposeCppObject() throws NativePointerCastException {
if (0L != ptrToCppObject) {
disposeCppClass(ptrToCppObject);
ptrToCppObject = 0L;
}
}
public void set_advancedSweep_General_printInfo(boolean advancedSweep_General_printInfo)
{
this.advancedSweep_General_printInfo = advancedSweep_General_printInfo;
}
public void set_advancedSweep_General_printFilterReasonInfo(boolean advancedSweep_General_printFilterReasonInfo)
{
this.advancedSweep_General_printFilterReasonInfo = advancedSweep_General_printFilterReasonInfo;
}
public void set_advancedSweep_General_exportIntermediateStages(boolean advancedSweep_General_exportIntermediateStages)
{
this.advancedSweep_General_exportIntermediateStages = advancedSweep_General_exportIntermediateStages;
}
public void set_advancedSweep_General_minEdgeLength(double advancedSweep_General_minEdgeLength)
{
this.advancedSweep_General_minEdgeLength = advancedSweep_General_minEdgeLength;
}
public void set_advancedSweep_General_maxEdgeLength(double advancedSweep_General_maxEdgeLength)
{
this.advancedSweep_General_maxEdgeLength = advancedSweep_General_maxEdgeLength;
}
public void set_advancedSweep_General_minDistToSweep(double advancedSweep_General_minDistToSweep)
{
this.advancedSweep_General_minDistToSweep = advancedSweep_General_minDistToSweep;
}
public void set_advancedSweep_Planarity_Use(boolean advancedSweep_Planarity_Use)
{
this.advancedSweep_Planarity_Use = advancedSweep_Planarity_Use;
}
public void set_advancedSweep_Planarity_IgnoreMultiplePoints(boolean advancedSweep_Planarity_IgnoreMultiplePoints)
{
this.advancedSweep_Planarity_IgnoreMultiplePoints = advancedSweep_Planarity_IgnoreMultiplePoints;
}
public void set_advancedSweep_Planarity_PlanarityTolerance(double advancedSweep_Planarity_PlanarityTolerance)
{
this.advancedSweep_Planarity_PlanarityTolerance = advancedSweep_Planarity_PlanarityTolerance;
}
public void set_advancedSweep_SweepPlane_Use(boolean advancedSweep_SweepPlane_Use)
{
this.advancedSweep_SweepPlane_Use = advancedSweep_SweepPlane_Use;
}
public void set_advancedSweep_SweepPlane_PushOnly(boolean advancedSweep_SweepPlane_PushOnly)
{
this.advancedSweep_SweepPlane_PushOnly = advancedSweep_SweepPlane_PushOnly;
}
public void set_advancedSweep_SweepPlane_PullOnly(boolean advancedSweep_SweepPlane_PullOnly)
{
this.advancedSweep_SweepPlane_PullOnly = advancedSweep_SweepPlane_PullOnly;
}
public void set_advancedSweep_SweepPlane_ShortestEdgeFirst(boolean advancedSweep_SweepPlane_ShortestEdgeFirst)
{
this.advancedSweep_SweepPlane_ShortestEdgeFirst = advancedSweep_SweepPlane_ShortestEdgeFirst;
}
public void set_advancedSweep_SweepPlane_SmallestFaceFirst(boolean advancedSweep_SweepPlane_SmallestFaceFirst)
{
this.advancedSweep_SweepPlane_SmallestFaceFirst = advancedSweep_SweepPlane_SmallestFaceFirst;
}
public void set_advancedSweep_SweepPlane_SmallestDistFirst(boolean advancedSweep_SweepPlane_SmallestDistFirst)
{
this.advancedSweep_SweepPlane_SmallestDistFirst = advancedSweep_SweepPlane_SmallestDistFirst;
}
public void set_advancedSweep_SweepRotate_Use(boolean advancedSweep_SweepRotate_Use)
{
this.advancedSweep_SweepRotate_Use = advancedSweep_SweepRotate_Use;
}
public void set_advancedSweep_SweepRotate_maxAngle(double advancedSweep_SweepRotate_maxAngle)
{
this.advancedSweep_SweepRotate_maxAngle = advancedSweep_SweepRotate_maxAngle;
}
public void set_advancedSweep_SweepRotate_SmallestDistFirst(boolean advancedSweep_SweepRotate_SmallestDistFirst)
{
this.advancedSweep_SweepRotate_SmallestDistFirst = advancedSweep_SweepRotate_SmallestDistFirst;
}
public void set_advancedSweep_SweepRotate_SmallestAngleFirst(boolean advancedSweep_SweepRotate_SmallestAngleFirst)
{
this.advancedSweep_SweepRotate_SmallestAngleFirst = advancedSweep_SweepRotate_SmallestAngleFirst;
}
public void set_advancedSweep_SweepRotate_SmallestFaceFirst(boolean advancedSweep_SweepRotate_SmallestFaceFirst)
{
this.advancedSweep_SweepRotate_SmallestFaceFirst = advancedSweep_SweepRotate_SmallestFaceFirst;
}
public boolean is_advancedSweep_General_printInfo()
{
return this.advancedSweep_General_printInfo;
}
public boolean is_advancedSweep_General_printFilterReasonInfo()
{
return this.advancedSweep_General_printFilterReasonInfo;
}
public boolean is_advancedSweep_General_exportIntermediateStages()
{
return this.advancedSweep_General_exportIntermediateStages;
}
public double get_advancedSweep_General_minEdgeLength()
{
return this.advancedSweep_General_minEdgeLength;
}
public double get_advancedSweep_General_maxEdgeLength()
{
return this.advancedSweep_General_maxEdgeLength;
}
public double get_advancedSweep_General_minDistToSweep()
{
return this.advancedSweep_General_minDistToSweep;
}
public boolean is_advancedSweep_Planarity_Use()
{
return this.advancedSweep_Planarity_Use;
}
public boolean is_advancedSweep_Planarity_IgnoreMultiplePoints()
{
return this.advancedSweep_Planarity_IgnoreMultiplePoints;
}
public double get_advancedSweep_Planarity_PlanarityTolerance()
{
return this.advancedSweep_Planarity_PlanarityTolerance;
}
public boolean is_advancedSweep_SweepPlane_Use()
{
return this.advancedSweep_SweepPlane_Use;
}
public boolean is_advancedSweep_SweepPlane_PushOnly()
{
return this.advancedSweep_SweepPlane_PushOnly;
}
public boolean is_advancedSweep_SweepPlane_PullOnly()
{
return this.advancedSweep_SweepPlane_PullOnly;
}
public boolean is_advancedSweep_SweepPlane_ShortestEdgeFirst()
{
return this.advancedSweep_SweepPlane_ShortestEdgeFirst;
}
public boolean is_advancedSweep_SweepPlane_SmallestFaceFirst()
{
return this.advancedSweep_SweepPlane_SmallestFaceFirst;
}
public boolean is_advancedSweep_SweepPlane_SmallestDistFirst()
{
return this.advancedSweep_SweepPlane_SmallestDistFirst;
}
public boolean is_advancedSweep_SweepRotate_Use()
{
return this.advancedSweep_SweepRotate_Use;
}
public double get_advancedSweep_SweepRotate_maxAngle()
{
return this.advancedSweep_SweepRotate_maxAngle;
}
public boolean is_advancedSweep_SweepRotate_SmallestDistFirst()
{
return this.advancedSweep_SweepRotate_SmallestDistFirst;
}
public boolean is_advancedSweep_SweepRotate_SmallestAngleFirst()
{
return this.advancedSweep_SweepRotate_SmallestAngleFirst;
}
public boolean is_advancedSweep_SweepRotate_SmallestFaceFirst()
{
return this.advancedSweep_SweepRotate_SmallestFaceFirst;
}
}
package de.hft.stuttgart.citydoctor2.connect.edge;
import de.hft.stuttgart.citydoctor2.connect.edge.CppReferenceHandlingBase;
import de.hft.stuttgart.citydoctor2.connect.edge.NativePointerCastException;
public class AutoProSettingsBool extends CppReferenceHandlingBase {
private native long createCppClass(
boolean useBool,
boolean printBoolInfo,
boolean exportIntermediateStages,
boolean useMinkowski,
boolean printMinkowskiInfo,
double minkowksiCubeSize,
boolean rotateMinkowskiCube
)
throws OutOfMemoryError;
private native void disposeCppClass(long ptrToCppAutoPro)
throws NativePointerCastException;
private boolean useBool;
private boolean printBoolInfo;
private boolean exportIntermediateStages;
private boolean useMinkowski;
private boolean printMinkowskiInfo;
private double minkowskiCubeSize;
private boolean rotateMinkowskiCube;
public AutoProSettingsBool() {
setUseBool(false);
setPrintBoolInfo(false);
setExportIntermediateStages(false);
setUseMinkowski(false);
setPrintMinkowskiInfo(false);
setMinkowskiCubeSize(2.2);
setRotateMinkowskiCube(false);
}
/**
* Creates an C++ feature object
*
* @throws IllegalStateException
* Thrown if the encapsulated "long-Pointer" isn't 0
* @throws NativeOutOfMemoryException
* If there is no more memory on the native side
*
* @see {@link disposeCppObject}
* @see de.hft.stuttgart.citydoctor.connect.edGe.CppReferenceHandlingBase#createCppObject()
*/
public void createCppObject() throws IllegalStateException,
OutOfMemoryError {
if (0L != ptrToCppObject) {
throw new IllegalStateException(
"Can't create new C++ object, there is allready one!");
}
// Maybe an exception is thrown
long tmpPointer = createCppClass(
isUseBool(),
isPrintBoolInfo(),
isExportIntermediateStages(),
isUseMinkowski(),
isPrintMinkowskiInfo(),
getMinkowskiCubeSize(),
isRotateMinkowskiCube()
);
ptrToCppObject = tmpPointer;
}
@Override
public void disposeCppObject() throws NativePointerCastException {
if (0L != ptrToCppObject) {
disposeCppClass(ptrToCppObject);
ptrToCppObject = 0L;
}
}
public void setUseBool(boolean useBool) {
this.useBool = useBool;
}
public void setPrintBoolInfo(boolean printBoolInfo) {
this.printBoolInfo = printBoolInfo;
}
public void setExportIntermediateStages(boolean exportIntermediateStages) {
this.exportIntermediateStages = exportIntermediateStages;
}
public void setUseMinkowski(boolean useMinkowski) {
this.useMinkowski = useMinkowski;
}
public void setPrintMinkowskiInfo(boolean printMinkowskiInfo) {
this.printMinkowskiInfo = printMinkowskiInfo;
}
public void setMinkowskiCubeSize(double minkowskiCubeSize) {
this.minkowskiCubeSize = minkowskiCubeSize;
}
public void setRotateMinkowskiCube(boolean rotateMinkowskiCube) {
this.rotateMinkowskiCube = rotateMinkowskiCube;
}
public boolean isUseBool() {
return useBool;
}
public boolean isPrintBoolInfo() {
return printBoolInfo;
}
public boolean isExportIntermediateStages() {
return exportIntermediateStages;
}
public boolean isUseMinkowski() {
return useMinkowski;
}
public boolean isPrintMinkowskiInfo() {
return printMinkowskiInfo;
}
public double getMinkowskiCubeSize() {
return minkowskiCubeSize;
}
public boolean isRotateMinkowskiCube() {
return rotateMinkowskiCube;
}
}
package de.hft.stuttgart.citydoctor2.connect.edge;
import de.hft.stuttgart.citydoctor2.connect.edge.CppReferenceHandlingBase;
import de.hft.stuttgart.citydoctor2.connect.edge.NativePointerCastException;
public class AutoProSettingsExport extends CppReferenceHandlingBase {
private native long createCppClass(
boolean exportMesh,
String meshFileName,
String meshFilePath,
boolean exportIV,
String ivFileName,
String ivFilePath,
boolean exportSTEP,
String stepFileName,
String stepFilePath,
boolean exportCityGML,
String cityGMLFileName,
String cityGMLFilePath,
boolean exportValidBuildingsOnly,
boolean moveBuildingsToOrigin,
boolean exportIntermediateStagesComplete,
boolean oneSolidPerBuilding,
double minDistToOrigin_X,
double minDistToOrigin_Y,
double minDistToOrigin_Z
)
throws OutOfMemoryError;
private native void disposeCppClass(long ptrToCppAutoPro)
throws NativePointerCastException;
private boolean exportMesh;
private String meshFileName;
private String meshFilePath;
private boolean exportIV;
private String ivFileName;
private String ivFilePath;
private boolean exportSTEP;
private String stepFileName;
private String stepFilePath;
private boolean exportCityGML;
private String cityGMLFileName;
private String cityGMLFilePath;
private boolean exportValidBuildingsOnly;
private boolean moveBuildingsToOrigin;
private boolean exportIntermediateStagesComplete;
private boolean oneSolidPerBuilding;
double minDistToOrigin_X;
double minDistToOrigin_Y;
double minDistToOrigin_Z;
public AutoProSettingsExport() {
setExportMesh(false);
setMeshFileName("");
setMeshFilePath("");
setExportIV(false);
setIVFileName("");
setIVFilePath("");
setExportSTEP(false);
setSTEPFileName("");
setSTEPFilePath("");
setExportCityGML(false);
setCityGMLFileName("");
setCityGMLFilePath("");
setExportValidBuildingsOnly(false);
setMoveBuildingsToOrigin(false);
setExportIntermediateStagesComplete(false);
setExportStepWithOneSolidPerBuilding(false);
setMinDistToOrigin_X(0);
setMinDistToOrigin_Y(0);
setMinDistToOrigin_Z(0);
}
/**
* Creates an C++ feature object
*
* @throws IllegalStateException
* Thrown if the encapsulated "long-Pointer" isn't 0
* @throws NativeOutOfMemoryException
* If there is no more memory on the native side
*
* @see {@link disposeCppObject}
* @see de.hft.stuttgart.citydoctor.connect.edGe.CppReferenceHandlingBase#createCppObject()
*/
public void createCppObject() throws IllegalStateException,
OutOfMemoryError {
if (0L != ptrToCppObject) {
throw new IllegalStateException(
"Can't create new C++ object, there is allready one!");
}
// Maybe an exception is thrown
long tmpPointer = createCppClass(
isExportMesh(),
getMeshFileName(),
getMeshFilePath(),
isExportIV(),
getIVFileName(),
getIVFilePath(),
isExportSTEP(),
getSTEPFileName(),
getSTEPFilePath(),
isExportCityGML(),
getCityGMLFileName(),
getCityGMLFilePath(),
getExportValidBuildingsOnly(),
getMoveBuildingsToOrigin(),
getExportIntermediateStagesComplete(),
getExportStepWithOneSolidPerBuilding(),
getMinDistToOrigin_X(),
getMinDistToOrigin_Y(),
getMinDistToOrigin_Z()
);
ptrToCppObject = tmpPointer;
}
@Override
public void disposeCppObject() throws NativePointerCastException {
if (0L != ptrToCppObject) {
disposeCppClass(ptrToCppObject);
ptrToCppObject = 0L;
}
}
public void setExportMesh(boolean exportMesh) {
this.exportMesh = exportMesh;
}
public void setMeshFileName(String meshFileName) {
this.meshFileName = meshFileName;
}
public void setMeshFilePath (String meshFilePath) {
this.meshFilePath = meshFilePath;
}
public void setExportIV(boolean exportIV) {
this.exportIV = exportIV;
}
public void setIVFileName(String ivFileName) {
this.ivFileName = ivFileName;
}
public void setIVFilePath (String ivFilePath) {
this.ivFilePath = ivFilePath;
}
public void setExportSTEP(boolean exportSTEP) {
this.exportSTEP = exportSTEP;
}
public void setSTEPFileName(String stepFileName) {
this.stepFileName = stepFileName;
}
public void setSTEPFilePath (String stepFilePath) {
this.stepFilePath = stepFilePath;
}
public void setExportCityGML(boolean exportCityGML) {
this.exportCityGML = exportCityGML;
}
public void setCityGMLFileName(String cityGMLFileName) {
this.cityGMLFileName = cityGMLFileName;
}
public void setCityGMLFilePath(String cityGMLFilePath) {
this.cityGMLFilePath = cityGMLFilePath;
}
public void setExportValidBuildingsOnly(boolean exportValidBuildingsOnly) {
this.exportValidBuildingsOnly = exportValidBuildingsOnly;
}
public void setMoveBuildingsToOrigin(boolean moveBuildingsToOrigin) {
this.moveBuildingsToOrigin = moveBuildingsToOrigin;
}
public void setExportIntermediateStagesComplete(boolean exportIntermediateStagesComplete) {
this.exportIntermediateStagesComplete = exportIntermediateStagesComplete;
}
public void setExportStepWithOneSolidPerBuilding(boolean oneSolidPerBuilding) {
this.oneSolidPerBuilding = oneSolidPerBuilding;
}
public void setMinDistToOrigin_X(double minDistToOrigin_X) {
this.minDistToOrigin_X = minDistToOrigin_X;
}
public void setMinDistToOrigin_Y(double minDistToOrigin_Y) {
this.minDistToOrigin_Y = minDistToOrigin_Y;
}
public void setMinDistToOrigin_Z(double minDistToOrigin_Z) {
this.minDistToOrigin_Z = minDistToOrigin_Z;
}
public boolean isExportMesh() {
return exportMesh;
}
public String getMeshFileName() {
return meshFileName;
}
public String getMeshFilePath () {
return meshFilePath;
}
public boolean isExportIV() {
return exportIV;
}
public String getIVFileName() {
return ivFileName;
}
public String getIVFilePath () {
return ivFilePath;
}
public boolean isExportSTEP() {
return exportSTEP;
}
public String getSTEPFileName() {
return stepFileName;
}
public String getSTEPFilePath () {
return stepFilePath;
}
public boolean isExportCityGML() {
return exportCityGML;
}
public String getCityGMLFileName() {
return cityGMLFileName;
}
public String getCityGMLFilePath() {
return cityGMLFilePath;
}
public boolean getExportValidBuildingsOnly() {
return exportValidBuildingsOnly;
}
public boolean getMoveBuildingsToOrigin() {
return moveBuildingsToOrigin;
}
public boolean getExportIntermediateStagesComplete() {
return exportIntermediateStagesComplete;
}
public boolean getExportStepWithOneSolidPerBuilding() {
return oneSolidPerBuilding;
}
public double getMinDistToOrigin_X() {
return minDistToOrigin_X;
}
public double getMinDistToOrigin_Y() {
return minDistToOrigin_Y;
}
public double getMinDistToOrigin_Z() {
return minDistToOrigin_Z;
}
}
package de.hft.stuttgart.citydoctor2.connect.edge;
import de.hft.stuttgart.citydoctor2.connect.edge.CppReferenceHandlingBase;
import de.hft.stuttgart.citydoctor2.connect.edge.NativePointerCastException;
public class AutoProSettingsGeneral extends CppReferenceHandlingBase {
private native long createCppClass(
boolean printBuildingInfo,
boolean printStatus,
boolean printSmallestAngle,
boolean printNumberOFSmallAngles,
double smallAngleTolerance,
boolean printShortestEdge,
boolean printNumberOfShortEdges,
double shortEdgesTolerance,
boolean printVolume,
boolean printNumberOfFacesAndVertices
)
throws OutOfMemoryError;
private native void disposeCppClass(long ptrToCppAutoPro)
throws NativePointerCastException;
private boolean printBuildingInfo;
private boolean printStatus;
private boolean printSmallestAngle;
private boolean printNumberOfSmallAngles;
private double smallAngleTolerance;
private boolean printShortestEdge;
private boolean printNumberOfShortEdges;
private double shortEdgesTolerance;
private boolean printVolume;
private boolean printNumberOfFacesAndVertices;
public AutoProSettingsGeneral() {
setPrintBuildingInfo(false);
setPrintStatus(false);
setPrintSmallestAngle(false);
setPrintNumberOfSmallAngles(false);
setSmallAngleTolerance(0.1);
setPrintShortestEdge(false);
setPrintNumberOfShortEdges(false);
setShortEdgesTolerance(0.1);
setPrintVolume(false);
setPrintNumberOfFacesAndVertices(false);
}
/**
* Creates an C++ feature object
*
* @throws IllegalStateException
* Thrown if the encapsulated "long-Pointer" isn't 0
* @throws NativeOutOfMemoryException
* If there is no more memory on the native side
*
* @see {@link disposeCppObject}
* @see de.hft.stuttgart.citydoctor.connect.edGe.CppReferenceHandlingBase#createCppObject()
*/
public void createCppObject() throws IllegalStateException,
OutOfMemoryError {
if (0L != ptrToCppObject) {
throw new IllegalStateException(
"Can't create new C++ object, there is allready one!");
}
// Maybe an exception is thrown
long tmpPointer = createCppClass(
isPrintBuildingInfo(),
isPrintStatus(),
isPrintSmallestAngle(),
isPrintNumberOfSmallAngles(),
getSmallAngleTolerance(),
isPrintShortestEdge(),
isPrintNumberOfShortEdges(),
getShortEdgesTolerance(),
isPrintVolume(),
isPrintNumberOfFacesAndVertices()
);
ptrToCppObject = tmpPointer;
}
@Override
public void disposeCppObject() throws NativePointerCastException {
if (0L != ptrToCppObject) {
disposeCppClass(ptrToCppObject);
ptrToCppObject = 0L;
}
}
public void setPrintBuildingInfo(boolean printBuildingInfo) {
this.printBuildingInfo = printBuildingInfo;
}
public void setPrintStatus(boolean printStatus) {
this.printStatus = printStatus;
}
public void setPrintSmallestAngle(boolean printSmallestAngle) {
this.printSmallestAngle = printSmallestAngle;
}
public void setPrintNumberOfSmallAngles(boolean printNumberOfSmallAngles) {
this.printNumberOfSmallAngles = printNumberOfSmallAngles;
}
public void setSmallAngleTolerance(double smallAngleTolerance) {
this.smallAngleTolerance = smallAngleTolerance;
}
public void setPrintShortestEdge(boolean printShortestEdge) {
this.printShortestEdge = printShortestEdge;
}
public void setPrintNumberOfShortEdges(boolean printNumberOfShortEdges) {
this.printNumberOfShortEdges = printNumberOfShortEdges;
}
public void setShortEdgesTolerance(double shortEdgesTolerance) {
this.shortEdgesTolerance = shortEdgesTolerance;
}
public void setPrintVolume(boolean printVolume) {
this.printVolume = printVolume;
}
public void setPrintNumberOfFacesAndVertices(boolean printNumberOfFacesAndVertices) {
this.printNumberOfFacesAndVertices = printNumberOfFacesAndVertices;
}
public boolean isPrintBuildingInfo() {
return printBuildingInfo;
}
public boolean isPrintStatus() {
return printStatus;
}
public boolean isPrintSmallestAngle() {
return printSmallestAngle;
}
public boolean isPrintNumberOfSmallAngles() {
return printNumberOfSmallAngles;
}
public double getSmallAngleTolerance() {
return smallAngleTolerance;
}
public boolean isPrintShortestEdge() {
return printShortestEdge;
}
public boolean isPrintNumberOfShortEdges() {
return printNumberOfShortEdges;
}
public double getShortEdgesTolerance() {
return shortEdgesTolerance;
}
public boolean isPrintVolume() {
return printVolume;
}
public boolean isPrintNumberOfFacesAndVertices() {
return printNumberOfFacesAndVertices;
}
}
package de.hft.stuttgart.citydoctor2.connect.edge;
import de.hft.stuttgart.citydoctor2.connect.edge.CppReferenceHandlingBase;
import de.hft.stuttgart.citydoctor2.connect.edge.NativePointerCastException;
public class AutoProSettingsMerge extends CppReferenceHandlingBase {
private native long createCppClass(
boolean useMerge,
boolean exportIntermediateStages,
boolean printMergeInfo,
double eps_PointEquality,
double eps_Parallelity
)
throws OutOfMemoryError;
private native void disposeCppClass(long ptrToCppAutoPro)
throws NativePointerCastException;
private boolean useMerge;
private boolean exportIntermediateStages;
private boolean printMergeInfo;
private double eps_PointEquality;
private double eps_Parallelity;
public AutoProSettingsMerge() {
setUseMerge(false);
setExportIntermediateStages(false);
setPrintMergeInfo(false);
setEps_PointEquality(0.01);
setEps_Parallelity(0.01);
}
/**
* Creates an C++ feature object
*
* @throws IllegalStateException
* Thrown if the encapsulated "long-Pointer" isn't 0
* @throws NativeOutOfMemoryException
* If there is no more memory on the native side
*
* @see {@link disposeCppObject}
* @see de.hft.stuttgart.citydoctor.connect.edGe.CppReferenceHandlingBase#createCppObject()
*/
public void createCppObject() throws IllegalStateException,
OutOfMemoryError {
if (0L != ptrToCppObject) {
throw new IllegalStateException(
"Can't create new C++ object, there is allready one!");
}
// Maybe an exception is thrown
long tmpPointer = createCppClass(
isUseMerge(),
isExportIntermediateStages(),
isPrintMergeInfo(),
getEps_PointEquality(),
getEps_Parallelity()
);
ptrToCppObject = tmpPointer;
}
@Override
public void disposeCppObject() throws NativePointerCastException {
if (0L != ptrToCppObject) {
disposeCppClass(ptrToCppObject);
ptrToCppObject = 0L;
}
}
public void setUseMerge(boolean useMerge) {
this.useMerge = useMerge;
}
public void setExportIntermediateStages(boolean exportIntermediateStages) {
this.exportIntermediateStages = exportIntermediateStages;
}
public void setPrintMergeInfo(boolean printMergeInfo) {
this.printMergeInfo = printMergeInfo;
}
public void setEps_PointEquality(double eps_PointEquality) {
this.eps_PointEquality = eps_PointEquality;
}
public void setEps_Parallelity(double eps_Parallelity) {
this.eps_Parallelity = eps_Parallelity;
}
public boolean isUseMerge() {
return useMerge;
}
public boolean isExportIntermediateStages() {
return exportIntermediateStages;
}
public boolean isPrintMergeInfo() {
return printMergeInfo;
}
public double getEps_PointEquality() {
return eps_PointEquality;
}
public double getEps_Parallelity() {
return eps_Parallelity;
}
}
/** --------------------------------------------------
* Hochschule fuer Technik Stuttgart
* Fachbereich Vermessung , Informatik und Mathematik
* Schellingstr . 24
* D - 70174 Stuttgart
*
* Projekt CityDoktor
*
* Copyright (c) 2011 HFT Stuttgart. All rights reserved.
* HFT Stuttgart and its licensors retain all intellectual property and
* proprietary rights in and to this software and related documentation.
* Any use, reproduction, disclosure, or distribution of this software
* and related documentation without an express license agreement from
* HFT Stuttgart is strictly prohibited.
*
* Please refer to the applicable HFT Stuttgart end user license agreement (EULA)
* associated with this source code for terms and conditions that govern
* your use of this HFT Stuttgart software.
*
* @author PiR
* @version 1.0
* created: 17.12.2017
*/
package de.hft.stuttgart.citydoctor2.gui;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSlider;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.filechooser.FileFilter;
import de.hft.stuttgart.citydoctor2.CppInitializer;
import de.hft.stuttgart.citydoctor2.connect.edge.AutoPro;
import de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsAdvancedSweep;
import de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsBool;
import de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsExport;
import de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsGeneral;
import de.hft.stuttgart.citydoctor2.connect.edge.AutoProSettingsMerge;
import de.hft.stuttgart.citydoctor2.connect.edge.CppFeature;
import de.hft.stuttgart.citydoctor2.connect.edge.CppHealResult;
import de.hft.stuttgart.citydoctor2.connect.edge.NativeException;
import de.hft.stuttgart.citydoctor2.connect.edge.NativePointerCastException;
//import de.hft.stuttgart.citydoctor2.CityDoctorDataStream;
//import de.hft.stuttgart.citydoctor2.CityDoctorValidationStreamLite;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
import de.hft.stuttgart.citydoctor2.datastructure.Installation;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingPart;
import de.hft.stuttgart.citydoctor2.datastructure.CityDoctorModel;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.Geometry;
import de.hft.stuttgart.citydoctor2.datastructure.Vertex;
class DoubleJSlider extends JSlider {
private static final long serialVersionUID = 1L;
final int scale;
public DoubleJSlider(int min, int max, int value, int scale) {
super(min, max, value);
this.scale = scale;
}
public double getScaledValue() {
return ((double)super.getValue()) / this.scale;
}
}
class FileInfo {
String filePath;
String fileName;
String fileType;
public FileInfo(String path, String name, String fileType) {
this.filePath = path;
this.fileName = name;
this.fileType = fileType;
}
public FileInfo() {
this.filePath = "";
this.fileName = "";
this.fileType = "";
}
public void setPath(String path) {
this.filePath = path;
}
public String getPath() {
return this.filePath;
}
public void setName(String name) {
this.fileName = name;
}
public String getName() {
return this.fileName;
}
public void setType(String fileType) {
this.fileType = fileType;
}
public String getType() {
return this.fileType;
}
public String getString() {
return this.filePath + this.fileName + this.fileType;
}
}
public class AutoProWindow extends JDialog implements ItemListener {
// Variable fuer Serialisierung
private static final long serialVersionUID = 2626132909887065227L;
JCheckBox MeshExportCheckBox;
private JTextField MeshExportTextField;
private JButton MeshExportJButton;
private FileInfo meshFileInfo = new FileInfo(".\\_meshFiles\\", "MeshObject", ".iv");
JCheckBox IVExportCheckBox;
private JTextField IVExportTextField;
private JButton IVExportJButton;
private FileInfo ivFileInfo = new FileInfo(".\\_ivFiles\\", "IVObject", ".iv");
JCheckBox STEPExportCheckBox;
private JTextField STEPExportTextField;
private JButton STEPExportJButton;
private FileInfo stepFileInfo = new FileInfo(".\\_stepFiles\\", "STEPObject", ".stp");
JCheckBox GMLExportCheckBox;
private JTextField GMLExportTextField;
private JButton GMLExportJButton;
private FileInfo gmlFileInfo = new FileInfo(".\\_gmlFiles\\", "CityGMLObject", ".gml");
JCheckBox exportValidBuildingsOnlyCheckBox;
JCheckBox moveBuildingBlockToOriginCheckBox;
JCheckBox exportIntermediateStagesCompleteCheckBox;
JCheckBox exportStepWithOneSolidPerBuilding;
double minDistToOrigin_X;
double minDistToOrigin_Y;
double minDistToOrigin_Z;
JCheckBox printBuildingInfoCheckBox;
JCheckBox printStatusCheckBox;
JCheckBox printAllCheckBox;
JCheckBox printSmallestAngleCheckBox;
JCheckBox printNumberOfSmallAnglesCheckBox;
JTextField smallAngleToleranceTextField;
double smallAngleTolerance;
JCheckBox printShortestEdgeCheckBox;
JCheckBox printNumberOfShortEdgesCheckBox;
JTextField shortEdgesToleranceTextField;
double shortEdgesTolerance;
JCheckBox printVolumeCheckBox;
JCheckBox printNumberOfFacesAndVerticesCheckBox;
JCheckBox boolCheckBox;
JCheckBox printBoolInfoCheckBox;
JCheckBox boolMinkowski_exportIntermediateStagesCheckBox;
JCheckBox minkowskiCheckBox;
JCheckBox printMinkowskiInfoCheckBox;
JLabel minkowskiCubeLabel;
DoubleJSlider minkowskiCubeSlider;
JTextField minkowskiCubeTextField;
JCheckBox rotateMinkowskiCube;
JCheckBox mergeCheckBox;
JCheckBox merge_exportIntermediateStagesCheckBox;
JCheckBox printMergeInfoCheckBox;
JLabel eps_PointEqualityLabel;
DoubleJSlider eps_PointEqualitySlider;
JTextField eps_PointEqualityTextField;
JLabel eps_ParallelityLabel;
DoubleJSlider eps_ParallelitySlider;
JTextField eps_ParallelityTextField;
JCheckBox advancedSweep_General_printInfoCheckBox;
JCheckBox advancedSweep_General_printFilterReasonInfoCheckBox;
JCheckBox advancedSweep_General_exportIntermediateStagesCheckBox;
JLabel advancedSweep_General_minEdgeLengthLabel;
DoubleJSlider advancedSweep_General_minEdgeLengthSlider;
JTextField advancedSweep_General_minEdgeLengthTextField;
JLabel advancedSweep_General_maxEdgeLengthLabel;
DoubleJSlider advancedSweep_General_maxEdgeLengthSlider;
JTextField advancedSweep_General_maxEdgeLengthTextField;
JLabel advancedSweep_General_minDistToSweepLabel;
DoubleJSlider advancedSweep_General_minDistToSweepSlider;
JTextField advancedSweep_General_minDistToSweepTextField;
JCheckBox advancedSweep_Planarity_Use_CheckBox;
JCheckBox advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox;
JLabel advancedSweep_Planarity_PlanarityTolerance_SweepLabel;
DoubleJSlider advancedSweep_Planarity_PlanarityTolerance_SweepSlider;
JTextField advancedSweep_Planarity_PlanarityTolerance_TextField;
JCheckBox advancedSweep_SweepPlane_Use_CheckBox;
JCheckBox advancedSweep_SweepPlane_PushOnly_CheckBox;
JCheckBox advancedSweep_SweepPlane_PullOnly_CheckBox;
JCheckBox advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox;
JCheckBox advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox;
JCheckBox advancedSweep_SweepPlane_SmallestDistFirst_CheckBox;
JCheckBox advancedSweep_SweepRotate_Use_CheckBox;
JLabel advancedSweep_SweepRotate_maxAngleLabel;
DoubleJSlider advancedSweep_SweepRotate_maxAngleSlider;
JTextField advancedSweep_SweepRotate_maxAngleTextField;
JCheckBox advancedSweep_SweepRotate_MinDistFirst_CheckBox;
JCheckBox advancedSweep_SweepRotate_MinAngleFirst_CheckBox;
JCheckBox advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox;
CityDoctorModel model;
private final int stdBtnHeight = 25;
private final int stdBtnWidth = 300;
// UV MinPoint als Attribut, da auch ausserhalb von setBuildigunstoOrigin darauf zugegriffen weden soll
Vertex minPoint;
private void doClicksLeft() // Method for preadjusting settings
{
IVExportCheckBox.doClick();
STEPExportCheckBox.doClick();
//exportValidBuildingsOnlyCheckBox.doClick();
moveBuildingBlockToOriginCheckBox.doClick();
//printBuildingInfoCheckBox.doClick();
printStatusCheckBox.doClick();
//printAllCheckBox.doClick();
//exportIntermediateStagesCompleteCheckBox.doClick();
}
private void doClicksRight() // Method for preadjusting settings
{
//boolCheckBox.doClick();
//minkowskiCheckBox.doClick();
mergeCheckBox.doClick();
//advancedSweep_Planarity_Use_CheckBox.doClick();
advancedSweep_SweepPlane_Use_CheckBox.doClick();
//advancedSweep_SweepRotate_Use_CheckBox.doClick();
//printBoolInfoCheckBox.doClick();
//printMinkowskiInfoCheckBox.doClick();
//printMergeInfoCheckBox.doClick();
//advancedSweep_General_printInfoCheckBox.doClick();
rotateMinkowskiCube.doClick();
//boolMinkowski_exportIntermediateStagesCheckBox.doClick();
//merge_exportIntermediateStagesCheckBox.doClick();
//advancedSweep_General_exportIntermediateStagesCheckBox.doClick();
//advancedSweep_General_printFilterReasonInfoCheckBox.doClick();
//advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox.doClick();
//advancedSweep_SweepPlane_PullOnly_CheckBox.doClick();
//advancedSweep_SweepPlane_PushOnly_CheckBox.doClick();
}
public AutoProWindow(CityDoctorModel model) {
CppInitializer.initCpp();
this.model = model;
// ##########################
// Einstellungen des Fensters
// ##########################
int width = 1000;
int height = 800;
this.setSize(width, height);
// das Fenster soll zentriert sein
int x = 0, y = 0;
// TODO : !!!
/*
if (mainWindow != null) {
x = ((mainWindow.getWidth() / 2) - (width / 2)) + mainWindow.getX();
y = ((mainWindow.getHeight() / 2) - (height / 2))
+ mainWindow.getY();
}
*/
this.setLocation(x, y);
this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
this.setTitle(CDAutoProGuiMessages
.getString("AutoProWindow.PreferencesWindowTitle")); //$NON-NLS-1$
this.setModal(true);
// -------------------------------------------------------------------------
// Das Fenster aus Splitter und Buttons zusammenbauen
Container contentPane = this.getContentPane();
contentPane.setLayout(new BorderLayout());
JPanel leftPanel = createLeftPanel();
contentPane.add(leftPanel, BorderLayout.WEST);
JPanel rightPanel = createRightPanel();
contentPane.add(rightPanel, BorderLayout.EAST);
JPanel bottomPanel = createBottomPanel();
contentPane.add(bottomPanel, BorderLayout.SOUTH);
}
/**
* Diese Methode schließt das Fenster.
*/
private void close() {
this.dispose();
}
/** @throws FileNotFoundException
*/
private void startCppAutoProMethods() throws FileNotFoundException {
List<Building> buildings = this.model.getBuildings();
List<Geometry> geometryList = getAllGeometriesOfSelectedBuildings(buildings);
setBuildingsToOrigin(geometryList);
AutoPro autopro = new AutoPro();
autopro.createCppObject();
// fill information for AutoProSettings
AutoProSettingsExport autoProSettingsExport = new AutoProSettingsExport();
autoProSettingsExport.setExportMesh(MeshExportCheckBox.isSelected());
autoProSettingsExport.setMeshFileName(meshFileInfo.getName());
autoProSettingsExport.setMeshFilePath(meshFileInfo.getPath());
autoProSettingsExport.setExportIV(IVExportCheckBox.isSelected());
autoProSettingsExport.setIVFileName(ivFileInfo.getName());
autoProSettingsExport.setIVFilePath(ivFileInfo.getPath());
autoProSettingsExport.setExportSTEP(STEPExportCheckBox.isSelected());
autoProSettingsExport.setSTEPFileName(stepFileInfo.getName());
autoProSettingsExport.setSTEPFilePath(stepFileInfo.getPath());
autoProSettingsExport.setExportCityGML(false/*GMLExportCheckBox.isSelected()*/);
autoProSettingsExport.setCityGMLFileName(gmlFileInfo.getName());
autoProSettingsExport.setCityGMLFilePath(gmlFileInfo.getPath());
autoProSettingsExport.setExportValidBuildingsOnly(exportValidBuildingsOnlyCheckBox.isSelected());
autoProSettingsExport.setMoveBuildingsToOrigin(moveBuildingBlockToOriginCheckBox.isSelected());
autoProSettingsExport.setExportIntermediateStagesComplete(exportIntermediateStagesCompleteCheckBox.isSelected());
autoProSettingsExport.setExportStepWithOneSolidPerBuilding(exportStepWithOneSolidPerBuilding.isSelected());
autoProSettingsExport.setMinDistToOrigin_X(minDistToOrigin_X);
autoProSettingsExport.setMinDistToOrigin_Y(minDistToOrigin_Y);
autoProSettingsExport.setMinDistToOrigin_Z(minDistToOrigin_Z);
autoProSettingsExport.createCppObject();
AutoProSettingsGeneral autoProSettingsGeneral = new AutoProSettingsGeneral();
autoProSettingsGeneral.setPrintBuildingInfo(printBuildingInfoCheckBox.isSelected());
autoProSettingsGeneral.setPrintStatus(printStatusCheckBox.isSelected());
autoProSettingsGeneral.setPrintSmallestAngle(printSmallestAngleCheckBox.isSelected());
autoProSettingsGeneral.setPrintNumberOfSmallAngles(printNumberOfSmallAnglesCheckBox.isSelected());
autoProSettingsGeneral.setSmallAngleTolerance(smallAngleTolerance);
autoProSettingsGeneral.setPrintShortestEdge(printShortestEdgeCheckBox.isSelected());
autoProSettingsGeneral.setPrintNumberOfShortEdges(printNumberOfShortEdgesCheckBox.isSelected());
autoProSettingsGeneral.setShortEdgesTolerance(shortEdgesTolerance);
autoProSettingsGeneral.setPrintVolume(printVolumeCheckBox.isSelected());
autoProSettingsGeneral.setPrintNumberOfFacesAndVertices(printNumberOfFacesAndVerticesCheckBox.isSelected());
autoProSettingsGeneral.createCppObject();
AutoProSettingsBool autoProSettingsBool = new AutoProSettingsBool();
autoProSettingsBool.setUseBool(boolCheckBox.isSelected());
autoProSettingsBool.setPrintBoolInfo(printBoolInfoCheckBox.isSelected());
autoProSettingsBool.setUseMinkowski(minkowskiCheckBox.isSelected());
autoProSettingsBool.setPrintMinkowskiInfo(printMinkowskiInfoCheckBox.isSelected());
autoProSettingsBool.setMinkowskiCubeSize(minkowskiCubeSlider.getScaledValue());
autoProSettingsBool.setExportIntermediateStages(boolMinkowski_exportIntermediateStagesCheckBox.isSelected());
autoProSettingsBool.setRotateMinkowskiCube(rotateMinkowskiCube.isSelected());
autoProSettingsBool.createCppObject();
AutoProSettingsMerge autoProSettingsMerge = new AutoProSettingsMerge();
autoProSettingsMerge.setUseMerge(mergeCheckBox.isSelected());
autoProSettingsMerge.setExportIntermediateStages(merge_exportIntermediateStagesCheckBox.isSelected());
autoProSettingsMerge.setPrintMergeInfo(printMergeInfoCheckBox.isSelected());
autoProSettingsMerge.setEps_PointEquality(eps_PointEqualitySlider.getScaledValue());
autoProSettingsMerge.setEps_Parallelity(eps_ParallelitySlider.getScaledValue());
autoProSettingsMerge.createCppObject();
AutoProSettingsAdvancedSweep autoProSettingsAdvancedSweep = new AutoProSettingsAdvancedSweep();
autoProSettingsAdvancedSweep.set_advancedSweep_General_printInfo( advancedSweep_General_printInfoCheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_General_printFilterReasonInfo( advancedSweep_General_printFilterReasonInfoCheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_General_exportIntermediateStages( advancedSweep_General_exportIntermediateStagesCheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_General_minEdgeLength( advancedSweep_General_minEdgeLengthSlider.getScaledValue());
autoProSettingsAdvancedSweep.set_advancedSweep_General_maxEdgeLength( advancedSweep_General_maxEdgeLengthSlider.getScaledValue());
autoProSettingsAdvancedSweep.set_advancedSweep_General_minDistToSweep( advancedSweep_General_minDistToSweepSlider.getScaledValue());
autoProSettingsAdvancedSweep.set_advancedSweep_Planarity_Use( advancedSweep_Planarity_Use_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_Planarity_IgnoreMultiplePoints( advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_Planarity_PlanarityTolerance( advancedSweep_Planarity_PlanarityTolerance_SweepSlider.getScaledValue());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepPlane_Use( advancedSweep_SweepPlane_Use_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepPlane_PushOnly( advancedSweep_SweepPlane_PushOnly_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepPlane_PullOnly( advancedSweep_SweepPlane_PullOnly_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepPlane_ShortestEdgeFirst( advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepPlane_SmallestFaceFirst( advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepPlane_SmallestDistFirst( advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepRotate_Use( advancedSweep_SweepRotate_Use_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepRotate_maxAngle( advancedSweep_SweepRotate_maxAngleSlider.getScaledValue());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepRotate_SmallestDistFirst( advancedSweep_SweepRotate_MinDistFirst_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepRotate_SmallestAngleFirst( advancedSweep_SweepRotate_MinAngleFirst_CheckBox.isSelected());
autoProSettingsAdvancedSweep.set_advancedSweep_SweepRotate_SmallestFaceFirst( advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.isSelected());
autoProSettingsAdvancedSweep.createCppObject();
// end fill information for AutoProSettings
System.out.println(" " + geometryList.size() + " geometry features counted");
List<CppFeature> features = new ArrayList<>();
for(Geometry geometry: geometryList)
{
try {
String gmlId_string = geometry.getGmlId().getGmlString();
CppFeature feature = new CppFeature( gmlId_string);
feature.setGeometry( geometry );
feature.setLoD(geometry.getLod());
features.add(feature);
autopro.ap_addFeature(feature);
} catch (IllegalStateException e) {
// Auto-generated catch block
e.printStackTrace();
} catch (NativePointerCastException e) {
// Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// Auto-generated catch block
e.printStackTrace();
} catch (NativeException e) {
// Auto-generated catch block
e.printStackTrace();
}
}
try {
autopro.ap_setSettingsExport(autoProSettingsExport);
autopro.ap_setSettingsGeneral(autoProSettingsGeneral);
autopro.ap_setSettingsBool(autoProSettingsBool);
autopro.ap_setSettingsMerge(autoProSettingsMerge);
autopro.ap_setSettingsAdvancedSweep(autoProSettingsAdvancedSweep);
//autopro.ap_setSettings(autoProSettings);
autopro.ap_applyAutoProMethods();
Map<String, Geometry> geometryMap = new HashMap<>();
for (Geometry geom : geometryList) {
geometryMap.put(geom.getGmlId().getGmlString(), geom);
}
for (CppFeature feature : features) {
long healResult = autopro.ap_getHealResult(feature);
//long healResult = feature.getHealResult();
if (healResult == 0) {
feature.disposeCppObject();
continue;
}
System.out.println("merge changes into geometry ");
CppHealResult res = new CppHealResult(healResult);
String gmlId = feature.getType();
Geometry geometry = geometryMap.get(gmlId);
res.mergeIntoGeometry(geometry);
if (geometry.getPolygons().isEmpty()) {
CityObject parent = geometry.getParent();
parent.getGeometries().remove(geometry);
if (parent instanceof BuildingPart && parent.getGeometries().isEmpty()) {
BuildingPart part = (BuildingPart) parent;
Building building = part.getParent();
building.getBuildingParts().remove(part);
if (building.getBuildingParts().isEmpty() && building.getGeometries().isEmpty()) {
model.getBuildings().remove(building);
}
} else if (parent instanceof Building && parent.getGeometries().isEmpty()) {
Building building = (Building) parent;
if (building.getBuildingParts().isEmpty()) {
model.getBuildings().remove(building);
}
}
}
feature.disposeCppObject();
}
autopro.disposeCppObject();
} catch (IllegalStateException e) {
// Auto-generated catch block
e.printStackTrace();
} catch (NativePointerCastException e) {
// Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// Auto-generated catch block
e.printStackTrace();
} catch (NativeException e) {
// Auto-generated catch block
e.printStackTrace();
}
// UV
// Hier ist der Step-Export abgeschlossen
// Translationsvektor an die Datei STEPObject_End.stp anhängen
//System.out.println("Translationsvektor " + minPoint.getX()+ " " + minPoint.getY() + " " +minPoint.getZ());
String text = "/*" + "Translationsvektor " + minPoint.getX()+ " " + minPoint.getY() + " " +minPoint.getZ() + "*/";
String destination = stepFileInfo.getPath() +"STEPObject_End.stp";
//System.out.println(destination);
try {
FileWriter fw = new FileWriter(destination, true); // true: öffnen zum Anhängen von weiteren Zeilen
BufferedWriter ausgabe = new BufferedWriter(fw);
ausgabe.write(text);
ausgabe.newLine();
ausgabe.close();
} catch (IOException e1) {
System.out.println("Couldn't open "+ destination);
}
}
private void setBuildingsToOrigin(List<Geometry> geometryList)
{
//UV
//Vertex minPoint = new Vertex(Double.MAX_VALUE ,Double.MAX_VALUE ,Double.MAX_VALUE , false);
// Jetzt als Attribut der Klasse
minPoint = new Vertex(Double.MAX_VALUE ,Double.MAX_VALUE ,Double.MAX_VALUE);
minDistToOrigin_X = Double.MAX_VALUE;
minDistToOrigin_Y = Double.MAX_VALUE;
minDistToOrigin_Z = Double.MAX_VALUE;
for(Geometry geometry: geometryList)
{
Collection<Vertex> vertexCollection = geometry.getVertices();
for (Vertex vertex : vertexCollection) {
if (minPoint.getX() > vertex.getX())
{
minPoint.setX(vertex.getX());
minDistToOrigin_X = vertex.getX();
}
if (minPoint.getY() > vertex.getY())
{
minPoint.setY(vertex.getY());
minDistToOrigin_Y = vertex.getY();
}
if (minPoint.getZ() > vertex.getZ())
{
minPoint.setZ(vertex.getZ());
minDistToOrigin_Z = vertex.getZ();
}
}
}
// UV 200609
// Ausgabe Translationsvektor
// System.out.println("Translationsvektor " + minPoint.getX()+ " " + minPoint.getY() + " " +minPoint.getZ());
//
for(Geometry geometry: geometryList)
{
Collection<Vertex> vertexCollection = geometry.getVertices();
for (Vertex vertex : vertexCollection) {
vertex.setX(vertex.getX()-minPoint.getX());
vertex.setY(vertex.getY()-minPoint.getY());
vertex.setZ(vertex.getZ()-minPoint.getZ());
}
}
}
private List<Geometry> getAllGeometriesOfSelectedBuildings(List<Building> buildings)
{
List<Geometry> geometryList = new ArrayList<Geometry>();
for (Building building : buildings)
{
if (0 != building.getGeometries().size() )
{
for(Geometry geometry : building.getGeometries())
{
Geometry geometryCopy = geometry;
geometryCopy.setGmlId(building.getGmlId());
geometryList.add(geometryCopy);
}
}
else if(0 != building.getBuildingParts().size())
{
for(BuildingPart buildingPart: building.getBuildingParts())
{
for(Geometry geometry : buildingPart.getGeometries())
{
Geometry geometryCopy = geometry;
geometryCopy.setGmlId(buildingPart.getGmlId());
geometryList.add(geometryCopy);
}
}
}
else if(0 != building.getBuildingInstallations().size())
{
for(Installation buildingInstallation: building.getBuildingInstallations())
{
for(Geometry geometry : buildingInstallation.getGeometries())
{
Geometry geometryCopy = geometry;
geometryCopy.setGmlId(buildingInstallation.getGmlId());
geometryList.add(geometryCopy);
}
}
}
else
{
System.out.println("WARNING : start : no GeometryList for this Building");
}
}
return geometryList;
}
private JPanel createLeftPanel() {
JPanel panel = new JPanel();
panel.setAlignmentX(TOP_ALIGNMENT);
// create panels
JPanel exportMeshPanel = createExportMeshPanel();
JPanel exportIVPanel = createExportIVPanel();
JPanel exportSTEPPanel = createExportSTEPPanel();
JPanel exportGMLPanel = createExportGMLPanel();
JPanel exportSettingsPanel = createExportSettingsPanel();
JPanel printInfoPanel = createPrintInfoPanel();
JPanel comparisonPanel = createComparisonPanel();
doClicksLeft();
// create layout
GridBagLayout gbl = new GridBagLayout();
panel.setLayout(gbl);
// anchor the panel in the top left corner
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
c.anchor = GridBagConstraints.FIRST_LINE_START;
// create some distance to the panel above and below
c.insets = new Insets(10, 0, 10, 0);
c.gridx = 0;
c.gridy = 1;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(exportMeshPanel, c);
c.gridx = 0;
c.gridy = 2;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(exportIVPanel, c);
c.gridx = 0;
c.gridy = 3;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(exportSTEPPanel, c);
/*
c.gridx = 0;
c.gridy = 4;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(exportGMLPanel, c);
*/
c.gridx = 0;
c.gridy = 5;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(exportSettingsPanel, c);
c.gridx = 0;
c.gridy = 6;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(printInfoPanel, c);
c.gridx = 0;
c.gridy = 7;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(comparisonPanel, c);
return panel;
}
private JPanel createRightPanel() {
JPanel panel = new JPanel();
panel.setAlignmentX(TOP_ALIGNMENT);
panel.setAlignmentY(LEFT_ALIGNMENT);
// create panels
JPanel useBoolPanel = createBoolPanel();
JPanel useMergePanel = createMergePanel();
JPanel useAdvancedSweepPanel_General = createAdvancedSweepPanel_General();
JPanel useAdvancedSweepPanel_Planarity = createAdvancedSweepPanel_Planarity();
JPanel useAdvancedSweepPanel_SweepPlane = createAdvancedSweepPanel_SweepPlane();
JPanel useAdvancedSweepPanel_SweepRotate = createAdvancedSweepPanel_SweepRotate();
doClicksRight();
// create layout
GridBagLayout gbl = new GridBagLayout();
panel.setLayout(gbl);
// anchor the panel in the top left corner
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
c.anchor = GridBagConstraints.FIRST_LINE_START;
// create some distance to the panel above and below
c.insets = new Insets(10, 0, 10, 0);
c.gridx = 0;
c.gridy = 1;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(useBoolPanel, c);
c.gridx = 0;
c.gridy = 2;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(useMergePanel, c);
/*
c.gridx = 0;
c.gridy = 3;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(useSweepPlanePanel, c);
*/
c.gridx = 0;
c.gridy = 5;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(useAdvancedSweepPanel_General, c);
c.gridx = 0;
c.gridy = 6;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(useAdvancedSweepPanel_Planarity, c);
c.gridx = 0;
c.gridy = 7;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(useAdvancedSweepPanel_SweepPlane, c);
c.gridx = 0;
c.gridy = 8;
// create some distance to the panel below
c.insets = new Insets(0, 0, 10, 0);
panel.add(useAdvancedSweepPanel_SweepRotate, c);
return panel;
}
private JPanel createBottomPanel() {
JPanel panel = new JPanel();
panel.setAlignmentX(TOP_ALIGNMENT);
panel.setAlignmentY(LEFT_ALIGNMENT);
// create panels
JPanel executeButtonPanel = createExecuteButtonPanel();
// create layout
GridBagLayout gbl = new GridBagLayout();
panel.setLayout(gbl);
// anchor the panel in the top left corner
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
c.anchor = GridBagConstraints.FIRST_LINE_START;
// create some distance to the panel above and below
c.insets = new Insets(10, 0, 10, 0);
c.gridx = 0;
c.gridy = 1;
c.insets = new Insets(0, 0, 0, 0);
panel.add(executeButtonPanel, c);
return panel;
}
private JPanel createExportMeshPanel() {
// panel with surrounding border
JPanel exportMeshPanel = new JPanel();
exportMeshPanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.exportMeshPanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// Mesh Export Check Box
// --------------------------------------------------------------------
MeshExportCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.exportMeshButtonTitle"));
MeshExportCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.exportMeshButtonDescription"));
MeshExportCheckBox.setSelected(false);
MeshExportCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
MeshExportTextField.setEnabled(true);
MeshExportJButton.setEnabled(true);
} else {
MeshExportTextField.setEnabled(false);
MeshExportJButton.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// optional filename text field
// --------------------------------------------------------------------
MeshExportTextField = new JTextField();
MeshExportTextField
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.meshExportFileNameDescription"));
MeshExportTextField.setText(meshFileInfo.getString());
MeshExportTextField.setEnabled(false);
MeshExportTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
MeshExportTextField.setText(" Please Use The Button on the right ->");
}
}
});
// --------------------------------------------------------------------
// optional file search button
// --------------------------------------------------------------------
MeshExportJButton = new JButton("Set Path and Name");
MeshExportJButton
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.meshExportPathDescription"));
MeshExportJButton.setEnabled(false);
MeshExportJButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
meshFileInfo = saveFileDialog(
".iv",
"IV (*.iv)",
"Speicher Mesh unter ...");
if (null != meshFileInfo.getPath()) {
MeshExportTextField.setText(meshFileInfo.getString());
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(exportMeshPanel);
exportMeshPanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout
.createSequentialGroup()
.addGap(7)
// make the left side of the component align the buttons of the
// above check related panel
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(MeshExportCheckBox))
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(MeshExportTextField))
.addGap(10)
// pushes the file searchbuttons away
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(MeshExportJButton)).addGap(10));
panelLayout.setVerticalGroup(panelLayout
.createSequentialGroup()
.addGap(10)
// get some space between border and components
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.BASELINE)
.addComponent(MeshExportCheckBox)
.addComponent(MeshExportTextField)
.addComponent(MeshExportJButton))
);
return exportMeshPanel;
}
private JPanel createExportIVPanel() {
// panel with surrounding border
JPanel exportIVPanel = new JPanel();
exportIVPanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.exportIVPanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// IV Export Check Box
// --------------------------------------------------------------------
IVExportCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.exportIVButtonTitle"));
IVExportCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.exportIVButtonDescription"));
IVExportCheckBox.setSelected(false);
IVExportCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
IVExportTextField.setEnabled(true);
IVExportJButton.setEnabled(true);
} else {
IVExportTextField.setEnabled(false);
IVExportJButton.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// optional filename text field
// --------------------------------------------------------------------
IVExportTextField = new JTextField();
IVExportTextField
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.ivExportFileNameDescription"));
IVExportTextField.setText(ivFileInfo.getString());
IVExportTextField.setEnabled(false);
IVExportTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
IVExportTextField.setText(" Please Use The Button on the right ->");
}
}
});
// --------------------------------------------------------------------
// optional file search button
// --------------------------------------------------------------------
IVExportJButton = new JButton("Set Path and Name");
IVExportJButton
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.ivExportPathDescription"));
IVExportJButton.setEnabled(false);
IVExportJButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ivFileInfo = saveFileDialog(
".iv",
"IV (*.iv)",
"Speicher BRep Modell unter ...");
if (null != ivFileInfo.getPath()) {
IVExportTextField.setText(ivFileInfo.getString());
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(exportIVPanel);
exportIVPanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout
.createSequentialGroup()
.addGap(7)
// make the left side of the component align the buttons of the
// above check related panel
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(IVExportCheckBox))
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(IVExportTextField))
.addGap(10)
// pushes the file searchbuttons away
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(IVExportJButton)).addGap(10));
panelLayout.setVerticalGroup(panelLayout
.createSequentialGroup()
.addGap(10)
// get some space between border and components
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.BASELINE)
.addComponent(IVExportCheckBox)
.addComponent(IVExportTextField)
.addComponent(IVExportJButton))
);
return exportIVPanel;
}
private JPanel createExportSTEPPanel() {
// panel with surrounding border
JPanel exportSTEPPanel = new JPanel();
exportSTEPPanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.exportSTEPPanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// STEP Export Check Box
// --------------------------------------------------------------------
STEPExportCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.exportSTEPButtonTitle"));
STEPExportCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.exportSTEPButtonDescription"));
STEPExportCheckBox.setSelected(false);
STEPExportCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
STEPExportTextField.setEnabled(true);
STEPExportJButton.setEnabled(true);
} else {
STEPExportTextField.setEnabled(false);
STEPExportJButton.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// optional filename text field
// --------------------------------------------------------------------
STEPExportTextField = new JTextField();
STEPExportTextField
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.stepExportFileNameDescription"));
STEPExportTextField.setText(stepFileInfo.getString());
STEPExportTextField.setEnabled(false);
STEPExportTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
STEPExportTextField.setText(" Please Use The Button on the right ->");
}
}
});
// --------------------------------------------------------------------
// optional file search button
// --------------------------------------------------------------------
STEPExportJButton = new JButton("Set Path and Name");
STEPExportJButton
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.stepExportPathDescription"));
STEPExportJButton.setEnabled(false);
STEPExportJButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stepFileInfo = saveFileDialog(
".stp",
"STEP (*.stp)",
"Speicher STEP Modell unter ...");
if (null != stepFileInfo.getPath()) {
STEPExportTextField.setText(stepFileInfo.getString());
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(exportSTEPPanel);
exportSTEPPanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout
.createSequentialGroup()
.addGap(7)
// make the left side of the component align the buttons of the
// above check related panel
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(STEPExportCheckBox))
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(STEPExportTextField))
.addGap(10)
// pushes the file searchbuttons away
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(STEPExportJButton)).addGap(10));
panelLayout.setVerticalGroup(panelLayout
.createSequentialGroup()
.addGap(10)
// get some space between border and components
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.BASELINE)
.addComponent(STEPExportCheckBox)
.addComponent(STEPExportTextField)
.addComponent(STEPExportJButton))
);
return exportSTEPPanel;
}
private JPanel createExportGMLPanel() {
// panel with surrounding border
JPanel exportGMLPanel = new JPanel();
exportGMLPanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.exportGMLPanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// cityGML Export Check Box
// --------------------------------------------------------------------
GMLExportCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.exportGMLButtonTitle"));
GMLExportCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.exportGMLButtonDescription"));
GMLExportCheckBox.setSelected(false);
GMLExportCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
GMLExportTextField.setEnabled(true);
GMLExportJButton.setEnabled(true);
} else {
GMLExportTextField.setEnabled(false);
GMLExportJButton.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// optional filename text field
// --------------------------------------------------------------------
GMLExportTextField = new JTextField();
GMLExportTextField
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.gmlExportFileNameDescription"));
GMLExportTextField.setText(gmlFileInfo.getString());
GMLExportTextField.setEnabled(false);
GMLExportTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
GMLExportTextField.setText(" Please Use The Button on the right ->");
}
}
});
// --------------------------------------------------------------------
// optional file search button
// --------------------------------------------------------------------
GMLExportJButton = new JButton("Set Path and Name");
GMLExportJButton
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.gmlExportPathDescription"));
GMLExportJButton.setEnabled(false);
GMLExportJButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
gmlFileInfo = saveFileDialog(
".gml",
"GML (*.gml)",
"Speicher CityGML Modell unter ...");
if (null != gmlFileInfo.getPath()) {
GMLExportTextField.setText(gmlFileInfo.getString());
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(exportGMLPanel);
exportGMLPanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout
.createSequentialGroup()
.addGap(7)
// make the left side of the component align the buttons of the
// above check related panel
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(GMLExportCheckBox))
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(GMLExportTextField))
.addGap(10)
// pushes the file searchbuttons away
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.LEADING)
.addComponent(GMLExportJButton)).addGap(10));
panelLayout.setVerticalGroup(panelLayout
.createSequentialGroup()
.addGap(10)
// get some space between border and components
.addGroup(
panelLayout
.createParallelGroup(
GroupLayout.Alignment.BASELINE)
.addComponent(GMLExportCheckBox)
.addComponent(GMLExportTextField)
.addComponent(GMLExportJButton))
);
return exportGMLPanel;
}
private JPanel createExportSettingsPanel() {
// panel with surrounding border
JPanel exportSettingsPanel = new JPanel();
exportSettingsPanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.exportSettingsPanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// create export only valid buildings Check Box
// --------------------------------------------------------------------
exportValidBuildingsOnlyCheckBox = new JCheckBox("valid only");
exportValidBuildingsOnlyCheckBox.setToolTipText("export only valid buildings");
exportValidBuildingsOnlyCheckBox.setEnabled(true);
// --------------------------------------------------------------------
// create move buildings to Origin Check Box
// --------------------------------------------------------------------
moveBuildingBlockToOriginCheckBox = new JCheckBox("move Building to Origin");
moveBuildingBlockToOriginCheckBox.setToolTipText("move Building to Origin");
moveBuildingBlockToOriginCheckBox.setEnabled(true);
// --------------------------------------------------------------------
// create export intermediate stages Check Box
// --------------------------------------------------------------------
exportIntermediateStagesCompleteCheckBox = new JCheckBox("export Intermediate Stages");
exportIntermediateStagesCompleteCheckBox.setToolTipText("export Intermediate Stages ");
exportIntermediateStagesCompleteCheckBox.setEnabled(true);
exportIntermediateStagesCompleteCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
} else {
advancedSweep_General_exportIntermediateStagesCheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create export intermediate stages Check Box
// --------------------------------------------------------------------
exportStepWithOneSolidPerBuilding = new JCheckBox("One Solid Per Building");
exportStepWithOneSolidPerBuilding.setToolTipText("export Step Files with one Solid per Building");
exportStepWithOneSolidPerBuilding.setEnabled(true);
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(exportSettingsPanel);
exportSettingsPanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(exportValidBuildingsOnlyCheckBox)
.addComponent(moveBuildingBlockToOriginCheckBox)
.addComponent(exportIntermediateStagesCompleteCheckBox)
.addComponent(exportStepWithOneSolidPerBuilding)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(exportValidBuildingsOnlyCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(moveBuildingBlockToOriginCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(exportIntermediateStagesCompleteCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(exportStepWithOneSolidPerBuilding)
)
);
return exportSettingsPanel;
}
private JPanel createPrintInfoPanel() {
// panel with surrounding border
JPanel printInfoPanel = new JPanel();
printInfoPanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.printInfoPanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// create Check Box and TextFields
// --------------------------------------------------------------------
printBuildingInfoCheckBox = new JCheckBox("Print Building");
printBuildingInfoCheckBox.setToolTipText("Print Building");
printBuildingInfoCheckBox.setEnabled(true);
printStatusCheckBox = new JCheckBox("Print Status");
printStatusCheckBox.setToolTipText("Print Status");
printStatusCheckBox.setEnabled(true);
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(printInfoPanel);
printInfoPanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printBuildingInfoCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printStatusCheckBox)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printBuildingInfoCheckBox)
.addComponent(printStatusCheckBox)
)
);
return printInfoPanel;
}
private JPanel createComparisonPanel() {
// panel with surrounding border
JPanel comparisonPanel = new JPanel();
comparisonPanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.comparisonPanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// create Check Box and TextFields
// --------------------------------------------------------------------
printAllCheckBox = new JCheckBox("Print all");
printAllCheckBox.setToolTipText("Print all");
printAllCheckBox.setEnabled(true);
printAllCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
printSmallestAngleCheckBox.setSelected(true);
printNumberOfSmallAnglesCheckBox.setSelected(true);
printShortestEdgeCheckBox.setSelected(true);
printNumberOfShortEdgesCheckBox.setSelected(true);
printVolumeCheckBox.setSelected(true);
printNumberOfFacesAndVerticesCheckBox.setSelected(true);
} else {
printSmallestAngleCheckBox.setSelected(false);
printNumberOfSmallAnglesCheckBox.setSelected(false);
printShortestEdgeCheckBox.setSelected(false);
printNumberOfShortEdgesCheckBox.setSelected(false);
printVolumeCheckBox.setSelected(false);
printNumberOfFacesAndVerticesCheckBox.setSelected(false);
}
}
});
printSmallestAngleCheckBox = new JCheckBox("Print smallest angle");
printSmallestAngleCheckBox.setToolTipText("Print smallest angle between two edges to JAVA console");
printSmallestAngleCheckBox.setEnabled(true);
printNumberOfSmallAnglesCheckBox = new JCheckBox("Print number of small angles");
printNumberOfSmallAnglesCheckBox.setToolTipText("Print number of small angles to JAVA console");
printNumberOfSmallAnglesCheckBox.setEnabled(true);
final DecimalFormat dfSmallAngleTol = new DecimalFormat("0.###");
smallAngleTolerance = 10;
smallAngleToleranceTextField = new JTextField();
smallAngleToleranceTextField.setToolTipText("angles between two edges smaller than this value (angle in degrees) are printed to JAVA console (DON'T FORGET TO PRESS ENTER)");
smallAngleToleranceTextField.setEnabled(true);
smallAngleToleranceTextField.setText(dfSmallAngleTol.format(smallAngleTolerance));
smallAngleToleranceTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = smallAngleToleranceTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed);
smallAngleTolerance = value;
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'));
smallAngleTolerance = value;
return;
}
else
{
return;
}
}
}
});
printShortestEdgeCheckBox = new JCheckBox("Print shortest edge");
printShortestEdgeCheckBox.setToolTipText("Print shortest edge to Java console");
printShortestEdgeCheckBox.setEnabled(true);
printNumberOfShortEdgesCheckBox = new JCheckBox("Print number of short edges");
printNumberOfShortEdgesCheckBox.setToolTipText("Print number of short edges to JAVA console");
printNumberOfShortEdgesCheckBox.setEnabled(true);
final DecimalFormat dfShortEdgeTol = new DecimalFormat("0.###");
shortEdgesTolerance = 2.0;
shortEdgesToleranceTextField = new JTextField();
shortEdgesToleranceTextField.setToolTipText("edges smaller than this value (size in meter) are printed to JAVA console (DON'T FORGET TO PRESS ENTER)");
shortEdgesToleranceTextField.setEnabled(true);
shortEdgesToleranceTextField.setText(dfShortEdgeTol.format(shortEdgesTolerance));
shortEdgesToleranceTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = shortEdgesToleranceTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed);
shortEdgesTolerance = value;
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'));
shortEdgesTolerance = value;
return;
}
else
{
return;
}
}
}
});
printVolumeCheckBox = new JCheckBox("Print volume");
printVolumeCheckBox.setToolTipText("Print volume of building(s) to JAVA console");
printVolumeCheckBox.setEnabled(true);
printNumberOfFacesAndVerticesCheckBox = new JCheckBox("Print number of faces and vertices ");
printNumberOfFacesAndVerticesCheckBox.setToolTipText("Print the number of faces and vertices for each building before and after the simplification");
printNumberOfFacesAndVerticesCheckBox.setEnabled(true);
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(comparisonPanel);
comparisonPanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printAllCheckBox)
.addComponent(printSmallestAngleCheckBox)
.addComponent(printShortestEdgeCheckBox)
.addComponent(printVolumeCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
//.addComponent(NULL)
.addComponent(printNumberOfSmallAnglesCheckBox)
.addComponent(printNumberOfShortEdgesCheckBox)
.addComponent(printNumberOfFacesAndVerticesCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
//.addComponent(NULL)
.addComponent(smallAngleToleranceTextField)
.addComponent(shortEdgesToleranceTextField)
//.addComponent(NULL)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printAllCheckBox)
//.addComponent(NULL)
//.addComponent(NULL)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printSmallestAngleCheckBox)
.addComponent(printNumberOfSmallAnglesCheckBox)
.addComponent(smallAngleToleranceTextField)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printShortestEdgeCheckBox)
.addComponent(printNumberOfShortEdgesCheckBox)
.addComponent(shortEdgesToleranceTextField)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printVolumeCheckBox)
.addComponent(printNumberOfFacesAndVerticesCheckBox)
//.addComponent(NULL)
)
);
return comparisonPanel;
}
private JPanel createBoolPanel() {
// panel with surrounding border
JPanel boolPanel = new JPanel();
boolPanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.boolPanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// use bool Check Box
// --------------------------------------------------------------------
boolCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.boolButtonTitle"));
boolCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.boolButtonDescription"));
boolCheckBox.setSelected(false);
boolCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
printBoolInfoCheckBox.setEnabled(true);
} else {
printBoolInfoCheckBox.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// print bool info Check Box
// --------------------------------------------------------------------
printBoolInfoCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.boolInfoButtonTitle"));
printBoolInfoCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.boolInfoButtonDescription"));
printBoolInfoCheckBox.setSelected(false);
printBoolInfoCheckBox.setEnabled(false);
// --------------------------------------------------------------------
// use minkowski Check Box
// --------------------------------------------------------------------
minkowskiCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.minkowskiButtonTitle"));
minkowskiCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.minkowskiButtonDescription"));
minkowskiCheckBox.setSelected(false);
minkowskiCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
printMinkowskiInfoCheckBox.setEnabled(true);
minkowskiCubeLabel.setEnabled(true);
minkowskiCubeSlider.setEnabled(true);
minkowskiCubeTextField.setEnabled(true);
rotateMinkowskiCube.setEnabled(true);
} else {
printMinkowskiInfoCheckBox.setEnabled(false);
minkowskiCubeLabel.setEnabled(false);
minkowskiCubeSlider.setEnabled(false);
minkowskiCubeTextField.setEnabled(false);
rotateMinkowskiCube.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// print minkowski info Check Box
// --------------------------------------------------------------------
printMinkowskiInfoCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.minkowskiInfoButtonTitle"));
printMinkowskiInfoCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.minkowskiInfoButtonDescription"));
printMinkowskiInfoCheckBox.setSelected(false);
printMinkowskiInfoCheckBox.setEnabled(false);
// --------------------------------------------------------------------
// minkowskiCubeSize label, slider and text field
// --------------------------------------------------------------------
minkowskiCubeLabel = new JLabel("minkowskiCube Size");
minkowskiCubeLabel.setEnabled(false);
final DecimalFormat dfMinkowskiCube = new DecimalFormat("0.#");
minkowskiCubeSlider = new DoubleJSlider(1, 50, 20, 10);
minkowskiCubeSlider.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.minkowskiCubeSliderDescription"));
minkowskiCubeSlider.setMinorTickSpacing(10);
minkowskiCubeSlider.setPaintTicks(true);
minkowskiCubeSlider.setEnabled(false);
minkowskiCubeTextField = new JTextField();
minkowskiCubeTextField
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.minkowskiCubeDescription"));
minkowskiCubeTextField.setEnabled(false);
minkowskiCubeTextField.setText(dfMinkowskiCube.format(minkowskiCubeSlider.getScaledValue()));
minkowskiCubeSlider.addChangeListener(new ChangeListener(){
@Override
public void stateChanged(ChangeEvent e) {
minkowskiCubeTextField.setText(dfMinkowskiCube.format(minkowskiCubeSlider.getScaledValue()));
}
});
minkowskiCubeTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = minkowskiCubeTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed)*minkowskiCubeSlider.scale;
minkowskiCubeSlider.setValue((int)value);
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'))*minkowskiCubeSlider.scale;
minkowskiCubeSlider.setValue((int)value);
return;
}
else
{
return;
}
}
}
});
// --------------------------------------------------------------------
// export intermediate stages Check Box
// --------------------------------------------------------------------
boolMinkowski_exportIntermediateStagesCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.boolMinkowski_exportIntermediateStagesCheckBoxButtonTitle"));
boolMinkowski_exportIntermediateStagesCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.boolMinkowski_exportIntermediateStagesCheckBoxButtonDescription"));
// --------------------------------------------------------------------
// rotate Minkowski Cube Check Box
// --------------------------------------------------------------------
rotateMinkowskiCube = new JCheckBox("rotateMinkowskiCube");
rotateMinkowskiCube.setToolTipText("rotates the Minkowski-Cube corresponding to the biggest wallface if selcted");
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(boolPanel);
boolPanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(boolCheckBox)
.addComponent(minkowskiCheckBox)
.addComponent(minkowskiCubeLabel)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(boolMinkowski_exportIntermediateStagesCheckBox)
.addComponent(rotateMinkowskiCube)
.addComponent(minkowskiCubeSlider)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printBoolInfoCheckBox)
.addComponent(printMinkowskiInfoCheckBox)
.addComponent(minkowskiCubeTextField)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(boolCheckBox)
.addComponent(boolMinkowski_exportIntermediateStagesCheckBox)
.addComponent(printBoolInfoCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(minkowskiCheckBox)
.addComponent(rotateMinkowskiCube)
.addComponent(printMinkowskiInfoCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(minkowskiCubeLabel)
.addComponent(minkowskiCubeSlider)
.addComponent(minkowskiCubeTextField)
)
);
return boolPanel;
}
private JPanel createMergePanel() {
// panel with surrounding border
JPanel mergePanel = new JPanel();
mergePanel.setBorder(createTitledBorder(CDAutoProGuiMessages
.getString("AutoProWindow.mergePanel")));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// use merge Check Box
// --------------------------------------------------------------------
mergeCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.mergeButtonTitle"));
mergeCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.mergeButtonDescription"));
mergeCheckBox.setSelected(false);
mergeCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
printMergeInfoCheckBox.setEnabled(true);
merge_exportIntermediateStagesCheckBox.setEnabled(true);
eps_PointEqualityLabel.setEnabled(true);
eps_PointEqualitySlider.setEnabled(true);
eps_PointEqualityTextField.setEnabled(true);
eps_ParallelityLabel.setEnabled(true);
eps_ParallelitySlider.setEnabled(true);
eps_ParallelityTextField.setEnabled(true);
} else {
printMergeInfoCheckBox.setEnabled(false);
merge_exportIntermediateStagesCheckBox.setEnabled(false);
eps_PointEqualityLabel.setEnabled(false);
eps_PointEqualitySlider.setEnabled(false);
eps_PointEqualityTextField.setEnabled(false);
eps_ParallelityLabel.setEnabled(false);
eps_ParallelitySlider.setEnabled(false);
eps_ParallelityTextField.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// export intermediate stages Check Box
// --------------------------------------------------------------------
merge_exportIntermediateStagesCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.merge_exportIntermediateStagesCheckBoxButtonTitle"));
merge_exportIntermediateStagesCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.merge_exportIntermediateStagesCheckBoxButtonDescription"));
merge_exportIntermediateStagesCheckBox.setEnabled(false);
// --------------------------------------------------------------------
// print merge info Check Box
// --------------------------------------------------------------------
printMergeInfoCheckBox = new JCheckBox(
CDAutoProGuiMessages.getString("AutoProWindow.mergeInfoButtonTitle"));
printMergeInfoCheckBox.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.mergeInfoButtonDescription"));
printMergeInfoCheckBox.setSelected(false);
// --------------------------------------------------------------------
// eps_PointEquality label, slider and text field
// --------------------------------------------------------------------
eps_PointEqualityLabel = new JLabel("Point Equality Tolerance");
eps_PointEqualityLabel.setEnabled(false);
final DecimalFormat dfAngleTol_PE = new DecimalFormat("0.###");
eps_PointEqualitySlider = new DoubleJSlider(0, 1000, 20, 1000);
eps_PointEqualitySlider.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.eps_PointEqualitySliderDescription"));
eps_PointEqualitySlider.setMinorTickSpacing(100);
eps_PointEqualitySlider.setPaintTicks(true);
eps_PointEqualitySlider.setEnabled(false);
eps_PointEqualityTextField = new JTextField();
eps_PointEqualityTextField
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.eps_PointEqualityDescription"));
eps_PointEqualityTextField.setEnabled(false);
eps_PointEqualityTextField.setText(dfAngleTol_PE.format(eps_PointEqualitySlider.getScaledValue()));
eps_PointEqualitySlider.addChangeListener(new ChangeListener(){
@Override
public void stateChanged(ChangeEvent e) {
eps_PointEqualityTextField.setText(dfAngleTol_PE.format(eps_PointEqualitySlider.getScaledValue()));
}
});
eps_PointEqualityTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = eps_PointEqualityTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed)*eps_PointEqualitySlider.scale;
eps_PointEqualitySlider.setValue((int)value);
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'))*eps_PointEqualitySlider.scale;
eps_PointEqualitySlider.setValue((int)value);
return;
}
else
{
return;
}
}
}
});
// --------------------------------------------------------------------
// eps_Parallelity label, slider and text field
// --------------------------------------------------------------------
eps_ParallelityLabel = new JLabel("Parallelity Tolerance");
eps_ParallelityLabel.setEnabled(false);
final DecimalFormat dfAngleTol_P = new DecimalFormat("0.###");
eps_ParallelitySlider = new DoubleJSlider(0, 1000, 10, 1000);
eps_ParallelitySlider.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.eps_ParallelitySliderDescription"));
eps_ParallelitySlider.setMinorTickSpacing(100);
eps_ParallelitySlider.setPaintTicks(true);
eps_ParallelitySlider.setEnabled(false);
eps_ParallelityTextField = new JTextField();
eps_ParallelityTextField
.setToolTipText(CDAutoProGuiMessages
.getString("AutoProWindow.eps_ParallelityDescription"));
eps_ParallelityTextField.setEnabled(false);
eps_ParallelityTextField.setText(dfAngleTol_P.format(eps_ParallelitySlider.getScaledValue()));
eps_ParallelitySlider.addChangeListener(new ChangeListener(){
@Override
public void stateChanged(ChangeEvent e) {
eps_ParallelityTextField.setText(dfAngleTol_P.format(eps_ParallelitySlider.getScaledValue()));
}
});
eps_ParallelityTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = eps_ParallelityTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed)*eps_ParallelitySlider.scale;
eps_ParallelitySlider.setValue((int)value);
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'))*eps_ParallelitySlider.scale;
eps_ParallelitySlider.setValue((int)value);
return;
}
else
{
return;
}
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(mergePanel);
mergePanel.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(mergeCheckBox)
.addComponent(eps_PointEqualityLabel)
.addComponent(eps_ParallelityLabel)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(merge_exportIntermediateStagesCheckBox)
.addComponent(eps_PointEqualitySlider)
.addComponent(eps_ParallelitySlider)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(printMergeInfoCheckBox)
.addComponent(eps_PointEqualityTextField)
.addComponent(eps_ParallelityTextField)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(mergeCheckBox)
.addComponent(merge_exportIntermediateStagesCheckBox)
.addComponent(printMergeInfoCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(eps_PointEqualityLabel)
.addComponent(eps_PointEqualitySlider)
.addComponent(eps_PointEqualityTextField)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(eps_ParallelityLabel)
.addComponent(eps_ParallelitySlider)
.addComponent(eps_ParallelityTextField)
)
);
return mergePanel;
}
private JPanel createAdvancedSweepPanel_General() {
// panel with surrounding border
JPanel advancedSweepPanel_General = new JPanel();
advancedSweepPanel_General.setBorder(createTitledBorder("Advanced Sweep - General Settings"));
// --------------------------------------------------------------------
// create print info Check Box
// --------------------------------------------------------------------
advancedSweep_General_printInfoCheckBox = new JCheckBox("Print Sweep info");
advancedSweep_General_printInfoCheckBox.setToolTipText("Print Sweep info into JAVA terminal");
advancedSweep_General_printInfoCheckBox.setEnabled(true);
advancedSweep_General_printInfoCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_General_printFilterReasonInfoCheckBox.setEnabled(true);
} else {
advancedSweep_General_printFilterReasonInfoCheckBox.setEnabled(false);
advancedSweep_General_printFilterReasonInfoCheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create print info Check Box
// --------------------------------------------------------------------
advancedSweep_General_printFilterReasonInfoCheckBox = new JCheckBox("Print Filter Reasons info");
advancedSweep_General_printFilterReasonInfoCheckBox.setToolTipText("prints the reason why faces cannot by sweep faces");
advancedSweep_General_printFilterReasonInfoCheckBox.setEnabled(false);
// --------------------------------------------------------------------
// create Label for export intermediate stages
// --------------------------------------------------------------------
advancedSweep_General_exportIntermediateStagesCheckBox = new JCheckBox("export stages");
advancedSweep_General_exportIntermediateStagesCheckBox.setToolTipText("exports the intermediate stages within the sweep algorithms");
advancedSweep_General_exportIntermediateStagesCheckBox.setEnabled(true);
advancedSweep_General_exportIntermediateStagesCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
exportIntermediateStagesCompleteCheckBox.setSelected(true);
}
}
});
// --------------------------------------------------------------------
// write minEdgeLength Slider
// --------------------------------------------------------------------
final DecimalFormat dfMinEdge = new DecimalFormat("0.###");
advancedSweep_General_minEdgeLengthLabel = new JLabel("Min Edge Length");
advancedSweep_General_minEdgeLengthSlider = new DoubleJSlider(0, 500, 200, 100);
advancedSweep_General_minEdgeLengthSlider.setToolTipText("after the sweep there shouldn't be no edge left smaller that this value (size in meter)");
advancedSweep_General_minEdgeLengthSlider.setMinorTickSpacing(100);
advancedSweep_General_minEdgeLengthSlider.setPaintTicks(true);
advancedSweep_General_minEdgeLengthSlider.setEnabled(true);
advancedSweep_General_minEdgeLengthTextField = new JTextField();
advancedSweep_General_minEdgeLengthTextField.setToolTipText("after the sweep there shouldn't be no edge left smaller that this value (size in meter)");
advancedSweep_General_minEdgeLengthTextField.setEnabled(true);
advancedSweep_General_minEdgeLengthTextField.setText(dfMinEdge.format(advancedSweep_General_minEdgeLengthSlider.getScaledValue()));
advancedSweep_General_minEdgeLengthSlider.addChangeListener(new ChangeListener(){
@Override
public void stateChanged(ChangeEvent e) {
advancedSweep_General_minEdgeLengthTextField.setText(dfMinEdge.format(advancedSweep_General_minEdgeLengthSlider.getScaledValue()));
}
});
advancedSweep_General_minEdgeLengthTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = advancedSweep_General_minEdgeLengthTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed)*advancedSweep_General_minEdgeLengthSlider.scale;
advancedSweep_General_minEdgeLengthSlider.setValue((int)value);
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'))*advancedSweep_General_minEdgeLengthSlider.scale;
advancedSweep_General_minEdgeLengthSlider.setValue((int)value);
return;
}
else
{
return;
}
}
}
});
// --------------------------------------------------------------------
// write maxEdgeLength Slider
// --------------------------------------------------------------------
final DecimalFormat dfMaxEdge = new DecimalFormat("0.###");
advancedSweep_General_maxEdgeLengthLabel = new JLabel("Max Edge Length");
advancedSweep_General_maxEdgeLengthSlider = new DoubleJSlider(0, 2000, 500, 100);
advancedSweep_General_maxEdgeLengthSlider.setToolTipText("sweep is not allowed if an edge longer than this would completely dissapear (size in meter)");
advancedSweep_General_maxEdgeLengthSlider.setMinorTickSpacing(100);
advancedSweep_General_maxEdgeLengthSlider.setPaintTicks(true);
advancedSweep_General_maxEdgeLengthSlider.setEnabled(true);
advancedSweep_General_maxEdgeLengthTextField = new JTextField();
advancedSweep_General_maxEdgeLengthTextField.setToolTipText("sweep is not allowed if an edge longer than this would completely dissapear (size in meter)");
advancedSweep_General_maxEdgeLengthTextField.setEnabled(true);
advancedSweep_General_maxEdgeLengthTextField.setText(dfMaxEdge.format(advancedSweep_General_maxEdgeLengthSlider.getScaledValue()));
advancedSweep_General_maxEdgeLengthSlider.addChangeListener(new ChangeListener(){
@Override
public void stateChanged(ChangeEvent e) {
advancedSweep_General_maxEdgeLengthTextField.setText(dfMinEdge.format(advancedSweep_General_maxEdgeLengthSlider.getScaledValue()));
}
});
advancedSweep_General_maxEdgeLengthTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = advancedSweep_General_maxEdgeLengthTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed)*advancedSweep_General_maxEdgeLengthSlider.scale;
advancedSweep_General_maxEdgeLengthSlider.setValue((int)value);
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'))*advancedSweep_General_maxEdgeLengthSlider.scale;
advancedSweep_General_maxEdgeLengthSlider.setValue((int)value);
return;
}
else
{
return;
}
}
}
});
// --------------------------------------------------------------------
// write minDistToSweep Slider
// --------------------------------------------------------------------
final DecimalFormat dfMinDist = new DecimalFormat("0.####");
advancedSweep_General_minDistToSweepLabel = new JLabel("Min Dist");
advancedSweep_General_minDistToSweepSlider = new DoubleJSlider(0, 10000, 1, 10000);
advancedSweep_General_minDistToSweepSlider.setToolTipText("No Sweep, if sweep would be less than this value (size in meter)");
advancedSweep_General_minDistToSweepSlider.setMinorTickSpacing(10000);
advancedSweep_General_minDistToSweepSlider.setPaintTicks(true);
advancedSweep_General_minDistToSweepSlider.setEnabled(true);
advancedSweep_General_minDistToSweepTextField = new JTextField();
advancedSweep_General_minDistToSweepTextField.setToolTipText("No Sweep, if sweep would be less than this value (size in meter)");
advancedSweep_General_minDistToSweepTextField.setEnabled(true);
advancedSweep_General_minDistToSweepTextField.setText(dfMinDist.format(advancedSweep_General_minDistToSweepSlider.getScaledValue()));
advancedSweep_General_minDistToSweepSlider.addChangeListener(new ChangeListener(){
@Override
public void stateChanged(ChangeEvent e) {
advancedSweep_General_minDistToSweepTextField.setText(dfMinDist.format(advancedSweep_General_minDistToSweepSlider.getScaledValue()));
}
});
advancedSweep_General_minDistToSweepTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = advancedSweep_General_minDistToSweepTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed)*advancedSweep_General_minDistToSweepSlider.scale;
advancedSweep_General_minDistToSweepSlider.setValue((int)value);
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'))*advancedSweep_General_minDistToSweepSlider.scale;
advancedSweep_General_minDistToSweepSlider.setValue((int)value);
return;
}
else
{
return;
}
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(advancedSweepPanel_General);
advancedSweepPanel_General.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_General_printInfoCheckBox)
.addComponent(advancedSweep_General_minEdgeLengthLabel)
.addComponent(advancedSweep_General_maxEdgeLengthLabel)
.addComponent(advancedSweep_General_minDistToSweepLabel)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_General_printFilterReasonInfoCheckBox)
.addComponent(advancedSweep_General_minEdgeLengthSlider)
.addComponent(advancedSweep_General_maxEdgeLengthSlider)
.addComponent(advancedSweep_General_minDistToSweepSlider)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_General_exportIntermediateStagesCheckBox)
.addComponent(advancedSweep_General_minEdgeLengthTextField)
.addComponent(advancedSweep_General_maxEdgeLengthTextField)
.addComponent(advancedSweep_General_minDistToSweepTextField)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_General_printInfoCheckBox)
.addComponent(advancedSweep_General_printFilterReasonInfoCheckBox)
.addComponent(advancedSweep_General_exportIntermediateStagesCheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_General_minEdgeLengthLabel)
.addComponent(advancedSweep_General_minEdgeLengthSlider)
.addComponent(advancedSweep_General_minEdgeLengthTextField)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_General_maxEdgeLengthLabel)
.addComponent(advancedSweep_General_maxEdgeLengthSlider)
.addComponent(advancedSweep_General_maxEdgeLengthTextField)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_General_minDistToSweepLabel)
.addComponent(advancedSweep_General_minDistToSweepSlider)
.addComponent(advancedSweep_General_minDistToSweepTextField)
)
);
return advancedSweepPanel_General;
}
private JPanel createAdvancedSweepPanel_Planarity() {
// panel with surrounding border
JPanel advancedSweepPanel_Planarity = new JPanel();
advancedSweepPanel_Planarity.setBorder(createTitledBorder("Advanced Sweep Settings - Planarity"));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// use Planarity Check Box
// --------------------------------------------------------------------
advancedSweep_Planarity_Use_CheckBox = new JCheckBox("Use Planarity");
advancedSweep_Planarity_Use_CheckBox.setToolTipText("Use planarity Algorithm");
advancedSweep_Planarity_Use_CheckBox.setSelected(false);
advancedSweep_Planarity_Use_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox.setEnabled(true);
advancedSweep_Planarity_PlanarityTolerance_SweepLabel.setEnabled(true);
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.setEnabled(true);
advancedSweep_Planarity_PlanarityTolerance_TextField.setEnabled(true);
} else {
advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox.setEnabled(false);
advancedSweep_Planarity_PlanarityTolerance_SweepLabel.setEnabled(false);
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.setEnabled(false);
advancedSweep_Planarity_PlanarityTolerance_TextField.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// create ignore multiple Points CheckBox
// --------------------------------------------------------------------
advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox = new JCheckBox("Ignore Mult Points");
advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox.setToolTipText("If unselected the target plane will be created through fixpoints");
advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox.setSelected(false);
advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox.setEnabled(false);
// --------------------------------------------------------------------
// write planarity Tolerance Slider
// --------------------------------------------------------------------
final DecimalFormat dfTolerance = new DecimalFormat("0.############");
advancedSweep_Planarity_PlanarityTolerance_SweepLabel = new JLabel("Planarity Tolerance");
advancedSweep_Planarity_PlanarityTolerance_SweepSlider = new DoubleJSlider(0, 1000000000, 1, 1000000000);
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.setToolTipText("Planarity Tolerance (size in meter)");
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.setMinorTickSpacing(1000000000);
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.setPaintTicks(true);
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.setEnabled(false);
advancedSweep_Planarity_PlanarityTolerance_TextField = new JTextField();
advancedSweep_Planarity_PlanarityTolerance_TextField.setToolTipText("Planarity Tolerance (size in meter)");
advancedSweep_Planarity_PlanarityTolerance_TextField.setEnabled(false);
advancedSweep_Planarity_PlanarityTolerance_TextField.setText(dfTolerance.format(advancedSweep_Planarity_PlanarityTolerance_SweepSlider.getScaledValue()));
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.addChangeListener(new ChangeListener(){
@Override
public void stateChanged(ChangeEvent e) {
advancedSweep_Planarity_PlanarityTolerance_TextField.setText(dfTolerance.format(advancedSweep_Planarity_PlanarityTolerance_SweepSlider.getScaledValue()));
}
});
advancedSweep_Planarity_PlanarityTolerance_TextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = advancedSweep_Planarity_PlanarityTolerance_TextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed)*advancedSweep_Planarity_PlanarityTolerance_SweepSlider.scale;
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.setValue((int)value);
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'))*advancedSweep_Planarity_PlanarityTolerance_SweepSlider.scale;
advancedSweep_Planarity_PlanarityTolerance_SweepSlider.setValue((int)value);
return;
}
else
{
return;
}
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(advancedSweepPanel_Planarity);
advancedSweepPanel_Planarity.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_Planarity_Use_CheckBox)
.addComponent(advancedSweep_Planarity_PlanarityTolerance_SweepLabel)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox)
.addComponent(advancedSweep_Planarity_PlanarityTolerance_SweepSlider)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
//.addComponent(null)
.addComponent(advancedSweep_Planarity_PlanarityTolerance_TextField)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_Planarity_Use_CheckBox)
.addComponent(advancedSweep_Planarity_IgnoreMultiplePoints_CheckBox)
//.addComponent(null)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_Planarity_PlanarityTolerance_SweepLabel)
.addComponent(advancedSweep_Planarity_PlanarityTolerance_SweepSlider)
.addComponent(advancedSweep_Planarity_PlanarityTolerance_TextField)
)
);
return advancedSweepPanel_Planarity;
}
private JPanel createAdvancedSweepPanel_SweepPlane() {
// panel with surrounding border
JPanel advancedSweepPanel_SweepPlane = new JPanel();
advancedSweepPanel_SweepPlane.setBorder(createTitledBorder("Advanced Sweep Settings - SweepPlane"));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// use Planarity Check Box
// --------------------------------------------------------------------
advancedSweep_SweepPlane_Use_CheckBox = new JCheckBox("Use SweepPlane");
advancedSweep_SweepPlane_Use_CheckBox.setToolTipText("Use SweepPlane Algorithm");
advancedSweep_SweepPlane_Use_CheckBox.setSelected(false);
advancedSweep_SweepPlane_Use_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepPlane_PushOnly_CheckBox.setEnabled(true);
advancedSweep_SweepPlane_PullOnly_CheckBox.setEnabled(true);
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.setEnabled(true);
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.setEnabled(true);
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.setEnabled(true);
} else {
advancedSweep_SweepPlane_PushOnly_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_PullOnly_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// create push only CheckBox
// --------------------------------------------------------------------
advancedSweep_SweepPlane_PushOnly_CheckBox = new JCheckBox("Push Only");
advancedSweep_SweepPlane_PushOnly_CheckBox.setToolTipText("faces will only be pushed into the geometry");
advancedSweep_SweepPlane_PushOnly_CheckBox.setSelected(false);
advancedSweep_SweepPlane_PushOnly_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_PushOnly_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepPlane_PullOnly_CheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create pull only CheckBox
// --------------------------------------------------------------------
advancedSweep_SweepPlane_PullOnly_CheckBox = new JCheckBox("Pull Only");
advancedSweep_SweepPlane_PullOnly_CheckBox.setToolTipText("faces will only be pulled out of the geometry");
advancedSweep_SweepPlane_PullOnly_CheckBox.setSelected(false);
advancedSweep_SweepPlane_PullOnly_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_PullOnly_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepPlane_PushOnly_CheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create shortest edge first CheckBox
// --------------------------------------------------------------------
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox = new JCheckBox("Shortest Edge First");
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.setToolTipText("Shortest Edge First");
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.setSelected(false);
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.setSelected(false);
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create smallest face first CheckBox
// --------------------------------------------------------------------
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox = new JCheckBox("Smallest Face First");
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.setToolTipText("Smallest Face First");
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.setSelected(false);
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.setSelected(false);
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create smallest distance first CheckBox
// --------------------------------------------------------------------
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox = new JCheckBox("Smallest Dist First");
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.setToolTipText("Smallest Dist First");
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.setSelected(false);
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.setEnabled(false);
advancedSweep_SweepPlane_SmallestDistFirst_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox.setSelected(false);
advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(advancedSweepPanel_SweepPlane);
advancedSweepPanel_SweepPlane.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_SweepPlane_Use_CheckBox)
.addComponent(advancedSweep_SweepPlane_PushOnly_CheckBox)
.addComponent(advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
//.addComponent(null)
.addComponent(advancedSweep_SweepPlane_PullOnly_CheckBox)
.addComponent(advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
//.addComponent(null)
//.addComponent(null)
.addComponent(advancedSweep_SweepPlane_SmallestDistFirst_CheckBox)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_SweepPlane_Use_CheckBox)
//.addComponent(null)
//.addComponent(null)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_SweepPlane_PushOnly_CheckBox)
.addComponent(advancedSweep_SweepPlane_PullOnly_CheckBox)
//.addComponent(null)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_SweepPlane_ShortestEdgeFirst_CheckBox)
.addComponent(advancedSweep_SweepPlane_SmallestFaceFirst_CheckBox)
.addComponent(advancedSweep_SweepPlane_SmallestDistFirst_CheckBox)
)
);
return advancedSweepPanel_SweepPlane;
}
private JPanel createAdvancedSweepPanel_SweepRotate() {
// panel with surrounding border
JPanel advancedSweepPanel_SweepRotate = new JPanel();
advancedSweepPanel_SweepRotate.setBorder(createTitledBorder("Advanced Sweep Settings - SweepRotate"));
// ----------------------------- CONTENT -----------------------------
// --------------------------------------------------------------------
// use Planarity Check Box
// --------------------------------------------------------------------
advancedSweep_SweepRotate_Use_CheckBox = new JCheckBox("Use SweepRotate");
advancedSweep_SweepRotate_Use_CheckBox.setToolTipText("Use SweepRotate Algorithm");
advancedSweep_SweepRotate_Use_CheckBox.setSelected(false);
advancedSweep_SweepRotate_Use_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepRotate_MinDistFirst_CheckBox.setEnabled(true);
advancedSweep_SweepRotate_MinAngleFirst_CheckBox.setEnabled(true);
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.setEnabled(true);
} else {
advancedSweep_SweepRotate_MinDistFirst_CheckBox.setEnabled(false);
advancedSweep_SweepRotate_MinAngleFirst_CheckBox.setEnabled(false);
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.setEnabled(false);
}
}
});
// --------------------------------------------------------------------
// write max Angle Slider
// --------------------------------------------------------------------
final DecimalFormat dfAngle = new DecimalFormat("0.####");
advancedSweep_SweepRotate_maxAngleLabel = new JLabel("Min Angle");
advancedSweep_SweepRotate_maxAngleSlider = new DoubleJSlider(0, 600, 100, 10);
advancedSweep_SweepRotate_maxAngleSlider.setToolTipText("Sweep rotate, if angle between two edges is lower than this value (angle in degrees)");
advancedSweep_SweepRotate_maxAngleSlider.setMinorTickSpacing(100);
advancedSweep_SweepRotate_maxAngleSlider.setPaintTicks(true);
advancedSweep_SweepRotate_maxAngleSlider.setEnabled(true);
advancedSweep_SweepRotate_maxAngleTextField = new JTextField();
advancedSweep_SweepRotate_maxAngleTextField.setToolTipText("Sweep rotate, if angle between two edges is lower than this value (angle in degrees)");
advancedSweep_SweepRotate_maxAngleTextField.setEnabled(true);
advancedSweep_SweepRotate_maxAngleTextField.setText(dfAngle.format(advancedSweep_SweepRotate_maxAngleSlider.getScaledValue()));
advancedSweep_SweepRotate_maxAngleSlider.addChangeListener(new ChangeListener(){
@Override
public void stateChanged(ChangeEvent e) {
advancedSweep_SweepRotate_maxAngleTextField.setText(dfAngle.format(advancedSweep_SweepRotate_maxAngleSlider.getScaledValue()));
}
});
advancedSweep_SweepRotate_maxAngleTextField.addKeyListener(new KeyAdapter(){
@Override
public void keyReleased(KeyEvent ke) {
if(ke.getKeyCode() == KeyEvent.VK_ENTER)
{
String typed = advancedSweep_SweepRotate_maxAngleTextField.getText();
if(typed.matches("\\d+(\\.\\d*)?")) {
double value = Double.parseDouble(typed)*advancedSweep_SweepRotate_maxAngleSlider.scale;
advancedSweep_SweepRotate_maxAngleSlider.setValue((int)value);
}
else if (typed.matches("\\d+(\\,\\d*)?")) {
double value = Double.parseDouble(typed.replace(',','.'))*advancedSweep_SweepRotate_maxAngleSlider.scale;
advancedSweep_SweepRotate_maxAngleSlider.setValue((int)value);
return;
}
else
{
return;
}
}
}
});
// --------------------------------------------------------------------
// create min dist first CheckBox
// --------------------------------------------------------------------
advancedSweep_SweepRotate_MinDistFirst_CheckBox = new JCheckBox("Min. Distance First");
advancedSweep_SweepRotate_MinDistFirst_CheckBox.setToolTipText("Minimal Distance First");
advancedSweep_SweepRotate_MinDistFirst_CheckBox.setSelected(false);
advancedSweep_SweepRotate_MinDistFirst_CheckBox.setEnabled(false);
advancedSweep_SweepRotate_MinDistFirst_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepRotate_MinAngleFirst_CheckBox.setSelected(false);
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create min angle first CheckBox
// --------------------------------------------------------------------
advancedSweep_SweepRotate_MinAngleFirst_CheckBox = new JCheckBox("Min. Angle First");
advancedSweep_SweepRotate_MinAngleFirst_CheckBox.setToolTipText("Minimal Angle First");
advancedSweep_SweepRotate_MinAngleFirst_CheckBox.setSelected(false);
advancedSweep_SweepRotate_MinAngleFirst_CheckBox.setEnabled(false);
advancedSweep_SweepRotate_MinAngleFirst_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepRotate_MinDistFirst_CheckBox.setSelected(false);
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create smallest face first CheckBox
// --------------------------------------------------------------------
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox = new JCheckBox("Smallest Face First");
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.setToolTipText("Smallest Face First");
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.setSelected(false);
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.setEnabled(false);
advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (((JCheckBox) e.getSource()).isSelected()) {
advancedSweep_SweepRotate_MinDistFirst_CheckBox.setSelected(false);
advancedSweep_SweepRotate_MinAngleFirst_CheckBox.setSelected(false);
}
}
});
// --------------------------------------------------------------------
// create layout
// --------------------------------------------------------------------
GroupLayout panelLayout = new GroupLayout(advancedSweepPanel_SweepRotate);
advancedSweepPanel_SweepRotate.setLayout(panelLayout);
panelLayout.setHorizontalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_SweepRotate_Use_CheckBox)
.addComponent(advancedSweep_SweepRotate_maxAngleLabel)
.addComponent(advancedSweep_SweepRotate_MinAngleFirst_CheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
//.addComponent(NULL)
.addComponent(advancedSweep_SweepRotate_maxAngleSlider)
.addComponent(advancedSweep_SweepRotate_MinDistFirst_CheckBox)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
//.addComponent(NULL)
.addComponent(advancedSweep_SweepRotate_maxAngleTextField)
.addComponent(advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox)
)
);
panelLayout.setVerticalGroup(panelLayout.createSequentialGroup()
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_SweepRotate_Use_CheckBox)
//.addComponent(NULL)
//.addComponent(NULL)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_SweepRotate_maxAngleLabel)
.addComponent(advancedSweep_SweepRotate_maxAngleSlider)
.addComponent(advancedSweep_SweepRotate_maxAngleTextField)
)
.addGroup(panelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(advancedSweep_SweepRotate_MinAngleFirst_CheckBox)
.addComponent(advancedSweep_SweepRotate_MinDistFirst_CheckBox)
.addComponent(advancedSweep_SweepRotate_SmallestFaceFirst_CheckBox)
)
);
return advancedSweepPanel_SweepRotate;
}
private JPanel createExecuteButtonPanel() {
JPanel executePanel = new JPanel(new FlowLayout());
JButton execBtn = new JButton(
CDAutoProGuiMessages.getString("AutoProWindow.OkButtonLabel"));
execBtn.setMinimumSize(new Dimension(stdBtnWidth, stdBtnHeight));
execBtn.setMaximumSize(new Dimension(stdBtnWidth, stdBtnHeight));
execBtn.setPreferredSize(new Dimension(stdBtnWidth, stdBtnHeight));
execBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
startCppAutoProMethods();
} catch (FileNotFoundException e1) {
// Auto-generated catch block
e1.printStackTrace();
}
close();
}
});
executePanel.add(execBtn);
JButton cancelBtn = new JButton(
CDAutoProGuiMessages.getString("AutoProWindow.CancelButtonLabel"));
cancelBtn.setMinimumSize(new Dimension(stdBtnWidth, stdBtnHeight));
cancelBtn.setMaximumSize(new Dimension(stdBtnWidth, stdBtnHeight));
cancelBtn.setPreferredSize(new Dimension(stdBtnWidth, stdBtnHeight));
cancelBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
close();
}
});
executePanel.add(cancelBtn);
return executePanel;
}
// NOTE: this is a hack, to provide the file type and the description for
// the inner FileFilter class in the saveFileDialog method
private String currSaveTypeDescription;
private String currSaveFileType;
/**
* @param The target file type
* @param The description of the the file type
* @param The dialog title
* @return The FileInfo with absolute path, name and type for the selected file
*/
private FileInfo saveFileDialog(String fileType, String typeDescription,
String dialogTitle) {
if (!fileType.startsWith("."))
fileType = "." + fileType;
currSaveFileType = fileType;
currSaveTypeDescription = typeDescription;
JFileChooser fileChooser = new JFileChooser(new File("."));
fileChooser.setDialogTitle(dialogTitle);
fileChooser.setAcceptAllFileFilterUsed(false);
fileChooser.setFileFilter(new FileFilter() {
@Override
public String getDescription() {
return currSaveTypeDescription;
}
@Override
public boolean accept(File f) {
return f.isDirectory()
|| f.getName().toLowerCase().endsWith(currSaveFileType);
}
});
int userSelection = fileChooser.showSaveDialog(this);
if (userSelection == JFileChooser.APPROVE_OPTION) {
FileInfo fileInfo = new FileInfo();
fileInfo.setType(fileType);
String filename = fileChooser.getSelectedFile().getName();
if (filename.endsWith(fileType))
{
int pos = filename.lastIndexOf(".");
if (pos > 0) {
filename = filename.substring(0, pos);
}
}
fileInfo.setName(filename);
String absolutePath = fileChooser.getSelectedFile().getAbsolutePath();
fileInfo.setPath(absolutePath.substring(0,absolutePath.lastIndexOf(File.separator)) + "\\");
return fileInfo;
} else
return null;
}
private TitledBorder createTitledBorder(String heading) {
Border baseBorder = new LineBorder(Color.GRAY); // to have a gray border
Font headingFont = new Font("Arial", Font.BOLD + Font.ITALIC, 13);
TitledBorder finalBorder = new TitledBorder(baseBorder, heading,
TitledBorder.DEFAULT_POSITION,
TitledBorder.DEFAULT_JUSTIFICATION, headingFont,
Color.DARK_GRAY);
return finalBorder;
}
/**
* test
*
* @param args
*/
public static void main(String[] args) {
AutoProWindow v = new AutoProWindow(null);
v.setVisible(true);
}
@Override
public void itemStateChanged(ItemEvent paramItemEvent) {
// Auto-generated method stub
}
}
/** --------------------------------------------------
* Hochschule fuer Technik Stuttgart
* Fachbereich Vermessung , Informatik und Mathematik
* Schellingstr . 24
* D - 70174 Stuttgart
*
* Projekt CityDoktor
*
* Copyright (c) 2011 HFT Stuttgart. All rights reserved.
* HFT Stuttgart and its licensors retain all intellectual property and
* proprietary rights in and to this software and related documentation.
* Any use, reproduction, disclosure, or distribution of this software
* and related documentation without an express license agreement from
* HFT Stuttgart is strictly prohibited.
*
* Please refer to the applicable HFT Stuttgart end user license agreement (EULA)
* associated with this source code for terms and conditions that govern
* your use of this HFT Stuttgart software.
*
* @author PiR
* @version 1.0
* created: 17.12.2017
*/
package de.hft.stuttgart.citydoctor2.gui;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
* Diese Klasse ermoeglicht den Zugriff auf das ResourceBundle mit den
* lokalisierten Strings.
*
*/
public class CDAutoProGuiMessages {
private static final String BUNDLE_NAME = "de.hft.stuttgart.citydoctor2.gui.cdautoproguimessages"; //$NON-NLS-1$
private CDAutoProGuiMessages() {
}
/**
* Diese Methode laedt einen String aus dem ResourceBundle.
*
* @param key der Schluessel des Strings
* @return der String
*/
public static String getString(String key) {
ResourceBundle RESOURCE_BUNDLE = ResourceBundle
.getBundle(BUNDLE_NAME, Locale.getDefault());
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
}
CityDoctorAutoProFrame.WindowTitle=CityDoctor Automated Processing Tool
CityDoctorAutoProFrame.autoProActionTitle=Automated Processing
CityDoctorAutoProFrame.autoProActionText=Automated Processing
AutoProWindow.PreferencesWindowTitle = Automated Processing Window
// EXPORT
AutoProWindow.exportMeshPanel = export Mesh File via CPP (only original model can be printed)
AutoProWindow.exportMeshButtonTitle = export Mesh
AutoProWindow.exportMeshButtonDescription = export Mesh File via CPP
AutoProWindow.meshExportFileNameDescription = Hier kann optional der Name fuer die Mesh Datei angegeben werden
AutoProWindow.meshExportPathDescription = Hier kann optional der Speicherort fuer die Mesh Datei angegeben werden
AutoProWindow.exportMeshReportDialogTitle = Export Mesh File to...
AutoProWindow.exportIVPanel = export IV File via CPP
AutoProWindow.exportIVButtonTitle = export IV
AutoProWindow.exportIVButtonDescription = export IV File via CPP
AutoProWindow.ivExportFileNameDescription = Hier kann optional der Name fuer die IV Datei angegeben werden
AutoProWindow.ivExportPathDescription = Hier kann optional der Speicherort fuer die IV Datei angegeben werden
AutoProWindow.exportIVReportDialogTitle = Export IV File to...
AutoProWindow.exportSTEPPanel = export STEP File via CPP
AutoProWindow.exportSTEPButtonTitle = export STEP
AutoProWindow.exportSTEPButtonDescription = export STEP File via CPP
AutoProWindow.stepExportFileNameDescription = Hier kann optional der Name fuer die STEP Datei angegeben werden
AutoProWindow.stepExportPathDescription = Hier kann optional der Speicherort fuer die STEP Datei angegeben werden
AutoProWindow.exportSTEPReportDialogTitle = Export STEP File to...
AutoProWindow.exportGMLPanel = export CityGML File via CPP
AutoProWindow.exportGMLButtonTitle = export CityGML
AutoProWindow.exportGMLButtonDescription = export CityGML File via CPP
AutoProWindow.gmlExportFileNameDescription = Hier kann optional der Name fuer die CityGML Datei angegeben werden
AutoProWindow.gmlExportPathDescription = Hier kann optional der Speicherort fuer die CityGML Datei angegeben werden
AutoProWindow.exportGMLReportDialogTitle = Export CityGML File to...
AutoProWindow.exportSettingsPanel = General Setting for Export
//
AutoProWindow.printInfoPanel = General Print Info Settings
AutoProWindow.comparisonPanel = Print Settings for validation/comparison
// BOOL
AutoProWindow.boolPanel = Bool and Minkowski settings
AutoProWindow.boolButtonTitle = use Bool
AutoProWindow.boolButtonDescription = uses CGALs union operator to merge houses
AutoProWindow.boolInfoButtonTitle = Print Bool info
AutoProWindow.boolInfoButtonDescription = Print Bool info into JAVA terminal
AutoProWindow.minkowskiPanel = Minkowski settings
AutoProWindow.minkowskiButtonTitle = use Minkowski
AutoProWindow.minkowskiButtonDescription = uses CGALs minkowski operations
AutoProWindow.minkowskiInfoButtonTitle = Print Minkowski info
AutoProWindow.minkowskiInfoButtonDescription = Print Minkowski info into JAVA terminal
AutoProWindow.minkowskiCubeDescription = Sets the size of the minkowski cube (size in meter)
AutoProWindow.minkowskiCubeSliderDescription = Sets the size of the minkowski cube (size in meter)
AutoProWindow.boolMinkowski_exportIntermediateStagesCheckBoxButtonTitle = export intermediate stages
AutoProWindow.boolMinkowski_exportIntermediateStagesCheckBoxButtonDescription = if selected writes the intermediate stages of the algorithm to .iv and .step
// MERGE
AutoProWindow.mergePanel = Merge settings
AutoProWindow.mergeButtonTitle = use Merge
AutoProWindow.mergeButtonDescription = merges parallel, connected faces and edges and collapses degenerated faces and edges
AutoProWindow.merge_exportIntermediateStagesCheckBoxButtonTitle = export intermediate stages
AutoProWindow.merge_exportIntermediateStagesCheckBoxButtonDescription = if selected writes the intermediate stages of the algorithm to .iv and .step
AutoProWindow.mergeInfoButtonTitle = Print Merge info
AutoProWindow.mergeInfoButtonDescription = Print Merge info into JAVA terminal
AutoProWindow.eps_PointEqualitySliderDescription = Point Equality Tolerance (size in meter)
AutoProWindow.eps_PointEqualityDescription = if an edge is shorter than this tolerance the edge degenerates to a vertex
AutoProWindow.eps_ParallelitySliderDescription = Parallelity Tolerance (angle in degrees)
AutoProWindow.eps_ParallelityDescription = two vectors v1, v2 or planes (v are the planes' normal) are (anti-)parallel if |(v1 % v2) - (v1.length * v1.length)| < eps
// OK CANCEL
AutoProWindow.OkButtonLabel = DO IT
AutoProWindow.CancelButtonLabel = Cancel
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<ns prefix="gml" uri="http://www.opengis.net/gml"/>
<ns prefix="bldg" uri="http://www.opengis.net/citygml/building/2.0"/>
<pattern>
<rule context="//*:Building">
<assert test="count(descendant::*:lod1Solid) &gt; 0 or count(descendant::*:lod2Solid) &gt; 0 or count(descendant::*:lod3Solid) &gt; 0 or count(descendant::*:lod4Solid) &gt; 0"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||any solid</assert>
</rule>
<rule context="//*:BuildingPart">
<assert test="count(*:lod1Solid) = 1 or count(*:lod2Solid) = 1 or count(*:lod3Solid) = 1 or count(*:lod4Solid) = 1"><value-of select="ancestor::*:Building/@*:id"/>||<value-of select="@gml:id | @id"/>||SE_ATTRIBUTE_MISSING||any solid</assert>
</rule>
</pattern>
</schema>
<?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="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorParent</artifactId>
<version>3.15.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>CityDoctorGUI</artifactId>
<name>CityDoctorGUI</name>
<description>Graphical User Interface for CityDoctor</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorModel</artifactId>
</dependency>
<dependency>
<groupId>de.hft.stuttgart</groupId>
<artifactId>CityDoctorValidation</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j18-impl</artifactId>
</dependency>
</dependencies>
<profiles>
<profile>
<id>create-binaries</id>
<properties>
<win-jre>jre-${jre-version-short}-full</win-jre>
<lin-jre>${win-jre}</lin-jre>
<mac-jre>${win-jre}.jre</mac-jre>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.7.0</version>
<executions>
<execution>
<id>downloadWindowsJre</id>
<phase>install</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<uri>https://download.bell-sw.com/java/${jre-version}/bellsoft-jre${jre-version}-windows-amd64-full.zip</uri>
<unpack>false</unpack>
<outputDirectory>${project.build.directory}/jre/jre-win</outputDirectory>
<outputFileName>win-runtime.zip</outputFileName>
</configuration>
</execution>
<execution>
<id>downloadLinuxJre</id>
<phase>install</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<uri>https://download.bell-sw.com/java/${jre-version}/bellsoft-jre${jre-version}-linux-amd64-full.tar.gz</uri>
<unpack>false</unpack>
<outputDirectory>${project.build.directory}/jre/jre-lin</outputDirectory>
<outputFileName>lin-runtime.tar.gz</outputFileName>
</configuration>
</execution>
<execution>
<id>downloadMacJre</id>
<phase>install</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<uri>https://download.bell-sw.com/java/${jre-version}/bellsoft-jre${jre-version}-macos-amd64-full.zip</uri>
<unpack>false</unpack>
<outputDirectory>${project.build.directory}/jre/jre-mac</outputDirectory>
<outputFileName>mac-runtime.zip</outputFileName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>unpack</id>
<phase>install</phase>
<configuration>
<target name="unpack">
<untar src="${project.build.directory}/jre/jre-lin/lin-runtime.tar.gz" dest="${project.build.directory}/jre/jre-lin/runtime" compression="gzip"></untar>
<unzip src="${project.build.directory}/jre/jre-win/win-runtime.zip" dest="${project.build.directory}/jre/jre-win/runtime"></unzip>
<unzip src="${project.build.directory}/jre/jre-mac/mac-runtime.zip" dest="${project.build.directory}/jre/jre-mac/runtime"></unzip>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>create-archive-no-runtime</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-no-runtime</finalName>
<descriptors>
<descriptor>${project.basedir}/src/assembly/no_runtime/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>create-archive-win</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-win</finalName>
<descriptors>
<descriptor>${project.basedir}/src/assembly/win/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>create-archive-lin</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-lin</finalName>
<descriptors>
<descriptor>${project.basedir}/src/assembly/lin/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>create-archive-mac</id>
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-mac</finalName>
<descriptors>
<descriptor>${project.basedir}/src/assembly/mac/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<ns prefix="gml" uri="http://www.opengis.net/gml"/>
<ns prefix="bldg" uri="http://www.opengis.net/citygml/building/2.0"/>
<pattern>
<rule context="//*:Building">
<assert test="count(descendant::*:lod1Solid) &gt; 0 or count(descendant::*:lod2Solid) &gt; 0 or count(descendant::*:lod3Solid) &gt; 0 or count(descendant::*:lod4Solid) &gt; 0"><value-of select="@gml:id | @id"/>||||SE_ATTRIBUTE_MISSING||any solid</assert>
</rule>
<rule context="//*:BuildingPart">
<assert test="count(*:lod1Solid) = 1 or count(*:lod2Solid) = 1 or count(*:lod3Solid) = 1 or count(*:lod4Solid) = 1"><value-of select="ancestor::*:Building/@*:id"/>||<value-of select="@gml:id | @id"/>||SE_ATTRIBUTE_MISSING||any solid</assert>
</rule>
</pattern>
</schema>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>zip</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>app</outputDirectory>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/assembly/lin</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>start.sh</include>
</includes>
<filtered>true</filtered>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/assembly/common</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>checkForSolid.xml</include>
</includes>
<filtered>false</filtered>
</fileSet>
<fileSet>
<directory>${project.build.directory}/jre/jre-lin/runtime/${lin-jre}/
</directory>
<outputDirectory>/runtime</outputDirectory>
<includes>
<include>**/*</include>
</includes>
<filtered>false</filtered>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment