Commit 638dedb3 authored by Riegel's avatar Riegel
Browse files

Add Tab for GenericAttributes

parent 314f1216
......@@ -228,7 +228,13 @@ public class Citygml3FeatureMapper extends ObjectWalker {
parseAndAddSolid(as.getLod1Solid(), Lod.LOD1, co);
parseAndAddSolid(as.getLod2Solid(), Lod.LOD2, co);
parseAndAddSolid(as.getLod3Solid(), Lod.LOD3, co);
parseAndAddGenericAttributes(as, co);
}
private void parseAndAddGenericAttributes(AbstractSpace as, CityObject co) {
for (AbstractGenericAttributeProperty aga : as.getGenericAttributes()) {
co.addGenericAttribute(new GenericAttribute(aga));
}
}
@Override
......@@ -903,7 +909,6 @@ public class Citygml3FeatureMapper extends ObjectWalker {
}
}
SurfaceMapper surfaceMapper = new SurfaceMapper(polygonMap, references, compositeMap, vertexMap, config);
for (AbstractSpaceBoundaryProperty surfaceProp : gmlAb.getBoundaries()) {
if (!surfaceProp.isSetObject()) {
......
......@@ -41,6 +41,7 @@ import java.util.Set;
*/
public final class CityGmlUtils {
private CityGmlUtils() {
// util class
}
......
......@@ -64,6 +64,7 @@ MainWindow.errorsTab=Errors
MainWindow.polygonsTab=Polygons
MainWindow.edgesTab=Edges
MainWindow.verticesTab=Vertices
MainWindow.attributeTab=Attributes
MainWindow.logTab=Log
MainWindow.globalErrorsTab=Global Errors
OpenFileDialog.fileLabel=File:
......
......@@ -62,6 +62,7 @@ MainWindow.errorsTab=Fehler
MainWindow.polygonsTab=Polygone
MainWindow.edgesTab=Kanten
MainWindow.verticesTab=Punkte
MainWindow.attributeTab=Attribute
MainWindow.logTab=Log
MainWindow.globalErrorsTab=Globale Fehler
OpenFileDialog.fileLabel=Datei:
......
......@@ -428,6 +428,7 @@ public class CityDoctorController {
mainWindow.getCityFurnitureView().setRoot(null);
mainWindow.getOtherObjectsView().setRoot(null);
mainWindow.getErrorTree().getRoot().getChildren().clear();
mainWindow.getAttributeView().getRoot().getChildren().clear();
mainWindow.getGlobalErrorsView().getItems().clear();
clearGeometryTrees();
}
......
......@@ -78,6 +78,9 @@ public class MainWindow extends Application {
@FXML
private TreeView<Renderable> cityFurnitureView;
@FXML
private TreeView<Renderable> attributeView;
@FXML
TreeView<Renderable> otherObjectsView;
......@@ -177,6 +180,9 @@ public class MainWindow extends Application {
@FXML
private Tab verticesTab;
@FXML
private Tab attributeTab;
@FXML
private Tab logTab;
......@@ -419,6 +425,7 @@ public class MainWindow extends Application {
polygonsTab.setText(Localization.getText("MainWindow.polygonsTab"));
edgesTab.setText(Localization.getText("MainWindow.edgesTab"));
verticesTab.setText(Localization.getText("MainWindow.verticesTab"));
attributeTab.setText(Localization.getText("MainWindow.attributeTab"));
logTab.setText(Localization.getText("MainWindow.logTab"));
globalErrorsTab.setText(Localization.getText("MainWindow.globalErrorsTab"));
memoryLabel.setText(Localization.getText("MainWindow.memoryLabel"));
......@@ -746,6 +753,7 @@ public class MainWindow extends Application {
vegetationView.setShowRoot(true);
setupSelectListener(vegetationView);
vegetationView.setCellFactory(param -> new RenderableTreeCell());
vegetationView.setContextMenu(cMenu);
transView.setShowRoot(true);
setupSelectListener(transView);
......@@ -786,6 +794,10 @@ public class MainWindow extends Application {
setupSelectListener(edgeView);
edgeView.setRoot(new TreeItem<>());
edgeView.setCellFactory(param -> new RenderableTreeCell());
setupSelectListener(attributeView);
attributeView.setRoot(new TreeItem<>());
attributeView.setCellFactory(param -> new RenderableTreeCell());
}
private void setupSelectListener(TreeView<Renderable> view) {
......@@ -979,6 +991,10 @@ public class MainWindow extends Application {
return cityFurnitureView;
}
public TreeView<Renderable> getAttributeView() {
return attributeView;
}
public TreeView<Renderable> getOtherObjectsView() {
return otherObjectsView;
}
......@@ -1036,6 +1052,7 @@ public class MainWindow extends Application {
polygonView.getSelectionModel().clearSelection();
edgeView.getSelectionModel().clearSelection();
vertexView.getSelectionModel().clearSelection();
attributeView.getSelectionModel().clearSelection();
errorView.getSelectionModel().clearSelection();
}
......
......@@ -185,6 +185,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(building);
errorUpdater.run();
addGenericAttributesToView(building);
});
};
refresher.run();
......@@ -234,6 +235,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(bp);
errorUpdater.run();
addGenericAttributesToView(bp);
});
};
refresher.run();
......@@ -268,6 +270,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(room);
errorUpdater.run();
addGenericAttributesToView(room);
});
};
refresher.run();
......@@ -293,6 +296,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(furniture);
errorUpdater.run();
addGenericAttributesToView(furniture);
});
};
refresher.run();
......@@ -318,6 +322,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(storey);
errorUpdater.run();
addGenericAttributesToView(storey);
});
};
refresher.run();
......@@ -343,6 +348,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(buildingUnit);
errorUpdater.run();
addGenericAttributesToView(buildingUnit);
});
};
refresher.run();
......@@ -368,6 +374,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(tunnel);
errorUpdater.run();
addGenericAttributesToView(tunnel);
});
};
refresher.run();
......@@ -435,6 +442,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(bridge);
errorUpdater.run();
addGenericAttributesToView(bridge);
});
};
refresher.run();
......@@ -469,6 +477,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(co);
errorUpdater.run();
addGenericAttributesToView(co);
});
};
refresher.run();
......@@ -482,6 +491,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(relief);
errorUpdater.run();
addGenericAttributesToView(relief);
});
};
refresher.run();
......@@ -504,6 +514,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(bi);
errorUpdater.run();
addGenericAttributesToView(bi);
});
};
refresher.run();
......@@ -529,6 +540,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(cf);
errorUpdater.run();
addGenericAttributesToView(cf);
});
};
refresher.run();
......@@ -548,6 +560,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(gco);
errorUpdater.run();
addGenericAttributesToView(gco);
});
};
refresher.run();
......@@ -573,6 +586,7 @@ public class Renderer {
Platform.runLater(() -> {
errorUpdater = () -> displayErrors(bs);
errorUpdater.run();
addGenericAttributesToView(bs);
});
};
refresher.run();
......@@ -648,6 +662,7 @@ public class Renderer {
currentGeometry = geom;
}
addGeometryDataToView(geom);
addGenericAttributesToView(geom.getParent());
mainWindow.zoomOutForBoundingBox(BoundingBox.of(geom.getPolygons()));
errorUpdater = () -> displayErrors(geom);
errorUpdater.run();
......@@ -668,6 +683,13 @@ public class Renderer {
}
}
private void addGenericAttributesToView(CityObject co) {
clearAttributes();
for (GenericAttribute gen : co.getGenericAttributes()) {
addGenericAttributeToView(gen);
}
}
private void addVertexToView(Vertex v) {
Renderable cf = new VertexNode(v);
TreeItem<Renderable> ti = new TreeItem<>(cf);
......@@ -711,6 +733,12 @@ public class Renderer {
}
}
private void addGenericAttributeToView(GenericAttribute gen) {
GenericAttributeNode genNode = new GenericAttributeNode(gen);
TreeItem<Renderable> ti = new TreeItem<>(genNode);
mainWindow.getAttributeView().getRoot().getChildren().add(ti);
}
private CheckStatus determineCheckStatus(Checkable c) {
if (!c.isValidated()) {
return CheckStatus.NOT_CHECKED;
......@@ -742,6 +770,7 @@ public class Renderer {
Platform.runLater(() -> {
loadingDialog.show();
clearGeometryTrees();
clearAttributes();
});
Thread t = new Thread(() -> {
Set<ConcretePolygon> polygons = new HashSet<>();
......@@ -774,6 +803,7 @@ public class Renderer {
Platform.runLater(() -> {
loadingDialog.show();
clearGeometryTrees();
clearAttributes();
});
Thread t = new Thread(() -> {
currentTriGeom = TriangulatedGeometry.of(model, lodFilters);
......@@ -807,6 +837,7 @@ public class Renderer {
Platform.runLater(() -> {
loadingDialog.show();
clearGeometryTrees();
clearAttributes();
});
Thread t = new Thread(() -> {
Set<ConcretePolygon> polygons = new HashSet<>();
......@@ -843,6 +874,7 @@ public class Renderer {
Platform.runLater(() -> {
loadingDialog.show();
clearGeometryTrees();
clearAttributes();
});
Thread t = new Thread(() -> {
Set<ConcretePolygon> polygons = new HashSet<>();
......@@ -877,6 +909,7 @@ public class Renderer {
Platform.runLater(() -> {
loadingDialog.show();
clearGeometryTrees();
clearAttributes();
});
Thread t = new Thread(() -> {
Set<ConcretePolygon> polygons = new HashSet<>();
......@@ -909,6 +942,7 @@ public class Renderer {
Platform.runLater(() -> {
loadingDialog.show();
clearGeometryTrees();
clearAttributes();
});
Thread t = new Thread(() -> {
Set<ConcretePolygon> polygons = new HashSet<>();
......@@ -935,6 +969,7 @@ public class Renderer {
Platform.runLater(() -> {
loadingDialog.show();
clearGeometryTrees();
clearAttributes();
});
Thread t = new Thread(() -> {
Set<ConcretePolygon> polygons = new HashSet<>();
......@@ -1099,9 +1134,14 @@ public class Renderer {
Platform.runLater(() -> {
mainWindow.getMeshGroup().getChildren().clear();
clearGeometryTrees();
clearAttributes();
});
}
private void clearAttributes() {
mainWindow.getAttributeView().getRoot().getChildren().clear();
}
public void highlight(Polygon p) {
highlightController.highlight(p, currentTriGeom);
}
......
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.control.SplitPane?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.TreeView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane fx:id="mainPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="400.0" minWidth="400.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1">
<center>
<SplitPane fx:id="mainContainer" dividerPositions="0.47069431920649235" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="300.0" prefHeight="600.0" prefWidth="1100.0">
......@@ -129,6 +113,11 @@
<TreeView fx:id="vertexView" prefHeight="200.0" prefWidth="200.0" showRoot="false" />
</content>
</Tab>
<Tab fx:id="attributeTab" text="Attributes">
<content>
<TreeView fx:id="attributeView" prefHeight="200.0" prefWidth="200.0" showRoot="false"/>
</content>
</Tab>
</tabs>
</TabPane>
</items>
......
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