Salome HOME
refs# 1917 + protection against null shapes wires in GetMiddlePoint()
[modules/hydro.git] / src / HYDROPy / HYDROData_Zone.sip
index 6a1aba28ab0d6c335952f1ad40e48a0f089eae92..ff034d86b1799fc1498d10b6819d06cf21656042 100644 (file)
@@ -43,7 +43,7 @@ class HYDROData_Zone : public HYDROData_Entity
 public:
 
   // Enumeration of mergin types for conflict altitudes
-  enum MergeAltitudesType
+  enum MergeType
   {
     Merge_ZMIN,   // The minimum values
     Merge_ZMAX,   // The maximum values
@@ -52,114 +52,88 @@ public:
 
 public:      
 
-  /**
-   * Sets the merging type for conflict altitudes.
-   * By default it is set to Merge_ZMIN.
-   */
-  void SetMergeType( const MergeAltitudesType& theType );
+  void SetMergeType( const MergeType& theType );
+  MergeType GetMergeType() const;
 
-  /**
-   * Returns the merging type for conflict altitudes.
-   */
-  MergeAltitudesType GetMergeType() const;
-
-
-  /**
-   * Sets the reference altitude to resolve the conflict.
-   * This object is used only in case of "Merge_Object" merge type.
-   */
-  void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude ) [void (const Handle_HYDROData_IAltitudeObject&)];
+  void SetMergeAltitude( HYDROData_IAltitudeObject theAltitude )
+  [void (const opencascade::handle<HYDROData_IAltitudeObject>&)];
   %MethodCode
-
     Handle(HYDROData_IAltitudeObject) aRefAltitude =
       Handle(HYDROData_IAltitudeObject)::DownCast( createHandle( a0 ) );
     if ( !aRefAltitude.IsNull() )
     {
       Py_BEGIN_ALLOW_THREADS
-      sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeAltitude( aRefAltitude ) : 
-                      sipCpp->SetMergeAltitude( aRefAltitude );
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeObject( aRefAltitude ) : 
+                      sipCpp->SetMergeObject( aRefAltitude );
       Py_END_ALLOW_THREADS
     }
-
   %End
 
-  /**
-   * Returns the reference altitude to resolve the conflict.
-   */
-  HYDROData_IAltitudeObject GetMergeAltitude() const [Handle_HYDROData_IAltitudeObject ()];
+  HYDROData_IAltitudeObject GetMergeAltitude() const [opencascade::handle<HYDROData_IAltitudeObject> ()];
   %MethodCode
-
     Handle(HYDROData_IAltitudeObject) aRefAltitude;
-    
     Py_BEGIN_ALLOW_THREADS
-    aRefAltitude = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeAltitude() : 
-                                   sipCpp->GetMergeAltitude();
+    Handle(HYDROData_Entity) aRefObject = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeObject() : 
+                                                          sipCpp->GetMergeObject();
+       aRefAltitude = Handle(HYDROData_IAltitudeObject)::DownCast( aRefObject );
     Py_END_ALLOW_THREADS
-    
     sipRes = (HYDROData_IAltitudeObject*)createPointer( aRefAltitude );
-  
   %End
 
-  /**
-   * Removes the reference altitude for resolving the conflict.
-   */
   void RemoveMergeAltitude();
-
-
-  /**
-   * dd new one geometry object for zone.
-   */
-  void AddGeometryObject( HYDROData_Object theRegion ) [void (const Handle_HYDROData_Object&)];
   %MethodCode
+    Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::RemoveMergeObject() : 
+                      sipCpp->RemoveMergeObject();
+    Py_END_ALLOW_THREADS
+  %End
 
-    Handle(HYDROData_Object) aGeomObj =
-      Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
-    if ( !aGeomObj.IsNull() )
+  void SetMergeObject( HYDROData_Entity theObject ) [void (const opencascade::handle<HYDROData_Entity>&)];
+  %MethodCode
+    Handle(HYDROData_Entity) aRefObject = createHandle( a0 );
+    if ( !aRefObject.IsNull() )
     {
       Py_BEGIN_ALLOW_THREADS
-      sipSelfWasArg ? sipCpp->HYDROData_Zone::AddGeometryObject( aGeomObj ) : 
-                      sipCpp->AddGeometryObject( aGeomObj );
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeObject( aRefObject ) : 
+                      sipCpp->SetMergeObject( aRefObject );
       Py_END_ALLOW_THREADS
     }
+  %End
 
+  HYDROData_Entity GetMergeObject() const [opencascade::handle<HYDROData_Entity> ()];
+  %MethodCode
+    Handle(HYDROData_Entity) aRefObject;
+    Py_BEGIN_ALLOW_THREADS
+    aRefObject = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetMergeObject() : 
+                                 sipCpp->GetMergeObject();
+    Py_END_ALLOW_THREADS
+    sipRes = (HYDROData_Entity*)createPointer( aRefObject );
   %End
 
-  /**
-   * Returns all geometry objects of zone.
-   */
-  HYDROData_SequenceOfObjects GetGeometryObjects() const;
+  void RemoveMergeObject();
 
-  /**
-   * Removes all geometry objects from zone.
-   */
-  void RemoveGeometryObjects();
+  void AddObject( HYDROData_Entity theObject ) [void (const opencascade::handle<HYDROData_Entity>&)];
+  %MethodCode
 
+    Handle(HYDROData_Entity) anObj = createHandle( a0 );
+    if ( !anObj.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::AddObject( anObj ) : 
+                      sipCpp->AddObject( anObj );
+      Py_END_ALLOW_THREADS
+    }
 
-  /**
-   * Sets the interpolator for zone. By default it is NULL and original
-   * interpolation algorithms are used to calculate points altitudes.
-   * If you set interpolator it won't be stored in the data model structure,
-   * it will be deleted during that time as this zone will be freed.
-   */
-  void SetInterpolator( HYDROData_IInterpolator* theInter );
+  %End
+
+  HYDROData_SequenceOfObjects GetObjects() const;
 
-  /**
-   * * Returns the interpolator of zone object.
-   */
+  void RemoveObjects();
+  void SetInterpolator( HYDROData_IInterpolator* theInter );
   HYDROData_IInterpolator* GetInterpolator() const;
 
 protected:
 
-  /**
-   * Creates new object in the internal data structure. Use higher level objects 
-   * to create objects with real content.
-   */
   HYDROData_Zone();
-
-  /**
-   * Destructs properties of the object and object itself, removes it from the document.
-   */
   ~HYDROData_Zone();
 };
-
-