Skip to content

Commit

Permalink
Abolish the Renderable interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tordanik committed Nov 14, 2024
1 parent 5aaf69a commit d4ae59d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 26 deletions.
15 changes: 0 additions & 15 deletions src/main/java/org/osm2world/core/target/Renderable.java

This file was deleted.

3 changes: 1 addition & 2 deletions src/main/java/org/osm2world/core/world/data/WorldObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.osm2world.core.math.algorithms.CAGUtil;
import org.osm2world.core.math.shapes.PolygonShapeXZ;
import org.osm2world.core.math.shapes.SimplePolygonShapeXZ;
import org.osm2world.core.target.Renderable;
import org.osm2world.core.target.common.mesh.Mesh;
import org.osm2world.core.target.common.model.Model;
import org.osm2world.core.target.common.model.ModelInstance;
Expand Down Expand Up @@ -51,7 +50,7 @@ public default List<Mesh> buildMeshesForModelHierarchy() {
/**
* returns another world object this is part of, if any (e.g. a room is part of a building).
* Parents are responsible for rendering their children, so only root objects (those returning null here)
* will have their {@link Renderable#renderTo(org.osm2world.core.target.Target)} methods called.
* will have their {@link #buildMeshes()} and {@link #getSubModels()} methods called directly.
*/
public default @Nullable WorldObject getParent() { return null; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
import org.osm2world.core.math.TriangleXZ;
import org.osm2world.core.math.algorithms.TriangulationUtil;
import org.osm2world.core.target.CommonTarget;
import org.osm2world.core.target.Renderable;
import org.osm2world.core.target.common.material.Material;

/** the underside of a {@link BuildingPart} */
class BuildingBottom implements Renderable {
class BuildingBottom {

private final BuildingPart buildingPart;
private final Material material;
Expand All @@ -30,7 +29,6 @@ public BuildingBottom(BuildingPart buildingPart, Material material, PolygonWithH
this.floorHeight = floorHeight;
}

@Override
public void renderTo(CommonTarget target) {

double floorEle = buildingPart.building.getGroundLevelEle() + floorHeight - 0.01;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.osm2world.core.math.*;
import org.osm2world.core.math.algorithms.TriangulationUtil;
import org.osm2world.core.target.CommonTarget;
import org.osm2world.core.target.Renderable;
import org.osm2world.core.target.common.material.Material;
import org.osm2world.core.target.common.material.Materials;
import org.osm2world.core.world.attachment.AttachmentSurface;
Expand All @@ -28,7 +27,7 @@

import com.google.common.collect.Sets;

public class IndoorWall implements Renderable {
public class IndoorWall {

private final double straightnessTolerance = 0.001;
private final double wallThickness = 0.1;
Expand Down Expand Up @@ -961,7 +960,6 @@ private void renderTo(CommonTarget target, Boolean renderSides, Boolean attachme
}
}

@Override
public void renderTo(CommonTarget target) {
renderTo(target, true, false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.osm2world.core.math.PolygonWithHolesXZ;
import org.osm2world.core.math.VectorXZ;
import org.osm2world.core.target.CommonTarget;
import org.osm2world.core.target.Renderable;
import org.osm2world.core.target.common.material.Material;
import org.osm2world.core.world.attachment.AttachmentSurface;
import org.osm2world.core.world.modules.building.BuildingPart;
Expand Down Expand Up @@ -71,8 +70,7 @@ public Collection<AttachmentSurface> getAttachmentSurfaces(double baseEle, int l
}

/**
* renders the roof. The same as {@link Renderable#renderTo(CommonTarget)},
* but it also needs the lower elevation of the roof (which is not yet known at construction time).
* renders the roof. Needs the lower elevation of the roof (which is not yet known at construction time).
*/
public abstract void renderTo(CommonTarget target, double baseEle);

Expand Down

0 comments on commit d4ae59d

Please sign in to comment.