Salome HOME
Profile object creation.
[modules/hydro.git] / src / HYDROPy / HYDROData_Bathymetry.sip
index 2d5911e0616177bcb90444e1f8a99997b78de379..abeab659e8840347ae336df4a66dcfe753993b97 100644 (file)
 //
 
 %ExportedHeaderCode
-
 #include <HYDROData_Bathymetry.h>
-
+#include <gp_XY.hxx>
 #include <gp_XYZ.hxx>
-
 %End
 
 %ModuleCode
@@ -35,14 +33,20 @@ HYDROData_Bathymetry::AltitudePoints convertFromPythonAltitudeList( PyObject* th
 
 %End
 
-class HYDROData_Bathymetry : HYDROData_Object
+class HYDROData_Bathymetry : HYDROData_Entity
 {
 
 %ConvertToSubClassCode
-    if ( !Handle(HYDROData_Bathymetry)::DownCast( sipCpp ).IsNull() )
-      sipClass = sipClass_HYDROData_Bathymetry;
-    else
-      sipClass = NULL;
+    switch ( sipCpp->GetKind() )
+    {
+      case KIND_BATHYMETRY:
+        sipClass = sipClass_HYDROData_Bathymetry;
+        break;
+
+      default:
+        // We don't recognise the type.
+        sipClass = NULL;
+    }
 %End
 
 %TypeHeaderCode
@@ -98,12 +102,6 @@ HYDROData_Bathymetry::AltitudePoints convertFromPythonAltitudeList( PyObject* th
 
 %End
 
-
-public:
-
-  //virtual const ObjectKind GetKind() const { return KIND_BATHYMETRY; }
-
-
 public:      
   // Public methods to work with Bathymetry altitudes.
 
@@ -156,12 +154,14 @@ public:
     HYDROData_Bathymetry::AltitudePoints aPoints;
     
     Py_BEGIN_ALLOW_THREADS
-    aPoints = sipSelfWasArg ? sipCpp->HYDROData_Bathymetry::GetAltitudePoints() : sipCpp->GetAltitudePoints();
+    aPoints = sipSelfWasArg ? sipCpp->HYDROData_Bathymetry::GetAltitudePoints() : 
+                              sipCpp->GetAltitudePoints();
     Py_END_ALLOW_THREADS
 
     sipRes = convertToPythonAltitudeList( aPoints );
     
   %End
+
   /**
    * Remove all altitude points.
    */
@@ -173,6 +173,16 @@ public:
    * \return altitude value
    */
   double           GetAltitudeForPoint( const QPointF& thePoint ) const;
+  %MethodCode
+  
+    // The C++ API gets the gp_XY object, we convert it from QPointF.
+    gp_XY aPoint( a0->x(), a0->y() );
+    
+    Py_BEGIN_ALLOW_THREADS
+    sipRes = sipSelfWasArg ? sipCpp->HYDROData_Bathymetry::GetAltitudeForPoint( aPoint ) : 
+                             sipCpp->GetAltitudeForPoint( aPoint );
+    Py_END_ALLOW_THREADS
+  %End
 
 
 public:
@@ -189,8 +199,6 @@ public:
 
 protected:
 
-  //friend class HYDROData_Iterator;
-
   /**
    * Creates new object in the internal data structure. Use higher level objects 
    * to create objects with real content.