X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FHYDROData%2FHYDROData_ShapeFile.h;h=b546bd235a5123a713ea2826bd283d930db6d19a;hb=c16caee6b6e61dffbc739dce6639215b24a459d3;hp=fbeeb64358ec0bb0a78641f47ef4ff79dcbee1e9;hpb=4c3c0d75facf285b7d4bec6c9ce83e3775e13598;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_ShapeFile.h b/src/HYDROData/HYDROData_ShapeFile.h index fbeeb643..b546bd23 100644 --- a/src/HYDROData/HYDROData_ShapeFile.h +++ b/src/HYDROData/HYDROData_ShapeFile.h @@ -19,24 +19,29 @@ #ifndef HYDRODATA_SHAPEFILE_H #define HYDRODATA_SHAPEFILE_H -#include +#include "HYDROData.h" + #include + +#include + #include -#include "HYDROData.h" + +#include + //extern "C" { #include //}; class gp_XYZ; -class Handle_HYDROData_PolylineXY; -class Handle_HYDROData_Polyline3D; -class Handle(HYDROData_Document); -class TopTools_SequenceOfShape; +class HYDROData_PolylineXY; +class HYDROData_Polyline3D; +class HYDROData_Document; class TopoDS_Face; class TopoDS_Shape; -class Handle_HYDROData_Entity; -class Handle_HYDROData_LandCoverMap; +class HYDROData_Entity; +class HYDROData_LandCoverMap; class HYDROData_ShapeFile { @@ -58,6 +63,13 @@ enum DBF_FieldType DBF_FieldType_Invalid }; +enum ImportShapeType +{ + ImportShapeType_Polyline, + ImportShapeType_Polyline3D, + ImportShapeType_Polygon, + ImportShapeType_All +}; struct DBF_AttrValue { @@ -83,23 +95,23 @@ public: //Export operation HYDRODATA_EXPORT void Export(Handle(HYDROData_Document) theDocument, const QString& aFileName, - NCollection_Sequence aPolyXYSeq, - NCollection_Sequence aPoly3DSeq, + NCollection_Sequence aPolyXYSeq, + NCollection_Sequence aPoly3DSeq, QStringList& aNonExpList); HYDRODATA_EXPORT void Export(Handle(HYDROData_Document) theDocument, const QString& aFileName, - const Handle_HYDROData_LandCoverMap& aLCM, + const Handle(HYDROData_LandCoverMap)& aLCM, QStringList& aNonExpList, bool bCheckLinear = true, bool bUseDiscr = false, double theDefl = 0.1); int WriteObjectPolyXY(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle, - Handle_HYDROData_PolylineXY thePoly ); + Handle(HYDROData_PolylineXY) thePoly ); int WriteObjectPoly3D(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle, - Handle_HYDROData_Polyline3D thePoly ); + Handle(HYDROData_Polyline3D) thePoly ); int WriteObjectPolygon(Handle(HYDROData_Document) theDocument, SHPHandle theShpHandle, const TopoDS_Shape& theInputShape, bool bUseDiscr, double theDefl ); @@ -118,13 +130,15 @@ public: //Import Polyline void ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, - int theInd, NCollection_Sequence& theEntities); + int theInd, NCollection_Sequence& theEntities, + bool bReadAsPolylin = false); void ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, - int theInd, NCollection_Sequence& theEntities); + int theInd, NCollection_Sequence& theEntities); HYDRODATA_EXPORT int ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName, - NCollection_Sequence& theEntities, int& theShapeTypeOfFile); + NCollection_Sequence& theEntities, int& theShapeTypeOfFile, + ImportShapeType theShapeTypesToImport); HYDRODATA_EXPORT QString GetShapeTypeName(int theType); @@ -149,6 +163,9 @@ private: int TryOpenShapeFile(QString theFileName); + void GetFreeIndices(std::vector& theAllowedIndexes, QString strName, size_t theObjsSize, + QStringList theExistingNames, QString theBaseFileName); + private: std::vector mySHPObjects; SHPHandle myHSHP;