LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent,
Handle(HYDROData_Object) theModelObject,
- const QString& theParentEntry )
+ const QString& theParentEntry,
+ const bool theIsBuildTree )
{
HYDROGUI_DataObject* aResObj =
new HYDROGUI_DataObject( theParent, theModelObject, theParentEntry );
- buildObjectTree( theParent, aResObj, theParentEntry );
+
+ if ( theIsBuildTree )
+ {
+ buildObjectTree( theParent, aResObj, theParentEntry );
+ }
+
return aResObj;
}
LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent,
const QString& theName,
- const QString& theParentEntry )
+ const QString& theParentEntry )
{
return new HYDROGUI_NamedObject( theParent, theName, theParentEntry );
}
{
Handle(HYDROData_Object) aRefObj = anImageObj->Reference( anIndex );
if ( !aRefObj.IsNull() && !aRefObj->IsRemoved() )
- createObject( aGuiObj, aRefObj, aGuiObj->entry() );
+ createObject( aGuiObj, aRefObj, aGuiObj->entry(), false );
}
}
else if ( anObjectKind == KIND_ZONE )
Handle(HYDROData_Zone) aZoneObj =
Handle(HYDROData_Zone)::DownCast( aDataObj );
- LightApp_DataObject* aPolylineSect = createObject( aGuiObj, tr( "ZONE_POLYLINE" ), aGuiObj->entry() );
+ LightApp_DataObject* aPolylineSect =
+ createObject( aGuiObj, tr( "ZONE_POLYLINE" ), aGuiObj->entry() );
Handle(HYDROData_Polyline) aPolyline = aZoneObj->GetPolyline();
if ( !aPolyline.IsNull() && !aPolyline->IsRemoved() )
- createObject( aPolylineSect, aPolyline, aGuiObj->entry() );
+ createObject( aPolylineSect, aPolyline, aGuiObj->entry(), false );
- LightApp_DataObject* aBathsSect = createObject( aGuiObj, tr( "ZONE_BATHYMETRIES" ), aGuiObj->entry() );
+ LightApp_DataObject* aBathsSect =
+ createObject( aGuiObj, tr( "ZONE_BATHYMETRIES" ), aGuiObj->entry() );
HYDROData_SequenceOfObjects aZoneBaths = aZoneObj->GetBathymetries();
HYDROData_SequenceOfObjects::Iterator aBathsIter( aZoneBaths );
Handle(HYDROData_Bathymetry) aRefBath =
Handle(HYDROData_Bathymetry)::DownCast( aBathsIter.Value() );
if( !aRefBath.IsNull() && !aRefBath->IsRemoved() )
- createObject( aBathsSect, aRefBath, aGuiObj->entry() );
+ createObject( aBathsSect, aRefBath, 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 );
+ }
+
+ LightApp_DataObject* aSplittedZonesSect =
+ createObject( aGuiObj, tr( "CASE_SPLITTED_ZONES" ), aGuiObj->entry() );
+
+ HYDROData_SequenceOfObjects aSplittedZones = aCaseObj->GetSplittedZones();
+ anIter.Init( aSplittedZones );
+ for ( ; anIter.More(); anIter.Next() )
+ {
+ Handle(HYDROData_Zone) aSplittedZone =
+ Handle(HYDROData_Zone)::DownCast( anIter.Value() );
+ if( !aSplittedZone.IsNull() && !aSplittedZone->IsRemoved() )
+ createObject( aSplittedZonesSect, aSplittedZone, aGuiObj->entry(), false );
}
}
}