Commit 521d4e8d authored by Riegel's avatar Riegel
Browse files

Refactor: Remove unused fields

Showing with 5 additions and 9 deletions
+5 -9
...@@ -24,8 +24,6 @@ public class LibraryObject extends Geometry { ...@@ -24,8 +24,6 @@ public class LibraryObject extends Geometry {
private static final Logger logger = LogManager.getLogger(LibraryObject.class); private static final Logger logger = LogManager.getLogger(LibraryObject.class);
@Serial @Serial
private static final long serialVersionUID = -50293435187454911L; private static final long serialVersionUID = -50293435187454911L;
private final String filepath;
private final ParserConfiguration config;
private static Map<String, LibraryObject> libraryObjects = new ConcurrentHashMap<>(); private static Map<String, LibraryObject> libraryObjects = new ConcurrentHashMap<>();
public static LibraryObject of(Path path, ParserConfiguration config) { public static LibraryObject of(Path path, ParserConfiguration config) {
...@@ -36,7 +34,7 @@ public class LibraryObject extends Geometry { ...@@ -36,7 +34,7 @@ public class LibraryObject extends Geometry {
if (protoGeom == null) { if (protoGeom == null) {
return null; return null;
} }
LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod(), path, config); LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod());
protoGeom.getPolygons().forEach(libOb::addPolygon); protoGeom.getPolygons().forEach(libOb::addPolygon);
libOb.updateEdgesAndVertices(); libOb.updateEdgesAndVertices();
libraryObjects.put(path.toString(), libOb); libraryObjects.put(path.toString(), libOb);
...@@ -52,17 +50,15 @@ public class LibraryObject extends Geometry { ...@@ -52,17 +50,15 @@ public class LibraryObject extends Geometry {
if (protoGeom == null) { if (protoGeom == null) {
return null; return null;
} }
LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod(), Path.of(fileName), config); LibraryObject libOb = new LibraryObject(protoGeom.getType(), protoGeom.getLod());
protoGeom.getPolygons().forEach(libOb::addPolygon); protoGeom.getPolygons().forEach(libOb::addPolygon);
libOb.updateEdgesAndVertices(); libOb.updateEdgesAndVertices();
libraryObjects.put(fileName, libOb); libraryObjects.put(fileName, libOb);
return libOb; return libOb;
} }
private LibraryObject(GeometryType type, Lod lod, Path path, ParserConfiguration config) { private LibraryObject(GeometryType type, Lod lod) {
super(type, lod); super(type, lod);
this.filepath = path.toString();
this.config = config;
} }
...@@ -111,9 +107,9 @@ public class LibraryObject extends Geometry { ...@@ -111,9 +107,9 @@ public class LibraryObject extends Geometry {
} }
List<CityObject> objects = model.createFeatureStream().toList(); List<CityObject> objects = model.createFeatureStream().toList();
if (objects.isEmpty()) { if (objects.isEmpty()) {
throw new InvalidGmlFileException("Referenced library-object's gml file does not contain a CityGML object!"); throw new InvalidGmlFileException("Referenced library-object gml file does not contain any CityGML objects!");
} else if (objects.size() > 1) { } else if (objects.size() > 1) {
throw new InvalidGmlFileException("Referenced library-object's gml file contains more than one CityGML object!"); throw new InvalidGmlFileException("Referenced library-object gml file contains more than one CityGML object!");
} }
return objects.get(0).getHighestLodGeometry(); return objects.get(0).getHighestLodGeometry();
} }
......
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