#define __DALI_INTERNAL_SCENE_GRAPH_INHERITED_PROPERTY_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/object/property.h>
#include <dali/public-api/object/property-input.h>
#include <dali/public-api/object/property-types.h>
+#include <dali/public-api/math/math-utils.h> // Clamp
namespace Dali
{
/**
* @copydoc Dali::SceneGraph::PropertyInterface::Get()
*/
- Vector3& Get(size_t bufferIndex)
+ Vector3& Get( BufferIndex bufferIndex )
{
return mValue[bufferIndex];
}
/**
* @copydoc Dali::SceneGraph::PropertyInterface::Get()
*/
- const Vector3& Get(size_t bufferIndex) const
+ const Vector3& Get( BufferIndex bufferIndex ) const
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to read.
* @return The property value.
*/
- const Vector3& operator[](size_t bufferIndex) const
+ const Vector3& operator[]( BufferIndex bufferIndex ) const
{
return mValue[bufferIndex];
}
/**
* @copydoc Dali::SceneGraph::PropertyInterface::Get()
*/
- Vector4& Get(size_t bufferIndex)
+ Vector4& Get( BufferIndex bufferIndex )
{
return mValue[bufferIndex];
}
/**
* @copydoc Dali::SceneGraph::PropertyInterface::Get()
*/
- const Vector4& Get(size_t bufferIndex) const
+ const Vector4& Get( BufferIndex bufferIndex ) const
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to read.
* @return The property value.
*/
- const Vector4& operator[](size_t bufferIndex) const
+ const Vector4& operator[]( BufferIndex bufferIndex ) const
{
return mValue[bufferIndex];
}
bool mInheritedFlag :1; ///< Flag whether the value has ever been inherited
bool mReinheritedFlag :1; ///< Flag whether value was re-inherited in previous frame
-
};
/**
/**
* @copydoc Dali::SceneGraph::PropertyInterface::Get()
*/
- Quaternion& Get(size_t bufferIndex)
+ Quaternion& Get( BufferIndex bufferIndex )
{
return mValue[bufferIndex];
}
/**
* @copydoc Dali::SceneGraph::PropertyInterface::Get()
*/
- const Quaternion& Get(size_t bufferIndex) const
+ const Quaternion& Get( BufferIndex bufferIndex ) const
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to read.
* @return The property value.
*/
- const Quaternion& operator[](size_t bufferIndex) const
+ const Quaternion& operator[]( BufferIndex bufferIndex ) const
{
return mValue[bufferIndex];
}
}
/**
- * @copydoc Dali::PropertyInput::GetQuaternion()
- */
- virtual const Quaternion& GetQuaternion() const
- {
- DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
- return DUMMY_QUATERNION_VALUE;
- }
-
- /**
- * @copydoc Dali::PropertyInput::GetQuaternion()
- */
- virtual const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const
- {
- DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
- return DUMMY_QUATERNION_VALUE;
- }
-
- /**
* Set the property value. This will only persist for the current frame; the property
* will be reset with the base value, at the beginning of the next frame.
* @param[in] bufferIndex The buffer to write.
/**
* @copydoc Dali::SceneGraph::PropertyInterface::Get()
*/
- Matrix& Get(size_t bufferIndex)
+ Matrix& Get( BufferIndex bufferIndex )
{
return mValue[bufferIndex];
}
/**
* @copydoc Dali::SceneGraph::PropertyInterface::Get()
*/
- const Matrix& Get(size_t bufferIndex) const
+ const Matrix& Get( BufferIndex bufferIndex ) const
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to read.
* @return The property value.
*/
- const Matrix& operator[](size_t bufferIndex) const
+ const Matrix& operator[]( BufferIndex bufferIndex ) const
{
return mValue[bufferIndex];
}
- void SetDirty(size_t bufferIndex)
+ void SetDirty( BufferIndex bufferIndex )
{
mReinheritedFlag = true;