]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
debug of test
authorisn <isn@opencascade.com>
Fri, 10 Nov 2017 17:15:11 +0000 (20:15 +0300)
committerisn <isn@opencascade.com>
Fri, 10 Nov 2017 17:15:11 +0000 (20:15 +0300)
src/HYDRO_tests/TestViewer.cxx
src/HYDRO_tests/TestViewer.h
src/HYDRO_tests/reference_data/cyprus_natural_all.png
src/HYDRO_tests/test_HYDROData_LandCoverMap.cxx

index 28292718ec99f8ab7e760d84eb68e3aa2d188988..5c143368ade0c182cbc045e665ab7d637a4ca586 100644 (file)
@@ -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();
 }
 
index 9165763f6eeb7e98c0b9e1e19ed1fbdf663a9b50..af8400f01c16f9b6b8985762fa20d5269e9a58a0 100644 (file)
@@ -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,
index edd084aad0747b8d207a47cd11c314ef6646a94b..eca9f5f4ddb3d0828c550151b67b4133bcc55011 100644 (file)
Binary files a/src/HYDRO_tests/reference_data/cyprus_natural_all.png and b/src/HYDRO_tests/reference_data/cyprus_natural_all.png differ
index 21e0440a271663141dc04ffc731c644dd8578c62..be1326b9074d45b1f9fe1ffae78274b170d815c7 100644 (file)
@@ -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 <QTest>
 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();
 }