void ForceValidityVisitor::visit( MultiSolid& g ) { g.forceValidityFlag( valid_ ); for ( size_t i = 0; i < g.numGeometries(); i++ ) { visit( g.solidN( i ) ); } }
std::auto_ptr<Geometry> collect( const Geometry& ga, const Geometry& gb ) { if ( ga.geometryTypeId() == gb.geometryTypeId() ) { if ( ga.geometryTypeId() == TYPE_POINT ) { MultiPoint *mp = new MultiPoint; mp->addGeometry( ga ); mp->addGeometry( gb ); return std::auto_ptr<Geometry>(mp); } else if ( ga.geometryTypeId() == TYPE_LINESTRING ) { MultiLineString *mls = new MultiLineString(); mls->addGeometry(ga); mls->addGeometry(gb); return std::auto_ptr<Geometry>( mls ); } else if ( ga.geometryTypeId() == TYPE_POLYGON ) { MultiPolygon *mp = new MultiPolygon(); mp->addGeometry(ga); mp->addGeometry(gb); return std::auto_ptr<Geometry>( mp ); } else if ( ga.geometryTypeId() == TYPE_SOLID ) { MultiSolid *mp = new MultiSolid(); mp->addGeometry(ga); mp->addGeometry(gb); return std::auto_ptr<Geometry>( mp ); } } // else GeometryCollection* coll = new GeometryCollection(); coll->addGeometry(ga); coll->addGeometry(gb); return std::auto_ptr<Geometry>( coll ); }
void GetPointsVisitor::visit( const MultiSolid& g ) { for ( size_t i = 0; i < g.numGeometries(); i++ ) { visit( g.solidN( i ) ); } }
void BoundaryVisitor::visit( const MultiSolid& g ) { BOOST_THROW_EXCEPTION( Exception( ( boost::format( "unsupported type %1% in boundary operation" ) % g.geometryType() ).str() ) ); }