Ocean
FieldTyper.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_SCENEDESCRIPTION_FIELD_TYPER_H
9 #define META_OCEAN_SCENEDESCRIPTION_FIELD_TYPER_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace SceneDescription
18 {
19 
20 /**
21  * Class providing mapping between scalar field types and real types.
22  * @ingroup scenedescription
23  */
24 template <typename T>
26 {
27  public:
28 
29  /**
30  * Returns the scalar field type for this mapper object.
31  * @return Scalar field type
32  */
33  static constexpr Field::Type type();
34 };
35 
36 template <typename T>
38 {
39  return Field::TYPE_INVALID;
40 }
41 
42 /**
43  * Template specialization of TypeMapper::type().
44  * @see TypeMapper::type().
45  */
46 template <>
48 {
49  return Field::TYPE_BOOLEAN;
50 }
51 
52 /**
53  * Template specialization of TypeMapper::type().
54  * @see TypeMapper::type().
55  */
56 template <>
58 {
59  return Field::TYPE_COLOR;
60 }
61 
62 /**
63  * Template specialization of TypeMapper::type().
64  * @see TypeMapper::type().
65  */
66 template <>
68 {
69  return Field::TYPE_FLOAT;
70 }
71 
72 /**
73  * Template specialization of TypeMapper::type().
74  * @see TypeMapper::type().
75  */
76 template <>
78 {
79  return Field::TYPE_INT;
80 }
81 
82 /**
83  * Template specialization of TypeMapper::type().
84  * @see TypeMapper::type().
85  */
86 template <>
88 {
89  return Field::TYPE_MATRIX3;
90 }
91 
92 /**
93  * Template specialization of TypeMapper::type().
94  * @see TypeMapper::type().
95  */
96 template <>
98 {
99  return Field::TYPE_MATRIX4;
100 }
101 
102 /**
103  * Template specialization of TypeMapper::type().
104  * @see TypeMapper::type().
105  */
106 template <>
108 {
109  return Field::TYPE_NODE;
110 }
111 
112 /**
113  * Template specialization of TypeMapper::type().
114  * @see TypeMapper::type().
115  */
116 template <>
118 {
119  return Field::TYPE_ROTATION;
120 }
121 
122 /**
123  * Template specialization of TypeMapper::type().
124  * @see TypeMapper::type().
125  */
126 template <>
128 {
129  return Field::TYPE_STRING;
130 }
131 
132 /**
133  * Template specialization of TypeMapper::type().
134  * @see TypeMapper::type().
135  */
136 template <>
138 {
139  return Field::TYPE_TIME;
140 }
141 
142 /**
143  * Template specialization of TypeMapper::type().
144  * @see TypeMapper::type().
145  */
146 template <>
148 {
149  return Field::TYPE_VECTOR2;
150 }
151 
152 /**
153  * Template specialization of TypeMapper::type().
154  * @see TypeMapper::type().
155  */
156 template <>
158 {
159  return Field::TYPE_VECTOR3;
160 }
161 
162 /**
163  * Template specialization of TypeMapper::type().
164  * @see TypeMapper::type().
165  */
166 template <>
168 {
169  return Field::TYPE_VECTOR4;
170 }
171 
172 }
173 
174 }
175 
176 #endif // META_OCEAN_SCENEDESCRIPTION_FIELD_TYPER_H
Type
Definition of scalar field types.
Definition: Field.h:43
@ TYPE_MATRIX3
Field with a 3x3 matrix as value.
Definition: Field.h:55
@ TYPE_ROTATION
Field with a rotation value.
Definition: Field.h:61
@ TYPE_VECTOR3
Field with a 3D vector as value.
Definition: Field.h:69
@ TYPE_MATRIX4
Field with a 4x4 matrix as value.
Definition: Field.h:57
@ TYPE_INT
Field with an integer value.
Definition: Field.h:53
@ TYPE_INVALID
Invalid field type.
Definition: Field.h:45
@ TYPE_BOOLEAN
Field with a boolean value.
Definition: Field.h:47
@ TYPE_COLOR
Field with a color value.
Definition: Field.h:49
@ TYPE_VECTOR2
Field with a 2D vector as value.
Definition: Field.h:67
@ TYPE_NODE
Field with a node as value.
Definition: Field.h:59
@ TYPE_VECTOR4
Field with a 4D vector as value.
Definition: Field.h:71
@ TYPE_FLOAT
Field with a float value.
Definition: Field.h:51
@ TYPE_TIME
Field with a time value.
Definition: Field.h:65
@ TYPE_STRING
Field with a string value.
Definition: Field.h:63
Class providing mapping between scalar field types and real types.
Definition: FieldTyper.h:26
static constexpr Field::Type type()
Returns the scalar field type for this mapper object.
Definition: FieldTyper.h:37
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15