8 #ifndef META_OCEAN_SCENEDESCRIPTION_FIELD_H
9 #define META_OCEAN_SCENEDESCRIPTION_FIELD_H
28 namespace SceneDescription
35 class OCEAN_SCENEDESCRIPTION_EXPORT
Field
79 inline virtual ~
Field();
103 inline bool is0D()
const;
109 inline bool is1D()
const;
116 inline bool isType(
const Type type)
const;
124 inline bool isType(
const Type type,
const unsigned int dimension)
const;
130 inline void setTimestamp(
const Timestamp timestamp);
137 template <
typename T>
static const T& cast(
const Field& field);
187 timestamp_(timestamp)
214 return type() == checkType;
227 template <
typename T>
230 ocean_assert(field.
isType(T::fieldType, T::fieldDimension));
232 return dynamic_cast<const T&
>(field);
This class is the base class for all scene description fields.
Definition: Field.h:36
Timestamp timestamp_
Field timestamp.
Definition: Field.h:183
Timestamp timestamp() const
Returns the most recent field modification timestamp.
Definition: Field.h:197
virtual Field * copy() const =0
Returns a new instance of this field.
bool is0D() const
Returns whether this field is a 0D field.
Definition: Field.h:202
virtual bool assign(const Field &field)=0
Assigns a field to this field if both field have the identical field type.
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_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_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
void setTimestamp(const Timestamp timestamp)
Sets the field timestamp explicitly.
Definition: Field.h:222
bool is1D() const
Returns whether this field is a 1D field.
Definition: Field.h:207
bool isType(const Type type) const
Returns whether this field has a given type.
Definition: Field.h:212
Field(const Field &field)=delete
Disabled copy constructor.
virtual Type type() const =0
Returns the type of this field.
Field()=default
Creates a new field.
virtual ~Field()
Destructs a field object.
Definition: Field.h:192
Field & operator=(const Field &field)
Assigns a field to this field.
Definition: Field.h:235
virtual unsigned int dimension() const =0
Returns the dimension of this field.
static const T & cast(const Field &field)
Casts an unspecific field object to the real field object.
Definition: Field.h:228
This class implements a timestamp.
Definition: Timestamp.h:36
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15