Ocean
|
This class is the base class for all scene description fields. More...
Public Types | |
enum | Type : uint32_t { TYPE_INVALID = 0u , TYPE_BOOLEAN , TYPE_COLOR , TYPE_FLOAT , TYPE_INT , TYPE_MATRIX3 , TYPE_MATRIX4 , TYPE_NODE , TYPE_ROTATION , TYPE_STRING , TYPE_TIME , TYPE_VECTOR2 , TYPE_VECTOR3 , TYPE_VECTOR4 } |
Definition of scalar field types. More... | |
Public Member Functions | |
virtual | ~Field () |
Destructs a field object. More... | |
Timestamp | timestamp () const |
Returns the most recent field modification timestamp. More... | |
virtual Type | type () const =0 |
Returns the type of this field. More... | |
virtual unsigned int | dimension () const =0 |
Returns the dimension of this field. More... | |
bool | is0D () const |
Returns whether this field is a 0D field. More... | |
bool | is1D () const |
Returns whether this field is a 1D field. More... | |
bool | isType (const Type type) const |
Returns whether this field has a given type. More... | |
bool | isType (const Type type, const unsigned int dimension) const |
Returns whether this field has a given type and dimension. More... | |
void | setTimestamp (const Timestamp timestamp) |
Sets the field timestamp explicitly. More... | |
virtual Field * | copy () const =0 |
Returns a new instance of this field. More... | |
virtual bool | assign (const Field &field)=0 |
Assigns a field to this field if both field have the identical field type. More... | |
Field & | operator= (const Field &field) |
Assigns a field to this field. More... | |
Static Public Member Functions | |
template<typename T > | |
static const T & | cast (const Field &field) |
Casts an unspecific field object to the real field object. More... | |
Protected Member Functions | |
Field ()=default | |
Creates a new field. More... | |
Field (const Field &field)=delete | |
Disabled copy constructor. More... | |
Field (const Timestamp timestamp) | |
Creates a new field with an explicit modification timestamp. More... | |
Protected Attributes | |
Timestamp | timestamp_ |
Field timestamp. More... | |
This class is the base class for all scene description fields.
enum Ocean::SceneDescription::Field::Type : uint32_t |
Definition of scalar field types.
Enumerator | |
---|---|
TYPE_INVALID | Invalid field type. |
TYPE_BOOLEAN | Field with a boolean value. |
TYPE_COLOR | Field with a color value. |
TYPE_FLOAT | Field with a float value. |
TYPE_INT | Field with an integer value. |
TYPE_MATRIX3 | Field with a 3x3 matrix as value. |
TYPE_MATRIX4 | Field with a 4x4 matrix as value. |
TYPE_NODE | Field with a node as value. |
TYPE_ROTATION | Field with a rotation value. |
TYPE_STRING | Field with a string value. |
TYPE_TIME | Field with a time value. |
TYPE_VECTOR2 | Field with a 2D vector as value. |
TYPE_VECTOR3 | Field with a 3D vector as value. |
TYPE_VECTOR4 | Field with a 4D vector as value. |
|
inlinevirtual |
Destructs a field object.
|
protecteddefault |
Creates a new field.
The field timestamp will be set to invalid.
|
protecteddelete |
Disabled copy constructor.
field | Object which would be copied |
|
inlineexplicitprotected |
Creates a new field with an explicit modification timestamp.
timestamp | Explicit field timestamp |
|
pure virtual |
Assigns a field to this field if both field have the identical field type.
field | Field to assign the value from |
Implemented in Ocean::SceneDescription::Field1D< T >, Ocean::SceneDescription::Field1D< Scalar >, Ocean::SceneDescription::Field1D< std::string >, Ocean::SceneDescription::Field1D< Vector2 >, Ocean::SceneDescription::Field1D< int >, Ocean::SceneDescription::Field1D< Vector3 >, Ocean::SceneDescription::Field1D< RGBAColor >, Ocean::SceneDescription::Field1D< NodeRef >, Ocean::SceneDescription::Field1D< Rotation >, Ocean::SceneDescription::Field0D< T >, Ocean::SceneDescription::Field0D< Timestamp >, Ocean::SceneDescription::Field0D< Scalar >, Ocean::SceneDescription::Field0D< std::string >, Ocean::SceneDescription::Field0D< int >, Ocean::SceneDescription::Field0D< Vector2 >, Ocean::SceneDescription::Field0D< Vector3 >, Ocean::SceneDescription::Field0D< RGBAColor >, Ocean::SceneDescription::Field0D< bool >, Ocean::SceneDescription::Field0D< NodeRef >, and Ocean::SceneDescription::Field0D< Rotation >.
|
static |
Casts an unspecific field object to the real field object.
field | Unspecific field object |
|
pure virtual |
Returns a new instance of this field.
Implemented in Ocean::SceneDescription::Field1D< T >, Ocean::SceneDescription::Field1D< Scalar >, Ocean::SceneDescription::Field1D< std::string >, Ocean::SceneDescription::Field1D< Vector2 >, Ocean::SceneDescription::Field1D< int >, Ocean::SceneDescription::Field1D< Vector3 >, Ocean::SceneDescription::Field1D< RGBAColor >, Ocean::SceneDescription::Field1D< NodeRef >, Ocean::SceneDescription::Field1D< Rotation >, Ocean::SceneDescription::Field0D< T >, Ocean::SceneDescription::Field0D< Timestamp >, Ocean::SceneDescription::Field0D< Scalar >, Ocean::SceneDescription::Field0D< std::string >, Ocean::SceneDescription::Field0D< int >, Ocean::SceneDescription::Field0D< Vector2 >, Ocean::SceneDescription::Field0D< Vector3 >, Ocean::SceneDescription::Field0D< RGBAColor >, Ocean::SceneDescription::Field0D< bool >, Ocean::SceneDescription::Field0D< NodeRef >, and Ocean::SceneDescription::Field0D< Rotation >.
|
pure virtual |
Returns the dimension of this field.
Implemented in Ocean::SceneDescription::Field1D< T >, Ocean::SceneDescription::Field1D< Scalar >, Ocean::SceneDescription::Field1D< std::string >, Ocean::SceneDescription::Field1D< Vector2 >, Ocean::SceneDescription::Field1D< int >, Ocean::SceneDescription::Field1D< Vector3 >, Ocean::SceneDescription::Field1D< RGBAColor >, Ocean::SceneDescription::Field1D< NodeRef >, Ocean::SceneDescription::Field1D< Rotation >, Ocean::SceneDescription::Field0D< T >, Ocean::SceneDescription::Field0D< Timestamp >, Ocean::SceneDescription::Field0D< Scalar >, Ocean::SceneDescription::Field0D< std::string >, Ocean::SceneDescription::Field0D< int >, Ocean::SceneDescription::Field0D< Vector2 >, Ocean::SceneDescription::Field0D< Vector3 >, Ocean::SceneDescription::Field0D< RGBAColor >, Ocean::SceneDescription::Field0D< bool >, Ocean::SceneDescription::Field0D< NodeRef >, and Ocean::SceneDescription::Field0D< Rotation >.
|
inline |
Returns whether this field is a 0D field.
|
inline |
Returns whether this field is a 1D field.
|
inline |
Returns whether this field has a given type.
type | Type to check |
|
inline |
Returns whether this field has a given type and dimension.
type | Type to check |
dimension | Dimension to check |
Assigns a field to this field.
The field value and field timestamp is copied only if the field types are identical.
field | Field to assign |
|
inline |
Sets the field timestamp explicitly.
timestamp | Field timestamp to set |
|
inline |
Returns the most recent field modification timestamp.
|
pure virtual |
Returns the type of this field.
Implemented in Ocean::SceneDescription::Field1D< T >, Ocean::SceneDescription::Field1D< Scalar >, Ocean::SceneDescription::Field1D< std::string >, Ocean::SceneDescription::Field1D< Vector2 >, Ocean::SceneDescription::Field1D< int >, Ocean::SceneDescription::Field1D< Vector3 >, Ocean::SceneDescription::Field1D< RGBAColor >, Ocean::SceneDescription::Field1D< NodeRef >, Ocean::SceneDescription::Field1D< Rotation >, Ocean::SceneDescription::Field0D< T >, Ocean::SceneDescription::Field0D< Timestamp >, Ocean::SceneDescription::Field0D< Scalar >, Ocean::SceneDescription::Field0D< std::string >, Ocean::SceneDescription::Field0D< int >, Ocean::SceneDescription::Field0D< Vector2 >, Ocean::SceneDescription::Field0D< Vector3 >, Ocean::SceneDescription::Field0D< RGBAColor >, Ocean::SceneDescription::Field0D< bool >, Ocean::SceneDescription::Field0D< NodeRef >, and Ocean::SceneDescription::Field0D< Rotation >.