From: mzn Date: Fri, 20 Dec 2013 07:26:53 +0000 (+0000) Subject: Corrections. X-Git-Tag: BR_hydro_v_0_6~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e2c0eef34036fba9f9b44756c703f540ee91bc84;p=modules%2Fhydro.git Corrections. --- diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 55273f11..72c239c7 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -762,6 +762,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, GEOM::GEOM_Object_var aGroup = aGroupOp->CreateGroup( aMainShape, TopAbs_EDGE ); if ( !CORBA::is_nil(aGroup) && aGroupOp->IsDone() ) { GEOM::ListOfLong_var anIndexes = new GEOM::ListOfLong; + anIndexes->length( aGroupIndexes.count() ); int aListIndex = 0; foreach ( const int anIndex, aGroupIndexes ) { anIndexes[aListIndex++] = anIndex; @@ -770,7 +771,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, aGroupOp->UnionIDs( aGroup, anIndexes ); if ( aGroupOp->IsDone() ) { SALOMEDS::SObject_var aGroupSO = - theGeomEngine->AddInStudy( theStudy, aGroup, qPrintable( aName ), aMainShape ); + theGeomEngine->AddInStudy( theStudy, aGroup, qPrintable( aGroupName ), aMainShape ); } } } diff --git a/src/HYDROData/HYDROData_SplitToZonesTool.cxx b/src/HYDROData/HYDROData_SplitToZonesTool.cxx index 7e48efb2..1ae7a1b2 100644 --- a/src/HYDROData/HYDROData_SplitToZonesTool.cxx +++ b/src/HYDROData/HYDROData_SplitToZonesTool.cxx @@ -2,6 +2,7 @@ #include "HYDROData_SplitToZonesTool.h" #include "HYDROData_PolylineXY.h" +#include "HYDROData_ShapesGroup.h" #include #include @@ -93,25 +94,31 @@ HYDROData_SplitToZonesTool::SplitDataList SplitDataList anInputGroupList; for( int anIndex = 1; anIndex <= theGroupsList.Length(); anIndex++ ) { - Handle(HYDROData_Object) aGeomGroup = - Handle(HYDROData_Object)::DownCast( theGroupsList.Value( anIndex ) ); + Handle(HYDROData_ShapesGroup) aGeomGroup = + Handle(HYDROData_ShapesGroup)::DownCast( theGroupsList.Value( anIndex ) ); if( aGeomGroup.IsNull() ) continue; - const TopoDS_Shape& aShape = aGeomGroup->GetTopShape(); - if ( aShape.IsNull() ) - continue; - if ( aShape.ShapeType() == TopAbs_COMPOUND ) { - TopExp_Explorer anExp( aShape, TopAbs_EDGE ); - for ( ; anExp.More(); anExp.Next() ) { - const TopoDS_Edge& anEdge = TopoDS::Edge( anExp.Current() ); - if ( !anEdge.IsNull() ) { - SplitData aSplitData( SplitData::Data_Edge, anEdge, aGeomGroup->GetName() ); - anInputGroupList.append( aSplitData ); - } - } - } else { - SplitData aSplitData( SplitData::Data_Edge, aShape, aGeomGroup->GetName() ); - anInputGroupList.append( aSplitData ); + + TopTools_SequenceOfShape aGroupShapes; + aGeomGroup->GetShapes( aGroupShapes ); + for( int i = 1, aNbShapes = aGroupShapes.Length(); i <= aNbShapes; i++ ) { + const TopoDS_Shape& aGroupShape = aGroupShapes.Value( i ); + if ( aGroupShape.IsNull() ) + continue; + + if ( aGroupShape.ShapeType() == TopAbs_COMPOUND ) { + TopExp_Explorer anExp( aGroupShape, TopAbs_EDGE ); + for ( ; anExp.More(); anExp.Next() ) { + const TopoDS_Edge& anEdge = TopoDS::Edge( anExp.Current() ); + if ( !anEdge.IsNull() ) { + SplitData aSplitData( SplitData::Data_Edge, anEdge, aGeomGroup->GetName() ); + anInputGroupList.append( aSplitData ); + } + } + } else { + SplitData aSplitData( SplitData::Data_Edge, aGroupShape, aGeomGroup->GetName() ); + anInputGroupList.append( aSplitData ); + } } }