From: asl Date: Fri, 23 Oct 2015 15:30:09 +0000 (+0300) Subject: patch for the correct history extraction X-Git-Tag: v1.5~71 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=eeec5d35c935721b2e5d22891f5ab58a3d720d02;p=modules%2Fhydro.git patch for the correct history extraction --- diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index a429e381..d77a212d 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -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 aShapesFromNewFace; - //std::cout << "new: " << theNewShape << " " << theNewType << std::endl; + NCollection_IndexedMap 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 index 00000000..3927e468 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 index 00000000..b2d2d87a Binary files /dev/null and b/src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png differ