public List<? extends SurfacePatch> getPatches() { return baseSurface.getPatches(); }
@Override public List<SurfacePatch> getPatches() { List<SurfacePatch> allPatches = new LinkedList<SurfacePatch>(); for ( Surface member : memberSurfaces ) { allPatches.addAll( member.getPatches() ); } return allPatches; }
@Override public List<? extends SurfacePatch> getPatches() { return getReferencedObject().getPatches(); }
private boolean validateSurface( Surface surface, List<Object> affectedGeometryParticles ) { LOG.debug( "Surface geometry. Validating individual patches." ); boolean isValid = true; List<Object> affectedGeometryParticles2 = new ArrayList<Object>( affectedGeometryParticles ); affectedGeometryParticles2.add( surface ); List<? extends SurfacePatch> patches = surface.getPatches(); if ( patches.size() > 1 ) { LOG.warn( "Surface consists of multiple patches, but validation of inter-patch topology is not available yet." ); } for ( SurfacePatch patch : surface.getPatches() ) { if ( !( patch instanceof PolygonPatch ) ) { LOG.warn( "Skipping validation of surface patch -- not a PolygonPatch." ); } else { if ( !validatePatch( (PolygonPatch) patch, affectedGeometryParticles2 ) ) { isValid = false; } } } return isValid; }
/** * Map the given geometry to a {@link GeometryQualityModel} by extracting it's 'surfacepatches'. * * @param geom * to extract the geomtries from. * @param qm * to add the extracted geometries to. * @param min * will contain the minimum of all geometries of the given geometry * @param max * will contain the maximum of all geometries in the given geometry */ private void extractGeometries( MultiSurface<Surface> geom, GeometryQualityModel qm, double[] min, double[] max ) { List<SurfacePatch> patches = new LinkedList<org.deegree.geometry.primitive.patches.SurfacePatch>(); for ( Surface s : geom ) { patches.addAll( s.getPatches() ); } extractGeometriesFromPatches( patches, qm, min, max ); }
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." ); } } }
List<? extends SurfacePatch> l = geometry.getPatches(); for ( SurfacePatch p : l ) { switch ( p.getSurfacePatchType() ) {
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." ); } } }
case TriangulatedSurface: { Surface linearized = linearizer.linearize( geometry, crit ); if ( linearized.getPatches().size() == 1 ) { PolygonPatch patch = (PolygonPatch) linearized.getPatches().get( 0 ); Ring exteriorRing = patch.getExteriorRing(); List<Ring> interiorRings = patch.getInteriorRings(); } else { List<Polygon> members = new ArrayList<Polygon>( linearized.getPatches().size() ); for ( SurfacePatch patch : linearized.getPatches() ) { Ring exteriorRing = ( (PolygonPatch) patch ).getExteriorRing(); List<Ring> interiorRings = ( (PolygonPatch) patch ).getInteriorRings();
List<? extends SurfacePatch> patches = surface.getPatches(); List<PolygonPatch> linearizedPatches = new ArrayList<PolygonPatch>( patches.size() ); for ( SurfacePatch patch : surface.getPatches() ) { if ( !( patch instanceof PolygonPatch ) ) { String msg = "Linearization of non planar surface patches is not implemented"; List<? extends SurfacePatch> patches = surface.getPatches(); List<SurfacePatch> linearizedPatches = new ArrayList<SurfacePatch>( patches.size() ); for ( SurfacePatch patch : surface.getPatches() ) { if ( !( patch instanceof PolygonPatch ) ) { String msg = "Linearization of non planar surface patches is not implemented";
break; case OrientableSurface: List<? extends SurfacePatch> osP = surface.getPatches(); List<SurfacePatch> tosP = transform( osP, trans ); Surface tOs = geomFactory.createSurface( id, tosP, nCRS ); case PolyhedralSurface: List<PolygonPatch> phsP = (List<PolygonPatch>) surface.getPatches(); List<PolygonPatch> tphsP = (List) transform( phsP, trans ); result = geomFactory.createPolyhedralSurface( id, nCRS, tphsP ); break; case Surface: List<? extends SurfacePatch> ssP = surface.getPatches(); List<SurfacePatch> tssP = transform( ssP, trans ); result = geomFactory.createSurface( id, tssP, nCRS ); case TriangulatedSurface: List<Triangle> tsP = (List<Triangle>) surface.getPatches(); List<Triangle> ttsP = (List) transform( tsP, trans ); result = geomFactory.createTriangulatedSurface( id, nCRS, ttsP );
startGeometry( "Surface", surface ); writer.writeStartElement( gmlNs, "patches" ); for ( SurfacePatch surfacePatch : surface.getPatches() ) { exportSurfacePatch( surfacePatch );
Surface s = (Surface) geom; LinkedList<SurfacePatch> movedPatches = new LinkedList<SurfacePatch>(); for ( SurfacePatch patch : s.getPatches() ) { if ( patch instanceof PolygonPatch ) { Ring exterior = ( (PolygonPatch) patch ).getExteriorRing();
case Surface: case TriangulatedSurface: for ( SurfacePatch patch : s.getPatches() ) { traversePatch( patch );