Salome HOME
minor code review
[modules/hydro.git] / src / HYDRO_tests / test_HYDROData_PolylineXY.cxx
index b3af935f64ed9b79cc50d5d56da586bffc6f44e3..9b505914aaab94221c889a1aaf82577b0432e060 100644 (file)
@@ -28,6 +28,7 @@
 #include <HYDROData_ImmersibleZone.h>
 #include <HYDROData_Tool.h>
 #include <HYDROGUI_Shape.h>
+#include <HYDROGUI_Polyline.h>
 
 #include <AIS_DisplayMode.hxx>
 #include <AIS_PointCloud.hxx>
@@ -258,15 +259,37 @@ void test_HYDROData_PolylineXY::test_presentation()
   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, "" );
+  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();
-  //QTest::qWait( 50000 );
 }
 
 void test_HYDROData_PolylineXY::test_split_refs_627()