X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2Ftest_HYDROData_OperationsFactory.cxx;h=7901ef28cbc6f1d27ab19998c79f21570c089f3a;hb=f7c005b67e48ec7bac99c566fb4f34215ec1a4b1;hp=b5d068fe53273fdbe88a52ae17cd8cf4c53f34db;hpb=d40286a203c60a8a099b2ac92e6e88a449b2c1c2;p=modules%2Fhydro.git diff --git a/src/HYDROData/test_HYDROData_OperationsFactory.cxx b/src/HYDROData/test_HYDROData_OperationsFactory.cxx index b5d068fe..7901ef28 100644 --- a/src/HYDROData/test_HYDROData_OperationsFactory.cxx +++ b/src/HYDROData/test_HYDROData_OperationsFactory.cxx @@ -1,12 +1,36 @@ +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + #include #include #include -#include +#include #include #include +#include + #include void test_HYDROData_OperationsFactory::testCreate() @@ -46,21 +70,15 @@ void test_HYDROData_OperationsFactory::testCrop() QImage aTestImage = TestImage(); anOriImage->SetImage( aTestImage ); - Handle(HYDROData_Polyline) aCropPolyline = - Handle(HYDROData_Polyline)::DownCast( aDoc->CreateObject( KIND_POLYLINE ) ); - - HYDROData_Polyline::PolylineData aPolylineData; - - PolylineSection aPolylineSect; - - aPolylineSect.myCoords << 25 << 0 << 0; - aPolylineSect.myCoords << 0 << 20 << 0; - aPolylineSect.myCoords << 25 << 40 << 0; - aPolylineSect.myCoords << 50 << 20 << 0; + Handle(HYDROData_PolylineXY) aCropPolyline = + Handle(HYDROData_PolylineXY)::DownCast( aDoc->CreateObject( KIND_POLYLINEXY ) ); - aPolylineData << aPolylineSect; + aCropPolyline->AddSection( "", HYDROData_PolylineXY::SECTION_POLYLINE, true ); - aCropPolyline->SetPolylineData( aPolylineData ); + aCropPolyline->AddPoint( 0, HYDROData_PolylineXY::Point( 25, 0 ) ); + aCropPolyline->AddPoint( 0, HYDROData_PolylineXY::Point( 0, 20 ) ); + aCropPolyline->AddPoint( 0, HYDROData_PolylineXY::Point( 25, 40 ) ); + aCropPolyline->AddPoint( 0, HYDROData_PolylineXY::Point( 50, 20 ) ); // prepare Composer Operation ImageComposer_Operator* aCropOp =