From 726c1caa3f1dfd8d6cea87a2fba18f6a92002816 Mon Sep 17 00:00:00 2001 From: asl Date: Fri, 16 Oct 2015 12:20:36 +0300 Subject: [PATCH] final variant of the first merge test --- src/HYDROData/HYDROData_LandCoverMap.cxx | 46 +++++------------- .../reference_data/LandCoverMap_Merge_1.png | Bin 0 -> 8862 bytes 2 files changed, 13 insertions(+), 33 deletions(-) create mode 100644 src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png 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 0000000000000000000000000000000000000000..8a4f4298365d5816ba499b67258ea5cd6139d2bc GIT binary patch literal 8862 zcmYjX2|U!@*T27+VMewYBTK{>TS^RND={?LvV`gxC5*;x@7#0lIp34)M=(WzO1|8T+P*82(Y6G8CeKw2o!$|V>8v0DBga%qd08~_wx%`n>^ zmhbKP;oVcA7WoO$&k(7r$7f>YpV`&9>B=)U2t@ev!`i*`wj$u=XjOSnuwJb7 zt~ULr%MNtMCQDj*kLGdcuK-OVTcLe_iWw=U7@=&IlcZ^wrDpgdd4k!Zfof(kG=ycN zzn<<@N^-~W)ch4_lIoF-Ai6)7gluf`}$d%MoDWJk8nab1Gq!cKbfB`t*iROj^ ziV5(5+?$$GY;_ax9gYpxlwhmDri3z2S4z-aLIJEmuDcYjhNK80C8%@_44YMp=gHI( zlA5X=WFRtQb6nkEo;q#{q3J7O1_MhwbLIidj6+|OAKI>J0t}O7VoZ!mk6T25(sfFh z$RK)W58(=dBHUqECVgbmE z6@Nm(=SuF2w?ojsYm_ShWC}Z@arMLX83dd8%JN$Dy#C zB&-Q?T2*lN!+k7e3=XuaGx}8U0)Avg+MQ4brhFPPn-G&PPb_I^6w}ODPPHlDiFR2E4!(~04v33~;n7K0XdZ|~#wgqd+8SC|U^{_(| zNle8r@dmm+Wq&)z**D7Y+DSK3c{SNX|{R}5%AWeMBx+3I>O z^&_dF>CF}4Mrp~}e|KvhZ#iudP;$%bQ*zVa{#~}!g4Wx+^iO*vt11T^viD9qc39uy zdU z@oA40<(+=I9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