IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
HYDROData_CalculationCase::HYDROData_CalculationCase()
-: HYDROData_Entity()
+: HYDROData_Entity( Geom_2d_and_groups )
{
}
const HYDROData_SplitToZonesTool::SplitDataList& theZones,
const bool theLandCover )
{
+ DEBTRACE("HYDROData_CalculationCase::CreateRegionsAuto");
QMap<QString, Handle(HYDROData_Region)> aRegionsMap; //object name to region
QMap<QString, QString> aRegionNameToObjNameMap;
QString aZonesPref = theLandCover ? CALCULATION_LANDCOVER_ZONES_PREF : CALCULATION_ZONES_PREF;
if ( !theLandCover ) {
Handle(HYDROData_Object) aMergeObject = Handle(HYDROData_Object)::DownCast( aMergeEntity );
if ( !aMergeObject.IsNull() ) {
+ DEBTRACE("aMergeEntity " << aMergeEntity->GetName().toStdString());
aMergeEntity = aMergeObject->GetAltitudeObject();
}
}
AddReferenceObject( theObject, DataTag_GeometryObject );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ Changed( Geom_2d );
return true;
}
RemoveReferenceObject( theObject->Label(), DataTag_GeometryObject );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ Changed( Geom_2d );
}
void HYDROData_CalculationCase::RemoveGeometryObjects()
ClearReferenceObjects( DataTag_GeometryObject );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ Changed( Geom_2d );
}
bool HYDROData_CalculationCase::AddGeometryGroup( const Handle(HYDROData_ShapesGroup)& theGroup )
AddReferenceObject( theGroup, DataTag_GeometryGroup );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ Changed( Geom_Groups );
return true;
}
RemoveReferenceObject( theGroup->Label(), DataTag_GeometryGroup );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ Changed( Geom_Groups );
}
void HYDROData_CalculationCase::RemoveGeometryGroups()
ClearReferenceObjects( DataTag_GeometryGroup );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ Changed( Geom_Groups );
}
void HYDROData_CalculationCase::SetBoundaryPolyline( const Handle(HYDROData_PolylineXY)& thePolyline )
SetReferenceObject( thePolyline, DataTag_Polyline );
// Indicate model of the need to update zones splitting
- SetToUpdate( !IsEqual( aPrevPolyline, thePolyline ) || IsMustBeUpdated() );
+ if( !IsEqual( aPrevPolyline, thePolyline ) )
+ Changed( Geom_2d );
}
Handle(HYDROData_PolylineXY) HYDROData_CalculationCase::GetBoundaryPolyline() const
ClearReferenceObjects( DataTag_Polyline );
// Indicate model of the need to update zones splitting
- SetToUpdate( !aPrevPolyline.IsNull() || IsMustBeUpdated() );
+ Changed( Geom_2d );
}
void HYDROData_CalculationCase::SetStricklerTable( const Handle(HYDROData_StricklerTable)& theStricklerTable )
SetReferenceObject( theStricklerTable, DataTag_StricklerTable );
// Indicate model of the need to update land covers partition
- SetToUpdate( !IsEqual( aPrevStricklerTable, theStricklerTable ) || IsMustBeUpdated() );
+ if( !IsEqual( aPrevStricklerTable, theStricklerTable ) )
+ Changed( Geom_No );
}
Handle(HYDROData_StricklerTable) HYDROData_CalculationCase::GetStricklerTable() const
ClearReferenceObjects( DataTag_StricklerTable );
// Indicate model of the need to update land covers partition
- SetToUpdate( !aPrevStricklerTable.IsNull() || IsMustBeUpdated() );
+ Changed( Geom_No );
}
bool HYDROData_CalculationCase::AddLandCover( const Handle(HYDROData_LandCover)& theLandCover )
AddReferenceObject( theLandCover, DataTag_LandCover );
// Indicate model of the need to update land covers partition
- SetToUpdate( true );
+ Changed( Geom_No );
return true;
}
RemoveReferenceObject( theLandCover->Label(), DataTag_LandCover );
// Indicate model of the need to update land cover partition
- SetToUpdate( true );
+ Changed( Geom_No );
}
void HYDROData_CalculationCase::RemoveLandCovers()
ClearReferenceObjects( DataTag_LandCover );
// Indicate model of the need to update land cover partition
- SetToUpdate( true );
+ Changed( Geom_No );
}
Handle(HYDROData_Region) HYDROData_CalculationCase::AddNewRegion( const Handle(HYDROData_Zone)& theZone,
if ( !aFatherCalc.IsNull() && aFatherCalc->Label() != myLab )
{
Handle(HYDROData_Region) aNewRegion = addNewRegion( aDocument, CALCULATION_REGIONS_PREF, theLandCover );
- theRegion->CopyTo( aNewRegion );
+ theRegion->CopyTo( aNewRegion, true );
aFatherCalc->RemoveRegion( theRegion, theLandCover );
//DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString());
double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
if ( theZone.IsNull() )
+ {
+ DEBTRACE("Zone nulle");
return aResAltitude;
+ }
HYDROData_Zone::MergeType aZoneMergeType = theZone->GetMergeType();
+ //DEBTRACE("aZoneMergeType " << aZoneMergeType);
if ( !theZone->IsMergingNeed() )
{
aZoneMergeType = HYDROData_Zone::Merge_UNKNOWN;
+ //DEBTRACE("---");
}
else if ( aZoneMergeType == HYDROData_Zone::Merge_UNKNOWN )
{
+ DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString() << " Merge_UNKNOWN");
return aResAltitude;
}
{
if ( aZoneInterpolator != NULL )
{
+ DEBTRACE("aZoneInterpolator != NULL");
aZoneInterpolator->SetAltitudeObject( aMergeAltitude );
aResAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
}
else
+ {
+ DEBTRACE("aZoneInterpolator == NULL");
aResAltitude = aMergeAltitude->GetAltitudeForPoint( thePoint );
+ }
}
}
else
{
+ //DEBTRACE("aZoneMergeType != HYDROData_Zone::Merge_Object");
HYDROData_SequenceOfObjects aZoneObjects = theZone->GetObjects();
HYDROData_SequenceOfObjects::Iterator anIter( aZoneObjects );
for ( ; anIter.More(); anIter.Next() )
double aPointAltitude = 0.0;
if ( aZoneInterpolator != NULL )
{
+ DEBTRACE("aZoneInterpolator != NULL");
aZoneInterpolator->SetAltitudeObject( anObjAltitude );
aPointAltitude = aZoneInterpolator->GetAltitudeForPoint( thePoint );
}
else
+ {
+ //DEBTRACE("aZoneInterpolator == NULL");
aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint );
+ }
if ( ValuesEquals( aPointAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) )
continue;
// Indicate model of the need to update splitting
if ( theIsSetToUpdate ) {
- SetToUpdate( true );
+ Changed( Geom_2d );
}
}
HYDROData_PriorityQueue::AddRule( aRulesLab, theObject1, thePriority, theObject2, theMergeType );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ Changed( Geom_2d );
}
QString HYDROData_CalculationCase::DumpRules() const
TDataStd_Integer::Set( aModeLab, ( int ) theMode );
// Indicate model of the need to update splitting
- SetToUpdate( true );
+ Changed( Geom_2d );
}
HYDROData_CalculationCase::AssignmentMode HYDROData_CalculationCase::GetAssignmentMode() const
TDataStd_Integer::Set( aModeLab, ( int ) theMode );
// Indicate model of the need to update land covers partition
- SetToUpdate( true );
+ Changed( Geom_No );
}
HYDROData_CalculationCase::AssignmentMode HYDROData_CalculationCase::GetAssignmentLandCoverMode() const