Skip to content

Commit

Permalink
added point and curve style settings for furniture and vegetation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhihang Yao committed Sep 25, 2024
1 parent e0f26dc commit a5affac
Show file tree
Hide file tree
Showing 7 changed files with 321 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,18 @@ public VisExportPreferences(ViewController viewController, Config config) {
true, true, true, true,
config)));
renderingNode.addChildEntry(new DefaultPreferencesEntry(new BuildingStylingPanel(config)));
renderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.cityFurniture.styling",

DefaultPreferencesEntry cityFurnitureRenderingNode = new EmptyPanel(
() -> Language.I18N.getString("pref.tree.visExport.cityFurniture.styling"));
cityFurnitureRenderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.surfaceAndSolid.styling",
() -> config.getVisExportConfig().getCityFurnitureStyles(),
config)));
cityFurnitureRenderingNode.addChildEntry(new DefaultPreferencesEntry(new PointAndCurveStylingPanel(
() -> config.getVisExportConfig().getCityFurniturePointAndCurve(),
config)));
renderingNode.addChildEntry(cityFurnitureRenderingNode);

renderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.cityObjectGroup.styling",
() -> config.getVisExportConfig().getReliefStyles(),
Expand Down Expand Up @@ -85,7 +93,7 @@ public VisExportPreferences(ViewController viewController, Config config) {
() -> Language.I18N.getString("pref.tree.visExport.transportation.styling"));
transportationComplexRenderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.surfaceAndSolid.styling",
() -> config.getVisExportConfig().getGenericCityObjectStyles(),
() -> config.getVisExportConfig().getTransportationStyles(),
config)));
transportationComplexRenderingNode.addChildEntry(new DefaultPreferencesEntry(new PointAndCurveStylingPanel(
() -> config.getVisExportConfig().getTransportationPointAndCurve(),
Expand All @@ -97,10 +105,18 @@ public VisExportPreferences(ViewController viewController, Config config) {
() -> config.getVisExportConfig().getTunnelStyles(),
true, true, true, true,
config)));
renderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.vegetation.styling",

DefaultPreferencesEntry vegetationRenderingNode = new EmptyPanel(
() -> Language.I18N.getString("pref.tree.visExport.vegetation.styling"));
vegetationRenderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.surfaceAndSolid.styling",
() -> config.getVisExportConfig().getVegetationStyles(),
config)));
vegetationRenderingNode.addChildEntry(new DefaultPreferencesEntry(new PointAndCurveStylingPanel(
() -> config.getVisExportConfig().getSolitaryVegetationObjectPointAndCurve(),
config)));
renderingNode.addChildEntry(vegetationRenderingNode);

renderingNode.addChildEntry(new DefaultPreferencesEntry(new SurfaceStylingPanel(
"pref.tree.visExport.waterBody.styling",
() -> config.getVisExportConfig().getWaterBodyStyles(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@
"landUseBalloon",
"vegetationStyles",
"vegetationBalloon",
"solitaryVegetationObjectPointAndCurve",
"transportationStyles",
"transportationBalloon",
"transportationPointAndCurve",
"reliefStyles",
"reliefBalloon",
"cityFurnitureStyles",
"cityFurnitureBalloon",
"cityFurniturePointAndCurve",
"genericCityObjectStyles",
"genericCityObject3DBalloon",
"genericCityObjectPointAndCurve",
Expand Down Expand Up @@ -107,6 +109,7 @@ public class VisExportConfig {
@XmlJavaTypeAdapter(StylesAdapter.class)
private Styles vegetationStyles;
private Balloon vegetationBalloon;
private PointAndCurve solitaryVegetationObjectPointAndCurve;
@XmlJavaTypeAdapter(StylesAdapter.class)
private Styles transportationStyles;
private Balloon transportationBalloon;
Expand All @@ -117,6 +120,7 @@ public class VisExportConfig {
@XmlJavaTypeAdapter(StylesAdapter.class)
private Styles cityFurnitureStyles;
private Balloon cityFurnitureBalloon;
private PointAndCurve cityFurniturePointAndCurve;
@XmlJavaTypeAdapter(StylesAdapter.class)
private Styles genericCityObjectStyles;
private Balloon genericCityObject3DBalloon;
Expand Down Expand Up @@ -166,13 +170,15 @@ public VisExportConfig() {
landUseBalloon = new Balloon();
vegetationStyles = new Styles();
vegetationBalloon = new Balloon();
solitaryVegetationObjectPointAndCurve = new PointAndCurve();
transportationStyles = new Styles();
transportationBalloon = new Balloon();
transportationPointAndCurve = new PointAndCurve();
reliefStyles = new Styles();
reliefBalloon = new Balloon();
cityFurnitureStyles = new Styles();
cityFurnitureBalloon = new Balloon();
cityFurniturePointAndCurve = new PointAndCurve();
genericCityObjectStyles = new Styles();
genericCityObject3DBalloon = new Balloon();
genericCityObjectPointAndCurve = new PointAndCurve();
Expand Down Expand Up @@ -450,6 +456,14 @@ public void setGenericCityObjectStyles(Styles genericCityObjectStyles) {
}
}

public void setSolitaryVegetationObjectPointAndCurve(PointAndCurve solitaryVegetationObjectPointAndCurve) {
this.solitaryVegetationObjectPointAndCurve = solitaryVegetationObjectPointAndCurve;
}

public PointAndCurve getSolitaryVegetationObjectPointAndCurve() {
return solitaryVegetationObjectPointAndCurve;
}

public Styles getGenericCityObjectStyles() {
return genericCityObjectStyles;
}
Expand Down Expand Up @@ -488,6 +502,14 @@ public Balloon getCityFurnitureBalloon() {
return cityFurnitureBalloon;
}

public void setCityFurniturePointAndCurve(PointAndCurve cityFurniturePointAndCurve) {
this.cityFurniturePointAndCurve = cityFurniturePointAndCurve;
}

public PointAndCurve getCityFurniturePointAndCurve() {
return cityFurniturePointAndCurve;
}

public void setTransportationStyles(Styles transportationStyles) {
if (transportationStyles != null) {
this.transportationStyles = transportationStyles;
Expand All @@ -506,8 +528,8 @@ public Balloon getTransportationBalloon() {
return transportationBalloon;
}

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

public PointAndCurve getTransportationPointAndCurve() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public interface ADEVisExportQueryHelper {

String getSolitaryVegetationObjectQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);

String getSolitaryVegetationObjectPointAndCurveQuery(int lodToExportFrom, int objectClassId);

String getPlantCoverQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);

String getGenericCityObjectQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);
Expand All @@ -57,6 +59,8 @@ public interface ADEVisExportQueryHelper {

String getCityFurnitureQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);

String getCityFurniturePointAndCurveQuery(int lodToExportFrom, int objectClassId);

String getWaterBodyQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);

String getLandUseQuery(int lodToExportFrom, DisplayForm displayForm, int objectClassId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,10 @@ private void addStyle(DisplayForm displayForm, int objectClassId, SAXWriter saxW

switch (Util.getCityGMLClass(objectClassId)) {
case SOLITARY_VEGETATION_OBJECT:
style = config.getVisExportConfig().getVegetationStyles().getOrDefault(type);
styleBasisName = SolitaryVegetationObject.STYLE_BASIS_NAME;
addPointAndCurveStyle(saxWriter, config.getVisExportConfig().getSolitaryVegetationObjectPointAndCurve(), styleBasisName);
break;
case PLANT_COVER:
style = config.getVisExportConfig().getVegetationStyles().getOrDefault(type);
styleBasisName = SolitaryVegetationObject.STYLE_BASIS_NAME;
Expand All @@ -906,9 +910,9 @@ 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;
addPointAndCurveStyle(saxWriter, config.getVisExportConfig().getTransportationPointAndCurve(), styleBasisName);
break;
case RELIEF_FEATURE:
style = config.getVisExportConfig().getReliefStyles().getOrDefault(type);
Expand All @@ -921,11 +925,12 @@ private void addStyle(DisplayForm displayForm, int objectClassId, SAXWriter saxW
case CITY_FURNITURE:
style = config.getVisExportConfig().getCityFurnitureStyles().getOrDefault(type);
styleBasisName = CityFurniture.STYLE_BASIS_NAME;
addPointAndCurveStyle(saxWriter, config.getVisExportConfig().getCityFurniturePointAndCurve(), styleBasisName);
break;
case GENERIC_CITY_OBJECT:
addPointAndCurveStyle(saxWriter, config.getVisExportConfig().getGenericCityObjectPointAndCurve(), GenericCityObject.STYLE_BASIS_NAME);
style = config.getVisExportConfig().getGenericCityObjectStyles().getOrDefault(type);
styleBasisName = GenericCityObject.STYLE_BASIS_NAME;
addPointAndCurveStyle(saxWriter, config.getVisExportConfig().getGenericCityObjectPointAndCurve(), styleBasisName);
break;
case LAND_USE:
style = config.getVisExportConfig().getLandUseStyles().getOrDefault(type);
Expand Down
Loading

0 comments on commit a5affac

Please sign in to comment.