#define _DEVDEBUG_
#include "HYDRO_trace.hxx"
-IMPLEMENT_STANDARD_HANDLE(HYDROData_CalculationCase, HYDROData_Entity)
IMPLEMENT_STANDARD_RTTIEXT(HYDROData_CalculationCase, HYDROData_Entity)
HYDROData_CalculationCase::HYDROData_CalculationCase()
continue;
int aGroupId = aFatherGeom->GetGroupId( aGeomGroup );
- aResList << QString( "%1 = %2.GetGroup( %3 );" )
+ aResList << QString( "%1 = %2.GetGroup( %3 )" )
.arg( aGroupName ).arg( aFatherGeom->GetObjPyName() ).arg( aGroupId );
- aResList << QString( "%1.AddGeometryGroup( %2 );" ).arg( aCalculName ).arg( aGroupName );
+ aResList << QString( "%1.AddGeometryGroup( %2 )" ).arg( aCalculName ).arg( aGroupName );
}
Handle(HYDROData_PolylineXY) aBoundaryPolyline = GetBoundaryPolyline();
aResList << QString( "" );
aResList << "# Start the algorithm of the partition and assignment";
- aResList << QString( "%1.Update();" ).arg( aCalculName );
+ aResList << QString( "%1.Update()" ).arg( aCalculName );
if( aMode==MANUAL )
{
aResList << "import GEOM";
aResList << QString( "print \"Entry:\", %1" ).arg( anEntryVar );
QString aGeomShapeName = aCalculName + "_geom";
- aResList << QString( "%1 = salome.IDToObject( str( %2 ) )" ).arg( aGeomShapeName ).arg( anEntryVar );
- aResList << QString( "print \"Geom shape:\", %1" ).arg( aGeomShapeName );
- aResList << QString( "print \"Geom shape name:\", %1.GetName()" ).arg( aGeomShapeName );
+ aResList << QString( "HYDRO_%1 = salome.IDToObject( str( %2 ) )" ).arg( GetName() ).arg( anEntryVar );
+ aResList << QString( "print \"Geom shape:\", HYDRO_%1" ).arg( GetName() );
+ aResList << QString( "print \"Geom shape name:\", HYDRO_%1.GetName()" ).arg( GetName() );
- DumpSampleMeshing( aResList, aStudyName, aGeomShapeName, aCalculName+"_mesh" );
+
+ //DumpSampleMeshing( aResList, aStudyName, aGeomShapeName, aCalculName+"_mesh" );
aResList << QString( "" );
return aResList;
}
double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint,
- const Handle(HYDROData_Region)& theRegion ) const
+ const Handle(HYDROData_Region)& theRegion,
+ int theMethod) const
{
double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
//DEBTRACE("GetAltitudeForPoint Region " << theRegion->GetName().toStdString() << " Zone " << aZone->GetName().toStdString());
Handle(HYDROData_Region) aRefRegion = Handle(HYDROData_Region)::DownCast( aZone->GetFatherObject() );
if ( IsEqual( aRefRegion, theRegion ) )
- aResAltitude = GetAltitudeForPoint( thePoint, aZone );
+ aResAltitude = GetAltitudeForPoint( thePoint, aZone, theMethod );
else
{
DEBTRACE("GetAltitudeForPoint Region " << aRefRegion->GetName().toStdString() << " Zone " << aZone->GetName().toStdString() << " ---------------------------");
- aResAltitude = GetAltitudeForPoint( thePoint, aZone );
+ aResAltitude = GetAltitudeForPoint( thePoint, aZone, theMethod );
}
}
else
}
double HYDROData_CalculationCase::GetAltitudeForPoint( const gp_XY& thePoint,
- const Handle(HYDROData_Zone)& theZone ) const
+ const Handle(HYDROData_Zone)& theZone,
+ int theMethod) const
{
//DEBTRACE("GetAltitudeForPoint Zone " << theZone->GetName().toStdString());
double aResAltitude = HYDROData_IAltitudeObject::GetInvalidAltitude();
else
{
//DEBTRACE("aZoneInterpolator == NULL");
- aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint );
+ aPointAltitude = anObjAltitude->GetAltitudeForPoint( thePoint, theMethod );
}
if ( ValuesEquals( aPointAltitude, HYDROData_IAltitudeObject::GetInvalidAltitude() ) )
NCollection_Sequence<double> HYDROData_CalculationCase::GetAltitudesForPoints(
const NCollection_Sequence<gp_XY>& thePoints,
- const Handle(HYDROData_Region)& theRegion ) const
+ const Handle(HYDROData_Region)& theRegion,
+ int theMethod) const
{
- //DEBTRACE("HYDROData_CalculationCase::GetAltitudesForPoints " << theRegion->GetName().toStdString());
+ DEBTRACE("HYDROData_CalculationCase::GetAltitudesForPoints " << theRegion->GetName().toStdString());
NCollection_Sequence<double> aResSeq;
for ( int i = 1, n = thePoints.Length(); i <= n; ++i )
{
const gp_XY& thePnt = thePoints.Value( i );
- double anAltitude = GetAltitudeForPoint( thePnt, theRegion );
+ double anAltitude = GetAltitudeForPoint( thePnt, theRegion, theMethod );
aResSeq.Append( anAltitude );
}
NCollection_Sequence<double> HYDROData_CalculationCase::GetAltitudesForPoints(
const NCollection_Sequence<gp_XY>& thePoints,
- const Handle(HYDROData_Zone)& theZone ) const
+ const Handle(HYDROData_Zone)& theZone,
+ int theMethod) const
{
NCollection_Sequence<double> aResSeq;
{
const gp_XY& thePnt = thePoints.Value( i );
- double anAltitude = GetAltitudeForPoint( thePnt, theZone );
+ double anAltitude = GetAltitudeForPoint( thePnt, theZone, theMethod );
aResSeq.Append( anAltitude );
}
AddRegion( aNewRegion );
QString aRegionName = isPrefix ? HYDROData_Tool::GenerateObjectName( theDoc, thePrefixOrName ) : thePrefixOrName;
- aNewRegion->SetName( aRegionName );
+ aNewRegion->SetName( aRegionName, true );
return aNewRegion;
}
aRes = Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs, theGeomObjEntry );;
}
+ if( aRes && !GetLandCoverMap().IsNull() && !GetStricklerTable().IsNull() )
+ {
+ QString aTelemacFileName = GetName() + ".telemac";
+ aRes = GetLandCoverMap()->ExportTelemac( aTelemacFileName, 1E-2, GetStricklerTable() );
+ }
return aRes;
}
const HYDROData_SequenceOfObjects& theRegions ) const
{
HYDROData_SequenceOfObjects::Iterator anIter;
- anIter.Init( theRegions );
- for ( ; anIter.More(); anIter.Next() )
- {
- Handle(HYDROData_Region) aRegion =
- Handle(HYDROData_Region)::DownCast( anIter.Value() );
- if ( aRegion.IsNull() )
- continue;
-
- theTreatedObjects.insert( aRegion->GetName(), aRegion );
- QStringList aRegDump = aRegion->DumpToPython( thePyScriptPath, theTreatedObjects );
- theResList << aRegDump;
- }
+ anIter.Init(theRegions);
+ for (int ireg = 1; anIter.More(); anIter.Next(), ireg++)
+ {
+ Handle(HYDROData_Region) aRegion = Handle(HYDROData_Region)::DownCast(anIter.Value());
+ if (aRegion.IsNull())
+ continue;
+ QString defRegName = this->GetName();
+ QString regSuffix = QString("_Reg_%1").arg(ireg);
+ defRegName += regSuffix;
+ theTreatedObjects.insert(aRegion->GetName(), aRegion);
+ QStringList aRegDump = aRegion->DumpToPython(thePyScriptPath, theTreatedObjects, defRegName);
+ theResList << aRegDump;
+ }
+ for (anIter.Init(theRegions); anIter.More(); anIter.Next())
+ {
+ Handle(HYDROData_Region) aRegion = Handle(HYDROData_Region)::DownCast(anIter.Value());
+ if (aRegion.IsNull())
+ continue;
+ QStringList aRegDump;
+ aRegion->SetNameInDumpPython(aRegDump);
+ theResList << aRegDump;
+ }
}
bool HYDROData_CalculationCase::GetRule( int theIndex,