-%TypeHeaderCode
-#include <HYDROData_Bathymetry.h>
-%End
-
-%TypeCode
-
-PyObject* convertToPythonAltitudeList( const HYDROData_Bathymetry::AltitudePoints& thePoints )
-{
- int aListSize = thePoints.size();
-
- PyObject* aPythonList = NULL;
- if ( ( aPythonList = PyList_New( aListSize ) ) == NULL )
- return NULL;
-
- for ( int i = 0; i < aListSize; ++i )
- {
- const HYDROData_Bathymetry::AltitudePoint& aPoint = thePoints.at( i );
-
- PyObject* aTypleObj = Py_BuildValue( "(ddd)", aPoint.X(), aPoint.Y(), aPoint.Z() );
-
- PyList_SET_ITEM( aPythonList, i, aTypleObj );
- }
-
- return aPythonList;
-}
-
-HYDROData_Bathymetry::AltitudePoints convertFromPythonAltitudeList( PyObject* thePythonList )
-{
- HYDROData_Bathymetry::AltitudePoints aPoints;
- if ( thePythonList == NULL )
- return aPoints;
-
- for ( int i = 0, n = PyList_GET_SIZE( thePythonList ); i < n; ++i )
- {
- PyObject* aTypleObj = PyList_GET_ITEM( thePythonList, i );
-
- double anArr[ 3 ];
- if ( !PyArg_ParseTuple( aTypleObj, "ddd", &anArr[ 0 ], &anArr[ 1 ], &anArr[ 2 ] ) )
- continue;
-
- HYDROData_Bathymetry::AltitudePoint aPoint;
- aPoint.SetX( anArr[ 0 ] );
- aPoint.SetY( anArr[ 1 ] );
- aPoint.SetZ( anArr[ 2 ] );