]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Corrections.
authormzn <mzn@opencascade.com>
Fri, 20 Dec 2013 07:26:53 +0000 (07:26 +0000)
committermzn <mzn@opencascade.com>
Fri, 20 Dec 2013 07:26:53 +0000 (07:26 +0000)
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_SplitToZonesTool.cxx

index 55273f11a7b4894509101b9653e7ada00b1f92fa..72c239c7927660e66f0ad0eae68846d06ef760ef 100644 (file)
@@ -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 );
         }
       }
     }
index 7e48efb2d248b9313decbe1bea4cd1d41c1c7631..1ae7a1b2e641b3f0b031343c84eabed0e326e02b 100644 (file)
@@ -2,6 +2,7 @@
 #include "HYDROData_SplitToZonesTool.h"
 
 #include "HYDROData_PolylineXY.h"
+#include "HYDROData_ShapesGroup.h"
 
 #include <BRepAlgoAPI_Common.hxx>
 #include <BRepAlgoAPI_Cut.hxx>
@@ -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 );
+      }
     }
   }