From: isn Date: Fri, 13 Nov 2015 12:30:38 +0000 (+0300) Subject: new iteration process in TestViewer; X-Git-Tag: v1.5~43^2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=189f3e0e5bff7c95540c116cdc69e974896c6667;p=modules%2Fhydro.git new iteration process in TestViewer; new pics etc. --- diff --git a/src/HYDROData/HYDROData_LandCoverMap.cxx b/src/HYDROData/HYDROData_LandCoverMap.cxx index acecb291..ec7dfd9f 100644 --- a/src/HYDROData/HYDROData_LandCoverMap.cxx +++ b/src/HYDROData/HYDROData_LandCoverMap.cxx @@ -856,14 +856,7 @@ void HYDROData_LandCoverMap::StoreLandCovers( const HYDROData_MapOfFaceToStrickl TopoDS_Shape aResult; if( aListOfFaces.Extent() == 1 ) - { - /*TopoDS_Shell aShell; - BRep_Builder aShellBuilder; - aShellBuilder.MakeShell( aShell ); - aShell.Closed( Standard_False ); - aShellBuilder.Add( aShell, aListOfFaces.First() );*/ - aResult = aListOfFaces.First(); //aShell; - } + aResult = aListOfFaces.First(); else if( aListOfFaces.Extent() > 1 ) aResult = MergeFaces( aListOfFaces, false ); diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 3ed66129..efd8a586 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -169,15 +169,20 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, return; int i = 0; - if( theShape.ShapeType()==TopAbs_COMPOUND ) - { - TopExp_Explorer anExplorer( theShape, TopAbs_FACE ); - for( ; anExplorer.More(); anExplorer.Next() ) - ShowShape (anExplorer.Current(), theMode, i); - } - else - ShowShape(theShape, theMode, i); + //show all faces first + TopExp_Explorer aFE( theShape, TopAbs_FACE ); + for( ; aFE.More(); aFE.Next(), i++ ) + show( aFE.Current(), theMode, false, GetColor(i) ); + //show all independent wires + TopExp_Explorer aWE( theShape, TopAbs_WIRE, TopAbs_FACE ); + for( ; aWE.More(); aWE.Next(), i++ ) + show( aWE.Current(), theMode, false, GetColor(i) ); + + //show all independent edges + TopExp_Explorer anEE( theShape, TopAbs_EDGE, TopAbs_WIRE ); + for( ; anEE.More(); anEE.Next(), i++ ) + show( anEE.Current(), theMode, false, GetColor(i) ); if( isFitAll ) { @@ -186,7 +191,7 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, } } -void TestViewer::ShowShape(const TopoDS_Shape& theShape, int theMode, int& i) +/*void TestViewer::ShowShape(const TopoDS_Shape& theShape, int theMode, int& i) { if( theShape.ShapeType()==TopAbs_SHELL ) { @@ -205,7 +210,7 @@ void TestViewer::ShowShape(const TopoDS_Shape& theShape, int theMode, int& i) show( theShape, theMode, false, GetColor(i) ); i++; } -} +}*/ bool AreImagesEqual( const QImage& theImage1, const QImage& theImage2, double theTolerance ) { diff --git a/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png b/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png index a860b7f5..2ad80eb6 100644 Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Merge_1.png differ diff --git a/src/HYDRO_tests/reference_data/LandCoverMap_PrsByTypes.png b/src/HYDRO_tests/reference_data/LandCoverMap_PrsByTypes.png index 2d7da92e..f6b29495 100644 Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_PrsByTypes.png and b/src/HYDRO_tests/reference_data/LandCoverMap_PrsByTypes.png differ diff --git a/src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png b/src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png index dce48726..9776c2ca 100644 Binary files a/src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png and b/src/HYDRO_tests/reference_data/LandCoverMap_Remove_1.png differ diff --git a/src/HYDRO_tests/reference_data/LandCover_Triangles.png b/src/HYDRO_tests/reference_data/LandCover_Triangles.png index 3927e468..37530adb 100644 Binary files a/src/HYDRO_tests/reference_data/LandCover_Triangles.png 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 index b2d2d87a..44b54cce 100644 Binary files a/src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png and b/src/HYDRO_tests/reference_data/LandCover_Triangles_Split.png differ diff --git a/src/HYDRO_tests/reference_data/NLD_water_areas_dcw.png b/src/HYDRO_tests/reference_data/NLD_water_areas_dcw.png index 8c125799..f9237151 100644 Binary files a/src/HYDRO_tests/reference_data/NLD_water_areas_dcw.png and b/src/HYDRO_tests/reference_data/NLD_water_areas_dcw.png differ diff --git a/src/HYDRO_tests/reference_data/clc_dec_150_350.png b/src/HYDRO_tests/reference_data/clc_dec_150_350.png index 85a68007..05f535a1 100644 Binary files a/src/HYDRO_tests/reference_data/clc_dec_150_350.png and b/src/HYDRO_tests/reference_data/clc_dec_150_350.png differ diff --git a/src/HYDRO_tests/reference_data/cyprus_natural_all.png b/src/HYDRO_tests/reference_data/cyprus_natural_all.png index b7cbfd9c..53ac60b5 100644 Binary files a/src/HYDRO_tests/reference_data/cyprus_natural_all.png and b/src/HYDRO_tests/reference_data/cyprus_natural_all.png differ diff --git a/src/HYDRO_tests/reference_data/merge_faces_boxes_12.png b/src/HYDRO_tests/reference_data/merge_faces_boxes_12.png index ee6ecb05..cf8bab03 100644 Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_12.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_12.png differ diff --git a/src/HYDRO_tests/reference_data/merge_faces_boxes_13.png b/src/HYDRO_tests/reference_data/merge_faces_boxes_13.png index 341f77fa..d7db042d 100644 Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_13.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_13.png differ diff --git a/src/HYDRO_tests/reference_data/merge_faces_boxes_22.png b/src/HYDRO_tests/reference_data/merge_faces_boxes_22.png index ee6ecb05..cf8bab03 100644 Binary files a/src/HYDRO_tests/reference_data/merge_faces_boxes_22.png and b/src/HYDRO_tests/reference_data/merge_faces_boxes_22.png differ diff --git a/src/HYDRO_tests/reference_data/merge_faces_circles_12.png b/src/HYDRO_tests/reference_data/merge_faces_circles_12.png index 9fcbd304..2bb3b807 100644 Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_12.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_12.png differ diff --git a/src/HYDRO_tests/reference_data/merge_faces_circles_13.png b/src/HYDRO_tests/reference_data/merge_faces_circles_13.png index e9c116f9..19287d9f 100644 Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_13.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_13.png differ diff --git a/src/HYDRO_tests/reference_data/merge_faces_circles_14.png b/src/HYDRO_tests/reference_data/merge_faces_circles_14.png index e9c116f9..19287d9f 100644 Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_14.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_14.png differ diff --git a/src/HYDRO_tests/reference_data/merge_faces_circles_22.png b/src/HYDRO_tests/reference_data/merge_faces_circles_22.png index 9fcbd304..2bb3b807 100644 Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_22.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_22.png differ diff --git a/src/HYDRO_tests/reference_data/merge_faces_circles_24.png b/src/HYDRO_tests/reference_data/merge_faces_circles_24.png index 89fb4050..e536901a 100644 Binary files a/src/HYDRO_tests/reference_data/merge_faces_circles_24.png and b/src/HYDRO_tests/reference_data/merge_faces_circles_24.png differ diff --git a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index 6a1cddbd..0f9ad6ac 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -256,7 +256,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_boxes() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_boxes_12" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } { TopTools_ListOfShape Faces; @@ -266,7 +266,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_boxes() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_boxes_13" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } { TopTools_ListOfShape Faces; @@ -298,7 +298,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_boxes() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_boxes_22" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } { TopTools_ListOfShape Faces; @@ -308,7 +308,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_boxes() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_boxes_23" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } { TopTools_ListOfShape Faces; @@ -353,7 +353,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_circles() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_circles_12" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } { TopTools_ListOfShape Faces; @@ -363,7 +363,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_circles() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_circles_13" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } { TopTools_ListOfShape Faces; @@ -373,7 +373,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_circles() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, true ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_circles_14" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } // @@ -394,7 +394,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_circles() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_circles_22" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } { TopTools_ListOfShape Faces; @@ -404,7 +404,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_circles() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_circles_23" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } { TopTools_ListOfShape Faces; @@ -414,7 +414,7 @@ void test_HYDROData_LandCoverMap::test_merge_faces_circles() TopoDS_Shape aMergedFace = HYDROData_LandCoverMap::MergeFaces( Faces, false ); TestViewer::show( aMergedFace, AIS_Shaded, true, "merge_faces_circles_24" ); CPPUNIT_ASSERT_IMAGES - CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_SHELL); + CPPUNIT_ASSERT(aMergedFace.ShapeType() == TopAbs_COMPOUND); } }