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;
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 );
}
}
}
#include "HYDROData_SplitToZonesTool.h"
#include "HYDROData_PolylineXY.h"
+#include "HYDROData_ShapesGroup.h"
#include <BRepAlgoAPI_Common.hxx>
#include <BRepAlgoAPI_Cut.hxx>
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 );
+ }
}
}