Skip to content

Commit

Permalink
fixed Appearance model class and model walker
Browse files Browse the repository at this point in the history
  • Loading branch information
clausnagel committed Jan 1, 2025
1 parent 0ace02a commit b7296c2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ public Appearance setSurfaceData(List<SurfaceDataProperty> surfaceData) {
return this;
}

public Appearance addSurfaceData(SurfaceDataProperty surfaceData) {
if (surfaceData != null) {
getSurfaceData().add(surfaceData);
}

return this;
}

@Override
public Optional<AppearanceDescriptor> getDescriptor() {
return Optional.ofNullable(descriptor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public void visit(SurfaceCollection<?> collection) {

@Override
public void visit(Address address) {
if (shouldWalk) {
address.getMultiPoint().ifPresent(multiPoint -> multiPoint.accept(this));
}
}

@Override
Expand Down Expand Up @@ -148,12 +151,16 @@ public void visit(Feature feature) {
@Override
public void visit(GeoreferencedTexture texture) {
visit((Texture<?>) texture);

if (shouldWalk) {
texture.getReferencePoint().ifPresent(referencePoint -> referencePoint.accept(this));
}
}

@Override
public void visit(ImplicitGeometry implicitGeometry) {
if (shouldWalk && implicitGeometry.getGeometry().isPresent()) {
implicitGeometry.getGeometry().get().accept(this);
if (shouldWalk) {
implicitGeometry.getGeometry().ifPresent(geometry -> geometry.accept(this));
}

if (implicitGeometry.hasAppearances()) {
Expand Down Expand Up @@ -276,6 +283,10 @@ public void visit(SurfaceDataProperty property) {

public void visit(ImplicitGeometryProperty property) {
visit((InlineOrByReferenceProperty<?>) property);

if (shouldWalk) {
property.getReferencePoint().ifPresent(referencePoint -> referencePoint.accept(this));
}
}

private void visitObject(Object object) {
Expand Down

0 comments on commit b7296c2

Please sign in to comment.