1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROData_SplitToZonesTool_H
20 #define HYDROData_SplitToZonesTool_H
23 #pragma warning ( disable: 4251 )
26 #include <HYDROData_Object.h>
27 #include <HYDROData_Transform.h>
28 #include <TopoDS_Shape.hxx>
29 #include <TopoDS_Compound.hxx>
30 #include <TopoDS_Face.hxx>
31 #include <TopTools_ShapeMapHasher.hxx>
32 #include <NCollection_IndexedMap.hxx>
33 #include <NCollection_IndexedDataMap.hxx>
34 #include <TopTools_ListOfShape.hxx>
35 #include <QStringList>
37 class HYDROData_PolylineXY;
40 * \class HYDROData_SplitToZonesTool
41 * \brief This class contains methods used for splitting geometry objects
42 * into non-intersected regions.
44 class HYDRODATA_EXPORT HYDROData_SplitToZonesTool
47 struct HYDRODATA_EXPORT SplitData
57 QStringList ObjectNames;
63 SplitData( const SplitObjectType& theType,
64 const TopoDS_Shape& theShape,
65 const QStringList& theObjectNames ) :
66 Type( theType ), Shape( theShape ), ObjectNames( theObjectNames ) {}
68 SplitData( const SplitObjectType& theType,
69 const TopoDS_Shape& theShape,
70 const QString& theObjectName ) :
71 Type( theType ), Shape( theShape ), ObjectNames( theObjectName ) {}
73 TopoDS_Face Face() const;
76 typedef QList <SplitData> SplitDataList;
77 typedef QListIterator<SplitData> SplitDataListIterator;
78 typedef NCollection_IndexedMap<TopoDS_Shape, TopTools_ShapeMapHasher> HYDROData_MapOfShape;
79 typedef HYDROData_MapOfShape::Iterator HYDROData_MapIteratorOfMapOfShape;
80 typedef NCollection_IndexedDataMap<TopoDS_Shape, TopTools_ListOfShape, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfShape;
81 typedef HYDROData_DataMapOfShapeListOfShape::Iterator HYDROData_DataMapIteratorOfDataMapOfShapeListOfShape;
82 typedef NCollection_IndexedDataMap<TopoDS_Shape, QStringList, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfString;
83 typedef HYDROData_DataMapOfShapeListOfString::Iterator HYDROData_DataMapIteratorOfDataMapOfShapeListOfString;
84 #undef _NCollection_MapHasher
88 static SplitDataList Split( const HYDROData_SequenceOfObjects& theObjectList,
89 const HYDROData_SequenceOfObjects& theGroupsList,
90 const Handle(HYDROData_PolylineXY)& thePolyline );
92 static SplitDataList Split( const HYDROData_SequenceOfObjects& theObjectList );
94 static void SetFileNames(const QString& theNameBefore, const QString& theNameAfter);
101 static Standard_Integer SplitFaces(const TopoDS_Compound& theComp, HYDROData_Transform& theTool);
105 #pragma warning ( default: 4251 )