projects
/
platform
/
core
/
uifw
/
dali-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "[dali-core] add libhyphen-dev library to dali-env" into devel/master
[platform/core/uifw/dali-core.git]
/
dali
/
internal
/
update
/
manager
/
transform-manager-property.h
diff --git
a/dali/internal/update/manager/transform-manager-property.h
b/dali/internal/update/manager/transform-manager-property.h
index
800a65a
..
609cac7
100644
(file)
--- a/
dali/internal/update/manager/transform-manager-property.h
+++ b/
dali/internal/update/manager/transform-manager-property.h
@@
-2,7
+2,7
@@
#define TRANSFORM_MANAGER_PROPERTY_H_
/*
#define TRANSFORM_MANAGER_PROPERTY_H_
/*
- * Copyright (c) 20
18
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
20
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-35,14
+35,14
@@
struct TransformManagerPropertyHandler : public AnimatablePropertyBase
* Constructor
*/
TransformManagerPropertyHandler()
* Constructor
*/
TransformManagerPropertyHandler()
- :mTxManager(
0
),
+ :mTxManager(
nullptr
),
mId( INVALID_TRANSFORM_ID )
{}
/**
* @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
*/
mId( INVALID_TRANSFORM_ID )
{}
/**
* @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
*/
-
virtual Dali::Property::Type GetType() const
= 0;
+
Dali::Property::Type GetType() const override
= 0;
/**
* @copydoc Dali::SceneGraph::AnimatableProperty::Get()
/**
* @copydoc Dali::SceneGraph::AnimatableProperty::Get()
@@
-57,13
+57,19
@@
struct TransformManagerPropertyHandler : public AnimatablePropertyBase
/**
* @copydoc Dali::PropertyInput::GetVector3()
*/
/**
* @copydoc Dali::PropertyInput::GetVector3()
*/
-
virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
{ return Vector3::ZERO; }
+
const Vector3& GetVector3( BufferIndex bufferIndex ) const override
{ return Vector3::ZERO; }
/**
* Retrieve a component of property
* @param[in] component The component of the property
*/
/**
* Retrieve a component of property
* @param[in] component The component of the property
*/
- virtual const float& GetFloatComponent(uint32_t component)=0;
+ virtual const float& GetFloatComponent(uint32_t component) const
+ {
+ DALI_ASSERT_DEBUG( 0 && "Invalid call");
+
+ static const float value = 0.0f;
+ return value;
+ }
/**
* Set the property value. This will only persist for the current frame; the property
/**
* Set the property value. This will only persist for the current frame; the property
@@
-120,12
+126,12
@@
struct TransformManagerPropertyHandler : public AnimatablePropertyBase
/**
* @copydoc Dali::AnimatableProperty::ResetToBaseValue()
*/
/**
* @copydoc Dali::AnimatableProperty::ResetToBaseValue()
*/
- v
irtual void ResetToBaseValue(BufferIndex updateBufferIndex)
{}
+ v
oid ResetToBaseValue(BufferIndex updateBufferIndex) override
{}
/**
* @copydoc Dali::AnimatableProperty::IsClean()
*/
/**
* @copydoc Dali::AnimatableProperty::IsClean()
*/
-
virtual bool IsClean() const
{ return false; }
+
bool IsClean() const override
{ return false; }
/**
* Initializes the property
/**
* Initializes the property
@@
-141,7
+147,7
@@
struct TransformManagerPropertyHandler : public AnimatablePropertyBase
/**
* @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
*/
/**
* @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
*/
- virtual bool IsTransformManagerProperty() const
+ bool IsTransformManagerProperty() const override
{
return true;
}
{
return true;
}
@@
-158,32
+164,34
@@
struct TransformManagerPropertyVector3 : public TransformManagerPropertyHandler<
mProperty( property )
{}
mProperty( property )
{}
- Dali::Property::Type GetType() const
+ Dali::Property::Type GetType() const
override
{
return Dali::PropertyTypes::Get<Vector3>();
}
{
return Dali::PropertyTypes::Get<Vector3>();
}
- Vector3& Get( BufferIndex bufferIndex )
+ Vector3& Get( BufferIndex bufferIndex )
override
{
return mTxManager->GetVector3PropertyValue( mId, mProperty );
}
{
return mTxManager->GetVector3PropertyValue( mId, mProperty );
}
- const Vector3& Get( BufferIndex bufferIndex ) const
+ const Vector3& Get( BufferIndex bufferIndex ) const
override
{
{
- return mTxManager->GetVector3PropertyValue( mId, mProperty );
+ const TransformManager* txManager = mTxManager;
+ return txManager->GetVector3PropertyValue( mId, mProperty );
}
}
- virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
+ const Vector3& GetVector3( BufferIndex bufferIndex ) const override
{
return Get(bufferIndex);
}
{
return Get(bufferIndex);
}
- const float& GetFloatComponent( uint32_t component )
+ const float& GetFloatComponent( uint32_t component )
const override
{
{
- return mTxManager->GetVector3PropertyComponentValue( mId, mProperty, component );
+ const TransformManager* txManager = mTxManager;
+ return txManager->GetVector3PropertyComponentValue( mId, mProperty, component );
}
}
- void Set(BufferIndex bufferIndex, const Vector3& value)
+ void Set(BufferIndex bufferIndex, const Vector3& value)
override
{
mTxManager->SetVector3PropertyValue( mId, mProperty, value );
}
{
mTxManager->SetVector3PropertyValue( mId, mProperty, value );
}
@@
-198,42
+206,42
@@
struct TransformManagerPropertyVector3 : public TransformManagerPropertyHandler<
mTxManager->BakeVector3PropertyComponentValue( mId, mProperty, value, component);
}
mTxManager->BakeVector3PropertyComponentValue( mId, mProperty, value, component);
}
- void Bake(BufferIndex bufferIndex, const Vector3& value)
+ void Bake(BufferIndex bufferIndex, const Vector3& value)
override
{
mTxManager->BakeVector3PropertyValue(mId, mProperty, value );
}
{
mTxManager->BakeVector3PropertyValue(mId, mProperty, value );
}
- void BakeX(BufferIndex bufferIndex, float value)
+ void BakeX(BufferIndex bufferIndex, float value)
override
{
mTxManager->BakeXVector3PropertyValue(mId, mProperty, value );
}
{
mTxManager->BakeXVector3PropertyValue(mId, mProperty, value );
}
- void BakeY(BufferIndex bufferIndex, float value)
+ void BakeY(BufferIndex bufferIndex, float value)
override
{
mTxManager->BakeYVector3PropertyValue(mId, mProperty, value );
}
{
mTxManager->BakeYVector3PropertyValue(mId, mProperty, value );
}
- void BakeZ(BufferIndex bufferIndex, float value)
+ void BakeZ(BufferIndex bufferIndex, float value)
override
{
mTxManager->BakeZVector3PropertyValue(mId, mProperty, value );
}
{
mTxManager->BakeZVector3PropertyValue(mId, mProperty, value );
}
- void SetFloatComponent( float value, uint32_t component)
+ void SetFloatComponent( float value, uint32_t component)
override
{
mTxManager->SetVector3PropertyComponentValue( mId, mProperty, value, component);
}
{
mTxManager->SetVector3PropertyComponentValue( mId, mProperty, value, component);
}
- void BakeFloatComponent( float value, uint32_t component )
+ void BakeFloatComponent( float value, uint32_t component )
override
{
mTxManager->BakeVector3PropertyComponentValue( mId, mProperty, value, component);
}
{
mTxManager->BakeVector3PropertyComponentValue( mId, mProperty, value, component);
}
- void BakeRelative(BufferIndex bufferIndex, const Vector3& value)
+ void BakeRelative(BufferIndex bufferIndex, const Vector3& value)
override
{
mTxManager->BakeRelativeVector3PropertyValue(mId, mProperty, value );
}
{
mTxManager->BakeRelativeVector3PropertyValue(mId, mProperty, value );
}
- void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& value)
+ void BakeRelativeMultiply(BufferIndex bufferIndex, const Vector3& value)
override
{
mTxManager->BakeMultiplyVector3PropertyValue(mId, mProperty, value );
}
{
mTxManager->BakeMultiplyVector3PropertyValue(mId, mProperty, value );
}
@@
-249,42
+257,38
@@
public:
:TransformManagerPropertyHandler()
{}
:TransformManagerPropertyHandler()
{}
- virtual Dali::Property::Type GetType() const
+ Dali::Property::Type GetType() const override
{
return Dali::PropertyTypes::Get<Quaternion>();
}
{
return Dali::PropertyTypes::Get<Quaternion>();
}
- Quaternion& Get( BufferIndex bufferIndex )
- {
- return mTxManager->GetQuaternionPropertyValue( mId );
- }
-
- const Quaternion& Get( BufferIndex bufferIndex ) const
+ Quaternion& Get( BufferIndex bufferIndex ) override
{
return mTxManager->GetQuaternionPropertyValue( mId );
}
{
return mTxManager->GetQuaternionPropertyValue( mId );
}
- const
float& GetFloatComponent( uint32_t component)
+ const
Quaternion& Get( BufferIndex bufferIndex ) const override
{
{
- return mTxManager->GetQuaternionPropertyValue( mId ).mVector[component];
+ const TransformManager* txManager = mTxManager;
+ return txManager->GetQuaternionPropertyValue( mId );
}
}
- void Set(BufferIndex bufferIndex, const Quaternion& value)
+ void Set(BufferIndex bufferIndex, const Quaternion& value)
override
{
return mTxManager->SetQuaternionPropertyValue( mId, value );
}
{
return mTxManager->SetQuaternionPropertyValue( mId, value );
}
- void Bake(BufferIndex bufferIndex, const Quaternion& value)
+ void Bake(BufferIndex bufferIndex, const Quaternion& value)
override
{
return mTxManager->BakeQuaternionPropertyValue( mId, value );
}
{
return mTxManager->BakeQuaternionPropertyValue( mId, value );
}
- void BakeRelative(BufferIndex bufferIndex, const Quaternion& value)
+ void BakeRelative(BufferIndex bufferIndex, const Quaternion& value)
override
{
return mTxManager->BakeRelativeQuaternionPropertyValue( mId, value );
}
{
return mTxManager->BakeRelativeQuaternionPropertyValue( mId, value );
}
- virtual const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const
+ const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const override
{
return Get(bufferIndex);
}
{
return Get(bufferIndex);
}
@@
-302,7
+306,7
@@
public:
* Create an TransformManagerVector3Input
*/
TransformManagerVector3Input( TransformManagerProperty property, const Vector3& initialValue )
* Create an TransformManagerVector3Input
*/
TransformManagerVector3Input( TransformManagerProperty property, const Vector3& initialValue )
- :mTxManager(
0
),
+ :mTxManager(
nullptr
),
mId(INVALID_TRANSFORM_ID),
mProperty(property),
mValue(initialValue)
mId(INVALID_TRANSFORM_ID),
mProperty(property),
mValue(initialValue)
@@
-311,14
+315,12
@@
public:
/**
* Virtual destructor.
*/
/**
* Virtual destructor.
*/
- virtual ~TransformManagerVector3Input()
- {
- }
+ ~TransformManagerVector3Input() override = default;
/**
* @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
*/
/**
* @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
*/
- virtual Dali::Property::Type GetType() const
+ Dali::Property::Type GetType() const override
{
return Dali::PropertyTypes::Get<Vector3>();
}
{
return Dali::PropertyTypes::Get<Vector3>();
}
@@
-334,7
+336,7
@@
public:
/**
* @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
*/
/**
* @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
*/
- virtual bool InputInitialized() const
+ bool InputInitialized() const override
{
return true;
}
{
return true;
}
@@
-343,7
+345,7
@@
public:
* @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
* @note A constraint can only receive the inherited property from the previous frame.
*/
* @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
* @note A constraint can only receive the inherited property from the previous frame.
*/
- virtual bool InputChanged() const
+ bool InputChanged() const override
{
return true;
}
{
return true;
}
@@
-354,9
+356,10
@@
public:
*/
void ComputeTransformComponent() const
{
*/
void ComputeTransformComponent() const
{
- if( mTxManager )
+ const TransformManager* txManager = mTxManager;
+ if( txManager )
{
{
- const Matrix& worldMatrix =
mT
xManager->GetWorldMatrix(mId);
+ const Matrix& worldMatrix =
t
xManager->GetWorldMatrix(mId);
if( mProperty == TRANSFORM_PROPERTY_WORLD_POSITION )
{
if( mProperty == TRANSFORM_PROPERTY_WORLD_POSITION )
{
@@
-374,7
+377,7
@@
public:
/**
* @copydoc Dali::PropertyInput::GetVector3()
*/
/**
* @copydoc Dali::PropertyInput::GetVector3()
*/
- virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
+ const Vector3& GetVector3( BufferIndex bufferIndex ) const override
{
ComputeTransformComponent();
return mValue;
{
ComputeTransformComponent();
return mValue;
@@
-383,7
+386,7
@@
public:
/**
* @copydoc Dali::PropertyInput::GetConstraintInputVector3()
*/
/**
* @copydoc Dali::PropertyInput::GetConstraintInputVector3()
*/
- virtual const Vector3& GetConstraintInputVector3( BufferIndex bufferIndex ) const
+ const Vector3& GetConstraintInputVector3( BufferIndex bufferIndex ) const override
{
ComputeTransformComponent();
return mValue;
{
ComputeTransformComponent();
return mValue;
@@
-432,7
+435,7
@@
public:
/**
* @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
*/
/**
* @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
*/
- virtual bool IsTransformManagerProperty() const
+ bool IsTransformManagerProperty() const override
{
return true;
}
{
return true;
}
@@
-464,7
+467,7
@@
public:
* Constructor
*/
TransformManagerQuaternionInput()
* Constructor
*/
TransformManagerQuaternionInput()
- :mTxManager(
0
),
+ :mTxManager(
nullptr
),
mId(INVALID_TRANSFORM_ID),
mValue(1.0f,0.0f,0.0f,0.0f)
{
mId(INVALID_TRANSFORM_ID),
mValue(1.0f,0.0f,0.0f,0.0f)
{
@@
-473,14
+476,12
@@
public:
/**
* Virtual destructor.
*/
/**
* Virtual destructor.
*/
- virtual ~TransformManagerQuaternionInput()
- {
- }
+ ~TransformManagerQuaternionInput() override = default;
/**
* @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
*/
/**
* @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
*/
- virtual Dali::Property::Type GetType() const
+ Dali::Property::Type GetType() const override
{
return Dali::PropertyTypes::Get<Quaternion>();
}
{
return Dali::PropertyTypes::Get<Quaternion>();
}
@@
-496,7
+497,7
@@
public:
/**
* @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
*/
/**
* @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
*/
- virtual bool InputInitialized() const
+ bool InputInitialized() const override
{
return true;
}
{
return true;
}
@@
-505,7
+506,7
@@
public:
* @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
* @note A constraint can only receive the inherited property from the previous frame.
*/
* @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
* @note A constraint can only receive the inherited property from the previous frame.
*/
- virtual bool InputChanged() const
+ bool InputChanged() const override
{
return true;
}
{
return true;
}
@@
-516,9
+517,10
@@
public:
*/
void ComputeTransformComponent() const
{
*/
void ComputeTransformComponent() const
{
- if( mTxManager )
+ const TransformManager* txManager = mTxManager;
+ if( txManager )
{
{
- const Matrix& worldMatrix =
mT
xManager->GetWorldMatrix(mId);
+ const Matrix& worldMatrix =
t
xManager->GetWorldMatrix(mId);
Vector3 position, scale;
worldMatrix.GetTransformComponents(position, mValue, scale);
}
Vector3 position, scale;
worldMatrix.GetTransformComponents(position, mValue, scale);
}
@@
-527,7
+529,7
@@
public:
/**
* @copydoc Dali::PropertyInput::GetQuaternion()
*/
/**
* @copydoc Dali::PropertyInput::GetQuaternion()
*/
- virtual const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const
+ const Quaternion& GetQuaternion( BufferIndex bufferIndex ) const override
{
ComputeTransformComponent();
return mValue;
{
ComputeTransformComponent();
return mValue;
@@
-536,7
+538,7
@@
public:
/**
* @copydoc Dali::PropertyInput::GetConstraintInputQuaternion()
*/
/**
* @copydoc Dali::PropertyInput::GetConstraintInputQuaternion()
*/
- virtual const Quaternion& GetConstraintInputQuaternion( BufferIndex bufferIndex ) const
+ const Quaternion& GetConstraintInputQuaternion( BufferIndex bufferIndex ) const override
{
ComputeTransformComponent();
return mValue;
{
ComputeTransformComponent();
return mValue;
@@
-585,7
+587,7
@@
public:
/**
* @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
*/
/**
* @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
*/
- virtual bool IsTransformManagerProperty() const
+ bool IsTransformManagerProperty() const override
{
return true;
}
{
return true;
}
@@
-616,7
+618,7
@@
public:
* Constructor
*/
TransformManagerMatrixInput()
* Constructor
*/
TransformManagerMatrixInput()
- :mTxManager(
0
),
+ :mTxManager(
nullptr
),
mId(INVALID_TRANSFORM_ID)
{
}
mId(INVALID_TRANSFORM_ID)
{
}
@@
-624,14
+626,12
@@
public:
/**
* Virtual destructor.
*/
/**
* Virtual destructor.
*/
- virtual ~TransformManagerMatrixInput()
- {
- }
+ ~TransformManagerMatrixInput() override = default;
/**
* @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
*/
/**
* @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
*/
- virtual Dali::Property::Type GetType() const
+ Dali::Property::Type GetType() const override
{
return Dali::PropertyTypes::Get<Matrix>();
}
{
return Dali::PropertyTypes::Get<Matrix>();
}
@@
-647,7
+647,7
@@
public:
/**
* @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
*/
/**
* @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
*/
- virtual bool InputInitialized() const
+ bool InputInitialized() const override
{
return true;
}
{
return true;
}
@@
-656,7
+656,7
@@
public:
* @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
* @note A constraint can only receive the inherited property from the previous frame.
*/
* @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
* @note A constraint can only receive the inherited property from the previous frame.
*/
- virtual bool InputChanged() const
+ bool InputChanged() const override
{
return true;
}
{
return true;
}
@@
-664,11
+664,12
@@
public:
/**
* @copydoc Dali::PropertyInput::GetMatrix()
*/
/**
* @copydoc Dali::PropertyInput::GetMatrix()
*/
- virtual const Matrix& GetMatrix( BufferIndex bufferIndex ) const
+ const Matrix& GetMatrix( BufferIndex bufferIndex ) const override
{
{
- if( mTxManager )
+ const TransformManager* txManager = mTxManager;
+ if( txManager )
{
{
- return
mT
xManager->GetWorldMatrix(mId);
+ return
t
xManager->GetWorldMatrix(mId);
}
return Matrix::IDENTITY;
}
return Matrix::IDENTITY;
@@
-677,11
+678,12
@@
public:
/**
* @copydoc Dali::PropertyInput::GetConstraintInputMatrix()
*/
/**
* @copydoc Dali::PropertyInput::GetConstraintInputMatrix()
*/
- virtual const Matrix& GetConstraintInputMatrix( BufferIndex bufferIndex ) const
+ const Matrix& GetConstraintInputMatrix( BufferIndex bufferIndex ) const override
{
{
- if( mTxManager )
+ const TransformManager* txManager = mTxManager;
+ if( txManager )
{
{
- return
mT
xManager->GetWorldMatrix(mId);
+ return
t
xManager->GetWorldMatrix(mId);
}
return Matrix::IDENTITY;
}
return Matrix::IDENTITY;
@@
-692,7
+694,7
@@
public:
*/
Matrix& Get( BufferIndex bufferIndex )
{
*/
Matrix& Get( BufferIndex bufferIndex )
{
- DALI_ASSERT_ALWAYS( mTxManager !=
0
);
+ DALI_ASSERT_ALWAYS( mTxManager !=
nullptr
);
return mTxManager->GetWorldMatrix(mId);
}
return mTxManager->GetWorldMatrix(mId);
}
@@
-723,7
+725,7
@@
public:
/**
* @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
*/
/**
* @copydoc Dali::Internal::PropertyInputImpl::IsTransformManagerProperty()
*/
- virtual bool IsTransformManagerProperty() const
+ bool IsTransformManagerProperty() const override
{
return true;
}
{
return true;
}