]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
patch for the correct history extraction
authorasl <asl@opencascade.com>
Fri, 23 Oct 2015 15:30:09 +0000 (18:30 +0300)
committerasl <asl@opencascade.com>
Fri, 23 Oct 2015 15:30:09 +0000 (18:30 +0300)
src/HYDROData/HYDROData_LandCoverMap.cxx
src/HYDRO_tests/reference_data/LandCover_Triangles.png [new file with mode: 0644]
src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png [new file with mode: 0644]

index a429e381ae43931784e002cf925fac6169926e8a..d77a212dd76d0da9064d63c333375ca4bdcda5a8 100644 (file)
@@ -658,16 +658,18 @@ bool HYDROData_LandCoverMap::LocalPartition( const TopoDS_Shape& theNewShape, co
   if( anError )
     return false;
 
+  //std::cout << "History:" << std::endl;
   // analysis of the history
   //     a. to fill map of shapes which come from the new face
-  NCollection_IndexedMap<TopoDS_Shape> aShapesFromNewFace;
-  //std::cout << "new: " << theNewShape << " " << theNewType << std::endl;
+  NCollection_IndexedMap<int> aShapesFromNewFace;
+  //std::cout << "from NEW " << theNewShape << ":" << theNewType << std::endl;
   TopTools_ListOfShape aModified = aBuilder.Modified( theNewShape );
   TopTools_ListIteratorOfListOfShape aMIt( aModified );
   for( ; aMIt.More(); aMIt.Next() )
   {
     //std::cout << "   " << aMIt.Value() << std::endl;
-    aShapesFromNewFace.Add( aMIt.Value() );
+    int aKey = (int)aMIt.Value().TShape().operator->();
+    aShapesFromNewFace.Add( aKey );
   }
 
   //     b. to fill map of parts except parts from new face
@@ -675,14 +677,18 @@ bool HYDROData_LandCoverMap::LocalPartition( const TopoDS_Shape& theNewShape, co
   for( ; anIt.More(); anIt.Next() )
   {
     QString aSType = anIt.StricklerType();
-    //std::cout << anIt.Face() << " " << anIt.StricklerType() << std::endl;
+    //std::cout << "from " << anIt.Face() << ": " << anIt.StricklerType() << std::endl;
     TopTools_ListOfShape aModified = aBuilder.Modified( anIt.Face() );
+    if( aModified.Extent() == 0 )
+      aModified.Append( anIt.Face() );
+
     TopTools_ListIteratorOfListOfShape aMIt( aModified );
     for( ; aMIt.More(); aMIt.Next() )
     {
       TopoDS_Shape aShape = aMIt.Value();
       bool isFace = aShape.ShapeType()==TopAbs_FACE;
-      bool isAlsoFromNew = aShapesFromNewFace.Contains( aShape );
+      int aKey = (int)aShape.TShape().operator->();
+      bool isAlsoFromNew = aShapesFromNewFace.Contains( aKey );
       //std::cout << "   " << aShape << " " << isAlsoFromNew << std::endl;
       if( isFace && !isAlsoFromNew )
         aNewFaces.Add( TopoDS::Face( aShape ), aSType );
diff --git a/src/HYDRO_tests/reference_data/LandCover_Triangles.png b/src/HYDRO_tests/reference_data/LandCover_Triangles.png
new file mode 100644 (file)
index 0000000..3927e46
Binary files /dev/null and b/src/HYDRO_tests/reference_data/LandCover_Triangles.png differ
diff --git a/src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png b/src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png
new file mode 100644 (file)
index 0000000..b2d2d87
Binary files /dev/null and b/src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png differ