return false;
TopoDS_Shape aShape = thePolyline->GetShape();
- return LocalPartition( aShape, "" );
+ return Split( aShape );
}
+
+/**
+ Split the land cover map by the given polyline
+ @param theShape the tool polyline to split the land cover map
+ @return if the removing is successful
+*/
+bool HYDROData_LandCoverMap::Split( const TopoDS_Shape& theShape )
+{
+ return LocalPartition( theShape, "" );
+}
+
+
/**
Merge the given faces in the land cover
@param theFaces the faces to merge in the land cover map
HYDRODATA_EXPORT bool Remove( const TopTools_ListOfShape& );
HYDRODATA_EXPORT bool Split( const Handle( HYDROData_PolylineXY )& );
+ HYDRODATA_EXPORT bool Split( const TopoDS_Shape& );
HYDRODATA_EXPORT bool Merge( const TopTools_ListOfShape&, const QString& theType );
HYDRODATA_EXPORT TopoDS_Face FindByPoint( const gp_Pnt2d&, QString& theType ) const;
aLandCoverSplitted = aLandCoverMapObj->Split( aPolyline );
else if ( !aFace.IsNull() )
{
- // TODO:
- //Get the complete boundary of the object face as the splitting polyline
- Handle(HYDROData_PolylineXY) aBoundaryPolyline;
- aLandCoverSplitted = aLandCoverMapObj->Split( aBoundaryPolyline );
+ // Get the complete boundary of the object face as the splitting polyline
+ QList<TopoDS_Shape> aBoundShapes;
+ QStringList aBoundNames;
+ aFace->GetBoundaries( aBoundShapes, aBoundNames );
+
+ for( int i=0, n=aBoundShapes.size(); i<n; i++ )
+ {
+ TopoDS_Shape aShape = aBoundShapes[i];
+ if( aShape.IsNull() )
+ continue;
+
+ bool aSplitResult = aLandCoverMapObj->Split( aShape );
+ aLandCoverSplitted = ( i==0 ? aSplitResult : aLandCoverSplitted && aSplitResult );
+ }
}
if ( !aLandCoverSplitted )
{