From: isn Date: Fri, 10 Nov 2017 17:15:11 +0000 (+0300) Subject: debug of test X-Git-Tag: v2.1~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=419cb246be5d55f49b79e607911672eee3b451d4;p=modules%2Fhydro.git debug of test --- diff --git a/src/HYDRO_tests/TestViewer.cxx b/src/HYDRO_tests/TestViewer.cxx index 28292718..5c143368 100644 --- a/src/HYDRO_tests/TestViewer.cxx +++ b/src/HYDRO_tests/TestViewer.cxx @@ -118,10 +118,20 @@ QColor TestViewer::GetColor(int i) } } -void TestViewer::eraseAll( bool isUpdate ) +void TestViewer::eraseAll( bool isUpdate, bool eraseStructures ) { context()->CloseLocalContext( -1, Standard_False ); context()->EraseAll( isUpdate ); + if( eraseStructures ) + { + Graphic3d_MapOfStructure GmapS; + viewer()->getViewer3d()->StructureManager()->DisplayedStructures(GmapS); + for (Graphic3d_MapOfStructure::Iterator it(GmapS); it.More(); it.Next()) + { + Handle(Graphic3d_Structure) GS = it.Key(); + GS->Erase(); + } + } } void TestViewer::show( const Handle(AIS_InteractiveObject)& theObject, @@ -367,7 +377,6 @@ void TestViewer::select( int theViewX, int theViewY ) Handle(V3d_View) aView = myViewWindow->getViewPort()->getView(); context()->MoveTo( theViewX, theViewY, aView ); context()->Select(); - // context()->ClearLocalContext(); // context()->CloseAllContexts(); } diff --git a/src/HYDRO_tests/TestViewer.h b/src/HYDRO_tests/TestViewer.h index 9165763f..af8400f0 100644 --- a/src/HYDRO_tests/TestViewer.h +++ b/src/HYDRO_tests/TestViewer.h @@ -38,7 +38,7 @@ public: static OCCViewer_ViewFrame* viewWindow(); static Handle(AIS_InteractiveContext) context(); - static void eraseAll( bool isUpdate ); + static void eraseAll( bool isUpdate, bool eraseStructures = false ); static void show( const Handle(AIS_InteractiveObject)& theObject, int theMode, int theSelectionMode, bool isFitAll, const char* theKey ); static void show( const TopoDS_Shape& theShape, int theMode, bool isFitAll, const QColor& theColor, diff --git a/src/HYDRO_tests/reference_data/cyprus_natural_all.png b/src/HYDRO_tests/reference_data/cyprus_natural_all.png index edd084aa..eca9f5f4 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/test_HYDROData_LandCoverMap.cxx b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx index 21e0440a..be1326b9 100644 --- a/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx +++ b/src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx @@ -600,8 +600,8 @@ void test_HYDROData_LandCoverMap::test_land_cover_prs_by_types() TestViewer::show( aPrs, AIS_Shaded, 4, true, "LandCoverMap_PrsByTypes" ); // select one of faces (first) TestViewer::select( 200, 300 ); - // CPPUNIT_ASSERT_IMAGES - + CPPUNIT_ASSERT_IMAGES + TestViewer::eraseAll(true, true); aDoc->Close(); } @@ -810,6 +810,8 @@ void test_HYDROData_LandCoverMap::test_assign_to_calc_case() #include void test_HYDROData_LandCoverMap::test_shp_import_cyp() { + //TestViewer::eraseAll(true); + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); QString aFileName = REF_DATA_PATH + "/cyprus_natural.shp"; HYDROData_ShapeFile anImporter; @@ -834,7 +836,6 @@ void test_HYDROData_LandCoverMap::test_shp_import_cyp() LCM->StoreLandCovers(aMapFace2ST); TestViewer::show( LCM->GetShape(), AIS_Shaded, true, "cyprus_natural_all" ); - QTest::qWait(100000); CPPUNIT_ASSERT_IMAGES aDoc->Close(); }