ShapeType_Polygon
};
+enum DBF_FieldType
+{
+ DBF_FieldType_None,
+ DBF_FieldType_String,
+ DBF_FieldType_Integer,
+ DBF_FieldType_Double,
+ DBF_FieldType_Invalid
+};
+
+struct DBF_AttrValue
+{
+ DBF_AttrValue()
+ {
+ myIsNull = true;
+ myFieldType = DBF_FieldType_None;
+ }
+ QString myStrVal;
+ std::string myRawValue;
+ DBF_FieldType myFieldType;
+ bool myIsNull;
+};
+
public:
HYDRODATA_EXPORT HYDROData_ShapeFile( );
virtual HYDRODATA_EXPORT ~HYDROData_ShapeFile();
HYDRODATA_EXPORT int ImportPolylines(Handle(HYDROData_Document) theDocument, const QString& theFileName,
NCollection_Sequence<Handle_HYDROData_Entity>& theEntities, int& theShapeTypeOfFile);
HYDRODATA_EXPORT QString GetShapeTypeName(int theType);
+
+ //DBF I/O Methods
+ bool CheckDBFFileExisting(const QString& theSHPFilePath, QString& thePathToDBFFile);
+ bool DBF_OpenDBF(const QString& thePathToDBFFile);
+ int DBF_GetNbFields();
+ QStringList DBF_GetFieldList();
+ void DBF_GetFieldTypeList(std::vector<DBF_FieldType>& FTVect);
+ int DBF_GetNbRecords();
+ void DBF_CloseDBF();
+ void DBF_GetAttributeList(int theIndexOfField, std::vector<DBF_AttrValue>& theAttrV);
+
private:
void ProcessFace(TopoDS_Face theFace, SHPHandle theShpHandle);
int TryOpenShapeFile(QString theFileName);
private:
std::vector<SHPObject*> mySHPObjects;
SHPHandle myHSHP;
+ DBFHandle myHDBF;
+
+ friend class test_HYDROData_ShapeFile;
};
#endif