From: asl Date: Fri, 16 Oct 2015 09:20:36 +0000 (+0300) Subject: final variant of the first merge test X-Git-Tag: v1.5~107 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=726c1caa3f1dfd8d6cea87a2fba18f6a92002816;p=modules%2Fhydro.git final variant of the first merge test --- diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index 574b1e00..e6fee2a5 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -417,40 +417,20 @@ bool HYDROData_LandCoverMap::Split( const Handle( HYDROData_PolylineXY )& thePol */ bool HYDROData_LandCoverMap::Merge( const TopTools_ListOfShape& theFaces, const QString& theType ) { - // 1. to remove the merged faces from the current map - Remove( theFaces ); - - // 2. to fuse the faces into the new face - /*BOPAlgo_PaveFiller aPF; - aPF.SetArguments( theFaces ); - aPF.SetFuzzyValue( 1E-5 ); - aPF.SetRunParallel( Standard_False ); - aPF.Perform(); - int iErr = aPF.ErrorStatus(); - if( iErr ) - return false; - - BOPAlgo_BOP aBOP; - aBOP.SetArguments( theFaces ); - aBOP.SetOperation( BOPAlgo_FUSE ); - aBOP.SetRunParallel( Standard_False ); - aBOP.PerformWithFiller(aPF); - iErr = aBOP.ErrorStatus(); - if( iErr ) - return false; - - TopoDS_Shape aMergedShape = aBOP.Shape(); - if( aMergedShape.ShapeType()!=TopAbs_FACE ) - return false;*/ - - - //// - TopoDS_Shape MergedFace; - MergeFaces(theFaces, true, MergedFace); - //BRepTools::Write(aMergedShape, "c:/sh_.brep"); + // 1. to fuse the faces into the new face + TopoDS_Shape aMergedFace; + if( MergeFaces( theFaces, true, aMergedFace ) ) + { + if( aMergedFace.ShapeType()==TopAbs_FACE ) + { + // 2. to remove the merged faces from the current map + Remove( theFaces ); - // 3. to add the face into the map - return LocalPartition( TopoDS_Face( /*aMergedShape*/ ), theType ); + // 3. to add the face into the map + return LocalPartition( TopoDS::Face( aMergedFace ), theType ); + } + } + return false; } bool HYDROData_LandCoverMap::MergeFaces(const TopTools_ListOfShape& theFaces, bool IsToUnify, TopoDS_Shape& outSh) diff --git a/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png b/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png new file mode 100644 index 00000000..8a4f4298 Binary files /dev/null and b/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png differ