1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include <test_HYDROData_LandCoverMap.h>
20 #include <HYDROData_Document.h>
21 #include <HYDROData_LandCoverMap.h>
22 #include <TopoDS_Edge.hxx>
23 #include <TColgp_HArray1OfPnt.hxx>
24 #include <GeomAPI_Interpolate.hxx>
25 #include <BRepBuilderAPI_MakeEdge.hxx>
28 TopoDS_Edge Spline( bool isClosed, double x, double y, ... )
31 va_start( anArgs, y );
32 QList<gp_Pnt> aPointsList;
35 double x = va_arg( anArgs, double );
38 double y = va_arg( anArgs, double );
39 gp_Pnt aPnt( x, y, 0 );
40 aPointsList.append( aPnt );
44 int n = aPointsList.size();
45 Handle(TColgp_HArray1OfPnt) aPointsArray = new TColgp_HArray1OfPnt( 1, n );
46 for( int i=1; i<=n; i++ )
47 aPointsArray->SetValue( i, aPointsList[i-1] );
49 GeomAPI_Interpolate anInterpolator( aPointsArray, isClosed, 1E-3 );
50 anInterpolator.Perform();
51 bool aResult = anInterpolator.IsDone() == Standard_True;
54 Handle( Geom_BSplineCurve ) aCurve = anInterpolator.Curve();
55 return BRepBuilderAPI_MakeEdge( aCurve ).Edge();
61 void test_HYDROData_LandCoverMap::test_local_partition()
63 Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1);
65 Handle(HYDROData_LandCoverMap) aMap =
66 Handle(HYDROData_LandCoverMap)::DownCast( aDoc->CreateObject( KIND_LAND_COVER_MAP ) );
68 CPPUNIT_ASSERT_EQUAL( KIND_LAND_COVER_MAP, aMap->GetKind() );