Salome HOME
Merging with V7_main branch.
[modules/hydro.git] / src / HYDROPy / HYDROData_Zone.sip
index 892ef0aa2e847edf229fd07a49cb7147c8012f23..4b28e6d8451b06d6c5b8ac9585623294ac6cda57 100644 (file)
@@ -24,7 +24,7 @@
 #include <HYDROData_Zone.h>
 %End
 
-class HYDROData_Zone : HYDROData_Object
+class HYDROData_Zone : HYDROData_Entity
 {
 
 %TypeHeaderCode
@@ -32,151 +32,111 @@ class HYDROData_Zone : HYDROData_Object
 %End
 
 %ConvertToSubClassCode
-    if ( !Handle(HYDROData_Zone)::DownCast( sipCpp ).IsNull() )
-      sipClass = sipClass_HYDROData_Zone;
-    else
-      sipClass = NULL;
+    switch ( sipCpp->GetKind() )
+    {
+      case KIND_ZONE:
+        sipClass = sipClass_HYDROData_Zone;
+        break;
+
+      default:
+        // We don't recognise the type.
+        sipClass = NULL;
+    }
 %End
 
 public:
 
-  const ObjectKind          GetKind() const;
+  // Enumeration of mergin types for conflict bathymetries
+  enum MergeBathymetriesType
+  {
+    Merge_ZMIN,   // The minimum values
+    Merge_ZMAX,   // The maximum values
+    Merge_Object  // Only one bathymetry will be taken into account
+  };
 
 public:      
 
   /**
-   * Sets filling color for zone.
-   */
-  void SetFillingColor( const QColor& theColor );
-
-  /**
-   * Returns filling color of zone.
+   * Sets the merging type for conflict bathymetries.
+   * By default it is set to Merge_ZMIN.
    */
-  QColor GetFillingColor() const;
+  void SetMergeType( const MergeBathymetriesType& theType );
 
   /**
-   * Sets border color for zone.
+   * Returns the merging type for conflict bathymetries.
    */
-  void SetBorderColor( const QColor& theColor );
+  MergeBathymetriesType GetMergeType() const;
 
-  /**
-   * Returns border color of zone.
-   */
-  QColor GetBorderColor() const;
 
   /**
-   * Sets reference polyline object for zone.
+   * Sets the reference bathymetry to resolve the conflict.
+   * This object is used only in case of "Merge_Object" merge type.
    */
-  void SetPolyline( HYDROData_Polyline thePolyline ) [void (const Handle_HYDROData_Polyline&)];
+  void SetMergeBathymetry( HYDROData_Bathymetry theBathymetry ) [void (const Handle_HYDROData_Bathymetry&)];
   %MethodCode
 
-    Handle(HYDROData_Polyline) aRefPolyline =
-      Handle(HYDROData_Polyline)::DownCast( createHandle( a0 ) );
-    if ( !aRefPolyline.IsNull() )
+    Handle(HYDROData_Bathymetry) aRefBath =
+      Handle(HYDROData_Bathymetry)::DownCast( createHandle( a0 ) );
+    if ( !aRefBath.IsNull() )
     {
       Py_BEGIN_ALLOW_THREADS
-      sipSelfWasArg ? sipCpp->HYDROData_Zone::SetPolyline( aRefPolyline ) : 
-                      sipCpp->SetPolyline( aRefPolyline );
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeBathymetry( aRefBath ) : 
+                      sipCpp->SetMergeBathymetry( aRefBath );
       Py_END_ALLOW_THREADS
     }
 
   %End
 
   /**
-   * Returns reference polyline object of zone.
+   * Returns the reference bathymetry to resolve the conflict.
    */
-  HYDROData_Polyline GetPolyline() const [Handle_HYDROData_Polyline ()];
+  HYDROData_Bathymetry GetMergeBathymetry() const [Handle_HYDROData_Bathymetry ()];
   %MethodCode
 
-    Handle(HYDROData_Polyline) aRefPolyline;
+    Handle(HYDROData_Bathymetry) aRefBath;
     
     Py_BEGIN_ALLOW_THREADS
-    aRefPolyline = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetPolyline() : 
-                                   sipCpp->GetPolyline();
+    aRefBath = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeBathymetry() : 
+                               sipCpp->GetMergeBathymetry();
     Py_END_ALLOW_THREADS
     
-    sipRes = (HYDROData_Polyline*)createPointer( aRefPolyline );
+    sipRes = (HYDROData_Bathymetry*)createPointer( aRefBath );
   
   %End
 
   /**
-   * Remove reference polyline object of zone.
+   * Removes the reference bathymetry for resolving the conflict.
    */
-  void RemovePolyline();
+  void RemoveMergeBathymetry();
 
-  /**
-   * Returns number of bathymetry objects for zone.
-   */
-  int NbBathymetries() const;
 
   /**
-   * Add reference bathymetry object for zone.
+   * dd new one geometry object for zone.
    */
-  void AddBathymetry( HYDROData_Bathymetry theBathymetry ) [void (const Handle_HYDROData_Bathymetry&)];
+  void AddGeometryObject( HYDROData_Object theRegion ) [void (const Handle_HYDROData_Object&)];
   %MethodCode
 
-    Handle(HYDROData_Bathymetry) aRefBath =
-      Handle(HYDROData_Bathymetry)::DownCast( createHandle( a0 ) );
-    if ( !aRefBath.IsNull() )
+    Handle(HYDROData_Object) aGeomObj =
+      Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
+    if ( !aGeomObj.IsNull() )
     {
       Py_BEGIN_ALLOW_THREADS
-      sipSelfWasArg ? sipCpp->HYDROData_Zone::AddBathymetry( aRefBath ) : 
-                      sipCpp->AddBathymetry( aRefBath );
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::AddGeometryObject( aGeomObj ) : 
+                      sipCpp->AddGeometryObject( aGeomObj );
       Py_END_ALLOW_THREADS
     }
 
   %End
 
   /**
-   * Change reference bathymetry object with given index for zone.
-   */
-  void SetBathymetry( const int            theIndex, 
-                      HYDROData_Bathymetry theBathymetry ) [void (const int, const Handle_HYDROData_Bathymetry&)];
-  %MethodCode
-
-    Handle(HYDROData_Bathymetry) aRefBath =
-      Handle(HYDROData_Bathymetry)::DownCast( createHandle( a1 ) );
-    if ( !aRefBath.IsNull() )
-    {
-      Py_BEGIN_ALLOW_THREADS
-      sipSelfWasArg ? sipCpp->HYDROData_Zone::SetBathymetry( a0, aRefBath ) : 
-                      sipCpp->SetBathymetry( a0, aRefBath );
-      Py_END_ALLOW_THREADS
-    }
-
-  %End
-
-  /**
-   * Returns reference bathymetry object of zone by it index.
-   */
-  HYDROData_Bathymetry GetBathymetry( const int theIndex ) const [Handle_HYDROData_Bathymetry (const int)];
-  %MethodCode
-
-    Handle(HYDROData_Bathymetry) aRefBath;
-    
-    Py_BEGIN_ALLOW_THREADS
-    aRefBath = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetBathymetry( a0 ) : 
-                               sipCpp->GetBathymetry( a0 );
-    Py_END_ALLOW_THREADS
-    
-    sipRes = (HYDROData_Bathymetry*)createPointer( aRefBath );
-  
-  %End
-
-  /**
-   * Returns list of all reference bathymetry objects of zone.
-   */
-  //HYDROData_SequenceOfObjects GetBathymetries() const;
-
-  /**
-   * Clear list of bathymetry objects of zone.
+   * Returns all geometry objects of zone.
    */
-  void RemoveBathymetries();
+  //HYDROData_SequenceOfObjects GetGeometryObjects() const;
 
   /**
-   * Returns the painter path. The painter path is construct by polyline
+   * Removes all geometry objects from zone.
    */
-  QPainterPath GetPainterPath() const;
+  void RemoveGeometryObjects();
 
 protected: