Пример #1
0
void ForceValidityVisitor::visit( MultiPolygon& g )
{
    g.forceValidityFlag( valid_ );
    for ( size_t i = 0; i < g.numGeometries(); i++ ) {
        visit( g.polygonN( i ) );
    }
}
Пример #2
0
std::auto_ptr< MultiLineString > straightSkeleton( const MultiPolygon& g )
{
	std::auto_ptr< MultiLineString > result( new MultiLineString );
	for ( size_t i = 0; i < g.numGeometries(); i++ ){
		Polygon_with_holes_2 polygon = g.polygonN(i).toPolygon_with_holes_2() ;
		boost::shared_ptr< Straight_skeleton_2 > skeleton = CGAL::create_interior_straight_skeleton_2( polygon ) ;
		straightSkeletonToMultiLineString( *skeleton, *result ) ;
	}
	return result ;
}
Пример #3
0
void BoundaryVisitor::visit( const MultiPolygon& g )
{
    graph::GeometryGraph        graph ;
    graph::GeometryGraphBuilder graphBuilder( graph ) ;

    for ( size_t i = 0; i < g.numGeometries(); i++ ) {
        graphBuilder.addPolygon( g.polygonN( i ) );
    }

    getBoundaryFromPolygons( graph ) ;
}
Пример #4
0
std::auto_ptr< Geometry > building(
    const MultiPolygon& g,
    const Kernel::FT& wallHeight,
    const Kernel::FT& roofSlope
)
{
    std::auto_ptr< MultiSolid > multiSolid( new MultiSolid );

    for ( size_t i = 0; i < g.numGeometries(); i++ ) {
        multiSolid->addGeometry( building( g.polygonN( i ), wallHeight, roofSlope ).release() );
    }

    return std::auto_ptr< Geometry >( multiSolid.release() );
}
Пример #5
0
void WktWriter::write( const MultiPolygon & g )
{
	_s << "MULTIPOLYGON" ;
	if ( g.isEmpty() ){
		_s << " EMPTY" ;
		return ;
	}

	_s << "(";
	for ( size_t i = 0; i < g.numGeometries(); i++ ){
		if ( i != 0 )
			_s << "," ;
		writeInner( g.geometryN(i).as< Polygon >() );
	}
	_s << ")";
}
Пример #6
0
void GetPointsVisitor::visit( const MultiPolygon& g )
{
    for ( size_t i = 0; i < g.numGeometries(); i++ ) {
        visit( g.polygonN( i ) );
    }
}