]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #570: Land Cover: the partition algorithm (further implementation)
authormzn <mzn@opencascade.com>
Fri, 19 Jun 2015 09:53:16 +0000 (12:53 +0300)
committermzn <mzn@opencascade.com>
Fri, 19 Jun 2015 09:53:16 +0000 (12:53 +0300)
16 files changed:
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROData/HYDROData_PriorityQueue.cxx
src/HYDROData/HYDROData_PriorityQueue.h
src/HYDROData/HYDROData_Region.cxx
src/HYDROData/HYDROData_Zone.cxx
src/HYDROData/HYDROData_Zone.h
src/HYDROGUI/HYDROGUI_CalculationDlg.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.h
src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx
src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx
src/HYDROGUI/HYDROGUI_Zone.cxx
src/HYDROGUI/HYDROGUI_Zone.h
src/HYDROPy/HYDROData_CalculationCase.sip
src/HYDROPy/HYDROData_Zone.sip

index e5fda65ca9a855783244b884b89c3d96685f060f..4fd970820e2ee2b245857897ebefa33d19837b9f 100644 (file)
@@ -367,9 +367,8 @@ void HYDROData_CalculationCase::CreateRegionsAuto( const Handle(HYDROData_Docume
   while( anIter.hasNext() )
   {
     const HYDROData_SplitToZonesTool::SplitData& aSplitData = anIter.next();
-    HYDROData_Zone::MergeAltitudesType aMergeType;
-    Handle(HYDROData_Object) aRegObj =
-      Handle(HYDROData_Object)::DownCast( aPr.GetMostPriorityObject( aSplitData.ObjectNames, aMergeType ) );
+    HYDROData_Zone::MergeType aMergeType;
+    Handle(HYDROData_Entity) aRegObj = aPr.GetMostPriorityObject( aSplitData.ObjectNames, aMergeType );
     if( aRegObj.IsNull() )
       continue;
     Handle(HYDROData_Region) aRegion = aRegionsMap[aRegObj->GetName()];
@@ -382,6 +381,14 @@ void HYDROData_CalculationCase::CreateRegionsAuto( const Handle(HYDROData_Docume
       qDebug( "Error in algorithm: unresolved conflicts" );
     }
 
+    Handle(HYDROData_Entity) aMergeEntity = aRegObj;
+    if ( !theLandCover ) {
+      Handle(HYDROData_Object) aMergeObject = Handle(HYDROData_Object)::DownCast( aMergeEntity );
+      if ( !aMergeObject.IsNull() ) {
+        aMergeEntity = aMergeObject->GetAltitudeObject();
+      }
+    }
+
     switch( aMergeType )
     {
     case HYDROData_Zone::Merge_ZMIN:
@@ -390,8 +397,8 @@ void HYDROData_CalculationCase::CreateRegionsAuto( const Handle(HYDROData_Docume
       break;
     case HYDROData_Zone::Merge_Object:
       aRegionZone->SetMergeType( aMergeType );
-      aRegionZone->RemoveMergeAltitude();
-      aRegionZone->SetMergeAltitude( aRegObj->GetAltitudeObject() );
+      aRegionZone->RemoveMergeObject();
+      aRegionZone->SetMergeObject( aMergeEntity );
       break;
     }
   }
@@ -771,7 +778,7 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY&
   if ( theZone.IsNull() )
     return aResAltitude;
 
-  HYDROData_Zone::MergeAltitudesType aZoneMergeType = theZone->GetMergeType();
+  HYDROData_Zone::MergeType aZoneMergeType = theZone->GetMergeType();
   if ( !theZone->IsMergingNeed() )
   {
     aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
@@ -784,7 +791,8 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY&
   HYDROData_IInterpolator* aZoneInterpolator = theZone->GetInterpolator();
   if ( aZoneMergeType == HYDROData_Zone::Merge_Object )
   {
-    Handle(HYDROData_IAltitudeObject) aMergeAltitude = theZone->GetMergeAltitude();
+    Handle(HYDROData_IAltitudeObject) aMergeAltitude = 
+      Handle(HYDROData_IAltitudeObject)::DownCast( theZone->GetMergeObject() );
     if ( !aMergeAltitude.IsNull() )
     {
       if ( aZoneInterpolator != NULL )
@@ -798,7 +806,7 @@ double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY&
   }
   else
   {
-    HYDROData_SequenceOfObjects aZoneObjects = theZone->GetGeometryObjects();
+    HYDROData_SequenceOfObjects aZoneObjects = theZone->GetObjects();
     HYDROData_SequenceOfObjects::Iterator anIter( aZoneObjects );
     for ( ; anIter.More(); anIter.Next() )
     {
@@ -1262,7 +1270,7 @@ void HYDROData_CalculationCase::ClearRules( HYDROData_CalculationCase::DataTag t
 void HYDROData_CalculationCase::AddRule( const Handle(HYDROData_Entity)&    theObject1,
                                          HYDROData_PriorityType             thePriority,
                                          const Handle(HYDROData_Entity)&    theObject2,
-                                         HYDROData_Zone::MergeAltitudesType theMergeType,
+                                         HYDROData_Zone::MergeType          theMergeType,
                                          HYDROData_CalculationCase::DataTag theDataTag )
 {
   TDF_Label aRulesLab = myLab.FindChild( theDataTag );
@@ -1366,7 +1374,7 @@ bool HYDROData_CalculationCase::GetRule( int theIndex,
                                          Handle(HYDROData_Entity)&           theObject1,
                                          HYDROData_PriorityType&             thePriority,
                                          Handle(HYDROData_Entity)&           theObject2,
-                                         HYDROData_Zone::MergeAltitudesType& theMergeType,
+                                         HYDROData_Zone::MergeType&          theMergeType,
                                          HYDROData_CalculationCase::DataTag& theDataTag) const
 {
   TDF_Label aRulesLab = myLab.FindChild( theDataTag );
index fa0edeb14bf17bdbca8c52e3b295aba599ecf849..79e78705d35f5279df02372bf8c7af608b30f6ca 100644 (file)
@@ -374,13 +374,13 @@ public:
   HYDRODATA_EXPORT void AddRule( const Handle(HYDROData_Entity)&     theObject1,
                                  HYDROData_PriorityType              thePriority,
                                  const Handle(HYDROData_Entity)&     theObject2,
-                                 HYDROData_Zone::MergeAltitudesType  theMergeType,
+                                 HYDROData_Zone::MergeType theMergeType,
                                  HYDROData_CalculationCase::DataTag  theDataTag );
   HYDRODATA_EXPORT bool GetRule( int theIndex, 
                                  Handle(HYDROData_Entity)&           theObject1,
                                  HYDROData_PriorityType&             thePriority,
                                  Handle(HYDROData_Entity)&           theObject2,
-                                 HYDROData_Zone::MergeAltitudesType& theMergeType,
+                                 HYDROData_Zone::MergeType& theMergeType,
                                  HYDROData_CalculationCase::DataTag& theDataTag ) const;
 
   HYDRODATA_EXPORT void SetAssignmentLandCoverMode( AssignmentMode theMode );
index 6dbb5daec91146ad68f85220ec7f615574270ed8..43d39df35b5be6ffc1628113f280aaf03fa0ebd4 100644 (file)
@@ -46,7 +46,7 @@ HYDROData_PriorityQueue::~HYDROData_PriorityQueue()
 }
 
 Handle(HYDROData_Entity) HYDROData_PriorityQueue::GetMostPriorityObject( const QStringList& theZoneObjects,
-                                                                         HYDROData_Zone::MergeAltitudesType& theMergeType ) const
+                                                                         HYDROData_Zone::MergeType& theMergeType ) const
 {
   QStringList aSortedZoneObjects;
   for( int i=myGeomObjects.Lower(), n=myGeomObjects.Upper(); i<=n; i++ )
@@ -61,7 +61,7 @@ Handle(HYDROData_Entity) HYDROData_PriorityQueue::GetMostPriorityObject( const Q
   QStringList::const_iterator anIt = aSortedZoneObjects.begin(), aLast = aSortedZoneObjects.end();
   for( ; anIt!=aLast; anIt++ )
   {
-    HYDROData_Zone::MergeAltitudesType aLocalMerge = HYDROData_Zone::Merge_UNKNOWN;
+    HYDROData_Zone::MergeType aLocalMerge = HYDROData_Zone::Merge_UNKNOWN;
     Handle(HYDROData_Entity) anObj = myNames[*anIt];
     if( !anObj.IsNull() )
     {
@@ -86,7 +86,7 @@ Handle(HYDROData_Entity) HYDROData_PriorityQueue::GetMostPriorityObject( const Q
 
 bool HYDROData_PriorityQueue::IsMorePriority( const Handle(HYDROData_Entity)& theObj1,
                                               const Handle(HYDROData_Entity)& theObj2,
-                                              HYDROData_Zone::MergeAltitudesType& theMergeType ) const
+                                              HYDROData_Zone::MergeType& theMergeType ) const
 {
   // 1. First we check custom rules
   HYDROData_ListOfRules::const_iterator anIt = myRules.begin(), aLast = myRules.end();
@@ -134,11 +134,11 @@ enum HYDROData_PriorityQueueTag
   Merge_Tag,
 };
 
-void HYDROData_PriorityQueue::AddRule( TDF_Label&                         theRulesLabel,
-                                       const Handle(HYDROData_Entity)&    theObject1,
-                                       HYDROData_PriorityType             thePriority,
-                                       const Handle(HYDROData_Entity)&    theObject2,
-                                       HYDROData_Zone::MergeAltitudesType theMergeType )
+void HYDROData_PriorityQueue::AddRule( TDF_Label&                      theRulesLabel,
+                                       const Handle(HYDROData_Entity)& theObject1,
+                                       HYDROData_PriorityType          thePriority,
+                                       const Handle(HYDROData_Entity)& theObject2,
+                                       HYDROData_Zone::MergeType       theMergeType )
 {
   // Get the last rule index
   Standard_Integer aRuleIndex = 0;
@@ -190,7 +190,7 @@ HYDROData_ListOfRules HYDROData_PriorityQueue::GetRules( const TDF_Label& theRul
       aRule.Object1 = HYDROData_Iterator::Object( aRefs1->First() );
       aRule.Priority = ( HYDROData_PriorityType ) aPriorityAttr->Get();
       aRule.Object2 = HYDROData_Iterator::Object( aRefs2->First() );
-      aRule.MergeType = ( HYDROData_Zone::MergeAltitudesType ) aMergeAttr->Get();
+      aRule.MergeType = ( HYDROData_Zone::MergeType ) aMergeAttr->Get();
       aRules.append( aRule );
     }
   }
@@ -273,10 +273,10 @@ void HYDROData_PriorityQueue::DumpRulesToPython( const TDF_Label& theRulesLab,
 
 bool HYDROData_PriorityQueue::GetRule( const TDF_Label& theRulesLab,
                                        int theIndex, 
-                                       Handle(HYDROData_Entity)&           theObject1,
-                                       HYDROData_PriorityType&             thePriority,
-                                       Handle(HYDROData_Entity)&           theObject2,
-                                       HYDROData_Zone::MergeAltitudesType& theMergeType )
+                                       Handle(HYDROData_Entity)&  theObject1,
+                                       HYDROData_PriorityType&    thePriority,
+                                       Handle(HYDROData_Entity)&  theObject2,
+                                       HYDROData_Zone::MergeType& theMergeType )
 {
   TDF_Label aRuleLabel = theRulesLab.FindChild( theIndex );
 
@@ -294,7 +294,7 @@ bool HYDROData_PriorityQueue::GetRule( const TDF_Label& theRulesLab,
     theObject1   = HYDROData_Iterator::Object( aRefs1->First() );
     thePriority  = ( HYDROData_PriorityType ) aPriorityAttr->Get();
     theObject2   = HYDROData_Iterator::Object( aRefs2->First() );
-    theMergeType = ( HYDROData_Zone::MergeAltitudesType ) aMergeAttr->Get();
+    theMergeType = ( HYDROData_Zone::MergeType ) aMergeAttr->Get();
   }
   return isOK;
 }
index 80d1b652a134b1550d6dcdabc46dc49f5207d883..b9f645828794209fe84c5369e0747eb4100f451f 100644 (file)
@@ -33,10 +33,10 @@ enum HYDROData_PriorityType
 
 struct HYDROData_CustomRule
 {
-  Handle(HYDROData_Entity)           Object1;
-  HYDROData_PriorityType             Priority;
-  Handle(HYDROData_Entity)           Object2;
-  HYDROData_Zone::MergeAltitudesType MergeType;
+  Handle(HYDROData_Entity)  Object1;
+  HYDROData_PriorityType    Priority;
+  Handle(HYDROData_Entity)  Object2;
+  HYDROData_Zone::MergeType MergeType;
 };
 
 typedef QList<HYDROData_CustomRule> HYDROData_ListOfRules;
@@ -49,18 +49,18 @@ public:
   ~HYDROData_PriorityQueue();
 
   Handle_HYDROData_Entity GetMostPriorityObject( const QStringList& theZoneObjects,
-                                                 HYDROData_Zone::MergeAltitudesType& theMergeType ) const;
+                                                 HYDROData_Zone::MergeType& theMergeType ) const;
 
   bool IsMorePriority( const Handle(HYDROData_Entity)& theObj1,
                        const Handle(HYDROData_Entity)& theObj2,
-                       HYDROData_Zone::MergeAltitudesType& theMergeType ) const;
+                       HYDROData_Zone::MergeType& theMergeType ) const;
 
   static void ClearRules( TDF_Label& theRulesLabel );
   static void AddRule( TDF_Label& theRulesLabel,
                        const Handle(HYDROData_Entity)&    theObject1,
                        HYDROData_PriorityType             thePriority,
                        const Handle(HYDROData_Entity)&    theObject2,
-                       HYDROData_Zone::MergeAltitudesType theMergeType );
+                       HYDROData_Zone::MergeType theMergeType );
   static HYDROData_ListOfRules GetRules( const TDF_Label& theRulesLabel );
   static QString DumpRules( const TDF_Label& theRulesLab );
   static void DumpRulesToPython( const TDF_Label& theRulesLab,
@@ -71,7 +71,7 @@ public:
                        Handle(HYDROData_Entity)&           theObject1,
                        HYDROData_PriorityType&             thePriority,
                        Handle(HYDROData_Entity)&           theObject2,
-                       HYDROData_Zone::MergeAltitudesType& theMergeType );
+                       HYDROData_Zone::MergeType& theMergeType );
 private:
   typedef QMap<QString, Handle(HYDROData_Entity)> MapNameToObject;
 
index 0cbb266d27f1f5388730078fb6768ac00ee58b67..194d80e6344902802068f0393603bf1820db5079 100644 (file)
@@ -179,7 +179,7 @@ Handle(HYDROData_Zone) HYDROData_Region::addNewZone( const Handle(HYDROData_Docu
     if ( aRefObject.IsNull() )
       continue;
 
-    aNewZone->AddGeometryObject( aRefObject );
+    aNewZone->AddObject( aRefObject );
   }
 
   return aNewZone;
@@ -412,7 +412,7 @@ QStringList HYDROData_Region::DumpToPython( MapOfTreatedObjects& theTreatedObjec
     
     // set zone merge type
     QString aMergeTypeStr;
-    HYDROData_Zone::MergeAltitudesType aMergeType = aZone->GetMergeType();
+    HYDROData_Zone::MergeType aMergeType = aZone->GetMergeType();
     if ( aMergeType == HYDROData_Zone::Merge_ZMIN ) {
       aMergeTypeStr = "HYDROData_Zone.Merge_ZMIN";
     } else if ( aMergeType == HYDROData_Zone::Merge_ZMAX ) {
@@ -425,11 +425,11 @@ QStringList HYDROData_Region::DumpToPython( MapOfTreatedObjects& theTreatedObjec
       aResList << QString( "%1.SetMergeType( %2 )" ).arg( aZone->GetObjPyName() ).arg( aMergeTypeStr );
     }
     if ( aMergeType == HYDROData_Zone::Merge_Object ) {
-      Handle(HYDROData_IAltitudeObject) aMergeAltitude = aZone->GetMergeAltitude();
-      if ( !aMergeAltitude.IsNull() ) {
-        aMergeAltitude->findPythonReferenceObject( theTreatedObjects, aResList );
-        aResList << QString( "%1.SetMergeAltitude( %2 )" ).arg( aZone->GetObjPyName() )
-                                                          .arg( aMergeAltitude->GetObjPyName() );
+      Handle(HYDROData_Entity) aMergeObject = aZone->GetMergeObject();
+      if ( !aMergeObject.IsNull() ) {
+        aMergeObject->findPythonReferenceObject( theTreatedObjects, aResList );
+        aResList << QString( "%1.SetMergeObject( %2 )" ).arg( aZone->GetObjPyName() )
+                                                        .arg( aMergeObject->GetObjPyName() );
       }
     }
 
index 53d40e5224d6bfc590d9ee791fc9d7f782ee7e38..c6e3da1af9650fb148aa9bdd0946e87c38a3cd7d 100644 (file)
@@ -22,6 +22,7 @@
 #include "HYDROData_IAltitudeObject.h"
 #include "HYDROData_Document.h"
 #include "HYDROData_NaturalObject.h"
+#include "HYDROData_LandCover.h"
 
 #include <TNaming_Builder.hxx>
 #include <TNaming_NamedShape.hxx>
@@ -65,8 +66,8 @@ HYDROData_SequenceOfObjects HYDROData_Zone::GetAllReferenceObjects() const
 {
   HYDROData_SequenceOfObjects aResSeq = HYDROData_Entity::GetAllReferenceObjects();
 
-  HYDROData_SequenceOfObjects aSeqOfGeomObjects = GetGeometryObjects();
-  aResSeq.Append( aSeqOfGeomObjects );
+  HYDROData_SequenceOfObjects aSeqOfObjects = GetObjects();
+  aResSeq.Append( aSeqOfObjects );
 
   return aResSeq;
 }
@@ -92,14 +93,15 @@ TopoDS_Shape HYDROData_Zone::GetShape() const
 
 bool HYDROData_Zone::IsMergingNeed() const
 {
+  // Zones based on geometry objects (compare altitudes)
   Handle(HYDROData_IAltitudeObject) aRefAltitude;
 
-  HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
-  HYDROData_SequenceOfObjects::Iterator aGeomObjsIter( aGeomObjects );
-  for ( ; aGeomObjsIter.More(); aGeomObjsIter.Next() )
+  HYDROData_SequenceOfObjects anObjects = GetObjects();
+  HYDROData_SequenceOfObjects::Iterator anObjsIter( anObjects );
+  for ( ; anObjsIter.More(); anObjsIter.Next() )
   {
     Handle(HYDROData_Object) aRefGeomObj =
-      Handle(HYDROData_Object)::DownCast( aGeomObjsIter.Value() );
+      Handle(HYDROData_Object)::DownCast( anObjsIter.Value() );
     if ( aRefGeomObj.IsNull() )
       continue;
 
@@ -117,6 +119,30 @@ bool HYDROData_Zone::IsMergingNeed() const
       return true;
   }
 
+  // Zones based on land cover objects (compare Strickler types)
+  QString aRefStricklerType;
+
+  anObjsIter.Init( anObjects );
+  for ( ; anObjsIter.More(); anObjsIter.Next() )
+  {
+    Handle(HYDROData_LandCover) aRefLandCoverObj =
+      Handle(HYDROData_LandCover)::DownCast( anObjsIter.Value() );
+    if ( aRefLandCoverObj.IsNull() )
+      continue;
+
+    QString aStricklerType = aRefLandCoverObj->GetStricklerType();
+    
+    if ( aRefStricklerType.isNull() )
+    {
+      aRefStricklerType = aStricklerType;
+      continue;
+    }
+
+    if ( aRefStricklerType != aStricklerType )
+      return true;
+  }
+
+
   return false;
 }
 
@@ -130,77 +156,81 @@ HYDROData_IInterpolator* HYDROData_Zone::GetInterpolator() const
   return myInterpolator;
 }
 
-void HYDROData_Zone::SetMergeType( const MergeAltitudesType& theType )
+void HYDROData_Zone::SetMergeType( const MergeType& theType )
 {
   TDataStd_Integer::Set( myLab.FindChild( DataTag_MergeType ), (int)theType );
 }
 
-HYDROData_Zone::MergeAltitudesType HYDROData_Zone::GetMergeType() const
+HYDROData_Zone::MergeType HYDROData_Zone::GetMergeType() const
 {
-  MergeAltitudesType aMergeType = Merge_UNKNOWN;
+  MergeType aMergeType = Merge_UNKNOWN;
   
   TDF_Label aLabel = myLab.FindChild( DataTag_MergeType, false );
   if ( !aLabel.IsNull() )
   {
     Handle(TDataStd_Integer) anInt;
     if ( aLabel.FindAttribute( TDataStd_Integer::GetID(), anInt ) )
-      aMergeType = (MergeAltitudesType)anInt->Get();
+      aMergeType = (MergeType)anInt->Get();
   }
 
   return aMergeType;
 }
 
-void HYDROData_Zone::SetMergeAltitude( const Handle(HYDROData_IAltitudeObject)& theAltitude )
+void HYDROData_Zone::SetMergeObject( const Handle(HYDROData_Entity)& theObject )
 {
-  SetReferenceObject( theAltitude, DataTag_MergeAltitude );
+  SetReferenceObject( theObject, DataTag_MergeObject );
 }
 
-Handle(HYDROData_IAltitudeObject) HYDROData_Zone::GetMergeAltitude() const
+Handle(HYDROData_Entity) HYDROData_Zone::GetMergeObject() const
 {
-  return Handle(HYDROData_IAltitudeObject)::DownCast( 
-           GetReferenceObject( DataTag_MergeAltitude ) );
+  return Handle(HYDROData_Entity)::DownCast( 
+           GetReferenceObject( DataTag_MergeObject ) );
 }
 
-void HYDROData_Zone::RemoveMergeAltitude()
+void HYDROData_Zone::RemoveMergeObject()
 {
-  ClearReferenceObjects( DataTag_MergeAltitude );
+  ClearReferenceObjects( DataTag_MergeObject );
 }
 
-bool HYDROData_Zone::AddGeometryObject( const Handle(HYDROData_Object)& theObject )
+bool HYDROData_Zone::AddObject( const Handle(HYDROData_Entity)& theObject )
 {
   if ( theObject.IsNull() )
     return false;
   
   if ( !theObject->IsKind( STANDARD_TYPE(HYDROData_ArtificialObject) ) &&
-       !theObject->IsKind( STANDARD_TYPE(HYDROData_NaturalObject) ) )
+       !theObject->IsKind( STANDARD_TYPE(HYDROData_NaturalObject) ) && 
+       !theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) )
     return false; // Wrong type of object
 
-  if ( HasReference( theObject, DataTag_GeometryObject ) )
+  if ( HasReference( theObject, DataTag_Object ) )
     return false; // Object is already in reference list
 
-  AddReferenceObject( theObject, DataTag_GeometryObject );
+  AddReferenceObject( theObject, DataTag_Object );
 
   return true;
 }
 
-HYDROData_SequenceOfObjects HYDROData_Zone::GetGeometryObjects() const
+HYDROData_SequenceOfObjects HYDROData_Zone::GetObjects() const
 {
-  return GetReferenceObjects( DataTag_GeometryObject );
+  return GetReferenceObjects( DataTag_Object );
 }
 
-void HYDROData_Zone::RemoveGeometryObjects()
+void HYDROData_Zone::RemoveObjects()
 {
-  ClearReferenceObjects( DataTag_GeometryObject );
+  ClearReferenceObjects( DataTag_Object );
 }
 
 bool HYDROData_Zone::IsSubmersible() const
 {
-  HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
-  HYDROData_SequenceOfObjects::Iterator aGeomObjsIter( aGeomObjects );
-  for ( ; aGeomObjsIter.More(); aGeomObjsIter.Next() )
+  HYDROData_SequenceOfObjects anObjects = GetObjects();
+  HYDROData_SequenceOfObjects::Iterator anObjsIter( anObjects );
+  for ( ; anObjsIter.More(); anObjsIter.Next() )
   {
     Handle(HYDROData_Object) aRefGeomObj =
-      Handle(HYDROData_Object)::DownCast( aGeomObjsIter.Value() );
+      Handle(HYDROData_Object)::DownCast( anObjsIter.Value() );
+    if ( aRefGeomObj.IsNull() )
+      continue;
+
     if( !aRefGeomObj->IsSubmersible() )
       return false; //if one of geometry objects is not submersible the zone is considered as not submersible
   }
index b8a8c0d2c648fd86ac2c6b6d8ec5295ad5f648c1..3f95324ceb28e197b565e1f30b54817081b98232 100644 (file)
@@ -22,8 +22,7 @@
 #include "HYDROData_Entity.h"
 #include "HYDROData_IInterpolator.h"
 
-class Handle(HYDROData_Object);
-class Handle(HYDROData_IAltitudeObject);
+class Handle(HYDROData_LandCover);
 class TopoDS_Shape;
 
 DEFINE_STANDARD_HANDLE(HYDROData_Zone, HYDROData_Entity)
@@ -37,13 +36,13 @@ class HYDROData_Zone : public HYDROData_Entity
 
 public:
 
-  // Enumeration of mergin types for conflict altitudes
-  enum MergeAltitudesType
+  // Enumeration of mergin types for conflict altitudes/types
+  enum MergeType
   {
     Merge_UNKNOWN, // Undefined
     Merge_ZMIN,    // The minimum values
     Merge_ZMAX,    // The maximum values
-    Merge_Object   // Only one altitude will be taken into account
+    Merge_Object   // Only one altitude/land cover will be taken into account
   };
 
 protected:
@@ -54,9 +53,9 @@ protected:
   {
     DataTag_First = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve
     DataTag_Shape,           ///< reference shape
-    DataTag_GeometryObject,  ///< reference geometry objects
-    DataTag_MergeType,       ///< mergin type of conflict bathymetries
-    DataTag_MergeAltitude,   ///< reference altitude for conflict merge
+    DataTag_Object,          ///< reference objects
+    DataTag_MergeType,       ///< mergin type of conflict bathymetries/types
+    DataTag_MergeObject,     ///< reference altitude/land cover for conflict merge
   };
 
 public:
@@ -120,51 +119,49 @@ public:
    * * Returns the interpolator of zone object.
    */
   HYDRODATA_EXPORT virtual HYDROData_IInterpolator* GetInterpolator() const;
-
-
+  
   /**
    * Sets the merging type for conflict altitudes.
    * By default it is set to Merge_UNKNOWN.
    */
-  HYDRODATA_EXPORT virtual void SetMergeType( const MergeAltitudesType& theType );
+  HYDRODATA_EXPORT virtual void SetMergeType( const MergeType& theType );
 
   /**
-   * Returns the merging type for conflict altitudes.
+   * Returns the merging type for conflict altitudes/types.
    */
-  HYDRODATA_EXPORT virtual MergeAltitudesType GetMergeType() const;
+  HYDRODATA_EXPORT virtual MergeType GetMergeType() const;
 
 
   /**
-   * Sets the reference altitude to resolve the conflict.
+   * Sets the reference object to resolve the conflict.
    * This object is used only in case of "Merge_Object" merge type.
    */
-  HYDRODATA_EXPORT virtual void SetMergeAltitude( const Handle(HYDROData_IAltitudeObject)& theAltitude );
+  HYDRODATA_EXPORT virtual void SetMergeObject( const Handle(HYDROData_Entity)& theObject );
 
   /**
-   * Returns the reference altitude to resolve the conflict.
+   * Returns the reference object to resolve the conflict.
    */
-  HYDRODATA_EXPORT virtual Handle(HYDROData_IAltitudeObject) GetMergeAltitude() const;
+  HYDRODATA_EXPORT virtual Handle(HYDROData_Entity) GetMergeObject() const;
 
   /**
-   * Removes the reference altitude for resolving the conflict.
+   * Removes the reference object for resolving the conflict.
    */
-  HYDRODATA_EXPORT virtual void RemoveMergeAltitude();
+  HYDRODATA_EXPORT virtual void RemoveMergeObject();
   
-
   /**
-   * Add new one geometry object for zone.
+   * Add new one object for zone.
    */
-  HYDRODATA_EXPORT virtual bool AddGeometryObject( const Handle(HYDROData_Object)& theObject );
+  HYDRODATA_EXPORT virtual bool AddObject( const Handle(HYDROData_Entity)& theObject );
 
   /**
-   * Returns all geometry objects of zone.
+   * Returns all objects of zone.
    */
-  HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetGeometryObjects() const;
+  HYDRODATA_EXPORT virtual HYDROData_SequenceOfObjects GetObjects() const;
 
   /**
-   * Removes all geometry objects from zone.
+   * Removes all objects from zone.
    */
-  HYDRODATA_EXPORT virtual void RemoveGeometryObjects();
+  HYDRODATA_EXPORT virtual void RemoveObjects();
 
   HYDRODATA_EXPORT bool IsSubmersible() const;
 
index 83249f3cf77a9639482038896a2a3faa40775d9b..1b5fb33bdc60792a2a15d12985a42f6b5adb3689 100644 (file)
@@ -626,7 +626,7 @@ void HYDROGUI_CalculationDlg::onSelected( SUIT_DataObject* theObject )
     myBathymetryChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
     myBathymetryChoice->addItem( tr("MERGE_ZMIN"), HYDROData_Zone::Merge_ZMIN );
     myBathymetryChoice->addItem( tr("MERGE_ZMAX"), HYDROData_Zone::Merge_ZMAX );
-    QStringList aList = aZone->getAltitudes();
+    QStringList aList = aZone->getObjects();
     for ( int i = 0; i < aList.length(); i++ )
     {
       myBathymetryChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
index 94ea5dbb51fa6a60374ebd9e12ad1f7266ce251f..a63a43542a29895c315cec94d3be7bbb6ceae889 100644 (file)
@@ -518,7 +518,7 @@ void HYDROGUI_CalculationOp::onCreateLandCoverRegion( const QList<SUIT_DataObjec
   }
 }
 
-void HYDROGUI_CalculationOp::onSetMergeType( int theMergeType, QString& theAltitudeName )
+void HYDROGUI_CalculationOp::onSetMergeType( int theMergeType, QString& theMergeObjectName )
 {
   HYDROGUI_CalculationDlg* aPanel = 
     ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
@@ -527,7 +527,7 @@ void HYDROGUI_CalculationOp::onSetMergeType( int theMergeType, QString& theAltit
     HYDROGUI_Zone* aZone = aPanel->getCurrentZone();
     if ( aZone )
     {
-      aZone->setMergeType( theMergeType, theAltitudeName );
+      aZone->setMergeType( theMergeType, theMergeObjectName );
       HYDROGUI_Shape* aShape = module()->getObjectShape( HYDROGUI_Module::VMR_PreviewCaseZones, aZone->modelObject() );
       if ( aShape )
       {
@@ -1207,7 +1207,7 @@ void HYDROGUI_CalculationOp::setRules( HYDROData_CalculationCase::DataTag theDat
   HYDROData_ListOfRules aRules;
   Handle(HYDROData_Entity) anObject1, anObject2;
   HYDROData_PriorityType aPriority;
-  HYDROData_Zone::MergeAltitudesType aMergeType;
+  HYDROData_Zone::MergeType aMergeType;
   HYDROData_CalculationCase::DataTag aDataTag = HYDROData_CalculationCase::DataTag_CustomRules;
   for ( int anIndex = 0; ; anIndex++ )
   {
index 2e0c0fae3d305dde5889119164972357ae118d0c..6629e1c15d5617457a64714b40b6017f8a1dcaaa 100644 (file)
@@ -96,9 +96,9 @@ protected slots:
   void                            onRemoveLandCovers();
 
   /**
-   * Set the given bathymetry merge type to the current zone.
+   * Set the given bathymetry/type merge type to the current zone.
    */
-  void                            onSetMergeType( int theMergeType, QString& theBathymetryName );
+  void                            onSetMergeType( int theMergeType, QString& theMergeObjectName );
   /**
    * Selected zones are moved to the existing region.
    */
index 6e2e46cd14efa289ff6f55974fd52cf78f5d89bd..c284d7927e94e306a413d6a9b216a4003569e272 100644 (file)
@@ -151,7 +151,7 @@ bool HYDROGUI_PriorityTableModel::setData( const QModelIndex & theIndex, const Q
     } else if ( aColumn == 1 ) {
       myRules[aRow].Priority = (HYDROData_PriorityType)theValue.toInt();
     } else if ( aColumn == 3 ) {
-      myRules[aRow].MergeType = (HYDROData_Zone::MergeAltitudesType)theValue.toInt();;
+      myRules[aRow].MergeType = (HYDROData_Zone::MergeType)theValue.toInt();;
     }
   }
 
index 5d152ea5de908ae1e658e085875f617948a40033..6554e5ef5213314bec99f3dd133d7ccda950f54c 100644 (file)
@@ -186,9 +186,9 @@ void HYDROGUI_VTKPrsShape::buildShape()
       else
       {
         // Generate the filling color for zone
-        QStringList aGeomObjectsNames;
+        QStringList anObjectsNames;
 
-        HYDROData_SequenceOfObjects aRefObjects = aZone->GetGeometryObjects();
+        HYDROData_SequenceOfObjects aRefObjects = aZone->GetObjects();
         HYDROData_SequenceOfObjects::Iterator anIter( aRefObjects );
         for ( ; anIter.More(); anIter.Next() )
         {
@@ -201,7 +201,7 @@ void HYDROGUI_VTKPrsShape::buildShape()
           if ( aRefObjectName.isEmpty() )
             continue;
 
-          aGeomObjectsNames.append( aRefObjectName );
+          anObjectsNames.append( aRefObjectName );
         }
 
         //setFillingColor( HYDROGUI_Tool::GenerateFillingColor( aDocument, aGeomObjectsNames ) );
index 9b6b304b0fd944eaa04f64a956eea07a0845608e..8561008c5ae563fda77aa41710130b650839e1c2 100644 (file)
@@ -21,6 +21,7 @@
 #include <HYDROData_Zone.h>
 #include <HYDROData_Object.h>
 #include <HYDROData_IAltitudeObject.h>
+#include <HYDROData_LandCover.h>
 
 #include <SUIT_DataObject.h>
 #include <QSet>
@@ -45,8 +46,8 @@ QString HYDROGUI_Zone::text( const int theColumnId ) const
         aRes = getRefObjectNames();
         break;
       case AltitudeObjId:
-        // Get altitude object name
-        aRes = getAltitudeName();
+        // Get altitude/land cover object name
+        aRes = getObjectName();
         break;
       default:
         aRes = LightApp_DataObject::text( theColumnId );
@@ -61,7 +62,7 @@ QString HYDROGUI_Zone::getRefObjectNames() const
   Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
   if ( !aZone.IsNull() )
   {
-    HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
+    HYDROData_SequenceOfObjects aSeq = aZone->GetObjects();
     HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
     for ( ; anIter.More(); anIter.Next() )
     {
@@ -81,13 +82,13 @@ QString HYDROGUI_Zone::getRefObjectNames() const
   return aRes;
 }
 
-QString HYDROGUI_Zone::getAltitudeName() const
+QString HYDROGUI_Zone::getObjectName() const
 {
   QString aRes;
   Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
   if ( !aZone.IsNull() )
   {
-    HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
+    HYDROData_SequenceOfObjects aSeq = aZone->GetObjects();
     bool isMergingNeed = aZone->IsMergingNeed();
     if ( ( isMergingNeed && aZone->GetMergeType() == HYDROData_Zone::Merge_UNKNOWN ) 
       || ( aSeq.Length() == 1 ) || ( !isMergingNeed ) )
@@ -140,11 +141,11 @@ QString HYDROGUI_Zone::getAltitudeName() const
         case HYDROData_Zone::Merge_ZMAX:    // The maximum values
           aRes = QObject::tr( "MERGE_ZMAX" );
           break;
-        case HYDROData_Zone::Merge_Object:   // Only one altitude will be taken into account
+        case HYDROData_Zone::Merge_Object:   // Only one altitude/land cover will be taken into account
         {
-          Handle(HYDROData_IAltitudeObject) anAltitude = aZone->GetMergeAltitude();
-          if ( !anAltitude.IsNull() )
-            aRes = anAltitude->GetName();
+          Handle(HYDROData_Entity) aMergeObj = aZone->GetMergeObject();
+          if ( !aMergeObj.IsNull() )
+            aRes = aMergeObj->GetName();
           break;
         }
         default:
@@ -202,15 +203,15 @@ QColor HYDROGUI_Zone::color( const ColorRole theColorRole, const int theColumnId
   return aRes;
 }
 
-QStringList HYDROGUI_Zone::getAltitudes() const
+QStringList HYDROGUI_Zone::getObjects() const
 {
   QStringList aRes;
   Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
   if ( !aZone.IsNull() )
   {
-    HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
-    // Collect all used altitudes names when merging is necessary
-    // or just get the name of altitude of a single geometry object
+    HYDROData_SequenceOfObjects aSeq = aZone->GetObjects();
+    // Collect all used altitudes/land cover names when merging is necessary
+    // or just get the name of altitude/land cover of a single object
     HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
     for ( ; anIter.More(); anIter.Next() )
     {
@@ -221,15 +222,17 @@ QStringList HYDROGUI_Zone::getAltitudes() const
         Handle(HYDROData_IAltitudeObject) anAltitudeObj = aRefGeomObj->GetAltitudeObject();
         if ( !anAltitudeObj.IsNull() && !aRes.contains( anAltitudeObj->GetName() ) )
           aRes.append( anAltitudeObj->GetName() );
+      } else {
+        aRes.append( anIter.Value()->GetName() );
       }
     }
   }
   return aRes;
 }
 
-HYDROData_Zone::MergeAltitudesType HYDROGUI_Zone::getMergeType() const
+HYDROData_Zone::MergeType HYDROGUI_Zone::getMergeType() const
 {
-  HYDROData_Zone::MergeAltitudesType aRes = HYDROData_Zone::Merge_UNKNOWN;
+  HYDROData_Zone::MergeType aRes = HYDROData_Zone::Merge_UNKNOWN;
   Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
   if ( !aZone.IsNull() )
   {
@@ -238,32 +241,37 @@ HYDROData_Zone::MergeAltitudesType HYDROGUI_Zone::getMergeType() const
   return aRes;
 }
 
-void HYDROGUI_Zone::setMergeType( int theMergeType, QString theAltitudeName )
+void HYDROGUI_Zone::setMergeType( int theMergeType, QString theMergeObjectName )
 {
   Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( modelObject() );
   if ( !aZone.IsNull() )
   {
-    HYDROData_Zone::MergeAltitudesType aMergeType = 
-      ( HYDROData_Zone::MergeAltitudesType )theMergeType;
+    HYDROData_Zone::MergeType aMergeType = 
+      ( HYDROData_Zone::MergeType )theMergeType;
     aZone->SetMergeType( aMergeType );
     if ( aMergeType == HYDROData_Zone::Merge_Object )
     {
-      // Find an altitude object by the given name and set it as the zone's merge altitude
-      HYDROData_SequenceOfObjects aSeq = aZone->GetGeometryObjects();
+      // Find an altitude/land cover object by the given name and set it as the zone's merge altitude/land cover
+      HYDROData_SequenceOfObjects aSeq = aZone->GetObjects();
       HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
       for ( ; anIter.More(); anIter.Next() )
       {
+        Handle(HYDROData_Entity) aMergeObject;
+
         Handle(HYDROData_Object) aRefGeomObj =
           Handle(HYDROData_Object)::DownCast( anIter.Value() );
         if ( !aRefGeomObj.IsNull() )
         {
-          // Get altitude object name
-          Handle(HYDROData_IAltitudeObject) anAltitudeObj = aRefGeomObj->GetAltitudeObject();
-          if ( !anAltitudeObj.IsNull() && theAltitudeName == anAltitudeObj->GetName() )
-          {
-            aZone->SetMergeAltitude( anAltitudeObj );
-            break;
-          }
+          // Get altitude object
+          aMergeObject = aRefGeomObj->GetAltitudeObject();
+        } else {
+          aMergeObject = Handle(HYDROData_LandCover)::DownCast( anIter.Value() );
+        }
+
+        if ( !aMergeObject.IsNull() && theMergeObjectName == aMergeObject->GetName() )
+        {
+          aZone->SetMergeObject( aMergeObject );
+          break;
         }
       }
     }
index aaf7a2ded1b9e165a1085e08198978fe77bba1d4..a4293f4c8152ea94ebecf71cdd998d1b41420d77 100644 (file)
@@ -72,23 +72,23 @@ public:
   bool        isMergingNeed() const;
 
   /**
-   * Returns the list of altidude object names.
+   * Returns the list of source object names.
    */
-  QStringList getAltitudes() const;
+  QStringList getObjects() const;
 
   /**
    * Returns the merging type for conflict altidudes.
    */
-  HYDROData_Zone::MergeAltitudesType getMergeType() const;
+  HYDROData_Zone::MergeType getMergeType() const;
 
   /**
-   * Set the merging type for conflict altidudes. 
-   * If the type is Merge_Object then use the second parameter to set the merge bathymetry.
+   * Set the merging type for conflict altidudes/types
+   * If the type is Merge_Object then use the second parameter to set the merge bathymetry/land cover.
    */
-  void        setMergeType( int theMergeType, QString theAltitudeName = QString() );
+  void        setMergeType( int theMergeType, QString theMergeObjectName = QString() );
 
 private:
   QString getRefObjectNames() const;
-  QString getAltitudeName() const;
+  QString getObjectName() const;
 };
 #endif
index afa46a342641d87a95bc5826968a72202d54be49..df0279af4021698366809d39d33d57365f2ebad2 100644 (file)
@@ -512,9 +512,9 @@ public:
   void AddRule( HYDROData_Entity                   theObject1,
                 HYDROData_PriorityType             thePriority,
                 HYDROData_Entity                   theObject2,
-                HYDROData_Zone::MergeAltitudesType theMergeType,
+                HYDROData_Zone::MergeType          theMergeType,
                                HYDROData_CalculationCase::DataTag theDataTag )
-  [void ( const Handle_HYDROData_Entity&, HYDROData_PriorityType, const Handle_HYDROData_Entity&, HYDROData_Zone::MergeAltitudesType, HYDROData_CalculationCase::DataTag )];
+  [void ( const Handle_HYDROData_Entity&, HYDROData_PriorityType, const Handle_HYDROData_Entity&, HYDROData_Zone::MergeType, HYDROData_CalculationCase::DataTag )];
   %MethodCode
     Handle(HYDROData_Entity) anObject1 =
       Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
index 6a1aba28ab0d6c335952f1ad40e48a0f089eae92..31e1dd2c711ba9d9431615a83a4f34edcbbf6437 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
@@ -56,12 +56,12 @@ 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 );
 
   /**
    * Returns the merging type for conflict altitudes.
    */
-  MergeAltitudesType GetMergeType() const;
+  MergeType GetMergeType() const;
 
 
   /**
@@ -76,8 +76,8 @@ public:
     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
     }
 
@@ -92,8 +92,9 @@ public:
     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 );
@@ -104,35 +105,83 @@ public:
    * Removes the reference altitude for resolving the conflict.
    */
   void RemoveMergeAltitude();
+  %MethodCode
+
+    Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::RemoveMergeObject() : 
+                      sipCpp->RemoveMergeObject();
+    Py_END_ALLOW_THREADS
+
+  %End
+
+  /**
+   * Sets the reference object to resolve the conflict.
+   * This object is used only in case of "Merge_Object" merge type.
+   */
+  void SetMergeObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)];
+  %MethodCode
+
+    Handle(HYDROData_Entity) aRefObject =
+      Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
+    if ( !aRefObject.IsNull() )
+    {
+      Py_BEGIN_ALLOW_THREADS
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::SetMergeObject( aRefObject ) : 
+                      sipCpp->SetMergeObject( aRefObject );
+      Py_END_ALLOW_THREADS
+    }
 
+  %End
+
+  /**
+   * Returns the reference object to resolve the conflict.
+   */
+  HYDROData_Entity GetMergeObject() const [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
+
+  /**
+   * Removes the reference object for resolving the conflict.
+   */
+  void RemoveMergeObject();
 
   /**
-   * dd new one geometry object for zone.
+   * Add new one object for zone.
    */
-  void AddGeometryObject( HYDROData_Object theRegion ) [void (const Handle_HYDROData_Object&)];
+  void AddObject( HYDROData_Entity theObject ) [void (const Handle_HYDROData_Entity&)];
   %MethodCode
 
-    Handle(HYDROData_Object) aGeomObj =
-      Handle(HYDROData_Object)::DownCast( createHandle( a0 ) );
-    if ( !aGeomObj.IsNull() )
+    Handle(HYDROData_Entity) anObj =
+      Handle(HYDROData_Entity)::DownCast( createHandle( a0 ) );
+    if ( !anObj.IsNull() )
     {
       Py_BEGIN_ALLOW_THREADS
-      sipSelfWasArg ? sipCpp->HYDROData_Zone::AddGeometryObject( aGeomObj ) : 
-                      sipCpp->AddGeometryObject( aGeomObj );
+      sipSelfWasArg ? sipCpp->HYDROData_Zone::AddObject( anObj ) : 
+                      sipCpp->AddObject( anObj );
       Py_END_ALLOW_THREADS
     }
 
   %End
 
   /**
-   * Returns all geometry objects of zone.
+   * Returns all objects of zone.
    */
-  HYDROData_SequenceOfObjects GetGeometryObjects() const;
+  HYDROData_SequenceOfObjects GetObjects() const;
 
   /**
-   * Removes all geometry objects from zone.
+   * Removes all objects from zone.
    */
-  void RemoveGeometryObjects();
+  void RemoveObjects();
 
 
   /**