1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include<test_HYDROData_PolylineXY.h>
25 #include <HYDROData_Document.h>
26 #include <HYDROData_PolylineXY.h>
31 void test_HYDROData_PolylineXY::testPolyline()
33 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document( 1 );
35 Handle(HYDROData_PolylineXY) aPolyline =
36 Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY));
38 aPolyline->AddSection( "Section_1", HYDROData_PolylineXY::SECTION_POLYLINE, false );
39 aPolyline->AddSection( "Section_2", HYDROData_PolylineXY::SECTION_SPLINE, true );
41 int aNbSections = aPolyline->NbSections();
42 CPPUNIT_ASSERT( aNbSections == 2 );
44 NCollection_Sequence<TCollection_AsciiString> aSectNames;
45 NCollection_Sequence<HYDROData_PolylineXY::SectionType> aSectTypes;
46 NCollection_Sequence<bool> aSectClosures;
47 aPolyline->GetSections( aSectNames, aSectTypes, aSectClosures );
49 CPPUNIT_ASSERT( aSectNames.Value( 0 ) == "Section_1" );
50 CPPUNIT_ASSERT( aSectTypes.Value( 0 ) == HYDROData_PolylineXY::SECTION_POLYLINE );
51 CPPUNIT_ASSERT( aSectClosures.Value( 0 ) == false );
53 CPPUNIT_ASSERT( aSectNames.Value( 1 ) == "Section_2" );
54 CPPUNIT_ASSERT( aSectTypes.Value( 1 ) == HYDROData_PolylineXY::SECTION_SPLINE );
55 CPPUNIT_ASSERT( aSectClosures.Value( 1 ) == true );
61 void test_HYDROData_PolylineXY::testCopy()
63 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
64 Handle(HYDROData_PolylineXY) aPolyline1 =
65 Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY));
68 // aPolyline1->setPoints(aPoints);
70 Handle(HYDROData_PolylineXY) aPolyline2 =
71 Handle(HYDROData_PolylineXY)::DownCast(aDoc->CreateObject(KIND_POLYLINEXY));
73 aPolyline1->CopyTo(aPolyline2);