]> SALOME platform Git repositories - modules/hydro.git/blobdiff - src/HYDROData/HYDROData_CalculationCase.cxx
Salome HOME
Create goups for stream.
[modules/hydro.git] / src / HYDROData / HYDROData_CalculationCase.cxx
index 1f74601d777c4d517cab07ade9b0b7c13a91c9a9..d40387eee159af849077abd59f4ff15e3d5ee2ec 100644 (file)
@@ -651,12 +651,24 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
                                         SALOMEDS::Study_ptr theStudy )
 {
   // Get faces
-  // TODO
+  // TODO to be revised
   TopTools_ListOfShape aFaces;
+  HYDROData_SequenceOfObjects aCaseRegions = GetRegions();
+  HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
+  for ( ; aRegionIter.More(); aRegionIter.Next() ) {
+    Handle(HYDROData_Region) aRegion =
+      Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
+    if( aRegion.IsNull() ) {
+      continue;
+    }
+
+    TopoDS_Shape aRegionShape = aRegion->GetShape();
+    aFaces.Append( aRegionShape );
+  }
 
   // Get groups
-  // TODO
-  HYDROData_SequenceOfObjects aSplittedGroups;
+  // TODO to be revised
+  HYDROData_SequenceOfObjects aSplittedGroups = GetSplittedGroups();
 
   return Export( theGeomEngine, theStudy, aFaces, aSplittedGroups );
 }
@@ -710,7 +722,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
   TopTools_IndexedMapOfShape aMapOfSubShapes;
   TopExp::MapShapes( aSewedShape, aMapOfSubShapes );
 
-  QHash<QString, QSet<int>> aGroupsData;
+  QHash<QString, QSet<int> > aGroupsData;
 
   HYDROData_SequenceOfObjects::Iterator anIter( theSplittedGroups );
   for ( ; anIter.More(); anIter.Next() ) {
@@ -725,7 +737,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine,
 
     // Get shapes of the group
     TopTools_SequenceOfShape aShapes;
-    aGroup->GeShapes( aShapes );
+    aGroup->GetShapes( aShapes );
     for( int i = 1, aNbShapes = aShapes.Length(); i <= aNbShapes; i++ ) {
       const TopoDS_Shape& aShape = aShapes.Value( i );
       const TopoDS_Shape ModifiedShape = aSewing.Modified( aShape );
@@ -773,8 +785,6 @@ GEOM::GEOM_Object_ptr HYDROData_CalculationCase::publishShapeInGEOM(
 {
   GEOM::GEOM_Object_var aGeomObj;
 
-  bool isNil = aGeomObj->_is_nil(); ///@MZN
-
   if ( theGeomEngine->_is_nil() || theStudy->_is_nil() ||
        theShape.IsNull() ) {
     return aGeomObj._retn();
@@ -809,4 +819,4 @@ GEOM::GEOM_Object_ptr HYDROData_CalculationCase::publishShapeInGEOM(
   }
 
   return aGeomObj._retn();
- }
\ No newline at end of file
+ }