Skip to content

Commit

Permalink
added point and curve style settings for transportation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhihang Yao committed Sep 6, 2024
1 parent 90de487 commit e506354
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public VisExportPreferences(ViewController viewController, Config config) {
() -> config.getVisExportConfig().getGenericCityObjectPointAndCurve(),
config)));
renderingNode.addChildEntry(genericCityObjectRenderingNode);

renderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.landUse.styling",
() -> config.getVisExportConfig().getLandUseStyles(),
Expand All @@ -80,10 +81,17 @@ public VisExportPreferences(ViewController viewController, Config config) {
"pref.tree.visExport.relief.styling",
() -> config.getVisExportConfig().getReliefStyles(),
config)));
renderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.transportation.styling",
() -> config.getVisExportConfig().getTransportationStyles(),
DefaultPreferencesEntry transportationComplexRenderingNode = new EmptyPanel(
() -> Language.I18N.getString("pref.tree.visExport.transportation.styling"));
transportationComplexRenderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.surfaceAndSolid.styling",
() -> config.getVisExportConfig().getGenericCityObjectStyles(),
config)));
transportationComplexRenderingNode.addChildEntry(new DefaultPreferencesEntry(new PointAndCurveStylingPanel(
() -> config.getVisExportConfig().getTransportationPointAndCurve(),
config)));
renderingNode.addChildEntry(transportationComplexRenderingNode);

renderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.tunnel.styling",
() -> config.getVisExportConfig().getTunnelStyles(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"vegetationBalloon",
"transportationStyles",
"transportationBalloon",
"transportationPointAndCurve",
"reliefStyles",
"reliefBalloon",
"cityFurnitureStyles",
Expand Down Expand Up @@ -109,6 +110,7 @@ public class VisExportConfig {
@XmlJavaTypeAdapter(StylesAdapter.class)
private Styles transportationStyles;
private Balloon transportationBalloon;
private PointAndCurve transportationPointAndCurve;
@XmlJavaTypeAdapter(StylesAdapter.class)
private Styles reliefStyles;
private Balloon reliefBalloon;
Expand Down Expand Up @@ -166,6 +168,7 @@ public VisExportConfig() {
vegetationBalloon = new Balloon();
transportationStyles = new Styles();
transportationBalloon = new Balloon();
transportationPointAndCurve = new PointAndCurve();
reliefStyles = new Styles();
reliefBalloon = new Balloon();
cityFurnitureStyles = new Styles();
Expand Down Expand Up @@ -503,6 +506,14 @@ public Balloon getTransportationBalloon() {
return transportationBalloon;
}

public void setTransportationPointAndCurve(PointAndCurve TransportationPointAndCurve) {
this.transportationPointAndCurve = TransportationPointAndCurve;
}

public PointAndCurve getTransportationPointAndCurve() {
return transportationPointAndCurve;
}

public Styles getReliefStyles() {
return reliefStyles;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ public interface ADEVisExportQueryHelper {
String getWaterBodyQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);
String getLandUseQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);
String getTransportationQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);
String getTransportationPointAndCurveQuery(int lodToExportFrom, int objectClassId);
String getReliefQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ private void addStyle(DisplayForm displayForm, int objectClassId, SAXWriter saxW
case RAILWAY:
case ROAD:
case SQUARE:
addPointAndCurveStyle(saxWriter, config.getVisExportConfig().getTransportationPointAndCurve(), Transportation.STYLE_BASIS_NAME);
style = config.getVisExportConfig().getTransportationStyles().getOrDefault(type);
styleBasisName = Transportation.STYLE_BASIS_NAME;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ protected AbstractVisObject(Connection connection,
defaultX3dMaterial.setSpecularColor(getX3dColorFromString("1.0 1.0 1.0"));
defaultX3dMaterial.setEmissiveColor(getX3dColorFromString("0.0 0.0 0.0"));

queries = new Queries(databaseAdapter, visExporterManager.getDatabaseAdapter().getConnectionDetails().getSchema());
queries = new Queries(databaseAdapter, visExporterManager.getDatabaseAdapter().getConnectionDetails().getSchema(), this.visExporterManager);
imageReader = new ImageReader();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,17 @@ public String getTransportationQuery(int lod, DisplayForm displayForm, int objec
return query;
}

@Override
public String getTransportationPointAndCurveQuery(int lodToExportFrom, int objectClassId) {
String query = new StringBuilder("SELECT tc.lod0_network, ")
.append(implicitGeometryNullColumns)
.append("FROM ").append(schema).append(".transportation_complex tc ")
.append("WHERE tc.id = ? ")
.append("AND tc.lod0_network IS NOT NULL").toString();

return unionADEQueries(QUERY_POINT_AND_CURVE_GEOMETRY, query, lodToExportFrom, objectClassId);
}

// ----------------------------------------------------------------------
// RELIEF QUERIES
// ----------------------------------------------------------------------
Expand Down
Loading

0 comments on commit e506354

Please sign in to comment.