Commit 51c58d36 authored by Matthias Betz's avatar Matthias Betz
Browse files

Release 0.1.0 of citygml4j-quality-ade plugin

parent 84999154
Pipeline #1886 passed with stage
in 5 seconds
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.hft.stuttgart</groupId>
<artifactId>citygml4j-quality-ade</artifactId>
<version>0.1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.citygml4j/citygml4j -->
<dependency>
<groupId>org.citygml4j</groupId>
<artifactId>citygml4j</artifactId>
<version>2.10.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality;
import java.util.Collections;
import java.util.List;
import org.citygml4j.model.citygml.ade.binding.ADEContext;
import org.citygml4j.model.citygml.ade.binding.ADEMarshaller;
import org.citygml4j.model.citygml.ade.binding.ADEUnmarshaller;
import org.citygml4j.model.module.ade.ADEModule;
import de.hft.stuttgart.quality.marshaller.QualityAdeMarshaller;
import de.hft.stuttgart.quality.marshaller.QualityAdeUnmarshaller;
public class QualityADEContext implements ADEContext {
private final List<ADEModule> modules = Collections.singletonList(QualityADEModule.V0_1);
@Override
public List<ADEModule> getADEModules() {
return modules;
}
@Override
public List<String> getModelPackageNames() {
return Collections.singletonList("de.hft.stuttgart.quality.model");
}
@Override
public ADEMarshaller createADEMarshaller() {
return new QualityAdeMarshaller();
}
@Override
public ADEUnmarshaller createADEUnmarshaller() {
return new QualityAdeUnmarshaller();
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality;
import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import javax.xml.namespace.QName;
import org.citygml4j.model.gml.feature.AbstractFeature;
import org.citygml4j.model.module.ade.ADEModule;
import org.citygml4j.model.module.citygml.CityGMLVersion;
import de.hft.stuttgart.quality.model.Validation;
public class QualityADEModule extends ADEModule {
public static final String NAMESPACE_URI = "https://transfer.hft-stuttgart.de/pages/qualityade/0.1";
public static final QualityADEModule V0_1 = new QualityADEModule();
private HashMap<String, Class<? extends AbstractFeature>> features;
private HashSet<String> featureProperties;
private static final long serialVersionUID = -8208579547274734280L;
public QualityADEModule() {
super(NAMESPACE_URI, "qual", CityGMLVersion.v2_0_0);
features = new HashMap<>();
features.put("validation", Validation.class);
featureProperties = new HashSet<>();
}
@Override
public URL getSchemaResource() {
return QualityADEContext.class.getResource("/qualityAde.xsd");
}
@Override
public List<String> getJAXBPackageNames() {
return Collections.singletonList("de.hft.stuttgart.quality.model.jaxb");
}
@Override
public boolean hasFeatureProperty(String name) {
return featureProperties.contains(name);
}
@Override
public boolean hasFeature(String name) {
return features.containsKey(name);
}
@Override
public Class<? extends AbstractFeature> getFeatureClass(String name) {
return features.get(name);
}
@Override
public QName getFeatureName(Class<? extends AbstractFeature> featureClass) {
for (Map.Entry<String, Class<? extends AbstractFeature>> entry : features.entrySet()) {
if (entry.getValue() == featureClass)
return new QName(getNamespaceURI(), entry.getKey());
}
return null;
}
@Override
public Map<String, Class<? extends AbstractFeature>> getFeatures() {
return Collections.unmodifiableMap(features);
}
@Override
public boolean isTopLevelFeature(String name) {
return false;
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.marshaller;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
import javax.xml.bind.JAXBElement;
import org.citygml4j.builder.jaxb.marshal.citygml.ade.ADEMarshallerHelper;
import org.citygml4j.model.citygml.ade.binding.ADEMarshaller;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.util.mapper.TypeMapper;
import de.hft.stuttgart.quality.model.AllPolygonsWrongOrientation;
import de.hft.stuttgart.quality.model.AttributeMissing;
import de.hft.stuttgart.quality.model.AttributeWrongValue;
import de.hft.stuttgart.quality.model.ConsecutivePointsSame;
import de.hft.stuttgart.quality.model.Edge;
import de.hft.stuttgart.quality.model.HoleOutside;
import de.hft.stuttgart.quality.model.InnerRingsNested;
import de.hft.stuttgart.quality.model.InteriorDisconnected;
import de.hft.stuttgart.quality.model.IntersectingRings;
import de.hft.stuttgart.quality.model.MultipleConnectedComponents;
import de.hft.stuttgart.quality.model.NonManifoldEdge;
import de.hft.stuttgart.quality.model.NonManifoldVertex;
import de.hft.stuttgart.quality.model.NonPlanarDistancePlane;
import de.hft.stuttgart.quality.model.NonPlanarNormalsDeviation;
import de.hft.stuttgart.quality.model.OrientationRingsSame;
import de.hft.stuttgart.quality.model.PolygonWrongOrientation;
import de.hft.stuttgart.quality.model.RingNotClosed;
import de.hft.stuttgart.quality.model.RingSelfIntersection;
import de.hft.stuttgart.quality.model.SolidNotClosed;
import de.hft.stuttgart.quality.model.SolidSelfIntersection;
import de.hft.stuttgart.quality.model.TooFewPoints;
import de.hft.stuttgart.quality.model.TooFewPolygons;
import de.hft.stuttgart.quality.model.Validation;
import de.hft.stuttgart.quality.model.ValidationError;
import de.hft.stuttgart.quality.model.ValidationResult;
import de.hft.stuttgart.quality.model.jaxb.AllPolygonsWrongOrientationType;
import de.hft.stuttgart.quality.model.jaxb.AttributeMissingType;
import de.hft.stuttgart.quality.model.jaxb.AttributeWrongValueType;
import de.hft.stuttgart.quality.model.jaxb.ConsecutivePointsSameType;
import de.hft.stuttgart.quality.model.jaxb.EdgeType;
import de.hft.stuttgart.quality.model.jaxb.HoleOutsideType;
import de.hft.stuttgart.quality.model.jaxb.InnerRingsNestedType;
import de.hft.stuttgart.quality.model.jaxb.InteriorDisconnectedType;
import de.hft.stuttgart.quality.model.jaxb.IntersectingRingsType;
import de.hft.stuttgart.quality.model.jaxb.MultipleConnectedComponentsType;
import de.hft.stuttgart.quality.model.jaxb.NonManifoldEdgeType;
import de.hft.stuttgart.quality.model.jaxb.NonManifoldVertexType;
import de.hft.stuttgart.quality.model.jaxb.NonPlanarDistancePlaneType;
import de.hft.stuttgart.quality.model.jaxb.NonPlanarNormalsDeviationType;
import de.hft.stuttgart.quality.model.jaxb.ObjectFactory;
import de.hft.stuttgart.quality.model.jaxb.OrientationRingsSameType;
import de.hft.stuttgart.quality.model.jaxb.PolygonWrongOrientationType;
import de.hft.stuttgart.quality.model.jaxb.RingNotClosedType;
import de.hft.stuttgart.quality.model.jaxb.RingSelfIntersectionType;
import de.hft.stuttgart.quality.model.jaxb.SolidNotClosedType;
import de.hft.stuttgart.quality.model.jaxb.SolidSelfIntersectionType;
import de.hft.stuttgart.quality.model.jaxb.TooFewPointsType;
import de.hft.stuttgart.quality.model.jaxb.TooFewPolygonsType;
import de.hft.stuttgart.quality.model.jaxb.ValidationErrorType;
import de.hft.stuttgart.quality.model.jaxb.ValidationResultType;
import de.hft.stuttgart.quality.model.jaxb.ValidationType;
public class QualityAdeMarshaller implements ADEMarshaller {
private final ReentrantLock lock = new ReentrantLock();
private final ObjectFactory factory = new ObjectFactory();
private TypeMapper<JAXBElement<?>> elementMapper;
private TypeMapper<Object> typeMapper;
private ADEMarshallerHelper helper;
private TypeMapper<JAXBElement<?>> getElementMapper() {
if (elementMapper == null) {
lock.lock();
try {
if (elementMapper == null) {
elementMapper = TypeMapper.<JAXBElement<?>>create().with(Validation.class, this::createValidation)
.with(ValidationResult.class, this::createValidationResult);
}
} finally {
lock.unlock();
}
}
return elementMapper;
}
private TypeMapper<Object> getTypeMapper() {
if (typeMapper == null) {
lock.lock();
try {
if (typeMapper == null) {
typeMapper = TypeMapper.create().with(Validation.class, this::marshalValidation)
.with(ValidationResult.class, this::marshalValidationResult)
.with(ConsecutivePointsSame.class, this::marshalConsecutivePointsSame)
.with(TooFewPoints.class, this::marshalTooFewPoints)
.with(RingSelfIntersection.class, this::marshalRingSelfIntersection)
.with(RingNotClosed.class, this::marshalRingNotClosed)
.with(InteriorDisconnected.class, this::marshalInteriorDisconnected)
.with(IntersectingRings.class, this::marshalIntersectingRings)
.with(NonPlanarDistancePlane.class, this::marshalNonPlanarDistancePlane)
.with(InnerRingsNested.class, this::marshalInnerRingsNested)
.with(HoleOutside.class, this::marshalHoleOutside)
.with(NonPlanarNormalsDeviation.class, this::marshalNonPlanarNormalsDeviation)
.with(OrientationRingsSame.class, this::marshalOrientationRingsSame)
.with(AllPolygonsWrongOrientation.class, this::marshalAllPolygonsWrongOrientation)
.with(PolygonWrongOrientation.class, this::marshalPolygonWrongOrientation)
.with(SolidSelfIntersection.class, this::marshalSolidSelfIntersection)
.with(NonManifoldVertex.class, this::marshalNonManifoldVertex)
.with(NonManifoldEdge.class, this::marshalNonManifoldEdge)
.with(SolidNotClosed.class, this::marshalSolidNotClosed)
.with(TooFewPolygons.class, this::marshalTooFewPolygons)
.with(MultipleConnectedComponents.class, this::marshalMultipleConnectedComponents)
.with(AttributeWrongValue.class, this::marshalAttributeWrongValue)
.with(AttributeMissing.class, this::marshalAttributeMissing);
}
} finally {
lock.unlock();
}
}
return typeMapper;
}
private ValidationType marshalValidation(Validation src) {
ValidationType dest = factory.createValidationType();
if (src.isSetDateTime()) {
dest.setValidationDate(src.getValidationDate());
}
if (src.isSetValidationSoftware()) {
dest.setValidationSoftware(src.getValidationSoftware());
}
if (src.isSetValidationPlan()) {
dest.setValidationPlan(src.getValidationPlan());
}
if (src.isSetStatistics()) {
dest.setStatistics(src.getStatistics());
}
return dest;
}
private ValidationResultType marshalValidationResult(ValidationResult src) {
ValidationResultType dest = factory.createValidationResultType();
dest.setResult(src.getResult());
if (src.hasErrors()) {
for (ValidationError err : src.getErrors()) {
dest.getErrors().add(marshalValidationError(err));
}
}
return dest;
}
private JAXBElement<?> createValidation(Validation src) {
return factory.createValidationType(marshalValidation(src));
}
private JAXBElement<?> createValidationResult(ValidationResult src) {
return factory.createValidationResultType(marshalValidationResult(src));
}
private ValidationErrorType marshalValidationError(ValidationError err) {
return (ValidationErrorType) marshal(err);
}
@Override
public void setADEMarshallerHelper(ADEMarshallerHelper helper) {
this.helper = helper;
}
@Override
public JAXBElement<?> marshalJAXBElement(ADEModelObject src) {
return getElementMapper().apply(src);
}
@Override
public Object marshal(ADEModelObject src) {
return getTypeMapper().apply(src);
}
private ConsecutivePointsSameType marshalConsecutivePointsSame(ConsecutivePointsSame src) {
ConsecutivePointsSameType dest = factory.createConsecutivePointsSameType();
dest.setLinearRingId(src.getLinearRingId());
if (src.getVertex1() != null) {
dest.setVertex1(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex1()));
}
if (src.getVertex2() != null) {
dest.setVertex2(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex2()));
}
return dest;
}
private TooFewPointsType marshalTooFewPoints(TooFewPoints src) {
TooFewPointsType dest = factory.createTooFewPointsType();
dest.setLinearRingId(src.getLinearRingId());
return dest;
}
private RingSelfIntersectionType marshalRingSelfIntersection(RingSelfIntersection src) {
RingSelfIntersectionType dest = factory.createRingSelfIntersectionType();
dest.setLinearRingId(src.getLinearRingId());
dest.setType(src.getType());
if (src.getEdge1() != null) {
dest.setEdge1(marshalEdge(src.getEdge1()));
}
if (src.getEdge2() != null) {
dest.setEdge2(marshalEdge(src.getEdge2()));
}
if (src.getVertex1() != null) {
dest.setVertex1(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex1()));
}
if (src.getVertex2() != null) {
dest.setVertex2(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex2()));
}
return dest;
}
private EdgeType marshalEdge(Edge src) {
EdgeType dest = new EdgeType();
if (src.getFrom() != null) {
dest.setFrom(helper.getGMLMarshaller().marshalDirectPosition(src.getFrom()));
}
if (src.getTo() != null) {
dest.setTo(helper.getGMLMarshaller().marshalDirectPosition(src.getTo()));
}
return dest;
}
private RingNotClosedType marshalRingNotClosed(RingNotClosed src) {
RingNotClosedType dest = new RingNotClosedType();
dest.setLinearRingId(src.getLinearRingId());
return dest;
}
private InteriorDisconnectedType marshalInteriorDisconnected(InteriorDisconnected src) {
InteriorDisconnectedType dest = new InteriorDisconnectedType();
dest.setPolygonId(src.getPolygonId());
return dest;
}
private IntersectingRingsType marshalIntersectingRings(IntersectingRings src) {
IntersectingRingsType dest = new IntersectingRingsType();
dest.setPolygonId(src.getPolygonId());
dest.setLinearRingId1(src.getLinearRingId1());
dest.setLinearRingId2(src.getLinearRingId2());
return dest;
}
private NonPlanarDistancePlaneType marshalNonPlanarDistancePlane(NonPlanarDistancePlane src) {
NonPlanarDistancePlaneType dest = new NonPlanarDistancePlaneType();
dest.setPolygonId(src.getPolygonId());
if (src.getVertex() != null) {
dest.setVertex(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex()));
}
if (src.getDistance() != null) {
dest.setDistance(helper.getGMLMarshaller().marshalLength(src.getDistance()));
}
return dest;
}
private InnerRingsNestedType marshalInnerRingsNested(InnerRingsNested src) {
InnerRingsNestedType dest = new InnerRingsNestedType();
dest.setPolygonId(src.getPolygonId());
dest.setLinearRingId1(src.getLinearRingId1());
dest.setLinearRingId2(src.getLinearRingId2());
return dest;
}
private HoleOutsideType marshalHoleOutside(HoleOutside src) {
HoleOutsideType dest = new HoleOutsideType();
dest.setPolygonId(src.getPolygonId());
dest.setLinearRingId(src.getLinearRingId());
return dest;
}
private NonPlanarNormalsDeviationType marshalNonPlanarNormalsDeviation(NonPlanarNormalsDeviation src) {
NonPlanarNormalsDeviationType dest = new NonPlanarNormalsDeviationType();
dest.setPolygonId(src.getPolygonId());
if (src.getDeviation() != null) {
dest.setDeviation(helper.getGMLMarshaller().marshalAngle(src.getDeviation()));
}
return dest;
}
private OrientationRingsSameType marshalOrientationRingsSame(OrientationRingsSame src) {
OrientationRingsSameType dest = new OrientationRingsSameType();
dest.setPolygonId(src.getPolygonId());
dest.setLinearRingId(src.getLinearRingId());
return dest;
}
private AllPolygonsWrongOrientationType marshalAllPolygonsWrongOrientation(AllPolygonsWrongOrientation src) {
AllPolygonsWrongOrientationType dest = new AllPolygonsWrongOrientationType();
dest.setGeometryId(src.getGeometryId());
return dest;
}
private PolygonWrongOrientationType marshalPolygonWrongOrientation(PolygonWrongOrientation src) {
PolygonWrongOrientationType dest = new PolygonWrongOrientationType();
dest.setGeometryId(src.getGeometryId());
if (src.isSetEdges()) {
List<EdgeType> edges = dest.getEdges();
for (Edge e : src.getEdges()) {
edges.add(marshalEdge(e));
}
}
return dest;
}
private SolidSelfIntersectionType marshalSolidSelfIntersection(SolidSelfIntersection src) {
SolidSelfIntersectionType dest = new SolidSelfIntersectionType();
dest.setGeometryId(src.getGeometryId());
dest.setPolygonId1(src.getPolygonId1());
dest.setPolygonId2(src.getPolygonId2());
return dest;
}
private NonManifoldVertexType marshalNonManifoldVertex(NonManifoldVertex src) {
NonManifoldVertexType dest = new NonManifoldVertexType();
dest.setGeometryId(src.getGeometryId());
if (src.getVertex() != null) {
dest.setVertex(helper.getGMLMarshaller().marshalDirectPosition(src.getVertex()));
}
return dest;
}
private NonManifoldEdgeType marshalNonManifoldEdge(NonManifoldEdge src) {
NonManifoldEdgeType dest = new NonManifoldEdgeType();
dest.setGeometryId(src.getGeometryId());
if (src.isSetEdges()) {
List<EdgeType> edges = dest.getEdges();
for (Edge e : src.getEdges()) {
edges.add(marshalEdge(e));
}
}
return dest;
}
private SolidNotClosedType marshalSolidNotClosed(SolidNotClosed src) {
SolidNotClosedType dest = new SolidNotClosedType();
dest.setGeometryId(src.getGeometryId());
if (src.isSetEdges()) {
List<EdgeType> edges = dest.getEdges();
for (Edge e : src.getEdges()) {
edges.add(marshalEdge(e));
}
}
return dest;
}
private TooFewPolygonsType marshalTooFewPolygons(TooFewPolygons src) {
TooFewPolygonsType dest = new TooFewPolygonsType();
dest.setGeometryId(src.getGeometryId());
return dest;
}
private MultipleConnectedComponentsType marshalMultipleConnectedComponents(MultipleConnectedComponents src) {
MultipleConnectedComponentsType dest = new MultipleConnectedComponentsType();
dest.setGeometryId(src.getGeometryId());
if (src.isSetComponents() ) {
dest.getComponents().addAll(src.getComponents());
}
return dest;
}
private AttributeWrongValueType marshalAttributeWrongValue(AttributeWrongValue src) {
AttributeWrongValueType dest = new AttributeWrongValueType();
dest.setAttributeName(src.getAttributeName());
dest.setChildId(src.getChildId());
dest.setGeneric(src.isGeneric());
return dest;
}
private AttributeMissingType marshalAttributeMissing(AttributeMissing src) {
AttributeMissingType dest = new AttributeMissingType();
dest.setAttributeName(src.getAttributeName());
dest.setChildId(src.getChildId());
dest.setGeneric(src.isGeneric());
return dest;
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.marshaller;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
import javax.xml.bind.JAXBElement;
import org.citygml4j.builder.jaxb.unmarshal.citygml.ade.ADEUnmarshallerHelper;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.citygml.ade.binding.ADEUnmarshaller;
import org.citygml4j.util.mapper.CheckedTypeMapper;
import org.citygml4j.xml.io.reader.MissingADESchemaException;
import de.hft.stuttgart.quality.model.AllPolygonsWrongOrientation;
import de.hft.stuttgart.quality.model.AttributeMissing;
import de.hft.stuttgart.quality.model.AttributeWrongValue;
import de.hft.stuttgart.quality.model.ConsecutivePointsSame;
import de.hft.stuttgart.quality.model.Edge;
import de.hft.stuttgart.quality.model.HoleOutside;
import de.hft.stuttgart.quality.model.InnerRingsNested;
import de.hft.stuttgart.quality.model.InteriorDisconnected;
import de.hft.stuttgart.quality.model.IntersectingRings;
import de.hft.stuttgart.quality.model.MultipleConnectedComponents;
import de.hft.stuttgart.quality.model.NonManifoldEdge;
import de.hft.stuttgart.quality.model.NonManifoldVertex;
import de.hft.stuttgart.quality.model.NonPlanarDistancePlane;
import de.hft.stuttgart.quality.model.NonPlanarNormalsDeviation;
import de.hft.stuttgart.quality.model.OrientationRingsSame;
import de.hft.stuttgart.quality.model.PolygonWrongOrientation;
import de.hft.stuttgart.quality.model.RingNotClosed;
import de.hft.stuttgart.quality.model.RingSelfIntersection;
import de.hft.stuttgart.quality.model.SolidNotClosed;
import de.hft.stuttgart.quality.model.SolidSelfIntersection;
import de.hft.stuttgart.quality.model.TooFewPoints;
import de.hft.stuttgart.quality.model.TooFewPolygons;
import de.hft.stuttgart.quality.model.Validation;
import de.hft.stuttgart.quality.model.ValidationError;
import de.hft.stuttgart.quality.model.ValidationResult;
import de.hft.stuttgart.quality.model.jaxb.AllPolygonsWrongOrientationType;
import de.hft.stuttgart.quality.model.jaxb.AttributeMissingType;
import de.hft.stuttgart.quality.model.jaxb.AttributeWrongValueType;
import de.hft.stuttgart.quality.model.jaxb.ConsecutivePointsSameType;
import de.hft.stuttgart.quality.model.jaxb.EdgeType;
import de.hft.stuttgart.quality.model.jaxb.HoleOutsideType;
import de.hft.stuttgart.quality.model.jaxb.InnerRingsNestedType;
import de.hft.stuttgart.quality.model.jaxb.InteriorDisconnectedType;
import de.hft.stuttgart.quality.model.jaxb.IntersectingRingsType;
import de.hft.stuttgart.quality.model.jaxb.MultipleConnectedComponentsType;
import de.hft.stuttgart.quality.model.jaxb.NonManifoldEdgeType;
import de.hft.stuttgart.quality.model.jaxb.NonManifoldVertexType;
import de.hft.stuttgart.quality.model.jaxb.NonPlanarDistancePlaneType;
import de.hft.stuttgart.quality.model.jaxb.NonPlanarNormalsDeviationType;
import de.hft.stuttgart.quality.model.jaxb.OrientationRingsSameType;
import de.hft.stuttgart.quality.model.jaxb.PolygonWrongOrientationType;
import de.hft.stuttgart.quality.model.jaxb.RingNotClosedType;
import de.hft.stuttgart.quality.model.jaxb.RingSelfIntersectionType;
import de.hft.stuttgart.quality.model.jaxb.SolidNotClosedType;
import de.hft.stuttgart.quality.model.jaxb.SolidSelfIntersectionType;
import de.hft.stuttgart.quality.model.jaxb.TooFewPointsType;
import de.hft.stuttgart.quality.model.jaxb.TooFewPolygonsType;
import de.hft.stuttgart.quality.model.jaxb.ValidationErrorType;
import de.hft.stuttgart.quality.model.jaxb.ValidationResultType;
import de.hft.stuttgart.quality.model.jaxb.ValidationType;
import de.hft.stuttgart.quality.util.UncheckedMissingADESchemaException;
public class QualityAdeUnmarshaller implements ADEUnmarshaller {
private final ReentrantLock lock = new ReentrantLock();
private CheckedTypeMapper<ADEModelObject> typeMapper;
private ADEUnmarshallerHelper helper;
private CheckedTypeMapper<ADEModelObject> getTypeMapper() {
if (typeMapper == null) {
lock.lock();
try {
if (typeMapper == null) {
typeMapper = CheckedTypeMapper.<ADEModelObject>create()
.with(ValidationType.class, this::unmarshalValidationType)
.with(ValidationResultType.class, this::umarshalValidationResultType)
.with(ConsecutivePointsSameType.class, this::unmarshalConsecutivePointsSameType)
.with(TooFewPointsType.class, this::unmarshalTooFewPointsType)
.with(RingSelfIntersectionType.class, this::unmarshalRingSelfIntersectionType)
.with(RingNotClosedType.class, this::unmarshalRingNotClosedType)
.with(InteriorDisconnectedType.class, this::unmarshalInteriorDisconnectedType)
.with(IntersectingRingsType.class, this::unmarshalIntersectingRingsType)
.with(NonPlanarDistancePlaneType.class, this::unmarshalNonPlanarDistancePlaneType)
.with(InnerRingsNestedType.class, this::unmarshalInnerRingsType)
.with(HoleOutsideType.class, this::unmarshalHoleOutsideType)
.with(OrientationRingsSameType.class, this::unmarshalOrientationRingsSameType)
.with(NonPlanarNormalsDeviationType.class, this::unmarshalNonPlanarNormalsDeviationType)
.with(AllPolygonsWrongOrientationType.class, this::unmarshalAllPolygonsWrongOrientationType)
.with(PolygonWrongOrientationType.class, this::unmarshalPolygonWrongOrientationType)
.with(SolidSelfIntersectionType.class, this::unmarshalSolidSelfIntersectionType)
.with(NonManifoldVertexType.class, this::unmarshalNonManifoldVertexType)
.with(NonManifoldEdgeType.class, this::unmarshalNonManifoldEdgeType)
.with(SolidNotClosedType.class, this::unmarshalSolidNotClosedType)
.with(TooFewPolygonsType.class, this::unmarshalTooFewPolygonsType)
.with(MultipleConnectedComponentsType.class, this::unmarshalMultipleConnectedComponentsType)
.with(AttributeWrongValueType.class, this::unmarshalAttributeWrongValueType)
.with(AttributeMissingType.class, this::unmarshalAttributeMissingType);
}
} finally {
lock.unlock();
}
}
return typeMapper;
}
@Override
public void setADEUnmarshallerHelper(ADEUnmarshallerHelper helper) {
this.helper = helper;
}
@Override
public ADEModelObject unmarshal(JAXBElement<?> src) throws MissingADESchemaException {
return unmarshal(src.getValue());
}
@Override
public ADEModelObject unmarshal(Object src) throws MissingADESchemaException {
return getTypeMapper().apply(src);
}
private Validation unmarshalValidationType(ValidationType src) {
Validation dest = new Validation();
dest.setValidationDate(src.getValidationDate());
dest.setValidationSoftware(src.getValidationSoftware());
dest.setValidationPlan(src.getValidationPlan());
dest.setStatistics(src.getStatistics());
return dest;
}
private ValidationResult umarshalValidationResultType(ValidationResultType src) throws MissingADESchemaException {
ValidationResult dest = new ValidationResult();
dest.setResult(src.getResult());
if (src.isSetErrors()) {
try {
dest.getErrors()
.addAll(src.getErrors().stream().map(this::unmarshalError).collect(Collectors.toList()));
} catch (UncheckedMissingADESchemaException e) {
throw e.getCause();
}
}
return dest;
}
private ValidationError unmarshalError(ValidationErrorType err) {
try {
return (ValidationError) getTypeMapper().apply(err);
} catch (MissingADESchemaException e) {
throw new UncheckedMissingADESchemaException(e);
}
}
private ConsecutivePointsSame unmarshalConsecutivePointsSameType(ConsecutivePointsSameType src) {
ConsecutivePointsSame dest = new ConsecutivePointsSame();
dest.setLinearRingId(src.getLinearRingId());
dest.setVertex1(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex1()));
dest.setVertex2(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex2()));
return dest;
}
private TooFewPoints unmarshalTooFewPointsType(TooFewPointsType src) {
TooFewPoints dest = new TooFewPoints();
dest.setLinearRingId(src.getLinearRingId());
return dest;
}
private RingSelfIntersection unmarshalRingSelfIntersectionType(RingSelfIntersectionType src) {
RingSelfIntersection dest = new RingSelfIntersection();
if (src.getEdge1() != null) {
dest.setEdge1(unmarshalEdge(src.getEdge1()));
}
if (src.getEdge2() != null) {
dest.setEdge2(unmarshalEdge(src.getEdge2()));
}
dest.setLinearRingId(src.getLinearRingId());
dest.setType(src.getType());
if (src.getVertex1() != null) {
dest.setVertex1(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex1()));
}
if (src.getVertex2() != null) {
dest.setVertex2(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex2()));
}
return dest;
}
private RingNotClosed unmarshalRingNotClosedType(RingNotClosedType src) {
RingNotClosed dest = new RingNotClosed();
dest.setLinearRingId(src.getLinearRingId());
return dest;
}
private Edge unmarshalEdge(EdgeType src) {
Edge dest = new Edge();
if (src.getFrom() != null) {
dest.setFrom(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getFrom()));
}
if (src.getTo() != null) {
dest.setTo(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getTo()));
}
return dest;
}
private InteriorDisconnected unmarshalInteriorDisconnectedType(InteriorDisconnectedType src) {
InteriorDisconnected dest = new InteriorDisconnected();
dest.setPolygonId(src.getPolygonId());
return dest;
}
private IntersectingRings unmarshalIntersectingRingsType(IntersectingRingsType src) {
IntersectingRings dest = new IntersectingRings();
dest.setPolygonId(src.getPolygonId());
dest.setLinearRingId1(src.getLinearRingId1());
dest.setLinearRingId2(src.getLinearRingId2());
return dest;
}
private InnerRingsNested unmarshalInnerRingsType(InnerRingsNestedType src) {
InnerRingsNested dest = new InnerRingsNested();
dest.setPolygonId(src.getPolygonId());
dest.setLinearRingId1(src.getLinearRingId1());
dest.setLinearRingId2(src.getLinearRingId2());
return dest;
}
private NonPlanarDistancePlane unmarshalNonPlanarDistancePlaneType(NonPlanarDistancePlaneType src) {
NonPlanarDistancePlane dest = new NonPlanarDistancePlane();
dest.setPolygonId(src.getPolygonId());
if (src.getVertex() != null) {
dest.setVertex(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex()));
}
if (src.getDistance() != null) {
dest.setDistance(helper.getGMLUnmarshaller().unmarshalLength(src.getDistance()));
}
return dest;
}
private HoleOutside unmarshalHoleOutsideType(HoleOutsideType src) {
HoleOutside dest = new HoleOutside();
dest.setPolygonId(src.getPolygonId());
dest.setLinearRingId(src.getLinearRingId());
return dest;
}
private NonPlanarNormalsDeviation unmarshalNonPlanarNormalsDeviationType(NonPlanarNormalsDeviationType src) {
NonPlanarNormalsDeviation dest = new NonPlanarNormalsDeviation();
dest.setPolygonId(src.getPolygonId());
if (src.getDeviation() != null) {
dest.setDeviation(helper.getGMLUnmarshaller().unmarshalAngle(src.getDeviation()));
}
return dest;
}
private OrientationRingsSame unmarshalOrientationRingsSameType(OrientationRingsSameType src) {
OrientationRingsSame dest = new OrientationRingsSame();
dest.setPolygonId(src.getPolygonId());
dest.setLinearRingId(src.getLinearRingId());
return dest;
}
private AllPolygonsWrongOrientation unmarshalAllPolygonsWrongOrientationType(AllPolygonsWrongOrientationType src) {
AllPolygonsWrongOrientation dest = new AllPolygonsWrongOrientation();
dest.setGeometryId(src.getGeometryId());
return dest;
}
private PolygonWrongOrientation unmarshalPolygonWrongOrientationType(PolygonWrongOrientationType src) {
PolygonWrongOrientation dest = new PolygonWrongOrientation();
dest.setGeometryId(src.getGeometryId());
if (src.isSetEdges()) {
List<Edge> edges = dest.getEdges();
for (EdgeType e : src.getEdges()) {
edges.add(unmarshalEdge(e));
}
}
return dest;
}
private SolidSelfIntersection unmarshalSolidSelfIntersectionType(SolidSelfIntersectionType src) {
SolidSelfIntersection dest = new SolidSelfIntersection();
dest.setGeometryId(src.getGeometryId());
dest.setPolygonId1(src.getPolygonId1());
dest.setPolygonId2(src.getPolygonId2());
return dest;
}
private NonManifoldVertex unmarshalNonManifoldVertexType(NonManifoldVertexType src) {
NonManifoldVertex dest = new NonManifoldVertex();
dest.setGeometryId(src.getGeometryId());
if (src.getVertex() != null) {
dest.setVertex(helper.getGMLUnmarshaller().unmarshalDirectPosition(src.getVertex()));
}
return dest;
}
private NonManifoldEdge unmarshalNonManifoldEdgeType(NonManifoldEdgeType src) {
NonManifoldEdge dest = new NonManifoldEdge();
dest.setGeometryId(src.getGeometryId());
if (src.isSetEdges()) {
List<Edge> edges = dest.getEdges();
for (EdgeType e : src.getEdges()) {
edges.add(unmarshalEdge(e));
}
}
return dest;
}
private SolidNotClosed unmarshalSolidNotClosedType(SolidNotClosedType src) {
SolidNotClosed dest = new SolidNotClosed();
dest.setGeometryId(src.getGeometryId());
if (src.isSetEdges()) {
List<Edge> edges = dest.getEdges();
for (EdgeType e : src.getEdges()) {
edges.add(unmarshalEdge(e));
}
}
return dest;
}
private TooFewPolygons unmarshalTooFewPolygonsType(TooFewPolygonsType src) {
TooFewPolygons dest = new TooFewPolygons();
dest.setGeometryId(src.getGeometryId());
return dest;
}
private MultipleConnectedComponents unmarshalMultipleConnectedComponentsType(MultipleConnectedComponentsType src) {
MultipleConnectedComponents dest = new MultipleConnectedComponents();
dest.setGeometryId(src.getGeometryId());
if (src.isSetComponents()) {
dest.getComponents().addAll(src.getComponents());
}
return dest;
}
private AttributeWrongValue unmarshalAttributeWrongValueType(AttributeWrongValueType src) {
AttributeWrongValue dest = new AttributeWrongValue();
dest.setAttributeName(src.getAttributeName());
dest.setChildId(src.getChildId());
dest.setGeneric(src.isGeneric());
return dest;
}
private AttributeMissing unmarshalAttributeMissingType(AttributeMissingType src) {
AttributeMissing dest = new AttributeMissing();
dest.setAttributeName(src.getAttributeName());
dest.setChildId(src.getChildId());
dest.setGeneric(src.isGeneric());
return dest;
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.marshaller;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import javax.xml.bind.annotation.adapters.XmlAdapter;
public class ZonedDateTimeAdapter extends XmlAdapter<String, ZonedDateTime> {
@Override
public ZonedDateTime unmarshal(String v) throws Exception {
try {
return ZonedDateTime.from(DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(v));
} catch (Exception e) {
return LocalDateTime.parse(v).atZone(ZoneId.systemDefault());
}
}
@Override
public String marshal(ZonedDateTime v) throws Exception {
return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(v);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class AllPolygonsWrongOrientation extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = 3817224755569965908L;
private String geometryId;
public void setGeometryId(String geometryId) {
this.geometryId = geometryId;
}
public String getGeometryId() {
return geometryId;
}
@Override
public String toString() {
return "AllPolygonsWrongOrientation [geometryId=" + geometryId + "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new AllPolygonsWrongOrientation(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class AttributeMissing extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = -5416574100733885169L;
private String childId;
private String attributeName;
private boolean generic;
public String getChildId() {
return childId;
}
public void setChildId(String childId) {
this.childId = childId;
}
public String getAttributeName() {
return attributeName;
}
public void setAttributeName(String attributeName) {
this.attributeName = attributeName;
}
public boolean isGeneric() {
return generic;
}
public void setGeneric(boolean generic) {
this.generic = generic;
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new AttributeWrongValue(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class AttributeWrongValue extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = -5650985861847806620L;
private String childId;
private String attributeName;
private boolean generic;
public String getChildId() {
return childId;
}
public void setChildId(String childId) {
this.childId = childId;
}
public String getAttributeName() {
return attributeName;
}
public void setAttributeName(String attributeName) {
this.attributeName = attributeName;
}
public boolean isGeneric() {
return generic;
}
public void setGeneric(boolean generic) {
this.generic = generic;
}
@Override
public String toString() {
return "AttributeWrongValue [childId=" + childId + ", attributeName=" + attributeName + ", generic=" + generic
+ "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new AttributeWrongValue(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
public class ConsecutivePointsSame extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = -838421312521561747L;
private String linearRingId;
private DirectPosition vertex1;
private DirectPosition vertex2;
public void setLinearRingId(String linearRingId) {
this.linearRingId = linearRingId;
}
public void setVertex1(DirectPosition vertex1) {
this.vertex1 = vertex1;
}
public void setVertex2(DirectPosition vertex2) {
this.vertex2 = vertex2;
}
public String getLinearRingId() {
return linearRingId;
}
public DirectPosition getVertex1() {
return vertex1;
}
public DirectPosition getVertex2() {
return vertex2;
}
@Override
public String toString() {
return "ConsecutivePointsSame [linearRingId=" + linearRingId + ", vertex1=" + vertex1 + ", vertex2=" + vertex2
+ "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new ConsecutivePointsSame(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import java.io.Serializable;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
public class Edge implements Serializable {
private static final long serialVersionUID = -5076265818764666094L;
private DirectPosition from;
private DirectPosition to;
public void setFrom(DirectPosition from) {
this.from = from;
}
public void setTo(DirectPosition to) {
this.to = to;
}
public DirectPosition getFrom() {
return from;
}
public DirectPosition getTo() {
return to;
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class HoleOutside extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = -3029497342950689843L;
private String polygonId;
private String linearRingId;
public void setPolygonId(String polygonId) {
this.polygonId = polygonId;
}
public void setLinearRingId(String linearRingId) {
this.linearRingId = linearRingId;
}
public String getPolygonId() {
return polygonId;
}
public String getLinearRingId() {
return linearRingId;
}
@Override
public String toString() {
return "HoleOutside [polygonId=" + polygonId + ", linearRingId=" + linearRingId + "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new HoleOutside(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class InnerRingsNested extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = 2291087505629924993L;
private String polygonId;
private String linearRingId1;
private String linearRingId2;
public void setPolygonId(String polygonId) {
this.polygonId = polygonId;
}
public void setLinearRingId1(String linearRingId1) {
this.linearRingId1 = linearRingId1;
}
public void setLinearRingId2(String linearRingId2) {
this.linearRingId2 = linearRingId2;
}
public String getPolygonId() {
return polygonId;
}
public String getLinearRingId1() {
return linearRingId1;
}
public String getLinearRingId2() {
return linearRingId2;
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new InnerRingsNested(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class InteriorDisconnected extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = 8443642232356795359L;
private String polygonId;
public void setPolygonId(String polygonId) {
this.polygonId = polygonId;
}
public String getPolygonId() {
return polygonId;
}
@Override
public String toString() {
return "InteriorDisconnected [polygonId=" + polygonId + "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new InteriorDisconnected(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class IntersectingRings extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = 7668529369582991408L;
private String polygonId;
private String linearRingId1;
private String linearRingId2;
public void setPolygonId(String polygonId) {
this.polygonId = polygonId;
}
public void setLinearRingId1(String linearRingId1) {
this.linearRingId1 = linearRingId1;
}
public void setLinearRingId2(String linearRingId2) {
this.linearRingId2 = linearRingId2;
}
public String getPolygonId() {
return polygonId;
}
public String getLinearRingId1() {
return linearRingId1;
}
public String getLinearRingId2() {
return linearRingId2;
}
@Override
public String toString() {
return "IntersectingRings [polygonId=" + polygonId + ", linearRingId1=" + linearRingId1 + ", linearRingId2="
+ linearRingId2 + "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new IntersectingRings(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import java.util.ArrayList;
import java.util.List;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
import de.hft.stuttgart.quality.model.jaxb.Component;
public class MultipleConnectedComponents extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = -4199420154182053060L;
private String geometryId;
private List<Component> components;
public void setGeometryId(String geometryId) {
this.geometryId = geometryId;
}
public String getGeometryId() {
return geometryId;
}
public boolean isSetComponents() {
return components != null && !components.isEmpty();
}
public List<Component> getComponents() {
if (components == null) {
components = new ArrayList<>();
}
return components;
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new MultipleConnectedComponents(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import java.util.ArrayList;
import java.util.List;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
public class NonManifoldEdge extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = -4312748985706248178L;
private String geometryId;
private List<Edge> edges;
public String getGeometryId() {
return geometryId;
}
public void setGeometryId(String geometryId) {
this.geometryId = geometryId;
}
public boolean isSetEdges() {
return edges != null && !edges.isEmpty();
}
public List<Edge> getEdges() {
if (edges == null) {
edges = new ArrayList<>();
}
return edges;
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new NonPlanarNormalsDeviation(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
public class NonManifoldVertex extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = -3434116956866828127L;
private String geometryId;
private DirectPosition vertex;
public void setGeometryId(String geometryId) {
this.geometryId = geometryId;
}
public void setVertex(DirectPosition vertex) {
this.vertex = vertex;
}
public String getGeometryId() {
return geometryId;
}
public DirectPosition getVertex() {
return vertex;
}
@Override
public String toString() {
return "NonManifoldVertex [geometryId=" + geometryId + ", vertex=" + vertex + "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new NonManifoldVertex(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
/*-
* Copyright 2020 Hochschule für Technik Stuttgart
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.citygml.ade.binding.ADEModelObject;
import org.citygml4j.model.common.visitor.FeatureFunctor;
import org.citygml4j.model.common.visitor.FeatureVisitor;
import org.citygml4j.model.common.visitor.GMLFunctor;
import org.citygml4j.model.common.visitor.GMLVisitor;
import org.citygml4j.model.gml.feature.AbstractFeature;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
import org.citygml4j.model.gml.measures.Length;
public class NonPlanarDistancePlane extends AbstractFeature implements ValidationError, ADEModelObject {
private static final long serialVersionUID = -3428574131554438219L;
private String polygonId;
private DirectPosition vertex;
private Length distance;
public void setPolygonId(String polygonId) {
this.polygonId = polygonId;
}
public void setVertex(DirectPosition vertex) {
this.vertex = vertex;
}
public void setDistance(Length distance) {
this.distance = distance;
}
public String getPolygonId() {
return polygonId;
}
public DirectPosition getVertex() {
return vertex;
}
public Length getDistance() {
return distance;
}
@Override
public String toString() {
return "NonPlanarDistancePlane [polygonId=" + polygonId + ", vertex=" + vertex + ", distance=" + distance + "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new NonPlanarDistancePlane(), copyBuilder);
}
@Override
public void accept(FeatureVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(FeatureFunctor<T> visitor) {
return visitor.apply(this);
}
@Override
public void accept(GMLVisitor visitor) {
visitor.visit(this);
}
@Override
public <T> T accept(GMLFunctor<T> visitor) {
return visitor.apply(this);
}
}
Markdown is supported
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