]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
final variant of the first merge test
authorasl <asl@opencascade.com>
Fri, 16 Oct 2015 09:20:36 +0000 (12:20 +0300)
committerasl <asl@opencascade.com>
Fri, 16 Oct 2015 09:20:36 +0000 (12:20 +0300)
src/HYDROData/HYDROData_LandCoverMap.cxx
src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png [new file with mode: 0644]

index 574b1e004c689e97edcb10810254c9b47bc48b4d..e6fee2a5dd06a02fd34393a508f2537eafa168ce 100644 (file)
@@ -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 (file)
index 0000000..8a4f429
Binary files /dev/null and b/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png differ