IImportShape.hpp
1 #pragma once
2 
3 //DM
4 #include "DM/config.hpp"
5 #include "DM/AutoLink.hpp" //enable autolink
6 
7 #include "DM/ColumnTypes.hpp"
8 #include "DM/IO/IImport.hpp"
9 #include "DM/IO/IShapeTableDefinition.hpp"
10 
11 DM_NAMESPACE_BEGIN
12 
13 /// Specific import class for handling shape file imports
14 class DM_API IImportShape : public virtual IImport
15 {
16 public:
17  static IImportShape* New( const char *file, FilterHandle filter = FilterHandle(), ControlObjectHandle control = ControlObjectHandle(),
18  bool collectHdrContents = false, unsigned maxBulkPoints = 1000, AddInfoLayoutHandle defaultLayout = AddInfoLayoutHandle() );
19 
20  /// retrieve the table definition of corresponding dbf file
21  static ShapeTableDefinitionHandle getTableDefinition(const char *file);
22 
23 protected:
24  virtual ~IImportShape() {}
25 
26 public:
27  /// \brief set a mapping between dbf attributes and an add info layout for importing the attribute information as well
28  /** This is optional import definition must be set before the first element (and file header) is read. If nothing is set no
29  dbf attributes will be imported.
30  \param[in] layout layout that should be attached to each geometry object
31  \param[in] mapSize size of the idxMap, which has to be a corresponding C array
32  \param[in] idxMap C array mapping the dbf attribute index (first value of std::pair) to the add info layout index (second value of std::pair)
33  */
34  virtual void setAttributeMapping(AddInfoLayoutHandle layout, unsigned mapSize, std::pair<unsigned, unsigned> *idxMap) = 0;
35 
36  /// \brief set a mapping between dbf attributes and an add info layout for importing the attribute information as well
37  /** This is optional import definition must be set before the first element (and file header) is read. If nothing is set no
38  dbf attributes will be imported.
39  \param[in] layout layout that should be attached to each geometry object
40  \param[in] mapSize size of the idxMap, which has to be a corresponding C array
41  \param[in] idxMap C array mapping the dbf attribute name (first value of std::pair) to the add info layout index (second value of std::pair)
42  */
43  virtual void setAttributeMapping(AddInfoLayoutHandle layout, unsigned mapSize, std::pair<const char*, unsigned> *idxMap) = 0;
44 
45  /// \brief set a translation map between a dbf attribute and the scop semantic
46  /** This is optional import definition must be set before the first element (and file header) is read.
47  \param[in] columnIdx index of the dbf attribute to be used
48  \param[in] mapSize size of the idxMap, which has to be a corresponding C array
49  \param[in] translationMap C array mapping string values (first value of std::pair) to the scop semantic (second value of std::pair)
50  */
51  virtual void setSemanticTranslation(unsigned columnIdx, unsigned mapSize, std::pair<const char*, int> *translationMap ) = 0;
52 
53  /// \brief set a translation map between a dbf attribute and the scop semantic
54  /** This is optional import definition must be set before the first element (and file header) is read.
55  \param[in] columnName dbf attribute name to be used
56  \param[in] mapSize size of the idxMap, which has to be a corresponding C array
57  \param[in] translationMap C array mapping string values (first value of std::pair) to the scop semantic (second value of std::pair)
58  */
59  virtual void setSemanticTranslation(const char* columnName, unsigned mapSize, std::pair<const char*, int> *translationMap ) = 0;
60 
61 };
62 
64 
65 DM_NAMESPACE_END
base class for importing original geometry data file
Definition: M/c++_api/inc/DM/IO/IImport.hpp:45
Specific import class for handling shape file imports.
Definition: IImportShape.hpp:14
Definition: Handle.hpp:427
static IImport * New(const char *file, DataFormat format, FilterHandle filter=FilterHandle(), ControlObjectHandle control=ControlObjectHandle(), bool collectHdrContents=false, unsigned maxBulkPoints=1000, AddInfoLayoutHandle defaultLayout=AddInfoLayoutHandle())
creates new import object