From e7325b62fba96a5a6cbc89ee0f57d86f7cc8d6df Mon Sep 17 00:00:00 2001 From: isn Date: Fri, 13 Nov 2015 14:36:04 +0300 Subject: [PATCH] corrections --- src/HYDROGUI/HYDROGUI_ExportFileOp.cxx | 2 +- src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx | 2 +- src/HYDRO_tests/TestViewer.cxx | 18 ++++++++++++------ src/HYDRO_tests/TestViewer.h | 2 +- .../reference_data/lcm_poly_2_sections.png | Bin 6805 -> 6805 bytes .../test_HYDROData_LandCoverMap.cxx | 1 + 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx b/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx index 02f6b2df..bd4825e3 100644 --- a/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ExportFileOp.cxx @@ -164,7 +164,7 @@ void HYDROGUI_ExportFileOp::startOperation() QStringList aStricklerTypes; if (aNonExpList.empty()) { - HYDROData_LandCoverMap::Iterator aLCMIt( aLCM ); + HYDROData_LandCoverMap::Explorer aLCMIt( aLCM ); for( ; aLCMIt.More(); aLCMIt.Next() ) { QString aST = aLCMIt.StricklerType(); diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx index dc04adb8..5c87c732 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapPrs.cxx @@ -71,7 +71,7 @@ void HYDROGUI_LandCoverMapPrs::UpdateColors() QString aStricklerType = anIt.StricklerType(); Quantity_Color aColor = GetColor( aStricklerType ); SetCustomColor( aFace, aColor ); - SetCustomWidth( aFace, 1.0 ); + SetCustomWidth( aFace, 1.0 ); } } diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 3fd331eb..3ed66129 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -168,14 +168,15 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, if( theShape.IsNull() ) return; + int i = 0; if( theShape.ShapeType()==TopAbs_COMPOUND ) { TopExp_Explorer anExplorer( theShape, TopAbs_FACE ); for( ; anExplorer.More(); anExplorer.Next() ) - ShowShape (anExplorer.Current(), theMode); + ShowShape (anExplorer.Current(), theMode, i); } else - ShowShape(theShape, theMode); + ShowShape(theShape, theMode, i); if( isFitAll ) @@ -185,20 +186,25 @@ void TestViewer::show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, } } -void TestViewer::ShowShape(const TopoDS_Shape& theShape, int theMode) +void TestViewer::ShowShape(const TopoDS_Shape& theShape, int theMode, int& i) { - int i = 0; if( theShape.ShapeType()==TopAbs_SHELL ) { TopoDS_Iterator anIt( theShape ); - for( ; anIt.More(); anIt.Next(), i++ ) + for( ; anIt.More(); anIt.Next()) + { show( anIt.Value(), theMode, false, GetColor(i) ); + i++; + } } else if (theShape.ShapeType()==TopAbs_FACE || theShape.ShapeType()==TopAbs_WIRE || theShape.ShapeType()==TopAbs_EDGE || theShape.ShapeType()==TopAbs_VERTEX ) - show( theShape, theMode, false, GetColor(0) ); + { + show( theShape, theMode, false, GetColor(i) ); + i++; + } } bool AreImagesEqual( const QImage& theImage1, const QImage& theImage2, double theTolerance ) diff --git a/src/HYDRO_tests/TestViewer.h b/src/HYDRO_tests/TestViewer.h index 8d07958e..303ebf4d 100644 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@ -38,7 +38,7 @@ public: int theMode, int theSelectionMode, bool isFitAll, const char* theKey ); static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor ); static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const char* theKey ); - static void ShowShape(const TopoDS_Shape& theShape, int theMode); + static void ShowShape(const TopoDS_Shape& theShape, int theMode, int& i); static bool AssertImages( QString& theMessage ); static QColor GetColor(int i); diff --git a/src/HYDRO_tests/reference_data/lcm_poly_2_sections.png b/src/HYDRO_tests/reference_data/lcm_poly_2_sections.png index 7b7d7fcb8545b2bf513aae6f44519a569fb09bf3..4b69df91f00378fbf253f225f9d9634deb7dde80 100644 GIT binary patch delta 119 zcmbPgI@NT;az-xy_=uK&`EqjeHg4X?$j8LayK_wd-+ SD>pVX0D-5gpUXO@geCwA-zum8 delta 119 zcmbPgI@NT;az-xwIdLuj^5y1PZrQw%k&lV}vbflC|M-H*$C#~|4jWHqX6Xe|n@pfKQ}$Add( Polyline_4, "" ) ); Handle(HYDROGUI_LandCoverMapPrs) aPrs = new HYDROGUI_LandCoverMapPrs( aMap ); + TopoDS_Shape aSh = aMap->GetShape(); TestViewer::show( aPrs, AIS_Shaded, 0, true, "LandCover_Triangles" ); CPPUNIT_ASSERT_IMAGES -- 2.39.2