Salome HOME
Python scripting is done for Zones and Calculations (Feature #13).
authoradv <adv@opencascade.com>
Mon, 23 Sep 2013 11:55:16 +0000 (11:55 +0000)
committeradv <adv@opencascade.com>
Mon, 23 Sep 2013 11:55:16 +0000 (11:55 +0000)
12 files changed:
src/HYDROData/HYDROData_Calculation.cxx
src/HYDROData/HYDROData_Document.cxx
src/HYDROData/HYDROData_Image.cxx
src/HYDROData/HYDROData_Object.cxx
src/HYDROData/HYDROData_Object.h
src/HYDROData/HYDROData_Zone.cxx
src/HYDROPy/HYDROData.sip
src/HYDROPy/HYDROData_Calculation.sip [new file with mode: 0644]
src/HYDROPy/HYDROData_Document.sip
src/HYDROPy/HYDROData_Object.sip
src/HYDROPy/HYDROData_Zone.sip [new file with mode: 0644]
src/HYDROPy/HYDROPy.vcproj

index 8b9c94d7bd051a384b9fc6244a04367d7e791ff4..766077e1ef24bde31c30ab60cb41754fe1cd9e56 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <QStringList>
 
-#define PYTHON_BATHYMETRY_ID "KIND_CALCULATION"
+#define PYTHON_CALCULATION_ID "KIND_CALCULATION"
 
 IMPLEMENT_STANDARD_HANDLE(HYDROData_Calculation, HYDROData_Object)
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Calculation, HYDROData_Object)
@@ -35,11 +35,35 @@ QStringList HYDROData_Calculation::DumpToPython( MapOfTreatedObjects& theTreated
   QString aCalculName = GetName();
 
   aResList << QString( "%1 = %2.CreateObject( %3 );" )
-              .arg( aCalculName ).arg( aDocName ).arg( PYTHON_BATHYMETRY_ID );
+              .arg( aCalculName ).arg( aDocName ).arg( PYTHON_CALCULATION_ID );
   aResList << QString( "%1.SetName( \"%2\" );" )
               .arg( aCalculName ).arg( aCalculName );
-
-  // TO_IMPLEMENT
+  aResList << QString( "" );
+
+  Handle(HYDROData_Polyline) aBoundaryPolyline = GetBoundaryPolyline();
+  setPythonReferenceObject( theTreatedObjects, aResList, aBoundaryPolyline, "SetBoundaryPolyline" );
+  aResList << QString( "" );
+
+  HYDROData_SequenceOfObjects aZones = GetZones();
+  HYDROData_SequenceOfObjects::Iterator anIter( aZones );
+  for ( ; anIter.More(); anIter.Next() )
+  {
+    Handle(HYDROData_Zone) aRefZone =
+      Handle(HYDROData_Zone)::DownCast( anIter.Value() );
+    if ( !aRefZone.IsNull() )
+      setPythonReferenceObject( theTreatedObjects, aResList, aRefZone, "AddZone" );
+  }
+  aResList << QString( "" );
+
+  aZones = GetSplittedZones();
+  anIter.Init( aZones );
+  for ( ; anIter.More(); anIter.Next() )
+  {
+    Handle(HYDROData_Zone) aSplittedZone =
+      Handle(HYDROData_Zone)::DownCast( anIter.Value() );
+    if ( !aSplittedZone.IsNull() )
+      setPythonReferenceObject( theTreatedObjects, aResList, aSplittedZone, "AddSplittedZone" );
+  }
 
   return aResList;
 }
index ec413b43e9f50f6281504761c55eca5605a5afb0..7c43e53ead4cf8bd2d402453862cfa801e5f1644 100644 (file)
@@ -197,6 +197,7 @@ bool HYDROData_Document::DumpToPython( const QString& theFileName ) const
   aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_IMAGE      );
   aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_POLYLINE   );
   aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_BATHYMETRY );
+  aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_ZONE );
   aRes = aRes && dumpPartitionToPython( aFile, aTreatedObjects, KIND_CALCULATION );
 
   return aRes;
index 362e151577e0dcf24ad2ba85377567fe0c440756..694e65f8a1c16439d7b084caef920b22d33fed40 100644 (file)
@@ -139,30 +139,7 @@ QStringList HYDROData_Image::DumpToPython( MapOfTreatedObjects& theTreatedObject
       for ( int i = 0; i < aNbReferences; ++i )
       {
         Handle(HYDROData_Image) aRefImg = Handle(HYDROData_Image)::DownCast( Reference( i ) );
-        if ( aRefImg.IsNull() )
-          continue;
-
-        QString aRefImgName = aRefImg->GetName();
-
-        // The definition of reference image must be dumped before this
-        if ( !theTreatedObjects.contains( aRefImgName ) )
-        {
-          // Write definition of reference image
-          QStringList aRefImgDump = aRefImg->DumpToPython( theTreatedObjects );
-          if ( aRefImgDump.isEmpty() )
-            continue;
-
-          QStringList aTmpList = aResList;
-          aResList = aRefImgDump;
-
-          aResList.append( "" );
-          aResList.append( aTmpList );
-
-          theTreatedObjects.insert( aRefImgName, aRefImg );
-        }
-
-        aResList << QString( "%1.AppendReference( %2 );" )
-                    .arg( anImageName ).arg( aRefImgName );
+        setPythonReferenceObject( theTreatedObjects, aResList, aRefImg, "AppendReference" );
       }
     }
 
index 9a971a75a61172f187e110cf429866fbcc6a8e1c..2ee9bd7ec4788fab611f7367eaebf3bf9173df72 100644 (file)
@@ -303,4 +303,44 @@ QColor HYDROData_Object::GetColor( const QColor& theDefColor,
   }
 
   return aResColor;
-}
\ No newline at end of file
+}
+
+void HYDROData_Object::setPythonReferenceObject( MapOfTreatedObjects&            theTreatedObjects,
+                                                 QStringList&                    theScript,
+                                                 const Handle(HYDROData_Object)& theRefObject,
+                                                 const QString&                  theMethod ) const
+{
+  if ( theRefObject.IsNull() )
+    return;
+
+  QString aRefObjName = theRefObject->GetName();
+  if ( aRefObjName.isEmpty() )
+    return;
+
+  bool anIsToSetObject = true;
+
+  // The definition of reference polyline must be dumped before this
+  if ( !theTreatedObjects.contains( aRefObjName ) )
+  {
+    // Write definition of reference polyline
+    QStringList aRefObjDump = theRefObject->DumpToPython( theTreatedObjects );
+    if ( ( anIsToSetObject = !aRefObjDump.isEmpty() ) )
+    {
+      QStringList aTmpList = theScript;
+      theScript = aRefObjDump;
+
+      theScript << QString( "" );
+      theScript << aTmpList;
+
+      theTreatedObjects.insert( aRefObjName, theRefObject );
+    }
+  }
+
+  if ( anIsToSetObject )
+  {
+    theScript << QString( "%1.%2( %3 );" )
+                 .arg( GetName() ).arg( theMethod ).arg( aRefObjName );
+  }
+}
+
+
index caa0b29ce5c14dd65c1c910ee594e04875b39df1..8ddb494891ce7a03e23bead3680ac495415aa438 100644 (file)
@@ -236,6 +236,13 @@ protected:
    */
   QColor GetColor( const QColor& theDefColor, const int theTag = 0 ) const;
 
+protected:
+
+  void setPythonReferenceObject( MapOfTreatedObjects&            theTreatedObjects,
+                                 QStringList&                    theScript,
+                                 const Handle(HYDROData_Object)& theRefObject,
+                                 const QString&                  theMethod ) const;
 protected:
 
   Handle(TDataStd_ReferenceList) getReferenceList( const int  theTag,
index fa2c0e16171b80e5c43c83c9cd4c0164c5e629ec..91765f5f79dbe4ad8f98cb05426a17dda04609cc 100644 (file)
@@ -11,7 +11,7 @@
 #include <QColor>
 #include <QStringList>
 
-#define PYTHON_POLYLINE_ID "KIND_ZONE"
+#define PYTHON_ZONE_ID "KIND_ZONE"
 
 IMPLEMENT_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Object)
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Zone, HYDROData_Object)
@@ -32,6 +32,43 @@ QStringList HYDROData_Zone::DumpToPython( MapOfTreatedObjects& theTreatedObjects
   if ( aDocument.IsNull() )
     return aResList;
 
+  QString aDocName = aDocument->GetDocPyName();
+  QString aZoneName = GetName();
+
+  aResList << QString( "%1 = %2.CreateObject( %3 );" )
+              .arg( aZoneName ).arg( aDocName ).arg( PYTHON_ZONE_ID );
+  aResList << QString( "%1.SetName( \"%2\" );" )
+              .arg( aZoneName ).arg( aZoneName );
+  aResList << QString( "" );
+
+  QColor aFillingColor = GetFillingColor();
+  aResList << QString( "filling_color = QColor( %1, %2, %3, %4 );" )
+              .arg( aFillingColor.red()  ).arg( aFillingColor.green() )
+              .arg( aFillingColor.blue() ).arg( aFillingColor.alpha() );
+  aResList << QString( "%1.SetFillingColor( filling_color );" ).arg( aZoneName );
+  aResList << QString( "" );
+
+  QColor aBorderColor = GetBorderColor();
+  aResList << QString( "border_color = QColor( %1, %2, %3, %4 );" )
+              .arg( aBorderColor.red()  ).arg( aBorderColor.green() )
+              .arg( aBorderColor.blue() ).arg( aBorderColor.alpha() );
+  aResList << QString( "%1.SetBorderColor( border_color );" ).arg( aZoneName );
+  aResList << QString( "" );
+
+  Handle(HYDROData_Polyline) aRefPolyline = GetPolyline();
+  setPythonReferenceObject( theTreatedObjects, aResList, aRefPolyline, "SetPolyline" );
+  aResList << QString( "" );
+
+  HYDROData_SequenceOfObjects aZoneBaths = GetBathymetries();
+  HYDROData_SequenceOfObjects::Iterator aBathsIter( aZoneBaths );
+  for ( ; aBathsIter.More(); aBathsIter.Next() )
+  {
+    Handle(HYDROData_Bathymetry) aRefBath =
+      Handle(HYDROData_Bathymetry)::DownCast( aBathsIter.Value() );
+    if ( !aRefBath.IsNull() )
+      setPythonReferenceObject( theTreatedObjects, aResList, aRefBath, "AddBathymetry" );
+  }
+
   return aResList;
 }
 
index 16016f2a3c2269076be90f6883676458d0d66d5f..1ef50c1e8e3ccc0ca21e2fc72f83d2b4bec1f3fe 100644 (file)
@@ -56,6 +56,8 @@ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 %Include HYDROData_Image.sip
 %Include HYDROData_Polyline.sip
 %Include HYDROData_Bathymetry.sip
+%Include HYDROData_Zone.sip
+%Include HYDROData_Calculation.sip
 
 %Include HYDROData_Document.sip
 
diff --git a/src/HYDROPy/HYDROData_Calculation.sip b/src/HYDROPy/HYDROData_Calculation.sip
new file mode 100644 (file)
index 0000000..00c026c
--- /dev/null
@@ -0,0 +1,254 @@
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+%ExportedHeaderCode
+#include <HYDROData_Calculation.h>
+%End
+
+class HYDROData_Calculation : HYDROData_Object
+{
+
+%TypeHeaderCode
+#include <HYDROData_Calculation.h>
+%End
+
+%ConvertToSubClassCode
+    if ( !Handle(HYDROData_Calculation)::DownCast( sipCpp ).IsNull() )
+      sipClass = sipClass_HYDROData_Calculation;
+    else
+      sipClass = NULL;
+%End
+
+public:
+
+  const ObjectKind          GetKind() const;
+
+public:      
+
+  /**
+   * Sets boundary polyline for calculation case.
+   */
+  void SetBoundaryPolyline( HYDROData_Polyline thePolyline ) [void (const Handle_HYDROData_Polyline&)];
+  %MethodCode
+
+    Handle(HYDROData_Polyline) aRefPolyline =
+      Handle(HYDROData_Polyline)::DownCast( createHandle( a0 ) );
+    if ( !aRefPolyline.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Calculation::SetBoundaryPolyline( aRefPolyline ) : 
+                      sipCpp->SetBoundaryPolyline( aRefPolyline );
+      Py_END_ALLOW_THREADS
+    }
+
+  %End
+
+  /**
+   * Returns boundary polyline of calculation case.
+   */
+  HYDROData_Polyline GetBoundaryPolyline() const [Handle_HYDROData_Polyline ()];
+  %MethodCode
+
+    Handle(HYDROData_Polyline) aRefPolyline;
+    
+    Py_BEGIN_ALLOW_THREADS
+    aRefPolyline = sipSelfWasArg ? sipCpp->HYDROData_Calculation::GetBoundaryPolyline() : 
+                                   sipCpp->GetBoundaryPolyline();
+    Py_END_ALLOW_THREADS
+    
+    sipRes = (HYDROData_Polyline*)createPointer( aRefPolyline );
+  
+  %End
+
+  /**
+   * Removes boundary polyline of calculation case.
+   */
+  void RemoveBoundaryPolyline();
+
+
+
+  /**
+   * Returns number of refrence zones for calculation case.
+   */
+  int NbZones() const;
+
+  /**
+   * Add new one refrence zone for calculation case.
+   */
+  void AddZone( HYDROData_Zone theZone ) [void (const Handle_HYDROData_Zone&)];
+  %MethodCode
+
+    Handle(HYDROData_Zone) aRefZone =
+      Handle(HYDROData_Zone)::DownCast( createHandle( a0 ) );
+    if ( !aRefZone.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Calculation::AddZone( aRefZone ) : 
+                      sipCpp->AddZone( aRefZone );
+      Py_END_ALLOW_THREADS
+    }
+
+  %End
+
+  /**
+   * Replace the refrence zone for calculation case.
+   */
+  void SetZone( const int      theIndex, 
+                HYDROData_Zone theZone ) [void (const int, const Handle_HYDROData_Zone&)];
+  %MethodCode
+
+    Handle(HYDROData_Zone) aRefZone =
+      Handle(HYDROData_Zone)::DownCast( createHandle( a1 ) );
+    if ( !aRefZone.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Calculation::SetZone( a0, aRefZone ) : 
+                      sipCpp->SetZone( a0, aRefZone );
+      Py_END_ALLOW_THREADS
+    }
+
+  %End
+
+  /**
+   * Sets the refrence zones for calculation case.
+   */
+  //void SetZones( const HYDROData_SequenceOfObjects& theZones );
+
+  /**
+   * Returns refrence zone of calculation case by index.
+   */
+  HYDROData_Zone GetZone( const int theIndex ) const [Handle_HYDROData_Zone (const int)];
+  %MethodCode
+
+    Handle(HYDROData_Zone) aRefZone;
+    
+    Py_BEGIN_ALLOW_THREADS
+    aRefZone = sipSelfWasArg ? sipCpp->HYDROData_Calculation::GetZone( a0 ) : 
+                               sipCpp->GetZone( a0 );
+    Py_END_ALLOW_THREADS
+    
+    sipRes = (HYDROData_Zone*)createPointer( aRefZone );
+  
+  %End
+
+  /**
+   * Returns all refrence zone of calculation case.
+   */
+  //HYDROData_SequenceOfObjects GetZones() const;
+
+  /**
+   * Removes all refrence zone of calculation case.
+   */
+  void RemoveZones();
+
+
+
+  /**
+   * Returns number of splitted zones for calculation case.
+   */
+  int NbSplittedZones() const;
+
+  /**
+   * Add new one splitted zone for calculation case.
+   */
+  void AddSplittedZone( HYDROData_Zone theZone ) [void (const Handle_HYDROData_Zone&)];
+  %MethodCode
+
+    Handle(HYDROData_Zone) aRefZone =
+      Handle(HYDROData_Zone)::DownCast( createHandle( a0 ) );
+    if ( !aRefZone.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Calculation::AddSplittedZone( aRefZone ) : 
+                      sipCpp->AddSplittedZone( aRefZone );
+      Py_END_ALLOW_THREADS
+    }
+
+  %End
+
+  /**
+   * Replace the splitted zone for calculation case.
+   */
+  void SetSplittedZone( const int      theIndex, 
+                        HYDROData_Zone theZone ) [void (const int, const Handle_HYDROData_Zone&)];
+  %MethodCode
+
+    Handle(HYDROData_Zone) aRefZone =
+      Handle(HYDROData_Zone)::DownCast( createHandle( a1 ) );
+    if ( !aRefZone.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Calculation::SetSplittedZone( a0, aRefZone ) : 
+                      sipCpp->SetSplittedZone( a0, aRefZone );
+      Py_END_ALLOW_THREADS
+    }
+
+  %End
+
+  /**
+   * Sets the refrence zones for calculation case.
+   */
+  //void SetSplittedZones( const HYDROData_SequenceOfObjects& theZones );
+
+  /**
+   * Returns splitted zone of calculation case by index.
+   */
+  HYDROData_Zone GetSplittedZone( const int theIndex ) const [Handle_HYDROData_Zone (const int)];
+  %MethodCode
+
+    Handle(HYDROData_Zone) aRefZone;
+    
+    Py_BEGIN_ALLOW_THREADS
+    aRefZone = sipSelfWasArg ? sipCpp->HYDROData_Calculation::GetSplittedZone( a0 ) : 
+                               sipCpp->GetSplittedZone( a0 );
+    Py_END_ALLOW_THREADS
+    
+    sipRes = (HYDROData_Zone*)createPointer( aRefZone );
+  
+  %End
+
+  /**
+   * Returns all splitted zones of calculation case.
+   */
+  //HYDROData_SequenceOfObjects GetSplittedZones() const;
+
+  /**
+   * Removes all splitted refrence zone of calculation case.
+   */
+  void RemoveSplittedZones();
+
+
+protected:
+
+  /**
+   * Creates new object in the internal data structure. Use higher level objects 
+   * to create objects with real content.
+   */
+  HYDROData_Calculation();
+
+  /**
+   * Destructs properties of the object and object itself, removes it from the document.
+   */
+  ~HYDROData_Calculation();
+};
+
+
index 4c2bfae199b2f2e65a7558fbde89b2a2a0c6ce68..a53cada0558e1f1b900d7985d73a6702439293d2 100644 (file)
@@ -77,6 +77,16 @@ class HYDROData_Document
         aRes = new HYDROData_Bathymetry( *dynamic_cast<HYDROData_Bathymetry*>( theObject ) );
         break;
       }
+      case KIND_CALCULATION:
+      {
+        aRes = new HYDROData_Calculation( *dynamic_cast<HYDROData_Calculation*>( theObject ) );
+        break;
+      }
+      case KIND_ZONE:
+      {
+        aRes = new HYDROData_Zone( *dynamic_cast<HYDROData_Zone*>( theObject ) );
+        break;
+      }
     }
     
     return aRes;
index 852e58f561836ee0594eca019ae1246fd16a7dd1..5cec249f104ea2187d69f8a909e344a3f4a63ca9 100644 (file)
@@ -32,6 +32,8 @@ const ObjectKind KIND_IMAGE;
 const ObjectKind KIND_POLYLINE;
 const ObjectKind KIND_VISUAL_STATE;
 const ObjectKind KIND_BATHYMETRY;
+const ObjectKind KIND_CALCULATION;
+const ObjectKind KIND_ZONE;
 
 class HYDROData_Object
 {
@@ -55,6 +57,14 @@ class HYDROData_Object
         sipClass = sipClass_HYDROData_Bathymetry;
         break;
 
+      case KIND_CALCULATION:
+        sipClass = sipClass_HYDROData_Calculation;
+        break;
+
+      case KIND_ZONE:
+        sipClass = sipClass_HYDROData_Zone;
+        break;
+
       case KIND_UNKNOWN:
         sipClass = sipClass_HYDROData_Object;
         break;
diff --git a/src/HYDROPy/HYDROData_Zone.sip b/src/HYDROPy/HYDROData_Zone.sip
new file mode 100644 (file)
index 0000000..892ef0a
--- /dev/null
@@ -0,0 +1,195 @@
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+%ExportedHeaderCode
+#include <HYDROData_Zone.h>
+%End
+
+class HYDROData_Zone : HYDROData_Object
+{
+
+%TypeHeaderCode
+#include <HYDROData_Zone.h>
+%End
+
+%ConvertToSubClassCode
+    if ( !Handle(HYDROData_Zone)::DownCast( sipCpp ).IsNull() )
+      sipClass = sipClass_HYDROData_Zone;
+    else
+      sipClass = NULL;
+%End
+
+public:
+
+  const ObjectKind          GetKind() const;
+
+public:      
+
+  /**
+   * Sets filling color for zone.
+   */
+  void SetFillingColor( const QColor& theColor );
+
+  /**
+   * Returns filling color of zone.
+   */
+  QColor GetFillingColor() const;
+
+  /**
+   * Sets border color for zone.
+   */
+  void SetBorderColor( const QColor& theColor );
+
+  /**
+   * Returns border color of zone.
+   */
+  QColor GetBorderColor() const;
+
+  /**
+   * Sets reference polyline object for zone.
+   */
+  void SetPolyline( HYDROData_Polyline thePolyline ) [void (const Handle_HYDROData_Polyline&)];
+  %MethodCode
+
+    Handle(HYDROData_Polyline) aRefPolyline =
+      Handle(HYDROData_Polyline)::DownCast( createHandle( a0 ) );
+    if ( !aRefPolyline.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::SetPolyline( aRefPolyline ) : 
+                      sipCpp->SetPolyline( aRefPolyline );
+      Py_END_ALLOW_THREADS
+    }
+
+  %End
+
+  /**
+   * Returns reference polyline object of zone.
+   */
+  HYDROData_Polyline GetPolyline() const [Handle_HYDROData_Polyline ()];
+  %MethodCode
+
+    Handle(HYDROData_Polyline) aRefPolyline;
+    
+    Py_BEGIN_ALLOW_THREADS
+    aRefPolyline = sipSelfWasArg ? sipCpp->HYDROData_Zone::GetPolyline() : 
+                                   sipCpp->GetPolyline();
+    Py_END_ALLOW_THREADS
+    
+    sipRes = (HYDROData_Polyline*)createPointer( aRefPolyline );
+  
+  %End
+
+  /**
+   * Remove reference polyline object of zone.
+   */
+  void RemovePolyline();
+
+  /**
+   * Returns number of bathymetry objects for zone.
+   */
+  int NbBathymetries() const;
+
+  /**
+   * Add reference bathymetry object for zone.
+   */
+  void AddBathymetry( HYDROData_Bathymetry theBathymetry ) [void (const Handle_HYDROData_Bathymetry&)];
+  %MethodCode
+
+    Handle(HYDROData_Bathymetry) aRefBath =
+      Handle(HYDROData_Bathymetry)::DownCast( createHandle( a0 ) );
+    if ( !aRefBath.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::AddBathymetry( aRefBath ) : 
+                      sipCpp->AddBathymetry( aRefBath );
+      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.
+   */
+  void RemoveBathymetries();
+
+  /**
+   * Returns the painter path. The painter path is construct by polyline
+   */
+  QPainterPath GetPainterPath() 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();
+};
+
+
index 1b1f85599e35e7d96ce2edf23dad06eba44246b1..ba703b69a23016ea738c445a6598c2aaa125fb56 100644 (file)
                                RelativePath=".\HYDROData_Bathymetry.sip"
                                >
                        </File>
+                       <File
+                               RelativePath=".\HYDROData_Calculation.sip"
+                               >
+                       </File>
                        <File
                                RelativePath=".\HYDROData_Document.sip"
                                >
                                RelativePath=".\HYDROData_Polyline.sip"
                                >
                        </File>
+                       <File
+                               RelativePath=".\HYDROData_Zone.sip"
+                               >
+                       </File>
                </Filter>
                <Filter
                        Name="Header Files"