X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Region.cxx;h=698cfc944925502b5744e9ae3adc281bc39b5523;hb=a95289fabbb6fbf6f32c06207422c65aafd5bd65;hp=20a86e42665435658222b149d6832e021bcf6c0c;hpb=2ca0651c272b155f0782ce79a4a63d5f9d9f466d;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Region.cxx b/src/HYDROData/HYDROData_Region.cxx index 20a86e42..698cfc94 100644 --- a/src/HYDROData/HYDROData_Region.cxx +++ b/src/HYDROData/HYDROData_Region.cxx @@ -44,6 +44,7 @@ #include #include +#include //#define DEB_GET_REGION_SHAPE @@ -52,7 +53,7 @@ IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Region, HYDROData_Entity) HYDROData_Region::HYDROData_Region() - : HYDROData_Entity() + : HYDROData_Entity( Geom_2d ) { } @@ -107,7 +108,7 @@ bool HYDROData_Region::AddZone( const Handle(HYDROData_Zone)& theZone ) if ( !aFatherRegion.IsNull() && aFatherRegion->Label() != myLab ) { Handle(HYDROData_Zone) aNewZone = addNewZone( aDocument, "", TopoDS_Face(), QStringList() ); - theZone->CopyTo( aNewZone ); + theZone->CopyTo( aNewZone, false ); // To prevent changing of stored shape aNewZone->SetShape( theZone->GetShape() ); @@ -388,12 +389,14 @@ TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* return aResShape; } -QStringList HYDROData_Region::DumpToPython( MapOfTreatedObjects& theTreatedObjects ) const +QStringList HYDROData_Region::DumpToPython( const QString& thePyScriptPath, + MapOfTreatedObjects& theTreatedObjects, + QString defRegName ) const { QStringList aResList; // Find region - findPythonReferenceObject( theTreatedObjects, aResList ); + findPythonReferenceObject( aResList, defRegName ); // Add zones HYDROData_SequenceOfObjects aZones = GetZones(); @@ -406,7 +409,7 @@ QStringList HYDROData_Region::DumpToPython( MapOfTreatedObjects& theTreatedObjec } // find zone - aZone->findPythonReferenceObject( theTreatedObjects, aResList ); + aZone->findPythonReferenceObject( aResList ); theTreatedObjects.insert( aZone->GetName(), aZone ); // set zone merge type @@ -426,14 +429,18 @@ QStringList HYDROData_Region::DumpToPython( MapOfTreatedObjects& theTreatedObjec if ( aMergeType == HYDROData_Zone::Merge_Object ) { Handle(HYDROData_Entity) aMergeObject = aZone->GetMergeObject(); if ( !aMergeObject.IsNull() ) { - aMergeObject->findPythonReferenceObject( theTreatedObjects, aResList ); + aMergeObject->findPythonReferenceObject( aResList ); aResList << QString( "%1.SetMergeObject( %2 )" ).arg( aZone->GetObjPyName() ) .arg( aMergeObject->GetObjPyName() ); } } - + // set color + QColor zoneColor = aZone->GetColor(Qt::darkBlue); + aResList << QString( "%1.SetColor( QColor( %2, %3, %4 ))" ) + .arg( aZone->GetObjPyName() ).arg( zoneColor.red() ).arg( zoneColor.green() ).arg( zoneColor.blue() ); // add zone - setPythonReferenceObject( theTreatedObjects, aResList, aZone, "AddZone" ); + setPythonReferenceObject( thePyScriptPath, theTreatedObjects, aResList, aZone, "AddZone" ); + } return aResList;