]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
SIP: HYDROData_Profile is included.
authorrkv <rkv@opencascade.com>
Wed, 8 Jan 2014 08:01:42 +0000 (08:01 +0000)
committerrkv <rkv@opencascade.com>
Wed, 8 Jan 2014 08:01:42 +0000 (08:01 +0000)
CMake/UsePyQt4EXT.cmake
src/HYDROData/HYDROData_Profile.h
src/HYDROPy/CMakeLists.txt
src/HYDROPy/HYDROData.sip
src/HYDROPy/HYDROData_Entity.sip
src/HYDROPy/HYDROData_IPolyline.sip
src/HYDROPy/HYDROData_Object.sip
src/HYDROPy/HYDROData_Profile.sip
src/HYDROPy/HYDROData_ProfileUZ.sip

index 064d73b1bb12821185ae43fa9962aeaf13df9862..76a77962fb3c82096cdfb953c6a63389b46bf79d 100644 (file)
@@ -85,6 +85,9 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles)
     LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Object.cc)
     SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Object.cc)
 
+    LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Profile.cc)
+    SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Profile.cc)
+
     LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc)
     SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Obstacle.cc)
 
@@ -108,7 +111,10 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles)
        
     LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XYZ.cc)
     SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XYZ.cc)
-
+    
+    LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc)
+    SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyNCollection_Sequence0100gp_XY.cc)
+    
     LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XYZ.cc)
     SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPygp_XYZ.cc)
 
index 62ecc7414a9ba0cbc483ba1865981ea81aeb1742..3c56846fa142f933433b07a7cce68611d22c3feb 100644 (file)
@@ -240,12 +240,12 @@ protected:
    * Creates new object in the internal data structure. Use higher level objects 
    * to create objects with real content.
    */
-  HYDROData_Profile();
+  HYDRODATA_EXPORT HYDROData_Profile();
 
   /**
    * Destructs properties of the object and object itself, removes it from the document.
    */
-  ~HYDROData_Profile();
+  HYDRODATA_EXPORT ~HYDROData_Profile();
 };
 
 #endif
index 2920884f4048e02f94a9fdba79ad3e5fbf8d16f8..19bcb5d22d3d5fee3df79cfd50110d064a82e551 100644 (file)
@@ -90,6 +90,7 @@ SET(_sip_files2
   HYDROData_IAltitudeObject.sip
   HYDROData_ObstacleAltitude.sip
   HYDROData_Object.sip
+  HYDROData_Profile.sip
   HYDROData_ProfileUZ.sip
   HYDROData_PolylineXY.sip
   HYDROData_ArtificialObject.sip
index 4a19836ff0a0e140b7055c2ae009fc6561908391..0f463874b33c458f68fa0320e59e5fbab7a355e7 100644 (file)
@@ -62,7 +62,7 @@ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 %Include HYDROData_IAltitudeObject.sip
 %Include HYDROData_ObstacleAltitude.sip
 %Include HYDROData_Object.sip
-//Include HYDROData_Profile.sip
+%Include HYDROData_Profile.sip
 //Include HYDROData_Polyline3D.sip
 %Include HYDROData_ProfileUZ.sip
 %Include HYDROData_PolylineXY.sip
index 04074c37954ec52cb915eea8c50c6c2280df3ffd..f5b75504d82f368aa824f77125b3b9c27b530932 100644 (file)
@@ -83,6 +83,10 @@ class HYDROData_Entity
         sipClass = sipClass_HYDROData_Obstacle;
         break;
 
+      case KIND_PROFILE:
+        sipClass = sipClass_HYDROData_Profile;
+        break;
+
       case KIND_REGION:
         sipClass = sipClass_HYDROData_Region;
         break;
index 1e0e9c7db828957732108f8d63f4225701876c9a..6d5f8b798d7a191124d5313dff8beb3a0eaccc1d 100644 (file)
 class HYDROData_IPolyline : HYDROData_Entity /Abstract/
 {
 
+  typedef gp_XY                       Point;
+  typedef NCollection_Sequence<gp_XY> PointsList;
+
+
 %TypeHeaderCode
 #include <HYDROData_IPolyline.h>
 %End
index d9596eb9a1cc311602977f32f584c67a12c63ba8..a451938aacfa557363a31a338ec3aa8b4582e190 100644 (file)
@@ -42,6 +42,10 @@ class HYDROData_Object : HYDROData_Entity /Abstract/
       sipClass = sipClass_HYDROData_ImmersibleZone;
       break;
 
+    case KIND_PROFILE:
+      sipClass = sipClass_HYDROData_Profile;
+      break;
+
     case KIND_UNKNOWN:
       sipClass = sipClass_HYDROData_Entity;
       break;
index cfd37d46aebc174ad81d10550cc3462cea7b5238..e25057b4a69038d6925c5aba701de423e21031a7 100644 (file)
 
 class HYDROData_Profile : public HYDROData_Object
 {
+public:
+
+  typedef gp_XYZ                       ProfilePoint;
+  typedef NCollection_Sequence<gp_XYZ> ProfilePoints;
+
 %TypeHeaderCode
 #include "HYDROData_Profile.h"
 %End
@@ -65,84 +70,27 @@ public:
    * Set first(left) point for profile.
    * \param thePoint the point
    */
-  void SetLeftPoint( const QPointF& thePoint ) [void (const gp_XY&)];
-  %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
-    if ( sipSelfWasArg )
-    {
-      sipCpp->HYDROData_Profile::SetLeftPoint( aPoint );
-    }
-    else
-    {
-      sipCpp->SetLeftPoint( aPoint );
-    }
-    Py_END_ALLOW_THREADS
-  %End
+  void SetLeftPoint( const gp_XY& thePoint );
 
   /**
    * Returns first(left) point of profile.
    * \param thePoint[out] profile first point
    * \return true if point has been set
    */
-  bool GetLeftPoint( QPointF& thePoint ) const [bool (gp_XY&)];
-  %MethodCode
+  bool GetLeftPoint( gp_XY& thePoint ) const;
   
-    // The C++ API gets the gp_XY object, then we convert it to QPointF.
-    gp_XY aPoint();
-    
-    Py_BEGIN_ALLOW_THREADS
-    sipRes = sipSelfWasArg ? sipCpp->HYDROData_Profile::GetLeftPoint( aPoint ) : 
-                             sipCpp->GetLeftPoint( aPoint );
-    Py_END_ALLOW_THREADS
-    
-    a0->SetX( aPoint.X() );
-    a0->SetY( aPoint.Y() );
-  %End
-
   /**
    * Set last(right) point for profile.
    * \param thePoint the point
    */
-  void SetRightPoint( const QPointF& thePoint ) [void (const gp_XY&)];
-  %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
-    {
-      sipCpp->HYDROData_Profile::SetRightPoint( aPoint );
-    }
-    else
-    {
-      sipCpp->SetRightPoint( aPoint );
-    }
-    Py_END_ALLOW_THREADS
-  %End
+  void SetRightPoint( const gp_XY& thePoint );
 
   /**
    * Returns last(right) point of profile.
    * \param thePoint[out] profile last point
    * \return true if point has been set
    */
-  bool GetRightPoint( QPointF& thePoint ) const [bool (gp_XY&)];
-  %MethodCode
-  
-    // The C++ API gets the gp_XY object, then we convert it to QPointF.
-    gp_XY aPoint();
-    
-    Py_BEGIN_ALLOW_THREADS
-    sipRes = sipSelfWasArg ? sipCpp->HYDROData_Profile::GetRightPoint( aPoint ) : 
-                             sipCpp->GetRightPoint( aPoint );
-    Py_END_ALLOW_THREADS
-    
-    a0->SetX( aPoint.X() );
-    a0->SetY( aPoint.Y() );
-  %End
+  bool GetRightPoint( gp_XY& thePoint ) const;
 
 
   /**
@@ -156,7 +104,7 @@ public:
     Handle(HYDROData_ProfileUZ) aRefProfileUZ;
     
     Py_BEGIN_ALLOW_THREADS
-    aRefProfileUZ = sipSelfWasArg ? sipCpp->HYDROData_ImmersibleZone::GetProfileUZ() : 
+    aRefProfileUZ = sipSelfWasArg ? sipCpp->HYDROData_Profile::GetProfileUZ() : 
                                    sipCpp->GetProfileUZ();
     Py_END_ALLOW_THREADS
     
@@ -181,13 +129,13 @@ public:
    * Replace current profile parametric points by new one.
    * \param thePoints the list with new points in parametric form
    */
-  void SetParametricPoints( SIP_PYLIST thePoints ) [void ( const HYDROData_ProfileUZ::PointsList& )];
+  void SetParametricPoints( const HYDROData_ProfileUZ::PointsList& thePoints );
 
   /**
    * Returns profile points in parametric form.
    * \return points list
    */
-  SIP_PYLIST GetParametricPoints() const [HYDROData_ProfileUZ::PointsList ()];
+  HYDROData_ProfileUZ::PointsList GetParametricPoints() const;
 
 
   /**
@@ -195,14 +143,14 @@ public:
    * First and last points will be automatically updated.
    * \param thePoints the list with new profile points
    */
-  void SetProfilePoints( const SIP_PYLIST thePoints ) [void ( const ProfilePoints& )];
+  void SetProfilePoints( const ProfilePoints thePoints );
 
   /**
    * Returns profile points.
    * Empty sequence is returned if first or last point was not set.
    * \return profile points list
    */
-  SIP_PYLIST GetProfilePoints() const [ProfilePoints ()];
+  ProfilePoints GetProfilePoints() const;
 
 
 public:
@@ -212,12 +160,12 @@ public:
    * Stores the profile file path
    * \param theFilePath profile file path
    */
-  void SetFilePath( const QString& theFilePath ) [void ( const TCollection_AsciiString& )];
+  void SetFilePath( const TCollection_AsciiString& theFilePath );
 
   /**
    * Returns uploaded profile file path
    */
-  QString GetFilePath() const [TCollection_AsciiString ()];
+  TCollection_AsciiString GetFilePath() const;
 
   /**
    * Imports Profile data from file. The supported file types:
@@ -225,26 +173,34 @@ public:
    *  - georeferenced presentation of profile (3 points in line X,Y,Z)
    * Create as many objects as many profiles in the file are defined.
    * \param theFileName the path to file
-   * \return \c true if file has been successfully read
-   */
-  static bool ImportFromFile( HYDROData_Document theDoc,
-                              const QString& theFileName )
-  [bool ( const Handle_HYDROData_Document&,
-          const TCollection_AsciiString& )];
-
+   * \return \c number of successfully imported profiles
+   */
+  /*static int ImportFromFile( HYDROData_Document theDoc,
+                             const TCollection_AsciiString&    theFileName,
+                             NCollection_Sequence<int>&        theBadProfilesIds )
+  [int ImportFromFile( const Handle(HYDROData_Document)& ,
+                              const TCollection_AsciiString&    ,
+                              NCollection_Sequence<int>&         )];
+  MethodCode
+    Handle(HYDROData_Document) aRef =
+      Handle(HYDROData_Document)::DownCast( createHandle( a0 ) );
+    if ( !aRef.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipRes = sipSelfWasArg ? sipCpp->HYDROData_Profile::ImportFromFile( aRef, a1, a2 ):
+                               sipCpp->ImportFromFile( aRef, a1, a2 );
+      Py_END_ALLOW_THREADS
+    }
+  End
+*/
   /**
    * Imports Profile data from file.
    * \param theFileName the path to file
+   * \param theIsRead set to true if at least one non empty string was read from file
    * \return \c true if file has been successfully read
    */
-  virtual bool ImportFromFile( const QString& theFileName ) [ bool ( const TCollection_AsciiString& ) ];
-
-  /**
-   * Imports Profile data from file. 
-   * \param theFile file to read
-   * \return \c true if file has been successfully read
-   */
-//  virtual bool ImportFromFile( OSD_File& theFile );
+  virtual bool ImportFromFile( const TCollection_AsciiString& theFileName,
+                               bool*                          theIsRead = 0 );
 
 protected:
   /**
index bb31535a868d2b33ff2bcacc8a2c3750c29fb3e3..f46209bd8161666feb73555c6cfb9cf11f2ef8b5 100644 (file)
@@ -27,6 +27,9 @@
 class HYDROData_ProfileUZ : HYDROData_IPolyline
 {
 
+  typedef gp_XY                       Point;
+  typedef NCollection_Sequence<gp_XY> PointsList;
+
 %TypeHeaderCode
 #include <HYDROData_ProfileUZ.h>
 %End