2 #ifndef HYDROData_SplitToZonesTool_H
3 #define HYDROData_SplitToZonesTool_H
5 #include <HYDROData_Object.h>
6 #include <HYDROData_Transform.h>
7 #include <TopoDS_Shape.hxx>
8 #include <TopoDS_Compound.hxx>
9 #include <TopoDS_Face.hxx>
10 #include <TopTools_ShapeMapHasher.hxx>
11 #include <NCollection_Map.hxx>
12 #include <NCollection_DataMap.hxx>
13 #include <TopTools_ListOfShape.hxx>
14 #include <QStringList>
16 class Handle(HYDROData_PolylineXY);
19 * \class HYDROData_SplitToZonesTool
20 * \brief This class contains methods used for splitting geometry objects
21 * into non-intersected regions.
23 class HYDRODATA_EXPORT HYDROData_SplitToZonesTool
26 struct HYDRODATA_EXPORT SplitData
36 QStringList ObjectNames;
42 SplitData( const SplitObjectType& theType,
43 const TopoDS_Shape& theShape,
44 const QStringList& theObjectNames ) :
45 Type( theType ), Shape( theShape ), ObjectNames( theObjectNames ) {}
47 SplitData( const SplitObjectType& theType,
48 const TopoDS_Shape& theShape,
49 const QString& theObjectName ) :
50 Type( theType ), Shape( theShape ), ObjectNames( theObjectName ) {}
52 TopoDS_Face Face() const;
55 typedef QList <SplitData> SplitDataList;
56 typedef QListIterator<SplitData> SplitDataListIterator;
57 typedef NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> HYDROData_MapOfShape;
58 typedef HYDROData_MapOfShape::Iterator HYDROData_MapIteratorOfMapOfShape;
59 typedef NCollection_DataMap<TopoDS_Shape, TopTools_ListOfShape, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfShape;
60 typedef HYDROData_DataMapOfShapeListOfShape::Iterator HYDROData_DataMapIteratorOfDataMapOfShapeListOfShape;
61 typedef NCollection_DataMap<TopoDS_Shape, QStringList, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfString;
62 typedef HYDROData_DataMapOfShapeListOfString::Iterator HYDROData_DataMapIteratorOfDataMapOfShapeListOfString;
63 #undef _NCollection_MapHasher
67 static SplitDataList Split( const HYDROData_SequenceOfObjects& theObjectList,
68 const HYDROData_SequenceOfObjects& theGroupsList,
69 const Handle(HYDROData_PolylineXY)& thePolyline );
71 static void SetFileNames(const QString& theNameBefore, const QString& theNameAfter);
75 static bool SplitTwoData( const SplitData& theData1,
76 const SplitData& theData2,
77 SplitData& theData1Subtracted,
78 SplitData& theData2Subtracted,
79 SplitData& theDataIntersected );
81 static SplitDataList ExtractSeparateData( const SplitData& theData );
86 static Standard_Integer SplitFaces(const TopoDS_Compound& theComp, HYDROData_Transform& theTool);