Salome HOME
Separate action "Find bottom" for context menu.
[modules/hydro.git] / src / HYDROData / test_HYDROData_OperationsFactory.cxx
index bea1c987d75fd8b22dbc65085ed87a43813cbf0b..7901ef28cbc6f1d27ab19998c79f21570c089f3a 100644 (file)
@@ -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 <test_HYDROData_OperationsFactory.h>
 
 #include <HYDROData_Document.h>
 #include <HYDROData_Image.h>
-#include <HYDROData_Polyline.h>
+#include <HYDROData_PolylineXY.h>
 #include <HYDROData_OperationsFactory.h>
 
 #include <ImageComposer_CropOperator.h>
 
+#include <gp_XY.hxx>
+
 #include <QPainter>
 
 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 =