Commit 98b386d2 authored by Claus Nagel's avatar Claus Nagel
Browse files

updated citygml4j module to support QualityADE version 0.1.4

parent 6cf1abce
/*
* Copyright 2021 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;
public enum ErrorType {
GE_R_TOO_FEW_POINTS,
GE_R_NOT_CLOSED,
GE_R_CONSECUTIVE_POINTS_SAME,
GE_R_SELF_INTERSECTION,
GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE,
GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION,
GE_P_INTERIOR_DISCONNECTED,
GE_P_INTERSECTING_RINGS,
GE_P_HOLE_OUTSIDE,
GE_P_ORIENTATION_RINGS_SAME,
GE_P_INNER_RINGS_NESTED,
GE_S_TOO_FEW_POLYGONS,
GE_S_NOT_CLOSED,
GE_S_NON_MANIFOLD_EDGE,
GE_S_POLYGON_WRONG_ORIENTATION,
GE_S_ALL_POLYGONS_WRONG_ORIENTATION,
GE_S_NON_MANIFOLD_VERTEX,
GE_S_SELF_INTERSECTION,
GE_S_MULTIPLE_CONNECTED_COMPONENTS,
SE_ATTRIBUTE_WRONG_VALUE,
SE_ATTRIBUTE_MISSING;
public static ErrorType fromValue(String value) {
for (ErrorType constant : ErrorType.values()) {
if (constant.name().equals(value)) {
return constant;
}
}
return null;
}
}
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,44 +13,43 @@ ...@@ -13,44 +13,43 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model; package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.builder.copy.ObjectCopier;
public class AttributeMissing extends SemanticError { public class FeatureStatistics extends AbstractDataType {
private int numChecked;
private static final long serialVersionUID = -5416574100733885169L; private int numErrors;
private String childId;
private String attributeName;
private boolean generic;
public String getChildId() { public int getNumChecked() {
return childId; return numChecked;
} }
public void setChildId(String childId) { public void setNumChecked(int numChecked) {
this.childId = childId; this.numChecked = numChecked;
} }
public String getAttributeName() { public int getNumErrors() {
return attributeName; return numErrors;
} }
public void setAttributeName(String attributeName) { public void setNumErrors(int numErrors) {
this.attributeName = attributeName; this.numErrors = numErrors;
} }
public boolean isGeneric() { @Override
return generic; public Object copyTo(Object target, CopyBuilder copyBuilder) {
} FeatureStatistics copy = target == null ?
new FeatureStatistics() :
(FeatureStatistics) target;
public void setGeneric(boolean generic) { return ObjectCopier.copyTo(this, copy, copyBuilder);
this.generic = generic; }
}
@Override @Override
public Object copy(CopyBuilder copyBuilder) { public Object copy(CopyBuilder copyBuilder) {
return copyTo(new AttributeWrongValue(), copyBuilder); return copyTo(new FeatureStatistics(), copyBuilder);
} }
} }
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,19 +13,24 @@ ...@@ -13,19 +13,24 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model;
public abstract class RingError extends ValidationError { package de.hft.stuttgart.quality.model;
private static final long serialVersionUID = -8610600028811350500L; public enum FeatureType {
BUILDING,
private String linearRingId; TRANSPORTATION,
VEGETATION,
BRIDGE,
WATER,
LAND;
public void setLinearRingId(String linearRingId) { public static FeatureType fromValue(String value) {
this.linearRingId = linearRingId; for (FeatureType constant : FeatureType.values()) {
} if (constant.name().equals(value)) {
return constant;
}
}
public String getLinearRingId() { return null;
return linearRingId; }
}
} }
/*
* Copyright 2021 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.builder.copy.ObjectCopier;
import java.util.ArrayList;
import java.util.List;
public class Filter extends AbstractDataType {
private List<FeatureType> featureTypes;
public boolean isSetFeatureTypes() {
return featureTypes != null && !featureTypes.isEmpty();
}
public List<FeatureType> getFeatureTypes() {
if (featureTypes == null) {
featureTypes = new ArrayList<>();
}
return featureTypes;
}
public void setFeatureTypes(List<FeatureType> featureTypes) {
this.featureTypes = featureTypes;
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
Filter copy = target == null ?
new Filter() :
(Filter) target;
return ObjectCopier.copyTo(this, copy, copyBuilder);
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new Filter(), copyBuilder);
}
}
/*-
* 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;
public class InteriorDisconnected extends PolygonError {
private static final long serialVersionUID = 8443642232356795359L;
@Override
public String toString() {
return "InteriorDisconnected [polygonId=" + getPolygonId() + "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new InteriorDisconnected(), copyBuilder);
}
}
/*
* Copyright 2021 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.builder.copy.ObjectCopier;
public class Parameter extends AbstractDataType {
private String name;
private String uom;
private String value;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUom() {
return uom;
}
public void setUom(String uom) {
this.uom = uom;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
Parameter copy = target == null ?
new Parameter() :
(Parameter) target;
return ObjectCopier.copyTo(this, copy, copyBuilder);
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new Parameter(), copyBuilder);
}
}
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,41 +13,40 @@ ...@@ -13,41 +13,40 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model; package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.builder.copy.ObjectCopier;
public class IntersectingRings extends PolygonError {
public class PolygonHoleOutside extends AbstractPolygonError {
private static final long serialVersionUID = 7668529369582991408L; private String linearRingId;
private String linearRingId1; public String getLinearRingId() {
private String linearRingId2; return linearRingId;
}
public void setLinearRingId1(String linearRingId1) {
this.linearRingId1 = linearRingId1; public void setLinearRingId(String linearRingId) {
} this.linearRingId = linearRingId;
}
public void setLinearRingId2(String linearRingId2) {
this.linearRingId2 = linearRingId2; @Override
} public ErrorType getErrorType() {
return ErrorType.GE_P_HOLE_OUTSIDE;
public String getLinearRingId1() { }
return linearRingId1;
} @Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
public String getLinearRingId2() { PolygonHoleOutside copy = target == null ?
return linearRingId2; new PolygonHoleOutside() :
} (PolygonHoleOutside) target;
@Override super.copyTo(copy, copyBuilder);
public String toString() { return ObjectCopier.copyTo(this, copy, copyBuilder);
return "IntersectingRings [polygonId=" + getPolygonId() + ", linearRingId1=" + linearRingId1 + ", linearRingId2=" }
+ linearRingId2 + "]";
} @Override
public Object copy(CopyBuilder copyBuilder) {
@Override return copyTo(new PolygonHoleOutside(), copyBuilder);
public Object copy(CopyBuilder copyBuilder) { }
return copyTo(new IntersectingRings(), copyBuilder);
}
} }
/*
* Copyright 2021 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.builder.copy.ObjectCopier;
public class PolygonInnerRingsNested extends AbstractPolygonError {
private String linearRingId1;
private String linearRingId2;
public String getLinearRingId1() {
return linearRingId1;
}
public void setLinearRingId1(String linearRingId1) {
this.linearRingId1 = linearRingId1;
}
public String getLinearRingId2() {
return linearRingId2;
}
public void setLinearRingId2(String linearRingId2) {
this.linearRingId2 = linearRingId2;
}
@Override
public ErrorType getErrorType() {
return ErrorType.GE_P_INNER_RINGS_NESTED;
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
PolygonInnerRingsNested copy = target == null ?
new PolygonInnerRingsNested() :
(PolygonInnerRingsNested) target;
super.copyTo(copy, copyBuilder);
return ObjectCopier.copyTo(this, copy, copyBuilder);
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new PolygonInnerRingsNested(), copyBuilder);
}
}
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,35 +13,29 @@ ...@@ -13,35 +13,29 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model; package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
public class InnerRingsNested extends PolygonError { public class PolygonInteriorDisconnected extends AbstractPolygonError {
private static final long serialVersionUID = 2291087505629924993L;
private String linearRingId1;
private String linearRingId2;
public void setLinearRingId1(String linearRingId1) {
this.linearRingId1 = linearRingId1;
}
public void setLinearRingId2(String linearRingId2) { @Override
this.linearRingId2 = linearRingId2; public ErrorType getErrorType() {
} return ErrorType.GE_P_INTERIOR_DISCONNECTED;
}
public String getLinearRingId1() { @Override
return linearRingId1; public Object copyTo(Object target, CopyBuilder copyBuilder) {
} PolygonInteriorDisconnected copy = target == null ?
new PolygonInteriorDisconnected() :
(PolygonInteriorDisconnected) target;
public String getLinearRingId2() { return super.copyTo(copy, copyBuilder);
return linearRingId2; }
}
@Override @Override
public Object copy(CopyBuilder copyBuilder) { public Object copy(CopyBuilder copyBuilder) {
return copyTo(new InnerRingsNested(), copyBuilder); return copyTo(new PolygonInteriorDisconnected(), copyBuilder);
} }
} }
/*
* Copyright 2021 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.builder.copy.ObjectCopier;
public class PolygonIntersectingRings extends AbstractPolygonError {
private String linearRingId1;
private String linearRingId2;
public PolygonIntersectingRings() {
}
public PolygonIntersectingRings(String linearRingId1, String linearRingId2) {
setLinearRingId1(linearRingId1);
setLinearRingId2(linearRingId2);
}
public String getLinearRingId1() {
return linearRingId1;
}
public void setLinearRingId1(String linearRingId1) {
this.linearRingId1 = linearRingId1;
}
public String getLinearRingId2() {
return linearRingId2;
}
public void setLinearRingId2(String linearRingId2) {
this.linearRingId2 = linearRingId2;
}
@Override
public ErrorType getErrorType() {
return ErrorType.GE_P_INTERSECTING_RINGS;
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
PolygonIntersectingRings copy = target == null ?
new PolygonIntersectingRings() :
(PolygonIntersectingRings) target;
super.copyTo(copy, copyBuilder);
return ObjectCopier.copyTo(this, copy, copyBuilder);
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new PolygonIntersectingRings(), copyBuilder);
}
}
/*
* Copyright 2021 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.builder.copy.ObjectCopier;
import org.citygml4j.model.common.base.ModelObjects;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
import org.citygml4j.model.gml.measures.Length;
public class PolygonNonPlanarDistancePlane extends AbstractPolygonError {
private Length distance;
private DirectPosition vertex;
public Length getDistance() {
return distance;
}
public void setDistance(Length distance) {
this.distance = ModelObjects.setParent(distance, this);
}
public DirectPosition getVertex() {
return vertex;
}
public void setVertex(DirectPosition vertex) {
this.vertex = ModelObjects.setParent(vertex, this);
}
@Override
public ErrorType getErrorType() {
return ErrorType.GE_P_NON_PLANAR_POLYGON_DISTANCE_PLANE;
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
PolygonNonPlanarDistancePlane copy = target == null ?
new PolygonNonPlanarDistancePlane() :
(PolygonNonPlanarDistancePlane) target;
super.copyTo(copy, copyBuilder);
return ObjectCopier.copyTo(this, copy, copyBuilder);
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new PolygonNonPlanarDistancePlane(), copyBuilder);
}
}
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,32 +13,42 @@ ...@@ -13,32 +13,42 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model; package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.builder.copy.ObjectCopier;
import org.citygml4j.model.common.base.ModelObjects;
import org.citygml4j.model.gml.measures.Angle; import org.citygml4j.model.gml.measures.Angle;
public class NonPlanarNormalsDeviation extends PolygonError { public class PolygonNonPlanarNormalsDeviation extends AbstractPolygonError {
private Angle deviation;
public Angle getDeviation() {
return deviation;
}
private static final long serialVersionUID = -8574024132334399550L; public void setDeviation(Angle deviation) {
this.deviation = ModelObjects.setParent(deviation, this);
private Angle deviation; }
public void setDeviation(Angle deviation) { @Override
this.deviation = deviation; public ErrorType getErrorType() {
} return ErrorType.GE_P_NON_PLANAR_POLYGON_NORMALS_DEVIATION;
}
public Angle getDeviation() { @Override
return deviation; public Object copyTo(Object target, CopyBuilder copyBuilder) {
} PolygonNonPlanarNormalsDeviation copy = target == null ?
new PolygonNonPlanarNormalsDeviation() :
(PolygonNonPlanarNormalsDeviation) target;
@Override super.copyTo(copy, copyBuilder);
public String toString() { return ObjectCopier.copyTo(this, copy, copyBuilder);
return "NonPlanarNormalsDeviation [polygonId=" + getPolygonId() + ", deviation=" + deviation + "]"; }
}
@Override @Override
public Object copy(CopyBuilder copyBuilder) { public Object copy(CopyBuilder copyBuilder) {
return copyTo(new NonPlanarNormalsDeviation(), copyBuilder); return copyTo(new PolygonNonPlanarNormalsDeviation(), copyBuilder);
} }
} }
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,50 +13,40 @@ ...@@ -13,50 +13,40 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model; package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.builder.copy.ObjectCopier;
public class AttributeWrongValue extends SemanticError {
public class PolygonOrientationRingsSame extends AbstractPolygonError {
private static final long serialVersionUID = -5650985861847806620L; private String linearRingId;
private String childId; public String getLinearRingId() {
private String attributeName; return linearRingId;
private boolean generic; }
public String getChildId() { public void setLinearRingId(String linearRingId) {
return childId; this.linearRingId = linearRingId;
} }
public void setChildId(String childId) { @Override
this.childId = childId; public ErrorType getErrorType() {
} return ErrorType.GE_P_ORIENTATION_RINGS_SAME;
}
public String getAttributeName() {
return attributeName; @Override
} public Object copyTo(Object target, CopyBuilder copyBuilder) {
PolygonOrientationRingsSame copy = target == null ?
public void setAttributeName(String attributeName) { new PolygonOrientationRingsSame() :
this.attributeName = attributeName; (PolygonOrientationRingsSame) target;
}
super.copyTo(copy, copyBuilder);
public boolean isGeneric() { return ObjectCopier.copyTo(this, copy, copyBuilder);
return generic; }
}
@Override
public void setGeneric(boolean generic) { public Object copy(CopyBuilder copyBuilder) {
this.generic = generic; return copyTo(new PolygonOrientationRingsSame(), copyBuilder);
} }
@Override
public String toString() {
return "AttributeWrongValue [childId=" + childId + ", attributeName=" + attributeName + ", generic=" + generic
+ "]";
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new AttributeWrongValue(), copyBuilder);
}
} }
/*
* Copyright 2021 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.builder.copy.ObjectCopier;
import org.citygml4j.model.common.base.ModelObjects;
import org.citygml4j.model.common.child.ChildList;
import java.util.List;
public class Requirement extends AbstractDataType {
private boolean enabled;
private RequirementType requirementType;
private List<Parameter> parameters;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public RequirementType getRequirementType() {
return requirementType;
}
public void setRequirementType(RequirementType requirementType) {
this.requirementType = requirementType;
}
public boolean isSetParameters() {
return parameters != null && !parameters.isEmpty();
}
public List<Parameter> getParameters() {
if (parameters == null) {
parameters = new ChildList<>(this);
}
return parameters;
}
public void setParameters(List<Parameter> parameters) {
this.parameters = ModelObjects.setParent(parameters, this);
}
@Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
Requirement copy = target == null ?
new Requirement() :
(Requirement) target;
return ObjectCopier.copyTo(this, copy, copyBuilder);
}
@Override
public Object copy(CopyBuilder copyBuilder) {
return copyTo(new Requirement(), copyBuilder);
}
}
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,43 +13,38 @@ ...@@ -13,43 +13,38 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
public class ConsecutivePointsSame extends RingError { package de.hft.stuttgart.quality.model;
private static final long serialVersionUID = -838421312521561747L;
private DirectPosition vertex1;
private DirectPosition vertex2;
public void setVertex1(DirectPosition vertex1) {
this.vertex1 = vertex1;
}
public void setVertex2(DirectPosition vertex2) {
this.vertex2 = vertex2;
}
public DirectPosition getVertex1() {
return vertex1;
}
public DirectPosition getVertex2() {
return vertex2;
}
@Override public enum RequirementType {
public String toString() { R_GE_R_TOO_FEW_POINTS,
return "ConsecutivePointsSame [linearRingId=" + getLinearRingId() + ", vertex1=" + vertex1 + ", vertex2=" + vertex2 R_GE_R_NOT_CLOSED,
+ "]"; R_GE_R_CONSECUTIVE_POINTS_SAME,
} R_GE_R_SELF_INTERSECTION,
R_GE_P_NON_PLANAR,
R_GE_P_INTERIOR_DISCONNECTED,
R_GE_P_INTERSECTING_RINGS,
R_GE_P_HOLE_OUTSIDE,
R_GE_P_ORIENTATION_RINGS_SAME,
R_GE_P_INNER_RINGS_NESTED,
R_GE_S_TOO_FEW_POLYGONS,
R_GE_S_NOT_CLOSED,
R_GE_S_NON_MANIFOLD_EDGE,
R_GE_S_POLYGON_WRONG_ORIENTATION,
R_GE_S_ALL_POLYGONS_WRONG_ORIENTATION,
R_GE_S_NON_MANIFOLD_VERTEX,
R_GE_S_SELF_INTERSECTION,
R_GE_S_MULTIPLE_CONNECTED_COMPONENTS,
R_SE_ATTRIBUTES_EXISTING,
R_SE_ATTRIBUTES_CORRECT;
@Override public static RequirementType fromValue(String value) {
public Object copy(CopyBuilder copyBuilder) { for (RequirementType constant : RequirementType.values()) {
return copyTo(new ConsecutivePointsSame(), copyBuilder); if (constant.name().equals(value)) {
} return constant;
}
}
return null;
}
} }
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,19 +13,21 @@ ...@@ -13,19 +13,21 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model;
public abstract class PolygonError extends ValidationError { package de.hft.stuttgart.quality.model;
private static final long serialVersionUID = 4694297467768369526L; public enum ResultType {
OK,
private String polygonId; ERROR,
NOT_CHECKED;
public void setPolygonId(String polygonId) { public static ResultType fromValue(String value) {
this.polygonId = polygonId; for (ResultType constant : ResultType.values()) {
} if (constant.name().equals(value)) {
return constant;
}
}
public String getPolygonId() { return null;
return polygonId; }
}
} }
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,32 +13,51 @@ ...@@ -13,32 +13,51 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model; package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.builder.copy.ObjectCopier;
import org.citygml4j.model.common.base.ModelObjects;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition; import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
public class NonManifoldVertex extends SolidError { public class RingConsecutivePointsSame extends AbstractRingError {
private DirectPosition vertex1;
private DirectPosition vertex2;
public DirectPosition getVertex1() {
return vertex1;
}
public void setVertex1(DirectPosition vertex1) {
this.vertex1 = ModelObjects.setParent(vertex1, this);
}
public DirectPosition getVertex2() {
return vertex2;
}
private static final long serialVersionUID = -3434116956866828127L; public void setVertex2(DirectPosition vertex2) {
this.vertex2 = ModelObjects.setParent(vertex2, this);
private DirectPosition vertex; }
public void setVertex(DirectPosition vertex) { @Override
this.vertex = vertex; public ErrorType getErrorType() {
} return ErrorType.GE_R_CONSECUTIVE_POINTS_SAME;
}
public DirectPosition getVertex() { @Override
return vertex; public Object copyTo(Object target, CopyBuilder copyBuilder) {
} RingConsecutivePointsSame copy = target == null ?
new RingConsecutivePointsSame() :
(RingConsecutivePointsSame) target;
@Override super.copyTo(copy, copyBuilder);
public String toString() { return ObjectCopier.copyTo(this, copy, copyBuilder);
return "NonManifoldVertex [geometryId=" + getGeometryId() + ", vertex=" + vertex + "]"; }
}
@Override @Override
public Object copy(CopyBuilder copyBuilder) { public Object copy(CopyBuilder copyBuilder) {
return copyTo(new NonManifoldVertex(), copyBuilder); return copyTo(new RingConsecutivePointsSame(), copyBuilder);
} }
} }
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,21 +13,29 @@ ...@@ -13,21 +13,29 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model; package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
public class RingNotClosed extends RingError { public class RingNotClosed extends AbstractRingError {
private static final long serialVersionUID = 5502668444088395535L; @Override
public ErrorType getErrorType() {
@Override return ErrorType.GE_R_NOT_CLOSED;
public String toString() { }
return "RingNotClosed [linearRingId=" + getLinearRingId() + "]";
} @Override
public Object copyTo(Object target, CopyBuilder copyBuilder) {
RingNotClosed copy = target == null ?
new RingNotClosed() :
(RingNotClosed) target;
return super.copyTo(copy, copyBuilder);
}
@Override @Override
public Object copy(CopyBuilder copyBuilder) { public Object copy(CopyBuilder copyBuilder) {
return copyTo(new RingNotClosed(), copyBuilder); return copyTo(new RingNotClosed(), copyBuilder);
} }
} }
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,71 +13,69 @@ ...@@ -13,71 +13,69 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model; package de.hft.stuttgart.quality.model;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
import org.citygml4j.builder.copy.ObjectCopier;
import org.citygml4j.model.common.base.ModelObjects;
import org.citygml4j.model.gml.geometry.primitives.DirectPosition; import org.citygml4j.model.gml.geometry.primitives.DirectPosition;
import de.hft.stuttgart.quality.model.jaxb.RingSelfIntType; public class RingSelfIntersection extends AbstractRingError {
private Edge edge1;
private Edge edge2;
private String type;
private DirectPosition vertex;
public class RingSelfIntersection extends RingError { public Edge getEdge1() {
return edge1;
}
private static final long serialVersionUID = -4426615638983209222L; public void setEdge1(Edge edge1) {
this.edge1 = ModelObjects.setParent(edge1, this);
private RingSelfIntType type; }
private Edge edge1;
private Edge edge2;
private DirectPosition vertex1;
private DirectPosition vertex2;
public void setType(RingSelfIntType type) { public Edge getEdge2() {
this.type = type; return edge2;
} }
public void setEdge1(Edge edge1) { public void setEdge2(Edge edge2) {
this.edge1 = edge1; this.edge2 = ModelObjects.setParent(edge2, this);
} }
public void setEdge2(Edge edge2) { public String getType() {
this.edge2 = edge2; return type;
} }
public void setVertex1(DirectPosition vertex1) { public void setType(String type) {
this.vertex1 = vertex1; this.type = type;
} }
public void setVertex2(DirectPosition vertex2) {
this.vertex2 = vertex2;
}
public RingSelfIntType getType() { public DirectPosition getVertex() {
return type; return vertex;
} }
public Edge getEdge1() { public void setVertex(DirectPosition vertex) {
return edge1; this.vertex = ModelObjects.setParent(vertex, this);
} }
public Edge getEdge2() { @Override
return edge2; public ErrorType getErrorType() {
} return ErrorType.GE_R_SELF_INTERSECTION;
}
public DirectPosition getVertex1() { @Override
return vertex1; public Object copyTo(Object target, CopyBuilder copyBuilder) {
} RingSelfIntersection copy = target == null ?
new RingSelfIntersection() :
public DirectPosition getVertex2() { (RingSelfIntersection) target;
return vertex2;
}
@Override super.copyTo(copy, copyBuilder);
public String toString() { return ObjectCopier.copyTo(this, copy, copyBuilder);
return "RingSelfIntersection [linearRingId=" + getLinearRingId() + ", type=" + type + ", edge1=" + edge1 + ", edge2=" }
+ edge2 + ", vertex1=" + vertex1 + ", vertex2=" + vertex2 + "]";
}
@Override @Override
public Object copy(CopyBuilder copyBuilder) { public Object copy(CopyBuilder copyBuilder) {
return copyTo(new RingSelfIntersection(), copyBuilder); return copyTo(new RingSelfIntersection(), copyBuilder);
} }
} }
/*- /*
* Copyright 2020 Hochschule für Technik Stuttgart * Copyright 2021 Hochschule für Technik Stuttgart
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
...@@ -13,32 +13,29 @@ ...@@ -13,32 +13,29 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package de.hft.stuttgart.quality.model;
import java.util.ArrayList; package de.hft.stuttgart.quality.model;
import java.util.List;
import org.citygml4j.builder.copy.CopyBuilder; import org.citygml4j.builder.copy.CopyBuilder;
public class NonManifoldEdge extends SolidError { public class RingTooFewPoints extends AbstractRingError {
private static final long serialVersionUID = -4312748985706248178L;
private List<Edge> edges; @Override
public ErrorType getErrorType() {
return ErrorType.GE_R_TOO_FEW_POINTS;
}
public boolean isSetEdges() { @Override
return edges != null && !edges.isEmpty(); public Object copyTo(Object target, CopyBuilder copyBuilder) {
} RingTooFewPoints copy = target == null ?
new RingTooFewPoints() :
(RingTooFewPoints) target;
public List<Edge> getEdges() { return super.copyTo(copy, copyBuilder);
if (edges == null) { }
edges = new ArrayList<>();
}
return edges;
}
@Override @Override
public Object copy(CopyBuilder copyBuilder) { public Object copy(CopyBuilder copyBuilder) {
return copyTo(new NonPlanarNormalsDeviation(), copyBuilder); return copyTo(new RingTooFewPoints(), copyBuilder);
} }
} }
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