Salome HOME
refs #1327: improvements for bathymetry presentation and rescale
[modules/hydro.git] / src / HYDROPy / HYDROData_SequenceOfObjects.sip
index be9b94cc356d14722af614fc388d238d9952470f..e183215039214a9ed12e82d71bf6f2b360bdc989 100644 (file)
@@ -1,12 +1,8 @@
-// Copyright (C) 2007-2013  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
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // 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.
+// 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
@@ -24,7 +20,7 @@
 #include <NCollection_Sequence.hxx>
 %End
 
-%MappedType NCollection_Sequence<Handle_HYDROData_Entity>
+%MappedType NCollection_Sequence<opencascade::handle<HYDROData_Entity>>
 {
 %TypeHeaderCode
 #include <NCollection_Sequence.hxx>
@@ -38,7 +34,7 @@
         return NULL;
 
     // Set the list elements.
-    for (int i = 0; i < sipCpp->Length(); ++i)
+    for (int i = 1; i <= sipCpp->Length(); ++i)
     {
        HYDROData_Entity* aPntr = createPointer(sipCpp->Value(i));
      
         {
             Py_DECREF(l);
             {
-              Handle_HYDROData_Entity anEnt( aPntr );
+              Handle(HYDROData_Entity) anEnt( aPntr );
             }
 
             return NULL;
         }
 
-        PyList_SET_ITEM(l, i, tobj);
+        PyList_SET_ITEM(l, i - 1, tobj);
     }
 
     return l;
@@ -83,8 +79,8 @@
         return 1;
     }
 
-    NCollection_Sequence<Handle_HYDROData_Entity> *ql = 
-      new NCollection_Sequence<Handle_HYDROData_Entity>;
+    NCollection_Sequence<Handle(HYDROData_Entity)> *aSeq = 
+      new NCollection_Sequence<Handle(HYDROData_Entity)>;
     len = PySequence_Size(sipPy);
  
     for (SIP_SSIZE_T i = 0; i < len; ++i)
         {
             sipReleaseType(t, sipType_HYDROData_Entity, state);
 
-            delete ql;
+            delete aSeq;
             return 0;
         }
 
-        Handle_HYDROData_Entity anEnt( t );
-        ql->Append( anEnt );
+        Handle(HYDROData_Entity) anEnt( t );
+        aSeq->Append( anEnt );
 
         //sipReleaseType(t, sipType_HYDROData_Entity, state);
     }
  
-    *sipCppPtr = ql;
+    *sipCppPtr = aSeq;
  
     return sipGetState(sipTransferObj);
 %End
 };
 
-typedef NCollection_Sequence<Handle_HYDROData_Entity> HYDROData_SequenceOfObjects;
+typedef NCollection_Sequence<opencascade::handle<HYDROData_Entity>> HYDROData_SequenceOfObjects;