#include "HYDROGUI_Tool.h"
#include <HYDROData_Bathymetry.h>
-#include <HYDROData_Calculation.h>
+#include <HYDROData_CalculationCase.h>
#include <HYDROData_Document.h>
#include <HYDROData_Image.h>
+#include <HYDROData_ImmersibleZone.h>
#include <HYDROData_Iterator.h>
#include <HYDROData_Polyline.h>
#include <HYDROData_VisualState.h>
createObject( aBathymetryRootObj, aBathymetryObj );
}
- LightApp_DataObject* aCalculRootObj = createObject( aRootObj, partitionName( KIND_CALCULATION ) );
-
- anIterator = HYDROData_Iterator( aDocument, KIND_CALCULATION );
- for( ; anIterator.More(); anIterator.Next() )
- {
- Handle(HYDROData_Calculation) aCalculObj =
- Handle(HYDROData_Calculation)::DownCast( anIterator.Current() );
- if( !aCalculObj.IsNull() )
- createObject( aCalculRootObj, aCalculObj );
- }
-
LightApp_DataObject* aPolylineRootObj = createObject( aRootObj, partitionName( KIND_POLYLINE ) );
anIterator = HYDROData_Iterator( aDocument, KIND_POLYLINE );
createObject( aPolylineRootObj, aPolylineObj );
}
- LightApp_DataObject* aZonesRootObj = createObject( aRootObj, partitionName( KIND_ZONE ) );
+ LightApp_DataObject* aZonesRootObj = createObject( aRootObj, partitionName( KIND_IMMERSIBLE_ZONE ) );
- anIterator = HYDROData_Iterator( aDocument, KIND_ZONE );
+ anIterator = HYDROData_Iterator( aDocument, KIND_IMMERSIBLE_ZONE );
for( ; anIterator.More(); anIterator.Next() )
{
- Handle(HYDROData_Zone) aZoneObj =
- Handle(HYDROData_Zone)::DownCast( anIterator.Current() );
+ Handle(HYDROData_ImmersibleZone) aZoneObj =
+ Handle(HYDROData_ImmersibleZone)::DownCast( anIterator.Current() );
if( !aZoneObj.IsNull() )
createObject( aZonesRootObj, aZoneObj );
}
+ LightApp_DataObject* aCalculRootObj = createObject( aRootObj, partitionName( KIND_CALCULATION ) );
+
+ anIterator = HYDROData_Iterator( aDocument, KIND_CALCULATION );
+ for( ; anIterator.More(); anIterator.Next() )
+ {
+ Handle(HYDROData_CalculationCase) aCalculObj =
+ Handle(HYDROData_CalculationCase)::DownCast( anIterator.Current() );
+ if( !aCalculObj.IsNull() )
+ createObject( aCalculRootObj, aCalculObj );
+ }
+
LightApp_DataObject* aVisualStateRootObj = createObject( aRootObj, partitionName( KIND_VISUAL_STATE ) );
anIterator = HYDROData_Iterator( aDocument, KIND_VISUAL_STATE );
}
}
-HYDROGUI_DataObject* HYDROGUI_DataModel::getDataObject( const Handle(HYDROData_Object)& theModelObject )
+HYDROGUI_DataObject* HYDROGUI_DataModel::getDataObject( const Handle(HYDROData_Entity)& theModelObject )
{
return NULL; // to do if necessary
}
update( aModule->getStudyId() );
}
-Handle(HYDROData_Object) HYDROGUI_DataModel::objectByEntry( const QString& theEntry,
+Handle(HYDROData_Entity) HYDROGUI_DataModel::objectByEntry( const QString& theEntry,
const ObjectKind theObjectKind )
{
QString anEntry = theEntry;
HYDROData_Iterator anIterator( aDocument, theObjectKind );
for( ; anIterator.More(); anIterator.Next() )
{
- Handle(HYDROData_Object) anObject = anIterator.Current();
+ Handle(HYDROData_Entity) anObject = anIterator.Current();
if( !anObject.IsNull() )
{
QString anEntryRef = HYDROGUI_DataObject::dataObjectEntry( anObject );
if( aSeq.Length() != 1 )
return false;
- Handle(HYDROData_Object) anObject = aSeq.First();
+ Handle(HYDROData_Entity) anObject = aSeq.First();
if( anObject.IsNull() )
return false;
{
for( int anIndex = 1, aLength = myCopyingObjects.Length(); anIndex <= aLength; anIndex++ )
{
- Handle(HYDROData_Object) anObject = myCopyingObjects.Value( anIndex );
+ Handle(HYDROData_Entity) anObject = myCopyingObjects.Value( anIndex );
if( !anObject.IsNull() && !anObject->IsRemoved() )
return true;
}
bool anIsChanged = false;
for( int anIndex = 1, aLength = myCopyingObjects.Length(); anIndex <= aLength; anIndex++ )
{
- Handle(HYDROData_Object) anObject = myCopyingObjects.Value( anIndex );
+ Handle(HYDROData_Entity) anObject = myCopyingObjects.Value( anIndex );
if( !anObject.IsNull() && !anObject->IsRemoved() )
{
ObjectKind aKind = anObject->GetKind();
- Handle(HYDROData_Object) aClone = getDocument()->CreateObject( aKind );
+ Handle(HYDROData_Entity) aClone = getDocument()->CreateObject( aKind );
if( !aClone.IsNull() )
{
anObject->CopyTo( aClone );
{
switch( theObjectKind )
{
- case KIND_IMAGE: return "IMAGES";
- case KIND_POLYLINE: return "POLYLINES";
- case KIND_VISUAL_STATE: return "VISUAL_STATES";
- case KIND_BATHYMETRY: return "BATHYMETRIES";
- case KIND_CALCULATION: return "CALCULATION_CASES";
- case KIND_ZONE: return "ZONES";
+ case KIND_IMAGE: return "IMAGES";
+ case KIND_POLYLINE: return "POLYLINES";
+ case KIND_VISUAL_STATE: return "VISUAL_STATES";
+ case KIND_BATHYMETRY: return "BATHYMETRIES";
+ case KIND_CALCULATION: return "CALCULATION_CASES";
+ case KIND_IMMERSIBLE_ZONE: return "IMMERSIBLE_ZONES";
default: break;
}
return QString();
}
LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent,
- Handle(HYDROData_Object) theModelObject,
+ Handle(HYDROData_Entity) theModelObject,
const QString& theParentEntry,
const bool theIsBuildTree )
{
if ( !aGuiObj )
return;
- Handle(HYDROData_Object) aDataObj = aGuiObj->modelObject();
+ Handle(HYDROData_Entity) aDataObj = aGuiObj->modelObject();
if ( aDataObj.IsNull() )
return;
Handle(HYDROData_Image)::DownCast( aDataObj );
for ( int anIndex = 0, aNbRef = anImageObj->NbReferences(); anIndex < aNbRef; anIndex++ )
{
- Handle(HYDROData_Object) aRefObj = anImageObj->Reference( anIndex );
+ Handle(HYDROData_Entity) aRefObj = anImageObj->Reference( anIndex );
if ( !aRefObj.IsNull() && !aRefObj->IsRemoved() )
createObject( aGuiObj, aRefObj, aGuiObj->entry(), false );
}
}
- else if ( anObjectKind == KIND_ZONE )
+ else if ( anObjectKind == KIND_IMMERSIBLE_ZONE )
{
- Handle(HYDROData_Zone) aZoneObj =
- Handle(HYDROData_Zone)::DownCast( aDataObj );
+ Handle(HYDROData_ImmersibleZone) aZoneObj =
+ Handle(HYDROData_ImmersibleZone)::DownCast( aDataObj );
LightApp_DataObject* aPolylineSect =
createObject( aGuiObj, tr( "ZONE_POLYLINE" ), aGuiObj->entry() );
if ( !aPolyline.IsNull() && !aPolyline->IsRemoved() )
createObject( aPolylineSect, aPolyline, aGuiObj->entry(), false );
- LightApp_DataObject* aBathsSect =
- createObject( aGuiObj, tr( "ZONE_BATHYMETRIES" ), aGuiObj->entry() );
+ LightApp_DataObject* aBathSect =
+ createObject( aGuiObj, tr( "ZONE_BATHYMETRY" ), aGuiObj->entry() );
- HYDROData_SequenceOfObjects aZoneBaths = aZoneObj->GetBathymetries();
- HYDROData_SequenceOfObjects::Iterator aBathsIter( aZoneBaths );
- for ( ; aBathsIter.More(); aBathsIter.Next() )
- {
- Handle(HYDROData_Bathymetry) aRefBath =
- Handle(HYDROData_Bathymetry)::DownCast( aBathsIter.Value() );
- if( !aRefBath.IsNull() && !aRefBath->IsRemoved() )
- createObject( aBathsSect, aRefBath, aGuiObj->entry(), false );
- }
+ Handle(HYDROData_Bathymetry) aBathymetry = aZoneObj->GetBathymetry();
+ if ( !aBathymetry.IsNull() && !aBathymetry->IsRemoved() )
+ createObject( aBathSect, aBathymetry, aGuiObj->entry(), false );
}
else if ( anObjectKind == KIND_CALCULATION )
{
- Handle(HYDROData_Calculation) aCaseObj =
- Handle(HYDROData_Calculation)::DownCast( aDataObj );
-
- LightApp_DataObject* aPolylineSect =
- createObject( aGuiObj, tr( "CASE_BND_POLYLINE" ), aGuiObj->entry() );
-
- Handle(HYDROData_Polyline) aPolyline = aCaseObj->GetBoundaryPolyline();
- if ( !aPolyline.IsNull() && !aPolyline->IsRemoved() )
- createObject( aPolylineSect, aPolyline, aGuiObj->entry(), false );
-
- LightApp_DataObject* aRefZonesSect =
- createObject( aGuiObj, tr( "CASE_REFERENCE_ZONES" ), aGuiObj->entry() );
-
- HYDROData_SequenceOfObjects aRefZones = aCaseObj->GetZones();
- HYDROData_SequenceOfObjects::Iterator anIter( aRefZones );
- for ( ; anIter.More(); anIter.Next() )
- {
- Handle(HYDROData_Zone) aRefZone =
- Handle(HYDROData_Zone)::DownCast( anIter.Value() );
- if( !aRefZone.IsNull() && !aRefZone->IsRemoved() )
- createObject( aRefZonesSect, aRefZone, aGuiObj->entry(), false );
- }
+ Handle(HYDROData_CalculationCase) aCaseObj =
+ Handle(HYDROData_CalculationCase)::DownCast( aDataObj );
LightApp_DataObject* aCaseRegionsSect =
createObject( aGuiObj, tr( "CASE_REGIONS" ), aGuiObj->entry() );
HYDROData_SequenceOfObjects aCaseRegions = aCaseObj->GetRegions();
- anIter.Init( aCaseRegions );
+ HYDROData_SequenceOfObjects::Iterator anIter( aCaseRegions );
for ( ; anIter.More(); anIter.Next() )
{
Handle(HYDROData_Region) aCaseRegion =
Handle(HYDROData_Region)::DownCast( anIter.Value() );
if( !aCaseRegion.IsNull() && !aCaseRegion->IsRemoved() )
- createObject( aCaseRegionsSect, aCaseRegion, aGuiObj->entry(), false );
+ createObject( aCaseRegionsSect, aCaseRegion, aGuiObj->entry(), true );
+ }
+ }
+ else if ( anObjectKind == KIND_REGION )
+ {
+ Handle(HYDROData_Region) aRegionObj =
+ Handle(HYDROData_Region)::DownCast( aDataObj );
+
+ HYDROData_SequenceOfObjects aRegionZones = aRegionObj->GetZones();
+ HYDROData_SequenceOfObjects::Iterator anIter( aRegionZones );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Zone) aRegionZone =
+ Handle(HYDROData_Zone)::DownCast( anIter.Value() );
+ if( !aRegionZone.IsNull() && !aRegionZone->IsRemoved() )
+ createObject( aGuiObj, aRegionZone, aGuiObj->entry(), true );
}
}
}