X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_ShapeFile.h;h=88e3f3afaa81a3db11093f8eebcedff52d09e66b;hb=545854182f0363f61284d5abe34c3627d4f3b088;hp=0f1cd3d2f819fef44a4fbe9961c75791706829d1;hpb=6157337f0cd2502aa22545265ebbc797d631c887;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_ShapeFile.h b/src/HYDROData/HYDROData_ShapeFile.h index 0f1cd3d2..88e3f3af 100644 --- a/src/HYDROData/HYDROData_ShapeFile.h +++ b/src/HYDROData/HYDROData_ShapeFile.h @@ -1,8 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE -// -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// Copyright (C) 2014-2015 EDF-R&D // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -35,15 +31,17 @@ class gp_XYZ; class Handle_HYDROData_PolylineXY; class Handle_HYDROData_Polyline3D; -class Handle_HYDROData_LandCover; class Handle(HYDROData_Document); class TopTools_SequenceOfShape; class TopoDS_Face; class Handle_HYDROData_Entity; +class Handle_HYDROData_LandCoverMap; class HYDROData_ShapeFile { +public: + enum ShapeType { ShapeType_Polyline, @@ -52,10 +50,29 @@ enum ShapeType enum DBF_FieldType { + DBF_FieldType_None, DBF_FieldType_String, DBF_FieldType_Integer, DBF_FieldType_Double, - DBF_FieldType_Invalid + DBF_FieldType_Invalid +}; + + +struct DBF_AttrValue +{ + DBF_AttrValue() + { + myIntVal = -1; + myDoubleVal = -1.0; + myIsNull = true; + myFieldType = DBF_FieldType_None; + } + QString myStrVal; + int myIntVal; + double myDoubleVal; + std::string myRawValue; + DBF_FieldType myFieldType; + bool myIsNull; }; public: @@ -66,11 +83,11 @@ public: HYDRODATA_EXPORT void Export(const QString& aFileName, NCollection_Sequence aPolyXYSeq, NCollection_Sequence aPoly3DSeq, - NCollection_Sequence aLCSeq, + const Handle_HYDROData_LandCoverMap& aLCSeq, QStringList& aNonExpList); int WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYDROData_PolylineXY thePoly ); int WriteObjectPoly3D(SHPHandle theShpHandle, Handle_HYDROData_Polyline3D thePoly ); - int WriteObjectLC(SHPHandle theShpHandle, Handle_HYDROData_LandCover theLC ); + //TODO:int WriteObjectLC(SHPHandle theShpHandle, Handle_HYDROData_LandCover theLC ); //Import bool Parse(SHPHandle theHandle, ShapeType theType, int& theShapeTypeOfFile); //Import Landcover @@ -92,7 +109,10 @@ public: int DBF_GetNbFields(); QStringList DBF_GetFieldList(); void DBF_GetFieldTypeList(std::vector& FTVect); + int DBF_GetNbRecords(); void DBF_CloseDBF(); + void DBF_GetAttributeList(int theIndexOfField, std::vector& theAttrV); + bool DBF_WriteFieldAndValues(const QString& theFileName, const QString& theFieldName, DBF_FieldType theType, const std::vector& theAttrV, bool bUseStrValue); private: void ProcessFace(TopoDS_Face theFace, SHPHandle theShpHandle);