From b33da0d7f657c56dfa2a57e2617eecce308ccb91 Mon Sep 17 00:00:00 2001 From: adv Date: Fri, 10 Jan 2014 09:29:25 +0000 Subject: [PATCH] Updating of groups for exporting of calculation case. --- src/HYDROData/HYDROData_CalculationCase.cxx | 168 +++++++++++--------- src/HYDROData/HYDROData_CalculationCase.h | 18 +-- src/HYDROData/HYDROData_Region.cxx | 148 ++++++++++------- src/HYDROData/HYDROData_Region.h | 4 +- src/HYDROData/HYDROData_ShapesGroup.cxx | 86 ++++++++++ src/HYDROData/HYDROData_ShapesGroup.h | 21 +++ 6 files changed, 299 insertions(+), 146 deletions(-) diff --git a/src/HYDROData/HYDROData_CalculationCase.cxx b/src/HYDROData/HYDROData_CalculationCase.cxx index 198222ab..bcbd1964 100644 --- a/src/HYDROData/HYDROData_CalculationCase.cxx +++ b/src/HYDROData/HYDROData_CalculationCase.cxx @@ -632,55 +632,74 @@ Handle(HYDROData_SplittedShapesGroup) HYDROData_CalculationCase::addNewSplittedG return aNewGroup; } -bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy ) +bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, + SALOMEDS::Study_ptr theStudy ) const { + HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroupsDefs; + + // Get groups definitions + HYDROData_SequenceOfObjects aSplittedGroups = GetSplittedGroups(); + + HYDROData_SequenceOfObjects::Iterator anIter( aSplittedGroups ); + for ( ; anIter.More(); anIter.Next() ) + { + // Get shapes group + Handle(HYDROData_ShapesGroup) aGroup = + Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() ); + if ( aGroup.IsNull() ) + continue; + + HYDROData_ShapesGroup::GroupDefinition aGroupDef; + + aGroupDef.Name = aGroup->GetName().toLatin1().constData(); + aGroup->GetShapes( aGroupDef.Shapes ); + + aSeqOfGroupsDefs.Append( aGroupDef ); + } + // Get faces TopTools_ListOfShape aFaces; HYDROData_SequenceOfObjects aCaseRegions = GetRegions(); HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions ); - for ( ; aRegionIter.More(); aRegionIter.Next() ) { + for ( ; aRegionIter.More(); aRegionIter.Next() ) + { Handle(HYDROData_Region) aRegion = Handle(HYDROData_Region)::DownCast( aRegionIter.Value() ); - if( aRegion.IsNull() ) { + if( aRegion.IsNull() ) continue; - } - TopoDS_Shape aRegionShape = aRegion->GetShape(); + TopoDS_Shape aRegionShape = aRegion->GetShape( &aSeqOfGroupsDefs ); aFaces.Append( aRegionShape ); } - // Get groups - HYDROData_SequenceOfObjects aSplittedGroups = GetSplittedGroups(); - - return Export( theGeomEngine, theStudy, aFaces, aSplittedGroups ); + return Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs ); } -bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, - const TopTools_ListOfShape& theFaces, - const HYDROData_SequenceOfObjects& theSplittedGroups ) +bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, + SALOMEDS::Study_ptr theStudy, + const TopTools_ListOfShape& theFaces, + const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs ) const { // Sew faces - BRepBuilderAPI_Sewing aSewing( Precision::Confusion()*10.0 ); + BRepBuilderAPI_Sewing aSewing( Precision::Confusion() * 10.0 ); aSewing.SetNonManifoldMode( Standard_True ); TopTools_ListIteratorOfListOfShape aFaceIter( theFaces ); - for ( ; aFaceIter.More(); aFaceIter.Next() ) { + for ( ; aFaceIter.More(); aFaceIter.Next() ) + { TopoDS_Shape aShape = aFaceIter.Value(); - if ( !aShape.IsNull() && (aShape.ShapeType() == TopAbs_FACE) ) { - TopoDS_Face aFace = TopoDS::Face( aShape ); - if ( !aFace.IsNull() ) { - aSewing.Add( aFace ); - } - } else { + if ( aShape.IsNull() ) + continue; + + if ( aShape.ShapeType() == TopAbs_FACE ) + { + aSewing.Add( aShape ); + } + else + { TopExp_Explorer anExp( aShape, TopAbs_FACE ); - for ( ; anExp.More(); anExp.Next() ) { - TopoDS_Face aFace = TopoDS::Face( anExp.Current() ); - if ( !aFace.IsNull() ) { - aSewing.Add( aFace ); - } - } + for ( ; anExp.More(); anExp.Next() ) + aSewing.Add( anExp.Current() ); } } // faces iterator @@ -688,76 +707,73 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, TopoDS_Shape aSewedShape = aSewing.SewedShape(); // If the sewed shape is empty - return false - if ( aSewedShape.IsNull() || !TopoDS_Iterator(aSewedShape).More() ) { + if ( aSewedShape.IsNull() || !TopoDS_Iterator( aSewedShape ).More() ) return false; - } // Publish the sewed shape QString aName = EXPORT_NAME; GEOM::GEOM_Object_ptr aMainShape = publishShapeInGEOM( theGeomEngine, theStudy, aSewedShape, aName ); - if ( aMainShape->_is_nil() ) { + if ( aMainShape->_is_nil() ) return false; - } + + if ( theGroupsDefs.IsEmpty() ) + return true; // Create groups TopTools_IndexedMapOfShape aMapOfSubShapes; TopExp::MapShapes( aSewedShape, aMapOfSubShapes ); - QHash > aGroupsData; + NCollection_DataMap< TCollection_AsciiString, NCollection_Sequence > aGroupsData; - HYDROData_SequenceOfObjects::Iterator anIter( theSplittedGroups ); - for ( ; anIter.More(); anIter.Next() ) { - // Get shapes group - Handle(HYDROData_ShapesGroup) aGroup = - Handle(HYDROData_ShapesGroup)::DownCast( anIter.Value() ); - if ( aGroup.IsNull() ) { - continue; - } + for ( int aGrId = 1, nbGroups = theGroupsDefs.Length(); aGrId <= nbGroups; ++aGrId ) + { + const HYDROData_ShapesGroup::GroupDefinition& aGroupDef = theGroupsDefs.Value( aGrId ); - QSet anIndexes; - - // Get shapes of the group - TopTools_SequenceOfShape 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 ); - if ( !ModifiedShape.IsNull() ) { - int anIndex = aMapOfSubShapes.FindIndex( ModifiedShape ); - if ( anIndex > 0 ) { - anIndexes << anIndex; - } - } - } - - if ( anIndexes.count() > 0 ) { - aGroupsData.insert( aGroup->GetName(), anIndexes ); + NCollection_Sequence aGroupIndexes; + for( int i = 1, n = aGroupDef.Shapes.Length(); i <= n; i++ ) + { + const TopoDS_Shape& aShape = aGroupDef.Shapes.Value( i ); + + const TopoDS_Shape& ModifiedShape = aSewing.Modified( aShape ); + if ( ModifiedShape.IsNull() ) + continue; + + int anIndex = aMapOfSubShapes.FindIndex( ModifiedShape ); + if ( anIndex > 0 ) aGroupIndexes.Append( anIndex ); } + + if ( !aGroupIndexes.IsEmpty() ) + aGroupsData.Bind( aGroupDef.Name, aGroupIndexes ); } - if ( !aGroupsData.isEmpty() ) { + if ( !aGroupsData.IsEmpty() ) + { GEOM::GEOM_IGroupOperations_var aGroupOp = theGeomEngine->GetIGroupOperations( theStudy->StudyId() ); - foreach ( const QString& aGroupName, aGroupsData.keys() ) { - QSet aGroupIndexes = aGroupsData.value( aGroupName ); + NCollection_DataMap< TCollection_AsciiString, NCollection_Sequence >::Iterator aMapIt( aGroupsData ); + for ( ; aMapIt.More(); aMapIt.Next() ) + { + const TCollection_AsciiString& aGroupName = aMapIt.Key(); + const NCollection_Sequence& aGroupIndexes = aMapIt.Value(); - 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; - } + GEOM::GEOM_Object_var aGeomGroup = aGroupOp->CreateGroup( aMainShape, TopAbs_EDGE ); + if ( CORBA::is_nil( aGeomGroup ) || !aGroupOp->IsDone() ) + continue; - aGroupOp->UnionIDs( aGroup, anIndexes ); - if ( aGroupOp->IsDone() ) { - SALOMEDS::SObject_var aGroupSO = - theGeomEngine->AddInStudy( theStudy, aGroup, qPrintable( aGroupName ), aMainShape ); - } + GEOM::ListOfLong_var aGeomIndexes = new GEOM::ListOfLong; + aGeomIndexes->length( aGroupIndexes.Length() ); + + for( int i = 1, n = aGroupIndexes.Length(); i <= n; i++ ) + aGeomIndexes[ i - 1 ] = aGroupIndexes.Value( i ); + + aGroupOp->UnionIDs( aGeomGroup, aGeomIndexes ); + if ( aGroupOp->IsDone() ) + { + SALOMEDS::SObject_var aGroupSO = + theGeomEngine->AddInStudy( theStudy, aGeomGroup, aGroupName.ToCString(), aMainShape ); } } } @@ -767,7 +783,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var theGeomEngine, GEOM::GEOM_Object_ptr HYDROData_CalculationCase::publishShapeInGEOM( GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy, - const TopoDS_Shape& theShape, const QString& theName ) + const TopoDS_Shape& theShape, const QString& theName ) const { GEOM::GEOM_Object_var aGeomObj; diff --git a/src/HYDROData/HYDROData_CalculationCase.h b/src/HYDROData/HYDROData_CalculationCase.h index f8c3ef55..0f2d6579 100644 --- a/src/HYDROData/HYDROData_CalculationCase.h +++ b/src/HYDROData/HYDROData_CalculationCase.h @@ -3,7 +3,7 @@ #ifndef HYDROData_CalculationCase_HeaderFile #define HYDROData_CalculationCase_HeaderFile -#include +#include // IDL includes #include @@ -201,8 +201,8 @@ public: * \param theStudy SALOMEDS study, is used for publishing of GEOM objects * \return true in case of success */ - HYDRODATA_EXPORT virtual bool Export( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy ); + HYDRODATA_EXPORT virtual bool Export( GEOM::GEOM_Gen_var theGeomEngine, + SALOMEDS::Study_ptr theStudy ) const; public: // Public methods to work with Calculation services @@ -252,10 +252,10 @@ private: * \param theSplittedGroups the list of groups * \return true in case of success */ - HYDRODATA_EXPORT bool Export( GEOM::GEOM_Gen_var theGeomEngine, - SALOMEDS::Study_ptr theStudy, - const TopTools_ListOfShape& theFaces, - const HYDROData_SequenceOfObjects& theSplittedGroups ); + HYDRODATA_EXPORT bool Export( GEOM::GEOM_Gen_var theGeomEngine, + SALOMEDS::Study_ptr theStudy, + const TopTools_ListOfShape& theFaces, + const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs ) const; /** * Publish the given shape in GEOM as a GEOM object. @@ -265,10 +265,10 @@ private: * \param theName the name of the published object * \return the published GEOM object */ - GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var theGeomEngine, + GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy, const TopoDS_Shape& theShape, - const QString& theName ); + const QString& theName ) const; protected: diff --git a/src/HYDROData/HYDROData_Region.cxx b/src/HYDROData/HYDROData_Region.cxx index 12103c78..81916d5a 100644 --- a/src/HYDROData/HYDROData_Region.cxx +++ b/src/HYDROData/HYDROData_Region.cxx @@ -4,18 +4,23 @@ #include "HYDROData_CalculationCase.h" #include "HYDROData_Document.h" #include "HYDROData_Iterator.h" +#include "HYDROData_ShapesTool.h" #include "HYDROData_Zone.h" #include #include #include #include + +#include + #include +#include #include -#include -#include + #include #include + #include #include @@ -166,8 +171,12 @@ Handle(HYDROData_Zone) HYDROData_Region::addNewZone() return aNewZone; } -TopoDS_Shape HYDROData_Region::GetShape() const +TopoDS_Shape HYDROData_Region::GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* theSeqOfGroups ) const { + HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroups; + if ( theSeqOfGroups ) + aSeqOfGroups = *theSeqOfGroups; + TopoDS_Shape aResShape; // Unite the region zones (each zone is a face) into one face (united face) @@ -178,74 +187,95 @@ TopoDS_Shape HYDROData_Region::GetShape() const HYDROData_SequenceOfObjects aZones = GetZones(); HYDROData_SequenceOfObjects::Iterator aZoneIter( aZones ); - for ( ; aZoneIter.More(); aZoneIter.Next() ) { + for ( ; aZoneIter.More(); aZoneIter.Next() ) + { Handle(HYDROData_Zone) aZone = Handle(HYDROData_Zone)::DownCast( aZoneIter.Value() ); - - if ( aZone.IsNull() ) { + if ( aZone.IsNull() ) continue; - } - TopoDS_Face aFace = TopoDS::Face( aZone->GetShape() ); - if ( !aFace.IsNull() ) { - aRegionFacesList.Append( aFace ); - } + TopoDS_Shape aZoneShape = aZone->GetShape(); + if ( aZoneShape.IsNull() || aZoneShape.ShapeType() != TopAbs_FACE ) + continue; + + TopoDS_Face aZoneFace = TopoDS::Face( aZoneShape ); + aRegionFacesList.Append( aZoneFace ); } // zones iterator - // Check number of faces - int aNbFaces = aRegionFacesList.Extent(); - if ( aNbFaces > 0 ) { - // The unite region face - TopoDS_Face aRegionFace; - - if ( aNbFaces == 1 ) { - aRegionFace = TopoDS::Face( aRegionFacesList.First() ); - } else { - // Fuse faces into one - TopoDS_Shape aFuseShape; - TopTools_ListIteratorOfListOfShape aFaceIter( aRegionFacesList ); - for ( ; aFaceIter.More(); aFaceIter.Next() ) { - if ( aFuseShape.IsNull() ) { - aFuseShape = aFaceIter.Value(); - } else { - BRepAlgoAPI_Fuse aFuse(aFuseShape, aFaceIter.Value()); - if ( !aFuse.IsDone() ) { - aFuseShape.Nullify(); - break; - } - aFuseShape = aFuse.Shape(); - } - } // faces iterator - - // Check the result of fuse operation - if ( !aFuseShape.IsNull() ) { - ShapeUpgrade_UnifySameDomain anUnifier( aFuseShape ); - anUnifier.Build(); - TopoDS_Shape anUnitedShape = anUnifier.Shape(); - - TopTools_IndexedMapOfShape aMapOfFaces; - TopExp::MapShapes( anUnitedShape, TopAbs_FACE, aMapOfFaces ); - if ( aMapOfFaces.Extent() == 1 ) { - aRegionFace = TopoDS::Face( aMapOfFaces(1) ); - } - } - } + if ( aRegionFacesList.IsEmpty() ) + return aResShape; - if ( !aRegionFace.IsNull() ) { // result shape is a face - aResShape = aRegionFace; - } else { // result shape is a shell - TopoDS_Shell aShell; - BRep_Builder aBuilder; - aBuilder.MakeShell( aShell ); + // The unite region face + TopoDS_Face aRegionFace; - TopTools_ListIteratorOfListOfShape aFaceIter( aRegionFacesList ); - for ( ; aFaceIter.More(); aFaceIter.Next() ) { - aBuilder.Add( aShell, aFaceIter.Value() ); + if ( aRegionFacesList.Extent() == 1 ) + { + aRegionFace = TopoDS::Face( aRegionFacesList.First() ); + } + else + { + // Try to fuse all region faces into one common face + TopoDS_Shape aFuseShape; + TopTools_ListIteratorOfListOfShape aFaceIter( aRegionFacesList ); + for ( ; aFaceIter.More(); aFaceIter.Next() ) + { + if ( aFuseShape.IsNull() ) + { + aFuseShape = aFaceIter.Value(); + continue; } - aResShape = aShell; + BRepAlgoAPI_Fuse aFuse( aFuseShape, aFaceIter.Value() ); + if ( !aFuse.IsDone() ) + { + aFuseShape.Nullify(); + break; + } + + aFuseShape = aFuse.Shape(); + HYDROData_ShapesGroup::GroupDefinition::Update( &aSeqOfGroups, &aFuse ); + } // faces iterator + + // Check the result of fuse operation + if ( !aFuseShape.IsNull() ) + { + ShapeUpgrade_UnifySameDomain anUnifier( aFuseShape ); + anUnifier.Build(); + + const TopoDS_Shape& anUnitedShape = anUnifier.Shape(); + + TopTools_SequenceOfShape aShapeFaces; + HYDROData_ShapesTool::ExploreShapeToShapes( anUnitedShape, TopAbs_FACE, aShapeFaces ); + if ( aShapeFaces.Length() == 1 ) + { + aRegionFace = TopoDS::Face( aShapeFaces.Value( 1 ) ); + HYDROData_ShapesGroup::GroupDefinition::Update( &aSeqOfGroups, &anUnifier ); + + // temporary commented because of needs of testing + //if ( theSeqOfGroups ) + //*theSeqOfGroups = aSeqOfGroups; + } } } + + if ( !aRegionFace.IsNull() ) + { + // result shape is a face + aResShape = aRegionFace; + } + else + { + // result shape is a shell + TopoDS_Shell aShell; + BRep_Builder aBuilder; + aBuilder.MakeShell( aShell ); + + TopTools_ListIteratorOfListOfShape aFaceIter( aRegionFacesList ); + for ( ; aFaceIter.More(); aFaceIter.Next() ) + aBuilder.Add( aShell, aFaceIter.Value() ); + + aResShape = aShell; + } return aResShape; } diff --git a/src/HYDROData/HYDROData_Region.h b/src/HYDROData/HYDROData_Region.h index 7139837b..d5de5045 100644 --- a/src/HYDROData/HYDROData_Region.h +++ b/src/HYDROData/HYDROData_Region.h @@ -2,7 +2,7 @@ #ifndef HYDROData_Region_HeaderFile #define HYDROData_Region_HeaderFile -#include "HYDROData_Entity.h" +#include "HYDROData_ShapesGroup.h" DEFINE_STANDARD_HANDLE(HYDROData_Region, HYDROData_Entity) @@ -94,7 +94,7 @@ public: * - a shell if the zones faces can't be united into one face * \return shape as TopoDS_Shape */ - HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const; + HYDRODATA_EXPORT virtual TopoDS_Shape GetShape( HYDROData_ShapesGroup::SeqOfGroupsDefs* theSeqOfGroups = 0 ) const; protected: diff --git a/src/HYDROData/HYDROData_ShapesGroup.cxx b/src/HYDROData/HYDROData_ShapesGroup.cxx index 237059c0..a540e527 100644 --- a/src/HYDROData/HYDROData_ShapesGroup.cxx +++ b/src/HYDROData/HYDROData_ShapesGroup.cxx @@ -1,6 +1,8 @@ #include "HYDROData_ShapesGroup.h" +#include "HYDROData_ShapesTool.h" + #include #include @@ -12,9 +14,93 @@ #include #include +#include + +#include + IMPLEMENT_STANDARD_HANDLE(HYDROData_ShapesGroup,HYDROData_Entity) IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ShapesGroup,HYDROData_Entity) +void HYDROData_ShapesGroup::GroupDefinition::Update( SeqOfGroupsDefs* theGroupsDefs, + BRepBuilderAPI_MakeShape* theAlgo ) +{ + if ( !theGroupsDefs || !theAlgo ) + return; + + SeqOfGroupsDefs::Iterator anIter( *theGroupsDefs ); + for ( ; anIter.More(); anIter.Next() ) + { + GroupDefinition& aGroupDef = anIter.ChangeValue(); + if ( aGroupDef.Shapes.IsEmpty() ) + continue; + + TopTools_ListOfShape aShapesToAdd; + for ( int i = 1; i <= aGroupDef.Shapes.Length(); ++i ) + { + TopoDS_Shape aShape = aGroupDef.Shapes.Value( i ); + /* + if ( theAlgo->IsDeleted( aShape ) ) + { + aGroupDef.Shapes.Remove( i ); + --i; + } + else + {*/ + const TopTools_ListOfShape& aModifiedByAlgo = theAlgo->Modified( aShape ); + if ( !aModifiedByAlgo.IsEmpty() ) + { + HYDROData_ShapesTool::AddShapes( aShapesToAdd, aModifiedByAlgo ); + aGroupDef.Shapes.Remove( i ); + --i; + } + else + { + const TopTools_ListOfShape& aGeneratedByAlgo = theAlgo->Generated( aShape ); + if ( !aGeneratedByAlgo.IsEmpty() ) + { + HYDROData_ShapesTool::AddShapes( aShapesToAdd, aGeneratedByAlgo ); + aGroupDef.Shapes.Remove( i ); + --i; + } + } + //} + } + + HYDROData_ShapesTool::AddShapes( aGroupDef.Shapes, aShapesToAdd ); + } +} + +void HYDROData_ShapesGroup::GroupDefinition::Update( SeqOfGroupsDefs* theGroupsDefs, + ShapeUpgrade_UnifySameDomain* theAlgo ) +{ + if ( !theGroupsDefs || !theAlgo ) + return; + + SeqOfGroupsDefs::Iterator anIter( *theGroupsDefs ); + for ( ; anIter.More(); anIter.Next() ) + { + GroupDefinition& aGroupDef = anIter.ChangeValue(); + if ( aGroupDef.Shapes.IsEmpty() ) + continue; + + TopTools_ListOfShape aShapesToAdd; + for ( int i = 1; i <= aGroupDef.Shapes.Length(); ++i ) + { + TopoDS_Shape aShape = aGroupDef.Shapes.Value( i ); + + TopoDS_Shape aGeneratedByAlgo = theAlgo->Generated( aShape ); + if ( aGeneratedByAlgo.IsNull() || aShape.IsEqual( aGeneratedByAlgo ) ) + continue; + + aShapesToAdd.Append( aGeneratedByAlgo ); + aGroupDef.Shapes.Remove( i ); + --i; + } + + HYDROData_ShapesTool::AddShapes( aGroupDef.Shapes, aShapesToAdd ); + } +} + HYDROData_ShapesGroup::HYDROData_ShapesGroup() : HYDROData_Entity() { diff --git a/src/HYDROData/HYDROData_ShapesGroup.h b/src/HYDROData/HYDROData_ShapesGroup.h index 8d6a1948..56bed37c 100644 --- a/src/HYDROData/HYDROData_ShapesGroup.h +++ b/src/HYDROData/HYDROData_ShapesGroup.h @@ -6,8 +6,12 @@ #include +#include + class TopoDS_Shape; class TopTools_ListOfShape; +class BRepBuilderAPI_MakeShape; +class ShapeUpgrade_UnifySameDomain; DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity) @@ -16,6 +20,23 @@ DEFINE_STANDARD_HANDLE(HYDROData_ShapesGroup, HYDROData_Entity) */ class HYDROData_ShapesGroup : public HYDROData_Entity { +public: + + struct GroupDefinition + { + GroupDefinition() {} + + static void Update( NCollection_Sequence* theGroupsDefs, + BRepBuilderAPI_MakeShape* theAlgo ); + + static void Update( NCollection_Sequence* theGroupsDefs, + ShapeUpgrade_UnifySameDomain* theAlgo ); + + TCollection_AsciiString Name; + TopTools_SequenceOfShape Shapes; + }; + typedef NCollection_Sequence SeqOfGroupsDefs; + protected: /** * Enumeration of tags corresponding to the persistent object parameters. -- 2.39.2