1 #include<test_HYDROData_PolylineXY.h>
3 #include <HYDROData_Document.h>
4 #include <HYDROData_PolylineXY.h>
9 void test_HYDROData_PolylineXY::testPolyline()
11 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 );
13 Handle(HYDROData_PolylineXY) aPolyline =
14 Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY));
16 aPolyline->AddSection( "Section_1", HYDROData_PolylineXY::SECTION_POLYLINE, false );
17 aPolyline->AddSection( "Section_2", HYDROData_PolylineXY::SECTION_SPLINE, true );
19 int aNbSections = aPolyline->NbSections();
20 CPPUNIT_ASSERT( aNbSections == 2 );
22 NCollection_Sequence<TCollection_AsciiString> aSectNames;
23 NCollection_Sequence<HYDROData_PolylineXY::SectionType> aSectTypes;
24 NCollection_Sequence<bool> aSectClosures;
25 aPolyline->GetSections( aSectNames, aSectTypes, aSectClosures );
27 CPPUNIT_ASSERT( aSectNames.Value( 0 ) == "Section_1" );
28 CPPUNIT_ASSERT( aSectTypes.Value( 0 ) == HYDROData_PolylineXY::SECTION_POLYLINE );
29 CPPUNIT_ASSERT( aSectClosures.Value( 0 ) == false );
31 CPPUNIT_ASSERT( aSectNames.Value( 1 ) == "Section_2" );
32 CPPUNIT_ASSERT( aSectTypes.Value( 1 ) == HYDROData_PolylineXY::SECTION_SPLINE );
33 CPPUNIT_ASSERT( aSectClosures.Value( 1 ) == true );
39 void test_HYDROData_PolylineXY::testCopy()
41 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
42 Handle(HYDROData_PolylineXY) aPolyline1 =
43 Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY));
46 // aPolyline1->setPoints(aPoints);
48 Handle(HYDROData_PolylineXY) aPolyline2 =
49 Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY));
51 aPolyline1->CopyTo(aPolyline2);