X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDRO_tests%2Ftest_HYDROData_PolylineXY.cxx;h=9b505914aaab94221c889a1aaf82577b0432e060;hb=055514d32e7cabedb4a70c6fcaf7e1ca1df49a8a;hp=57d6435fcfd3cc192ab2167e50cea74e5cf22722;hpb=9082efb75ca2505f8b4c5096d37e8d87491cd5d9;p=modules%2Fhydro.git diff --git a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx index 57d6435f..9b505914 100644 --- a/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx +++ b/src/HYDRO_tests/test_HYDROData_PolylineXY.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include #include @@ -253,14 +255,40 @@ void test_HYDROData_PolylineXY::test_presentation() aPointsPrs->SetColor( Quantity_NOC_BLUE1 ); aPointsPrs->Attributes()->PointAspect()->SetTypeOfMarker( Aspect_TOM_O ); - Handle(HYDROGUI_Polyline) aNewPolylinePrs = new HYDROGUI_Polyline( aPolyline2d->GetShape() ); - aNewPolylinePrs->SetColor( Quantity_NOC_DARKGREEN ); + aPolyline2d->SetWireColor( Qt::darkGreen ); + HYDROGUI_Shape* aNewPolylinePrs = new HYDROGUI_Shape( TestViewer::context(), aPolyline2d ); + aNewPolylinePrs->update( true, true ); + + // Check default type + Handle(HYDROGUI_Arrow) arr = Handle(HYDROGUI_Arrow)::DownCast( aNewPolylinePrs->getAISObjects()[1] ); + CPPUNIT_ASSERT_EQUAL( HYDROGUI_Arrow::Cone, arr->GetType() ); + CPPUNIT_ASSERT_EQUAL( 35, arr->GetSize() ); + + + // Check polyline presentation with default (cone) arrow + TestViewer::eraseAll(true); TestViewer::show( aPointsPrs, AIS_PointCloud::DM_Points, 0, true, "Polyline_Presentation" ); TestViewer::show( aPolyline2d->GetShape(), 0, true, Qt::red ); - TestViewer::show( aNewPolylinePrs, AIS_PointCloud::DM_Points, 0, true, "" ); + //TestViewer::show( aNewPolylinePrs, AIS_PointCloud::DM_Points, 0, true, "" ); + aNewPolylinePrs->setBorderColor( Qt::blue ); + aNewPolylinePrs->display(); + TestViewer::fitAll(); + CPPUNIT_ASSERT_IMAGES + + + // Check polyline presentation with triangle arrow + arr->SetType( HYDROGUI_Arrow::Triangle ); + TestViewer::eraseAll(true); + TestViewer::show( aPointsPrs, AIS_PointCloud::DM_Points, 0, true, "Polyline_Presentation_triangle" ); + TestViewer::show( aPolyline2d->GetShape(), 0, true, Qt::red ); + //TestViewer::show( aNewPolylinePrs, AIS_PointCloud::DM_Points, 0, true, "" ); + TestViewer::context()->RecomputePrsOnly( arr ); + aNewPolylinePrs->display(); + TestViewer::fitAll(); CPPUNIT_ASSERT_IMAGES + //QTest::qWait( 50000 ); aDoc->Close(); }