IImportRDB.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 
10 DM_NAMESPACE_BEGIN
11 
12 /// Specific import class for handling shape file imports
13 class DM_API IImportRDB : public virtual IImport
14 {
15 public:
16  enum struct CoordSystem {
17  proj, ///< application/project coordinate system (cartesian coordinates) -> default
18  scs, ///< sensor coordinate system
19  ecef, ///< earth-centered earth-fixed coordinate system (cartesian coordinates)
20  map, ///< map coordinate system (not necessarily available)
21  default_ = proj
22  };
23 
24  enum struct StorageClass
25  {
26  constant = 1, ///< value cannot be changed
27  variable = 2, ///< value can change from time to time
28  dynamic = 3 ///< value is likely to be changed often
29  };
30 
31  enum struct CompressionOptions
32  {
33  default_ = 0, ///< nothing special, just use default compression algorithm
34  delta = 1, ///< calculate differences between two consecutive values
35  shuffle = 2, ///< shuffle bytes of point attribute values
36  delta_shuffle = 3 ///< calculate differences and shuffle bytes
37  };
38 
39  struct Attribute {
40  char name[64]; ///< unique attribute name (for queries) \see details of class PointAttribute
41  char title[64]; ///< attribute title (for display)
42  char description[255]; ///< attribute description (for display)
43  char unitSymbol[16]; ///< physical unit symbol (e.g. "m", "rad", "K")
44  uint32_t length; ///< number of dimensions/elements (1: scalar, >1: vector, e.g. 3 for point coordinates)
45  double resolution; ///< expected value resolution
46  double minimumValue; ///< theoretical minimum value
47  double maximumValue; ///< theoretical maximum value
48  double defaultValue; ///< default value (minimum <= default <= maximum)
49  double invalidValue; ///< invalid value (minimum <= invalid <= maximum, use "not-a-number" if there is no invalid value)
50  ColumnType dataType; ///< data type
51  StorageClass storageClass; ///< storage class \see enum StorageClass
52  CompressionOptions compressionOptions; ///< options additional to default compression
53  };
54 
55  static IImportRDB* New( const char *file, CoordSystem coordsys = CoordSystem::default_,
57  bool collectHdrContents = false, unsigned maxBulkPoints = 1000, AddInfoLayoutHandle defaultLayout = AddInfoLayoutHandle() );
58 
59 protected:
60  virtual ~IImportRDB() {}
61 
62 public:
63  /// get number of attribute (available after header was read)
64  virtual unsigned getAttributeCount() const = 0;
65  /// get corresponding attribute record (available after header was read)
66  virtual void getAttribute(unsigned idx, Attribute &attr) const = 0;
67 
68  /// Specify a predefined NG-attribute by its enum. The rdb attribute's type will be converted to that of the predefined attribute
69  virtual void importAttribute(int rdbAttrIndex, int arrayIdx = 0, ColumnSemantic ngCol = ColumnSemantic::null) = 0;
70  /// Specify the NG-attribute by name. By default, use the name and type of the rdb attribute
71  virtual void importAttribute(int rdbAttrIndex, int arrayIdx = 0, const char* ngName = 0, ColumnType ngType = ColumnType::count) = 0;
72 };
73 
74 typedef Handle<IImportRDB> ImportRDBHandle;
75 
76 DM_NAMESPACE_END
uint32_t length
number of dimensions/elements (1: scalar, >1: vector, e.g. 3 for point coordinates)
Definition: IImportRDB.hpp:44
CoordSystem
Definition: IImportRDB.hpp:16
ColumnType dataType
data type
Definition: IImportRDB.hpp:50
ColumnSemantic
Pre-defined attributes (attributes with semantic)
Definition: ColumnTypes.hpp:38
CompressionOptions compressionOptions
options additional to default compression
Definition: IImportRDB.hpp:52
StorageClass
Definition: IImportRDB.hpp:24
base class for importing original geometry data file
Definition: M/c++_api/inc/DM/IO/IImport.hpp:45
StorageClass storageClass
storage class
Definition: IImportRDB.hpp:51
Specific import class for handling shape file imports.
Definition: IImportRDB.hpp:13
Definition: Handle.hpp:427
CompressionOptions
Definition: IImportRDB.hpp:31
double defaultValue
default value (minimum <= default <= maximum)
Definition: IImportRDB.hpp:48
ColumnType
Supported attribute type.
Definition: ColumnTypes.hpp:8
Definition: IImportRDB.hpp:39
double resolution
expected value resolution
Definition: IImportRDB.hpp:45
double maximumValue
theoretical maximum value
Definition: IImportRDB.hpp:47
double invalidValue
invalid value (minimum <= invalid <= maximum, use "not-a-number" if there is no invalid value)
Definition: IImportRDB.hpp:49
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
double minimumValue
theoretical minimum value
Definition: IImportRDB.hpp:46