IAddInfoLayout.hpp
1 #pragma once
2 
3 #include "DM/config.hpp"
4 #include "DM/ColumnTypes.hpp"
5 #include "DM/Handle.hpp"
6 #include "DM/ObjectBase.hpp"
7 #include "DM/AutoLink.hpp" //enable autolink
8 
9 //boost
10 #include <boost/any.hpp>
11 
12 DM_NAMESPACE_BEGIN
13 
14 /// \brief AddInfo layouts describe a set of attributes that can be attached to geometry objects
15 /**
16  Managing attributes, layout and views is a core feature of the DM library. Please refer to the
17  \ref dm_attributes section for implementation concepts and to the <a href="examples.html">examples</a>
18  section (attribute handling) for further details.
19 */
20 class DM_API IAddInfoLayout : public ObjectBase
21 {
22 public:
23  /// returns the predefined column name for a specific semantic.
24  static const char* getColumnName(ColumnSemantic semantic);
25  /// returns the column type of a predefined semantic
26  static ColumnType getColumnType(ColumnSemantic semantic);
27 
28  /// find the semantic enumerator based on a given colum name
29  /// \return corresponding enumerator of ColumnSemantic::null if the given name isn't a predefined colum name
30  static ColumnSemantic getColumnSemantic(const char* name, bool caseSensitive = true);
31  /// find the type of a predefined column based on a given colum name
32  /// \return corresponding enumerator of ColumnType::count if the given name isn't a predefined colum name
33  static ColumnType getColumnType(const char* name, bool caseSensitive = true);
34 
35 
36 protected:
37  virtual ~IAddInfoLayout() {}
38 
39 public:
40  virtual unsigned columns() const = 0;
41 
42  virtual const char* name(unsigned index) const = 0;
43  virtual ColumnType type(unsigned index) const = 0;
44  virtual ColumnSemantic semantic(unsigned index) const = 0;
45  virtual unsigned size(unsigned index) const = 0; ///< returns array size
46 
47  virtual int index(const char*) const = 0;
48  virtual int index(ColumnSemantic) const = 0;
49 };
50 
52 
53 DM_NAMESPACE_END
ColumnSemantic
Pre-defined attributes (attributes with semantic)
Definition: ColumnTypes.hpp:38
AddInfo layouts describe a set of attributes that can be attached to geometry objects.
Definition: IAddInfoLayout.hpp:20
Definition: Handle.hpp:454
ColumnType
Supported attribute type.
Definition: ColumnTypes.hpp:8
Definition: M/c++_api/inc/DM/ObjectBase.hpp:8