]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
SIP: HYDROData_Stream is included.
authorrkv <rkv@opencascade.com>
Fri, 10 Jan 2014 08:10:16 +0000 (08:10 +0000)
committerrkv <rkv@opencascade.com>
Fri, 10 Jan 2014 08:10:16 +0000 (08:10 +0000)
CMake/UsePyQt4EXT.cmake
src/HYDROData/HYDROData_Stream.h
src/HYDROPy/CMakeLists.txt
src/HYDROPy/HYDROData.sip
src/HYDROPy/HYDROData_Document.sip
src/HYDROPy/HYDROData_Entity.sip
src/HYDROPy/HYDROData_NaturalObject.sip
src/HYDROPy/HYDROData_Object.sip
src/HYDROPy/HYDROData_Stream.sip

index 94d43d862bba32e3e103ea03fc3b6baa2074c272..50746cdc9f7944f8cbc51f529b6729c7f66a2984 100644 (file)
@@ -99,7 +99,7 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles)
 
     LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Digue.cc)
     SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Digue.cc)
+
     LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc)
     SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_PolylineXY.cc)
 
@@ -112,6 +112,9 @@ MACRO(PYQT4_WRAP_SIP_EXT outfiles)
     LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc)
     SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_River.cc)
 
+    LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Stream.cc)
+    SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Stream.cc)
+            
     LIST(APPEND _output ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc)
     SET(${outfiles} ${${outfiles}} ${CMAKE_CURRENT_BINARY_DIR}/sipHYDROPyHYDROData_Zone.cc)
 
index bba1d0a660548289dbe750b584fd034c7210ad77..b1ee6f48ae1a929fa36ae1612d936a30c5c2921d 100644 (file)
@@ -185,7 +185,7 @@ protected:
    * Returns the type of child altitude object.
    * Reimplemented to create stream altitude object.
    */
-  virtual ObjectKind getAltitudeObjectType() const;
+  HYDRODATA_EXPORT virtual ObjectKind getAltitudeObjectType() const;
 
   /**
    * Builds b-spline using interpolation algorithm.
@@ -195,12 +195,12 @@ protected:
   /**
    * Returns default filling color for new object.
    */
-  virtual QColor getDefaultFillingColor() const;
+  HYDRODATA_EXPORT virtual QColor getDefaultFillingColor() const;
 
   /**
    * Returns default border color for new object.
    */
-  virtual QColor getDefaultBorderColor() const;
+  HYDRODATA_EXPORT virtual QColor getDefaultBorderColor() const;
 
 private:
   
index 47ac660db99b93eb47960141f6724067f3d89fa4..f39075f7fceee458602721cb178517cdab547210 100644 (file)
@@ -53,31 +53,6 @@ SET(_sip_files
   HYDROData.sip
 )
 
-#TODO: new files include like this:
-#  HYDROData_Entity.sip
-#  HYDROData_IPolyline.sip
-#  HYDROData_IAltitudeObject.sip
-##  HYDROData_ObstacleAltitude.sip
-#  HYDROData_Object.sip
-##  HYDROData_Profile.sip
-##  HYDROData_Polyline3D.sip
-#  HYDROData_ProfileUZ.sip
-#  HYDROData_PolylineXY.sip
-#  HYDROData_ArtificialObject.sip
-#  HYDROData_Obstacle.sip
-##  HYDROData_Channel.sip
-##  HYDROData_Digue.sip
-#  HYDROData_NaturalObject.sip
-#  HYDROData_River.sip
-##  HYDROData_Stream.sip
-#  HYDROData_Image.sip
-#  HYDROData_Bathymetry.sip
-#  HYDROData_ImmersibleZone.sip
-#  HYDROData_Zone.sip
-#  HYDROData_Region.sip
-#  HYDROData_CalculationCase.sip
-#  HYDROData_Document.sip
-
 SET(_sip_files2
   CAS/gp_XY.sip
   CAS/gp_XYZ.sip
@@ -100,6 +75,7 @@ SET(_sip_files2
   HYDROData_Digue.sip
   HYDROData_NaturalObject.sip
   HYDROData_River.sip
+  HYDROData_Stream.sip
   HYDROData_Image.sip
   HYDROData_Bathymetry.sip
   HYDROData_ImmersibleZone.sip
index 801d167446e8424809fe473cb6f3236d272429c0..a0ec3a37a510b71be198d912834af1ed5d7582a2 100644 (file)
@@ -72,7 +72,7 @@ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 %Include HYDROData_Digue.sip
 %Include HYDROData_NaturalObject.sip
 %Include HYDROData_River.sip
-//Include HYDROData_Stream.sip
+%Include HYDROData_Stream.sip
 %Include HYDROData_Image.sip
 %Include HYDROData_PolylineXY.sip
 %Include HYDROData_Bathymetry.sip
index 16437bbae49349e7594eba69ebebc7be5c5f04d0..adfd9acdc101fe70e2a2f713415f7167d369ed2b 100644 (file)
@@ -137,6 +137,11 @@ class HYDROData_Document
         aRes = new HYDROData_Channel( *dynamic_cast<HYDROData_Channel*>( theObject ) );
         break;
       }
+      case KIND_STREAM:
+      {
+        aRes = new HYDROData_Stream( *dynamic_cast<HYDROData_Stream*>( theObject ) );
+        break;
+      }
     }
     
     return aRes;
index c5cf31d276cf4f7f2b4ce79f18080c77b4b5c45e..c07ecc35d01e3835395c90f382c58c7ebc1e960f 100644 (file)
@@ -107,6 +107,10 @@ class HYDROData_Entity
         sipClass = sipClass_HYDROData_Region;
         break;
 
+      case KIND_STREAM:
+        sipClass = sipClass_HYDROData_Stream;
+        break;
+
       case KIND_ZONE:
         sipClass = sipClass_HYDROData_Zone;
         break;
index d0ec9300db7d7d951e30878b8350622733d9fce8..53bcce3c5982993883b12dc22b56acf120d8b66f 100644 (file)
@@ -38,6 +38,10 @@ class HYDROData_NaturalObject : HYDROData_Object /Abstract/
       case KIND_IMMERSIBLE_ZONE:
         sipClass = sipClass_HYDROData_ImmersibleZone;
         break;
+        
+      case KIND_STREAM:
+        sipClass = sipClass_HYDROData_Stream;
+        break;
 
       case KIND_UNKNOWN:
         sipClass = sipClass_HYDROData_NaturalObject;
index 5a0057fff5deecdd21073806910e6abcc9ce22d3..a1736308469d67a2132cd3233dda78856974750b 100644 (file)
@@ -58,6 +58,10 @@ class HYDROData_Object : HYDROData_Entity /Abstract/
       sipClass = sipClass_HYDROData_Profile;
       break;
 
+    case KIND_STREAM:
+      sipClass = sipClass_HYDROData_Stream;
+      break;
+
     case KIND_UNKNOWN:
       sipClass = sipClass_HYDROData_Entity;
       break;
index 0fcd433c6b7e8c537a2f0022c1845ff310ad192e..6fc7a002a055b37350968aaf9a1d38b5abe4ddfc 100644 (file)
@@ -34,7 +34,7 @@ public:
   /**
    * Update the shape presentations of stream.
    */
-  virtual void UpdatePrs();
+  void UpdatePrs();
 
   /**
    * Returns default filling color for new stream.
@@ -49,7 +49,18 @@ public:
   /**
    * Returns true if given polyline can be used as stream axis.
    */
-  static bool IsValidAsAxis( const Handle(HYDROData_PolylineXY)& theAxis );
+  static bool IsValidAsAxis( HYDROData_PolylineXY theAxis ) 
+  [bool ( const Handle_HYDROData_PolylineXY& )];
+  %MethodCode
+    Handle(HYDROData_PolylineXY) aRef =
+      Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
+    if ( !aRef.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipRes = HYDROData_Stream::IsValidAsAxis( aRef );
+      Py_END_ALLOW_THREADS
+    }
+  %End
 
 public:      
   // Public methods to work with Stream presentation
@@ -81,59 +92,106 @@ public:
   /**
    * Sets reference hydraulic axis object for stream.
    */
-  virtual bool SetHydraulicAxis( const Handle(HYDROData_PolylineXY)& theAxis );
+  bool SetHydraulicAxis( HYDROData_PolylineXY theAxis )
+  [bool ( const Handle_HYDROData_PolylineXY& )];
+  %MethodCode
+    Handle(HYDROData_PolylineXY) aRef =
+      Handle(HYDROData_PolylineXY)::DownCast( createHandle( a0 ) );
+    if ( !aRef.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::SetHydraulicAxis( aRef ):
+                               sipCpp->SetHydraulicAxis( aRef );
+      Py_END_ALLOW_THREADS
+    }
+  %End
 
   /**
    * Returns reference hydraulic axis object of stream.
    */
-  virtual Handle(HYDROData_PolylineXY) GetHydraulicAxis() const;
+  HYDROData_PolylineXY GetHydraulicAxis() const
+  [Handle_HYDROData_PolylineXY ()];
+  %MethodCode
+    Handle(HYDROData_PolylineXY) aRef;
+    
+    Py_BEGIN_ALLOW_THREADS
+    aRef = sipSelfWasArg ? sipCpp->HYDROData_Stream::GetHydraulicAxis() : 
+                           sipCpp->GetHydraulicAxis();
+    Py_END_ALLOW_THREADS
+    
+    sipRes = (HYDROData_PolylineXY*)createPointer( aRef );
+  %End
 
   /**
    * Remove reference hydraulic axis object from stream.
    */
-  virtual void RemoveHydraulicAxis();
+  void RemoveHydraulicAxis();
 
   /**
    * Returns true if profile has the intersection with the given hydraulic axis.
    * Returns the parameter of inresection point on axis if axis is presented by one curve,
    * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point. 
    */
-  static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis, 
-                                                const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
-                                                                                                                       Standard_Real& outPar);
+//  static bool HasIntersection( const Handle(HYDROData_PolylineXY)& theHydAxis, 
+//                               const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
+//                                                    Standard_Real& outPar);
 
   /**
    * Returns true if profile has the intersection with reference hydraulic axis.
    * Returns the parameter of inresection point on axis if axis is presented by one curve,
    * if axis presented by set of edges the <outPar> returns a common length of segments till the intersection point. 
    */
-  virtual bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
-                                                                                                                        Standard_Real& outPar) const;
+//  bool HasIntersection( const Handle(HYDROData_Profile)& theProfile, const TopoDS_Face& thePlane,
+//                                                                                                                      Standard_Real& outPar) const;
 
    /**
    * Builds a planar face
    */
-  virtual bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const;
+//  bool BuildFace( const Handle(HYDROData_PolylineXY)& theHydAxis, TopoDS_Face& thePlane) const;
 
   /**
    * Add new one reference profile object for stream.
    */
-  virtual bool AddProfile( const Handle(HYDROData_Profile)& theProfile );
+  bool AddProfile( HYDROData_Profile theProfile )
+  [bool ( const Handle_HYDROData_Profile& )];
+  %MethodCode
+    Handle(HYDROData_Profile) aRef =
+      Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
+    if ( !aRef.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::AddProfile( aRef ):
+                               sipCpp->AddProfile( aRef );
+      Py_END_ALLOW_THREADS
+    }
+  %End
 
   /**
    * Returns all reference profile objects of stream.
    */
-  virtual HYDROData_SequenceOfObjects GetProfiles() const;
+  HYDROData_SequenceOfObjects GetProfiles() const;
 
   /**
    * Removes reference profile object from stream.
    */
-  virtual bool RemoveProfile( const Handle(HYDROData_Profile)& theProfile );
+  bool RemoveProfile( HYDROData_Profile theProfile )
+  [bool ( const Handle_HYDROData_Profile& )];
+  %MethodCode
+    Handle(HYDROData_Profile) aRef =
+      Handle(HYDROData_Profile)::DownCast( createHandle( a0 ) );
+    if ( !aRef.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipRes = sipSelfWasArg ? sipCpp->HYDROData_Stream::RemoveProfile( aRef ):
+                               sipCpp->RemoveProfile( aRef );
+      Py_END_ALLOW_THREADS
+    }
+  %End
 
   /**
    * Removes all reference profile objects from stream.
    */
-  virtual void RemoveProfiles();
+  void RemoveProfiles();
   
 protected:
   /**