#define HYDROData_SplitToZonesTool_H
#include <HYDROData_Object.h>
-
+#include <HYDROData_Transform.h>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Compound.hxx>
#include <TopoDS_Face.hxx>
-
+#include <TopTools_ShapeMapHasher.hxx>
+#include <NCollection_Map.hxx>
+#include <NCollection_DataMap.hxx>
+#include <TopTools_ListOfShape.hxx>
#include <QStringList>
-class Handle(HYDROData_Polyline);
+class Handle(HYDROData_PolylineXY);
/**
* \class HYDROData_SplitToZonesTool
public:
struct HYDRODATA_EXPORT SplitData
{
- TopoDS_Shape Shape;
- QStringList ObjectNames;
-
- SplitData() {}
+ enum SplitObjectType
+ {
+ Data_None,
+ Data_Zone,
+ Data_Edge
+ };
+
+ TopoDS_Shape Shape;
+ QStringList ObjectNames;
+ SplitObjectType Type;
+
+ SplitData() :
+ Type( Data_None ) {}
- SplitData( const TopoDS_Shape& theShape,
- const QStringList& theObjectNames ) :
- Shape( theShape ), ObjectNames( theObjectNames ) {}
+ SplitData( const SplitObjectType& theType,
+ const TopoDS_Shape& theShape,
+ const QStringList& theObjectNames ) :
+ Type( theType ), Shape( theShape ), ObjectNames( theObjectNames ) {}
- SplitData( const TopoDS_Shape& theShape,
- const QString& theObjectNames ) :
- Shape( theShape ), ObjectNames( theObjectNames ) {}
+ SplitData( const SplitObjectType& theType,
+ const TopoDS_Shape& theShape,
+ const QString& theObjectName ) :
+ Type( theType ), Shape( theShape ), ObjectNames( theObjectName ) {}
TopoDS_Face Face() const;
};
typedef QList <SplitData> SplitDataList;
- typedef QListIterator<SplitData> SplitDataListIterator;
+ typedef QListIterator<SplitData> SplitDataListIterator;
+ typedef NCollection_Map<TopoDS_Shape, TopTools_ShapeMapHasher> HYDROData_MapOfShape;
+ typedef HYDROData_MapOfShape::Iterator HYDROData_MapIteratorOfMapOfShape;
+ typedef NCollection_DataMap<TopoDS_Shape, TopTools_ListOfShape, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfShape;
+ typedef HYDROData_DataMapOfShapeListOfShape::Iterator HYDROData_DataMapIteratorOfDataMapOfShapeListOfShape;
+ typedef NCollection_DataMap<TopoDS_Shape, QStringList, TopTools_ShapeMapHasher> HYDROData_DataMapOfShapeListOfString;
+ typedef HYDROData_DataMapOfShapeListOfString::Iterator HYDROData_DataMapIteratorOfDataMapOfShapeListOfString;
+ #undef _NCollection_MapHasher
public:
- static SplitDataList SplitToZones( const HYDROData_SequenceOfObjects& theObjectList );
+ static SplitDataList Split( const HYDROData_SequenceOfObjects& theObjectList,
+ const HYDROData_SequenceOfObjects& theGroupsList,
+ const Handle(HYDROData_PolylineXY)& thePolyline );
+
+ static void SetFileNames(const QString& theNameBefore, const QString& theNameAfter);
private:
static SplitDataList ExtractSeparateData( const SplitData& theData );
+ /**
+ * Split input faces.
+ */
+ static Standard_Integer SplitFaces(const TopoDS_Compound& theComp, HYDROData_Transform& theTool);
};
#endif