void render( TextStyling styling, Font font, String text, Surface surface ) { for ( SurfacePatch patch : surface.getPatches() ) { if ( patch instanceof PolygonPatch ) { PolygonPatch polygonPatch = (PolygonPatch) patch; for ( Curve curve : polygonPatch.getBoundaryRings() ) { render( styling, font, text, curve ); } } else { throw new IllegalArgumentException( "Cannot render non-planar surfaces." ); } } }
void render( PointStyling styling, Surface surface ) { for ( SurfacePatch patch : surface.getPatches() ) { if ( patch instanceof PolygonPatch ) { PolygonPatch polygonPatch = (PolygonPatch) patch; for ( Curve curve : polygonPatch.getBoundaryRings() ) { curve.setCoordinateSystem( surface.getCoordinateSystem() ); renderer.render( styling, curve ); } } else { throw new IllegalArgumentException( "Cannot render non-planar surfaces." ); } } }
void render( PolygonStyling styling, Surface surface ) { for ( SurfacePatch patch : surface.getPatches() ) { if ( patch instanceof PolygonPatch ) { LinkedList<Double> lines = new LinkedList<Double>(); PolygonPatch polygonPatch = (PolygonPatch) patch; // just appending the holes appears to work, the Java2D rendering mechanism can determine that they lie // inside and thus no substraction etc. is needed. This speeds up things SIGNIFICANTLY GeneralPath polygon = new GeneralPath( WIND_EVEN_ODD ); for ( Curve curve : polygonPatch.getBoundaryRings() ) { Double d = geomHelper.fromCurve( curve, true ); lines.add( d ); polygon.append( d, false ); } fillRenderer.applyFill( styling.fill, styling.uom ); graphics.fill( polygon ); for ( Double d : lines ) { strokeRenderer.applyStroke( styling.stroke, styling.uom, d, styling.perpendicularOffset, styling.perpendicularOffsetType ); } } else { throw new IllegalArgumentException( "Cannot render non-planar surfaces." ); } } }
void render( LineStyling styling, Surface surface ) { for ( SurfacePatch patch : surface.getPatches() ) { if ( patch instanceof PolygonPatch ) { PolygonPatch polygonPatch = (PolygonPatch) patch; for ( Curve curve : polygonPatch.getBoundaryRings() ) { if ( curve.getCoordinateSystem() == null ) { curve.setCoordinateSystem( surface.getCoordinateSystem() ); } renderer.render( styling, curve ); } } else { throw new IllegalArgumentException( "Cannot render non-planar surfaces." ); } } }