X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_ShapeFile.h;h=e23c9d6e15f856d62b0ac18027bc634b2c191a3a;hb=23a6f7b3e29e74735d71d7e1448465a9920f91dd;hp=1dc0922bd71975cb5b65d214fdac7a277b66f75a;hpb=1b1584e859342a3e5759a77575f099369d54fd95;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_ShapeFile.h b/src/HYDROData/HYDROData_ShapeFile.h index 1dc0922b..e23c9d6e 100644 --- a/src/HYDROData/HYDROData_ShapeFile.h +++ b/src/HYDROData/HYDROData_ShapeFile.h @@ -44,11 +44,16 @@ class Handle_HYDROData_Entity; class HYDROData_ShapeFile { +enum ShapeType +{ + ShapeType_Polyline, + ShapeType_Polygon +}; + public: HYDRODATA_EXPORT HYDROData_ShapeFile( ); virtual HYDRODATA_EXPORT ~HYDROData_ShapeFile(); -public: //Export operation HYDRODATA_EXPORT void Export(const QString& aFileName, NCollection_Sequence aPolyXYSeq, @@ -58,21 +63,23 @@ public: int WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYDROData_PolylineXY thePoly ); int WriteObjectPoly3D(SHPHandle theShpHandle, Handle_HYDROData_Polyline3D thePoly ); int WriteObjectLC(SHPHandle theShpHandle, Handle_HYDROData_LandCover theLC ); + //Import + bool Parse(SHPHandle theHandle, ShapeType theType, int& theShapeTypeOfFile); //Import Landcover - void Parse1(SHPHandle theHandle); - void ProcessSHP(SHPObject* anObj, int i, TopoDS_Face& F); - HYDRODATA_EXPORT bool ImportLandCovers(const QString theFileName, QStringList& thePolygonsList, TopTools_SequenceOfShape& theFaces); + void ReadSHPPolygon(SHPObject* anObj, int i, TopoDS_Face& F); + HYDRODATA_EXPORT int ImportLandCovers(const QString theFileName, QStringList& thePolygonsList, TopTools_SequenceOfShape& theFaces, int& theShapeTypeOfFile); HYDRODATA_EXPORT void Free(); //Import Polyline - void Parse2( SHPHandle theHandle); - void ProcessSHPPolyXY(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, + void ReadSHPPolyXY(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, int theInd, NCollection_Sequence& theEntities); - void ProcessSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, + void ReadSHPPoly3D(Handle(HYDROData_Document) theDocument, SHPObject* anObj, QString theFileName, int theInd, NCollection_Sequence& theEntities); - HYDRODATA_EXPORT bool ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName, - NCollection_Sequence& theEntities); + HYDRODATA_EXPORT int ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName, + NCollection_Sequence& theEntities, int& theShapeTypeOfFile); + HYDRODATA_EXPORT QString GetShapeTypeName(int theType); private: void ProcessFace(TopoDS_Face theFace, SHPHandle theShpHandle); + int TryOpenShapeFile(QString theFileName); private: std::vector mySHPObjects; SHPHandle myHSHP;