DALI_TEST_EQUALS( actor.GetProperty<float>(index), targetValue, TEST_LOCATION );
END_TEST;
}
+
+int UtcDaliAnimationCustomUnsignedIntProperty(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ Stage::GetCurrent().Add(actor);
+ unsigned int startValue(0u);
+
+ Property::Index index = actor.RegisterProperty("an-index", startValue);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+
+ // Build the animation
+ float durationSeconds(1.0f);
+ Animation animation = Animation::New(durationSeconds);
+ animation.AnimateTo( Property(actor, index), 20u );
+
+ // Start the animation
+ animation.Play();
+
+ bool signalReceived(false);
+ AnimationFinishCheck finishCheck(signalReceived);
+ animation.FinishedSignal().Connect(&application, finishCheck);
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f)/* 50% progress */);
+
+ // We didn't expect the animation to finish yet
+ application.SendNotification();
+ finishCheck.CheckSignalNotReceived();
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 10u, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
+
+ // We did expect the animation to finish
+ application.SendNotification();
+ finishCheck.CheckSignalReceived();
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 20u, TEST_LOCATION );
+ END_TEST;
+}
+
{
public:
PropertyInputAbstraction(const bool& val) : mType(Dali::Property::BOOLEAN), mBoolData( val ) {}
- PropertyInputAbstraction(const float& val) : mType(Dali::Property::FLOAT), mFloatData( val ) {}
PropertyInputAbstraction(const int& val) : mType(Dali::Property::INTEGER), mIntData( val ) {}
+ PropertyInputAbstraction(const unsigned int& val) : mType(Dali::Property::UNSIGNED_INTEGER), mUIntData( val ) {}
+ PropertyInputAbstraction(const float& val) : mType(Dali::Property::FLOAT), mFloatData( val ) {}
PropertyInputAbstraction(const Vector2& val) : mType(Dali::Property::VECTOR2), mVector2Data( val ) {}
PropertyInputAbstraction(const Vector3& val) : mType(Dali::Property::VECTOR3), mVector3Data( val ) {}
PropertyInputAbstraction(const Vector4& val) : mType(Dali::Property::VECTOR4), mVector4Data( val ) {}
const bool& GetBoolean() const { return mBoolData; }
- const float& GetFloat() const { return mFloatData; }
-
const int& GetInteger() const { return mIntData; }
+ const unsigned int& GetUnsignedInteger() const { return mUIntData; }
+ const float& GetFloat() const { return mFloatData; }
const Vector2& GetVector2() const { return mVector2Data; }
const Vector3& GetVector3() const { return mVector3Data; }
const Vector4& GetVector4() const { return mVector4Data; }
private:
Dali::Property::Type mType;
bool mBoolData;
- float mFloatData;
int mIntData;
+ unsigned int mUIntData;
+ float mFloatData;
Vector2 mVector2Data;
Vector3 mVector3Data;
Vector4 mVector4Data;
int mValue;
};
+struct TestAlwaysEqualOrGreaterThanConstraintUnsignedInteger
+{
+ TestAlwaysEqualOrGreaterThanConstraintUnsignedInteger( unsigned int value )
+ : mValue( value )
+ {
+ }
+
+ unsigned int operator()( unsigned const int& current )
+ {
+ return ( current < mValue ) ? mValue : current;
+ }
+
+ unsigned int mValue;
+};
+
struct TestAlwaysEqualOrGreaterThanConstraintVector2
{
TestAlwaysEqualOrGreaterThanConstraintVector2( Vector2 value )
int mValue;
};
+struct TestConstraintUnsignedInteger
+{
+ TestConstraintUnsignedInteger( int value )
+ : mValue( value )
+ {
+ }
+
+ unsigned int operator()( const unsigned int& current )
+ {
+ return mValue;
+ }
+
+ unsigned int mValue;
+};
+
struct TestConstraintVector2
{
TestConstraintVector2( Vector2 value )
}
+int UtcDaliConstraintNewUnsignedInteger(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+
+ // Register an integer property
+ unsigned int startValue( 1u );
+ Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ Stage::GetCurrent().Add(actor);
+ DALI_TEST_CHECK( actor.GetProperty<unsigned int>(index) == startValue );
+
+ /**
+ * Test that the Constraint is correctly applied on a clean Node
+ */
+ application.SendNotification();
+ application.Render(0);
+ DALI_TEST_CHECK( actor.GetProperty<unsigned int>(index) == startValue );
+ application.Render(0);
+ DALI_TEST_CHECK( actor.GetProperty<unsigned int>(index) == startValue );
+ application.Render(0);
+ DALI_TEST_CHECK( actor.GetProperty<unsigned int>(index) == startValue );
+
+ // Apply constraint
+
+ unsigned int minValue( 2 );
+ Constraint constraint = Constraint::New<unsigned int>( index, TestAlwaysEqualOrGreaterThanConstraintUnsignedInteger( minValue ) );
+
+ actor.ApplyConstraint( constraint );
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render(0);
+
+ // Constraint should be fully applied
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), minValue, TEST_LOCATION );
+
+ // Check that nothing has changed after a couple of buffer swaps
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), minValue, TEST_LOCATION );
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), minValue, TEST_LOCATION );
+
+ // Set to greater than 2f, the constraint will allow this
+ actor.SetProperty( index, 3u );
+
+ application.SendNotification();
+ application.Render(0);
+
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 3, TEST_LOCATION );
+
+ // Check that nothing has changed after a couple of buffer swaps
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 3, TEST_LOCATION );
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 3, TEST_LOCATION );
+
+ // Set to less than 2, the constraint will NOT allow this
+ actor.SetProperty( index, 1u );
+
+ application.SendNotification();
+ application.Render(0);
+
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), minValue/*not 1*/, TEST_LOCATION );
+
+ // Check that nothing has changed after a couple of buffer swaps
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), minValue, TEST_LOCATION );
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), minValue, TEST_LOCATION );
+
+ // Remove the constraint, then set new value
+ actor.RemoveConstraints();
+ actor.SetProperty( index, 1u );
+
+ // Constraint should have been removed
+ application.SendNotification();
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 1, TEST_LOCATION );
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 1, TEST_LOCATION );
+ END_TEST;
+}
+
+
int UtcDaliConstraintNewVector2(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliConstraintNewOffStageUnsignedInteger(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+
+ // Register an integer property
+ unsigned int startValue(1);
+ Property::Index index = actor.RegisterProperty( "test-property", startValue );
+ DALI_TEST_CHECK( actor.GetProperty<unsigned int>(index) == startValue );
+
+ // Apply constraint to off-stage Actor
+ unsigned int constrainedValue( 2 );
+ Constraint constraint = Constraint::New<unsigned int>( index, TestConstraintUnsignedInteger( constrainedValue ) );
+ actor.ApplyConstraint( constraint );
+
+ application.SendNotification();
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+
+ // Add actor to stage
+ Stage::GetCurrent().Add(actor);
+ application.SendNotification();
+ application.Render(0);
+
+ // Constraint should be fully applied
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), constrainedValue, TEST_LOCATION );
+
+ // Check that nothing has changed after a couple of buffer swaps
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), constrainedValue, TEST_LOCATION );
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), constrainedValue, TEST_LOCATION );
+
+ // Take the actor off-stage
+ Stage::GetCurrent().Remove(actor);
+ application.SendNotification();
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), constrainedValue, TEST_LOCATION );
+
+ // Set back to startValue; the constraint will not prevent this
+ actor.SetProperty( index, startValue );
+ application.SendNotification();
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+
+ // Add actor to stage (2nd time)
+ Stage::GetCurrent().Add(actor);
+ application.SendNotification();
+ application.Render(0);
+
+ // Constraint should be fully applied (2nd time)
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), constrainedValue, TEST_LOCATION );
+
+ // Check that nothing has changed after a couple of buffer swaps
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), constrainedValue, TEST_LOCATION );
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), constrainedValue, TEST_LOCATION );
+
+ // Take the actor off-stage (2nd-time)
+ Stage::GetCurrent().Remove(actor);
+ application.SendNotification();
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), constrainedValue, TEST_LOCATION );
+
+ // Remove the constraint, and set back to startValue
+ actor.RemoveConstraints();
+ actor.SetProperty( index, startValue );
+ application.SendNotification();
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+
+ // Add actor to stage (3rd time)
+ Stage::GetCurrent().Add(actor);
+ application.SendNotification();
+ application.Render(0);
+
+ // Constraint should be gone
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+
+ // Check that nothing has changed after a couple of buffer swaps
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+ application.Render(0);
+ DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+ END_TEST;
+}
+
+
int UtcDaliConstraintNewOffStageVector2(void)
{
TestApplication application;
Property::Index boolIndex = actor.RegisterProperty( "bool-property", bool(true) );
Property::Index floatIndex = actor.RegisterProperty( "float-property", float(123.0f) );
Property::Index intIndex = actor.RegisterProperty( "int-property", 123 );
+ Property::Index unsignedIntIndex = actor.RegisterProperty( "unsigned-int-property", 456u );
Property::Index vector2Index = actor.RegisterProperty( "vector2-property", Vector2(1.0f, 2.0f) );
Property::Index vector3Index = actor.RegisterProperty( "vector3-property", Vector3(1.0f, 2.0f, 3.0f) );
Property::Index vector4Index = actor.RegisterProperty( "vector4-property", Vector4(1.0f, 2.0f, 3.0f, 4.0f) );
DALI_TEST_CHECK( Property::BOOLEAN == actor.GetPropertyType( boolIndex ) );
DALI_TEST_CHECK( Property::FLOAT == actor.GetPropertyType( floatIndex ) );
DALI_TEST_CHECK( Property::INTEGER == actor.GetPropertyType( intIndex ) );
+ DALI_TEST_CHECK( Property::UNSIGNED_INTEGER == actor.GetPropertyType( unsignedIntIndex ) );
DALI_TEST_CHECK( Property::VECTOR2 == actor.GetPropertyType( vector2Index ) );
DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( vector3Index ) );
DALI_TEST_CHECK( Property::VECTOR4 == actor.GetPropertyType( vector4Index ) );
{ "Property::BOOLEAN", true, true },
{ "Property::FLOAT", 1.0f, true },
{ "Property::INTEGER", 1, true },
- { "Property::UNSIGNED_INTEGER", 1u, false },
+ { "Property::UNSIGNED_INTEGER", 1u, true },
{ "Property::VECTOR2", Vector2::ONE, true },
{ "Property::VECTOR3", Vector3::ONE, true },
{ "Property::VECTOR4", Vector4::ONE, true },
{ "Property::ARRAY", array, false },
{ "Property::MAP", map, false },
};
+
unsigned int numOfProperties( sizeof( properties ) / sizeof( properties[0] ) );
for ( unsigned int i = 0; i < numOfProperties; ++i )
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- const AnimatableProperty< float >* property = dynamic_cast< const AnimatableProperty< float >* >( entry.GetSceneGraphProperty() );
+ const AnimatableProperty< int >* property = dynamic_cast< const AnimatableProperty< int >* >( entry.GetSceneGraphProperty() );
DALI_ASSERT_DEBUG( NULL != property );
// property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<float>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<float>::Bake, value.Get<float>() );
+ SceneGraph::NodePropertyMessage<int>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<int>::Bake, value.Get<int>() );
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- const AnimatableProperty< int >* property = dynamic_cast< const AnimatableProperty< int >* >( entry.GetSceneGraphProperty() );
+ const AnimatableProperty< unsigned int >* property = dynamic_cast< const AnimatableProperty< unsigned int >* >( entry.GetSceneGraphProperty() );
DALI_ASSERT_DEBUG( NULL != property );
// property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<int>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<int>::Bake, value.Get<int>() );
+ SceneGraph::NodePropertyMessage<unsigned int>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<unsigned int>::Bake, value.Get<unsigned int>() );
+
+ break;
+ }
+
+ case Property::FLOAT:
+ {
+ const AnimatableProperty< float >* property = dynamic_cast< const AnimatableProperty< float >* >( entry.GetSceneGraphProperty() );
+ DALI_ASSERT_DEBUG( NULL != property );
+
+ // property is being used in a separate thread; queue a message to set the property
+ SceneGraph::NodePropertyMessage<float>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<float>::Bake, value.Get<float>() );
break;
}
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- AddAnimatorConnector( AnimatorConnector<float>::New( object,
- target.propertyIndex,
- target.componentIndex,
- new AnimateByFloat(relativeValue.Get<float>()),
- alpha,
- period ) );
+ AddAnimatorConnector( AnimatorConnector<int>::New( object,
+ target.propertyIndex,
+ target.componentIndex,
+ new AnimateByInteger(relativeValue.Get<int>()),
+ alpha,
+ period ) );
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- AddAnimatorConnector( AnimatorConnector<int>::New( object,
+ AddAnimatorConnector( AnimatorConnector<unsigned int>::New( object,
target.propertyIndex,
target.componentIndex,
- new AnimateByInteger(relativeValue.Get<int>()),
+ new AnimateByUnsignedInteger(relativeValue.Get<unsigned int>()),
alpha,
period ) );
break;
}
+ case Property::FLOAT:
+ {
+ AddAnimatorConnector( AnimatorConnector<float>::New( object,
+ target.propertyIndex,
+ target.componentIndex,
+ new AnimateByFloat(relativeValue.Get<float>()),
+ alpha,
+ period ) );
+ break;
+ }
+
case Property::VECTOR2:
{
AddAnimatorConnector( AnimatorConnector<Vector2>::New( object,
break;
}
- case Property::FLOAT:
- {
- AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
- targetPropertyIndex,
- componentIndex,
- new AnimateToFloat( destinationValue.Get<float>() ),
- alpha,
- period ) );
- break;
- }
-
case Property::INTEGER:
{
AddAnimatorConnector( AnimatorConnector<int>::New( targetObject,
break;
}
+ case Property::UNSIGNED_INTEGER:
+ {
+ AddAnimatorConnector( AnimatorConnector<unsigned int>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new AnimateToUnsignedInteger( destinationValue.Get<unsigned int>() ),
+ alpha,
+ period ) );
+ break;
+ }
+
+ case Property::FLOAT:
+ {
+ AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
+ targetPropertyIndex,
+ componentIndex,
+ new AnimateToFloat( destinationValue.Get<float>() ),
+ alpha,
+ period ) );
+ break;
+ }
+
case Property::VECTOR2:
{
AddAnimatorConnector( AnimatorConnector<Vector2>::New( targetObject,
break;
}
- case Dali::Property::FLOAT:
+ case Dali::Property::INTEGER:
{
- const KeyFrameNumber* kf;
+ const KeyFrameInteger* kf;
GetSpecialization(keyFrames, kf);
- KeyFrameNumberPtr kfCopy = KeyFrameNumber::Clone(*kf);
- AddAnimatorConnector( AnimatorConnector<float>::New( object,
- target.propertyIndex,
- target.componentIndex,
- new KeyFrameNumberFunctor(kfCopy,interpolation),
- alpha,
- period ) );
+ KeyFrameIntegerPtr kfCopy = KeyFrameInteger::Clone(*kf);
+ AddAnimatorConnector( AnimatorConnector<int>::New( object,
+ target.propertyIndex,
+ target.componentIndex,
+ new KeyFrameIntegerFunctor(kfCopy,interpolation),
+ alpha,
+ period ) );
break;
}
- case Dali::Property::INTEGER:
+ case Dali::Property::UNSIGNED_INTEGER:
{
- const KeyFrameInteger* kf;
+ const KeyFrameUnsignedInteger* kf;
GetSpecialization(keyFrames, kf);
- KeyFrameIntegerPtr kfCopy = KeyFrameInteger::Clone(*kf);
+ KeyFrameUnsignedIntegerPtr kfCopy = KeyFrameUnsignedInteger::Clone(*kf);
AddAnimatorConnector( AnimatorConnector<int>::New( object,
target.propertyIndex,
target.componentIndex,
- new KeyFrameIntegerFunctor(kfCopy,interpolation),
+ new KeyFrameUnsignedIntegerFunctor(kfCopy,interpolation),
alpha,
period ) );
break;
}
+ case Dali::Property::FLOAT:
+ {
+ const KeyFrameNumber* kf;
+ GetSpecialization(keyFrames, kf);
+ KeyFrameNumberPtr kfCopy = KeyFrameNumber::Clone(*kf);
+ AddAnimatorConnector( AnimatorConnector<float>::New( object,
+ target.propertyIndex,
+ target.componentIndex,
+ new KeyFrameNumberFunctor(kfCopy,interpolation),
+ alpha,
+ period ) );
+ break;
+ }
+
case Dali::Property::VECTOR2:
{
const KeyFrameVector2* kf;
case Property::BOOLEAN:
mKeyFrames = Internal::KeyFrameBoolean::New();
break;
- case Property::FLOAT:
- mKeyFrames = Internal::KeyFrameNumber::New();
- break;
case Property::INTEGER:
mKeyFrames = Internal::KeyFrameInteger::New();
break;
+ case Property::UNSIGNED_INTEGER:
+ mKeyFrames = Internal::KeyFrameUnsignedInteger::New();
+ break;
+ case Property::FLOAT:
+ mKeyFrames = Internal::KeyFrameNumber::New();
+ break;
case Property::VECTOR2:
mKeyFrames = Internal::KeyFrameVector2::New();
break;
kf->AddKeyFrame(time, value.Get<bool>(), alpha);
break;
}
- case Property::FLOAT:
- {
- Internal::KeyFrameNumber* kf = static_cast<Internal::KeyFrameNumber*>(mKeyFrames.Get());
- kf->AddKeyFrame(time, value.Get<float>(), alpha);
- break;
- }
case Property::INTEGER:
{
Internal::KeyFrameInteger* kf = static_cast<Internal::KeyFrameInteger*>(mKeyFrames.Get());
kf->AddKeyFrame(time, value.Get<int>(), alpha);
break;
}
+ case Property::UNSIGNED_INTEGER:
+ {
+ Internal::KeyFrameUnsignedInteger* kf = static_cast<Internal::KeyFrameUnsignedInteger*>(mKeyFrames.Get());
+ kf->AddKeyFrame(time, value.Get<unsigned int>(), alpha);
+ break;
+ }
+ case Property::FLOAT:
+ {
+ Internal::KeyFrameNumber* kf = static_cast<Internal::KeyFrameNumber*>(mKeyFrames.Get());
+ kf->AddKeyFrame(time, value.Get<float>(), alpha);
+ break;
+ }
case Property::VECTOR2:
{
Internal::KeyFrameVector2* kf = static_cast<Internal::KeyFrameVector2*>(mKeyFrames.Get());
} // Internal
} // Dali
-
-
}
};
-typedef KeyFrameBaseSpec<float> KeyFrameNumber;
-typedef KeyFrameBaseSpec<bool> KeyFrameBoolean;
-typedef KeyFrameBaseSpec<int> KeyFrameInteger;
-typedef KeyFrameBaseSpec<Vector2> KeyFrameVector2;
-typedef KeyFrameBaseSpec<Vector3> KeyFrameVector3;
-typedef KeyFrameBaseSpec<Vector4> KeyFrameVector4;
-typedef KeyFrameBaseSpec<Quaternion> KeyFrameQuaternion;
-
-typedef IntrusivePtr<KeyFrameBoolean> KeyFrameBooleanPtr;
-typedef IntrusivePtr<KeyFrameNumber> KeyFrameNumberPtr;
-typedef IntrusivePtr<KeyFrameInteger> KeyFrameIntegerPtr;
-typedef IntrusivePtr<KeyFrameVector2> KeyFrameVector2Ptr;
-typedef IntrusivePtr<KeyFrameVector3> KeyFrameVector3Ptr;
-typedef IntrusivePtr<KeyFrameVector4> KeyFrameVector4Ptr;
-typedef IntrusivePtr<KeyFrameQuaternion> KeyFrameQuaternionPtr;
+typedef KeyFrameBaseSpec<float> KeyFrameNumber;
+typedef KeyFrameBaseSpec<bool> KeyFrameBoolean;
+typedef KeyFrameBaseSpec<int> KeyFrameInteger;
+typedef KeyFrameBaseSpec<unsigned int> KeyFrameUnsignedInteger;
+typedef KeyFrameBaseSpec<Vector2> KeyFrameVector2;
+typedef KeyFrameBaseSpec<Vector3> KeyFrameVector3;
+typedef KeyFrameBaseSpec<Vector4> KeyFrameVector4;
+typedef KeyFrameBaseSpec<Quaternion> KeyFrameQuaternion;
+
+typedef IntrusivePtr<KeyFrameBoolean> KeyFrameBooleanPtr;
+typedef IntrusivePtr<KeyFrameNumber> KeyFrameNumberPtr;
+typedef IntrusivePtr<KeyFrameInteger> KeyFrameIntegerPtr;
+typedef IntrusivePtr<KeyFrameUnsignedInteger> KeyFrameUnsignedIntegerPtr;
+typedef IntrusivePtr<KeyFrameVector2> KeyFrameVector2Ptr;
+typedef IntrusivePtr<KeyFrameVector3> KeyFrameVector3Ptr;
+typedef IntrusivePtr<KeyFrameVector4> KeyFrameVector4Ptr;
+typedef IntrusivePtr<KeyFrameQuaternion> KeyFrameQuaternionPtr;
inline void GetSpecialization(Internal::KeyFrames& keyFrames, Internal::KeyFrameBoolean*& keyFrameSpec)
keyFrameSpec = static_cast<const Internal::KeyFrameInteger*>(keyFrames.GetKeyFramesBase());
}
+inline void GetSpecialization(Internal::KeyFrames& keyFrames, Internal::KeyFrameUnsignedInteger*& keyFrameSpec)
+{
+ keyFrameSpec = static_cast<Internal::KeyFrameUnsignedInteger*>(keyFrames.GetKeyFramesBase());
+}
+
+inline void GetSpecialization(const Internal::KeyFrames& keyFrames, const Internal::KeyFrameUnsignedInteger*& keyFrameSpec)
+{
+ keyFrameSpec = static_cast<const Internal::KeyFrameUnsignedInteger*>(keyFrames.GetKeyFramesBase());
+}
+
inline void GetSpecialization(Internal::KeyFrames& keyFrames, Internal::KeyFrameVector2*& keyFrameSpec)
{
keyFrameSpec = static_cast<Internal::KeyFrameVector2*>(keyFrames.GetKeyFramesBase());
typedef ProgressValue<bool> ProgressBoolean;
typedef std::vector<ProgressBoolean> ProgressBooleanContainer;
-typedef ProgressValue<float> ProgressNumber;
-typedef std::vector<ProgressNumber> ProgressNumberContainer;
-
typedef ProgressValue<int> ProgressInteger;
typedef std::vector<ProgressInteger> ProgressIntegerContainer;
+typedef ProgressValue<unsigned int> ProgressUnsignedInteger;
+typedef std::vector<ProgressUnsignedInteger> ProgressUnsignedIntegerContainer;
+
+typedef ProgressValue<float> ProgressNumber;
+typedef std::vector<ProgressNumber> ProgressNumberContainer;
+
typedef ProgressValue<Vector2> ProgressVector2;
typedef std::vector<ProgressVector2> ProgressVector2Container;
result = progress < 0.5f ? a : b;
}
-inline void Interpolate (float& result, float a, float b, float progress)
+inline void Interpolate (int& result, int a, int b, float progress)
{
- result = a + (b-a) * progress;
+ result = static_cast<int>(a + (b - a) * progress + 0.5f);
}
-inline void Interpolate (int& result, int a, int b, float progress)
+inline void Interpolate (unsigned int& result, unsigned int a, unsigned int b, float progress)
{
- result = static_cast<int>(a + (b - a) * progress + 0.5f);
+ result = static_cast<unsigned int>(a + (b - a) * progress + 0.5f);
+}
+
+inline void Interpolate (float& result, float a, float b, float progress)
+{
+ result = a + (b-a) * progress;
}
inline void Interpolate (Vector2& result, const Vector2& a, const Vector2& b, float progress)
result = static_cast<int>( a3*progress*progress*progress + a2*progress*progress + a1*progress + p1 + 0.5f );
}
+inline void CubicInterpolate( unsigned int& result, unsigned int p0, unsigned int p1, unsigned int p2, unsigned int p3, float progress )
+{
+ float a3 = p3*0.5f - p2*1.5f + p1*1.5f - p0*0.5f;
+ float a2 = p0 - p1*2.5f + p2*2.0f - p3*0.5f;
+ float a1 = (p2-p0)*0.5f;
+
+ result = static_cast<unsigned int>( a3*progress*progress*progress + a2*progress*progress + a1*progress + p1 + 0.5f );
+}
+
inline void CubicInterpolate( float& result, float p0, float p1, float p2, float p3, float progress )
{
float a3 = p3*0.5f - p2*1.5f + p1*1.5f - p0*0.5f;
}
/**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetConstraintInputInteger() const
+ */
+ const int& GetConstraintInputInteger( BufferIndex updateBufferIndex ) const
+ {
+ DALI_ASSERT_DEBUG( mComponentIndex < 0 && "Did not expect valid component index" );
+
+ return mInput->GetConstraintInputInteger( updateBufferIndex );
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetConstraintInputUnsignedInteger() const
+ */
+ const unsigned int& GetConstraintInputUnsignedInteger( BufferIndex updateBufferIndex ) const
+ {
+ DALI_ASSERT_DEBUG( mComponentIndex < 0 && "Did not expect valid component index" );
+
+ return mInput->GetConstraintInputUnsignedInteger( updateBufferIndex );
+ }
+
+ /**
* @copydoc Dali::Internal::PropertyInputImpl::GetConstraintInputFloat()
*/
const float& GetConstraintInputFloat( BufferIndex updateBufferIndex ) const
}
/**
- * @copydoc Dali::Internal::PropertyInputImpl::GetConstraintInputInteger() const
- */
- const int& GetConstraintInputInteger( BufferIndex updateBufferIndex ) const
- {
- return mInput->GetConstraintInputInteger( updateBufferIndex );
- }
-
- /**
* @copydoc Dali::Internal::PropertyInputImpl::GetConstraintInputVector2()
*/
const Vector2& GetConstraintInputVector2( BufferIndex updateBufferIndex ) const
}
/**
- * @copydoc Dali::Internal::PropertyInput::GetFloat()
+ * @copydoc Dali::Internal::PropertyInput::GetInteger()
*/
- virtual const float& GetFloat() const
+ virtual const int& GetInteger() const
{
- return mInput->GetConstraintInputFloat( mBufferIndex );
+ return mInput->GetConstraintInputInteger( mBufferIndex );
}
/**
- * @copydoc Dali::Internal::PropertyInput::GetInteger()
+ * @copydoc Dali::Internal::PropertyInput::GetUnsignedInteger()
*/
- virtual const int& GetInteger() const
+ virtual const unsigned int& GetUnsignedInteger() const
{
- return mInput->GetConstraintInputInteger( mBufferIndex );
+ return mInput->GetConstraintInputUnsignedInteger( mBufferIndex );
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInput::GetFloat()
+ */
+ virtual const float& GetFloat() const
+ {
+ return mInput->GetConstraintInputFloat( mBufferIndex );
}
/**
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- newProperty = new AnimatableProperty<float>( propertyValue.Get<float>() );
+ newProperty = new AnimatableProperty<int>( propertyValue.Get<int>() );
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- newProperty = new AnimatableProperty<int>( propertyValue.Get<int>() );
+ newProperty = new AnimatableProperty<unsigned int>( propertyValue.Get<unsigned int>() );
+ break;
+ }
+
+ case Property::FLOAT:
+ {
+ newProperty = new AnimatableProperty<float>( propertyValue.Get<float>() );
break;
}
break;
}
- case Property::UNSIGNED_INTEGER:
case Property::RECTANGLE:
case Property::STRING:
case Property::ARRAY:
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry->GetSceneGraphProperty() );
+ const AnimatableProperty<int>* property = dynamic_cast< const AnimatableProperty<int>* >( entry->GetSceneGraphProperty() );
DALI_ASSERT_DEBUG( NULL != property );
value = (*property)[ bufferIndex ];
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- const AnimatableProperty<int>* property = dynamic_cast< const AnimatableProperty<int>* >( entry->GetSceneGraphProperty() );
+ const AnimatableProperty<unsigned int>* property = dynamic_cast< const AnimatableProperty<unsigned int>* >( entry->GetSceneGraphProperty() );
+ DALI_ASSERT_DEBUG( NULL != property );
+
+ value = (*property)[ bufferIndex ];
+ break;
+ }
+
+ case Property::FLOAT:
+ {
+ const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry->GetSceneGraphProperty() );
DALI_ASSERT_DEBUG( NULL != property );
value = (*property)[ bufferIndex ];
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
+ const AnimatableProperty<int>* property = dynamic_cast< const AnimatableProperty<int>* >( entry.GetSceneGraphProperty() );
DALI_ASSERT_DEBUG( NULL != property );
// property is being used in a separate thread; queue a message to set the property
- BakeMessage<float>( GetEventThreadServices(), *property, value.Get<float>() );
+ BakeMessage<int>( GetEventThreadServices(), *property, value.Get<int>() );
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- const AnimatableProperty<int>* property = dynamic_cast< const AnimatableProperty<int>* >( entry.GetSceneGraphProperty() );
+ const AnimatableProperty<unsigned int>* property = dynamic_cast< const AnimatableProperty<unsigned int>* >( entry.GetSceneGraphProperty() );
DALI_ASSERT_DEBUG( NULL != property );
// property is being used in a separate thread; queue a message to set the property
- BakeMessage<int>( GetEventThreadServices(), *property, value.Get<int>() );
+ BakeMessage<unsigned int>( GetEventThreadServices(), *property, value.Get<unsigned int>() );
+ break;
+ }
+
+ case Property::FLOAT:
+ {
+ const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
+ DALI_ASSERT_DEBUG( NULL != property );
+
+ // property is being used in a separate thread; queue a message to set the property
+ BakeMessage<float>( GetEventThreadServices(), *property, value.Get<float>() );
break;
}
static const bool DUMMY_BOOLEAN_VALUE( false );
static const float DUMMY_FLOAT_VALUE( 0.0f );
static const int DUMMY_INTEGER_VALUE( 0 );
+static const unsigned int DUMMY_UNSIGNED_INTEGER_VALUE( 0u );
static const Vector2 DUMMY_VECTOR2_VALUE( 0.0f, 0.0f );
static const Vector3 DUMMY_VECTOR3_VALUE( 0.0f, 0.0f, 0.0f );
static const Vector4 DUMMY_VECTOR4_VALUE( 0.0f, 0.0f, 0.0f, 0.0f );
}
/**
- * Retrieve a float value.
- * @pre GetType() returns Property::FLOAT.
+ * Retrieve an integer value.
+ * @pre GetType() returns Property::INTEGER.
* @param[in] bufferIndex The buffer to read from.
- * @return The float value.
+ * @return The integer value.
*/
- virtual const float& GetFloat( BufferIndex bufferIndex ) const
+ virtual const int& GetInteger( BufferIndex bufferIndex ) const
{
DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
- return DUMMY_FLOAT_VALUE;
+ return DUMMY_INTEGER_VALUE;
}
/**
* Retrieve an integer value.
- * @pre GetType() returns Property::INTEGER.
+ * @pre GetType() returns Property::UNSIGNED_INTEGER.
* @param[in] bufferIndex The buffer to read from.
* @return The integer value.
*/
- virtual const int& GetInteger( BufferIndex bufferIndex ) const
+ virtual const unsigned int& GetUnsignedInteger( BufferIndex bufferIndex ) const
{
DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
- return DUMMY_INTEGER_VALUE;
+ return DUMMY_UNSIGNED_INTEGER_VALUE;
+ }
+
+ /**
+ * Retrieve a float value.
+ * @pre GetType() returns Property::FLOAT.
+ * @param[in] bufferIndex The buffer to read from.
+ * @return The float value.
+ */
+ virtual const float& GetFloat( BufferIndex bufferIndex ) const
+ {
+ DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
+ return DUMMY_FLOAT_VALUE;
}
/**
}
/**
- * Retrieve a float input for a constraint function.
+ * Retrieve an integer input for a constraint function.
* @note For inherited properties, this method should be overriden to return the value
* from the previous frame i.e. not from the current update buffer.
- * @pre GetType() returns Property::FLOAT.
+ * @pre GetType() returns Property::INTEGER.
* @param[in] updateBufferIndex The current update buffer index.
- * @return The float value.
+ * @return The integer value.
*/
- virtual const float& GetConstraintInputFloat( BufferIndex updateBufferIndex ) const
+ virtual const int& GetConstraintInputInteger( BufferIndex updateBufferIndex ) const
{
- return GetFloat( updateBufferIndex );
+ return GetInteger( updateBufferIndex );
}
/**
- * Retrieve an integer input for a constraint function.
+ * Retrieve an unsigned integer input for a constraint function.
* @note For inherited properties, this method should be overriden to return the value
* from the previous frame i.e. not from the current update buffer.
- * @pre GetType() returns Property::INTEGER.
+ * @pre GetType() returns Property::UNSIGNED_INTEGER.
* @param[in] updateBufferIndex The current update buffer index.
* @return The integer value.
*/
- virtual const int& GetConstraintInputInteger( BufferIndex updateBufferIndex ) const
+ virtual const unsigned int& GetConstraintInputUnsignedInteger( BufferIndex updateBufferIndex ) const
{
- return GetInteger( updateBufferIndex );
+ return GetUnsignedInteger( updateBufferIndex );
+ }
+
+ /**
+ * Retrieve a float input for a constraint function.
+ * @note For inherited properties, this method should be overriden to return the value
+ * from the previous frame i.e. not from the current update buffer.
+ * @pre GetType() returns Property::FLOAT.
+ * @param[in] updateBufferIndex The current update buffer index.
+ * @return The float value.
+ */
+ virtual const float& GetConstraintInputFloat( BufferIndex updateBufferIndex ) const
+ {
+ return GetFloat( updateBufferIndex );
}
/**
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- debugStream << GetFloat( bufferIndex );
+ debugStream << GetInteger( bufferIndex );
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- debugStream << GetInteger( bufferIndex );
+ debugStream << GetUnsignedInteger( bufferIndex );
+ break;
+ }
+
+ case Property::FLOAT:
+ {
+ debugStream << GetFloat( bufferIndex );
break;
}
// switch based on property type to use correct GL uniform setter
switch ( property.GetType() )
{
- case Property::FLOAT :
+ case Property::BOOLEAN :
{
- program.SetUniform1f( loc, property.GetFloat( bufferIndex ) );
+ program.SetUniform1i( loc, property.GetBoolean( bufferIndex ) );
break;
}
case Property::INTEGER :
program.SetUniform1i( loc, property.GetInteger( bufferIndex ) );
break;
}
+ case Property::UNSIGNED_INTEGER :
+ {
+ program.SetUniform1i( loc, property.GetUnsignedInteger( bufferIndex ) );
+ break;
+ }
+ case Property::FLOAT :
+ {
+ program.SetUniform1f( loc, property.GetFloat( bufferIndex ) );
+ break;
+ }
case Property::VECTOR2 :
{
Vector2 value( property.GetVector2( bufferIndex ) );
break;
}
- default :
+ case Property::NONE:
+ case Property::ROTATION:
+ case Property::STRING:
+ case Property::RECTANGLE:
+ case Property::MAP:
+ case Property::ARRAY:
+ case Property::TYPE_COUNT:
{
- // Only float and Vector properties are passed as uniforms; other types are ignored.
+ DALI_ASSERT_ALWAYS( 0 && "Invalid property type for a uniform" );
break;
}
}
virtual ~AnimatorFunctionBase(){}
///Stub "()" operators.
+ virtual bool operator()(float progress, const bool& property)
+ {
+ return property;
+ }
+
virtual float operator()(float progress, const int& property)
{
return property;
}
- virtual float operator()(float progress, const float& property)
+ virtual float operator()(float progress, const unsigned int& property)
{
return property;
}
- virtual bool operator()(float progress, const bool& property)
+ virtual float operator()(float progress, const float& property)
{
return property;
}
// Update functions
-struct AnimateByFloat : public AnimatorFunctionBase
+struct AnimateByInteger : public AnimatorFunctionBase
{
- AnimateByFloat(const float& relativeValue)
+ AnimateByInteger(const int& relativeValue)
: mRelative(relativeValue)
{
}
- float operator()(float alpha, const float& property)
+ float operator()(float alpha, const int& property)
{
- return float(property + mRelative * alpha);
+ return int(property + mRelative * alpha + 0.5f );
}
- float mRelative;
+ int mRelative;
};
-struct AnimateToFloat : public AnimatorFunctionBase
+struct AnimateToInteger : public AnimatorFunctionBase
{
- AnimateToFloat(const float& targetValue)
+ AnimateToInteger(const int& targetValue)
: mTarget(targetValue)
{
}
- float operator()(float alpha, const float& property)
+ float operator()(float alpha, const int& property)
{
- return float(property + ((mTarget - property) * alpha));
+ return int(property + ((mTarget - property) * alpha) + 0.5f);
}
- float mTarget;
+ int mTarget;
};
-struct AnimateByInteger : public AnimatorFunctionBase
+struct AnimateByUnsignedInteger : public AnimatorFunctionBase
{
- AnimateByInteger(const int& relativeValue)
+ AnimateByUnsignedInteger(const unsigned int& relativeValue)
: mRelative(relativeValue)
{
}
- float operator()(float alpha, const int& property)
+ float operator()(float alpha, const unsigned int& property)
{
- return int(property + mRelative * alpha + 0.5f );
+ return static_cast<unsigned int>(property + mRelative * alpha + 0.5f );
}
- int mRelative;
+ unsigned int mRelative;
};
-struct AnimateToInteger : public AnimatorFunctionBase
+struct AnimateToUnsignedInteger : public AnimatorFunctionBase
{
- AnimateToInteger(const int& targetValue)
+ AnimateToUnsignedInteger(const unsigned int& targetValue)
: mTarget(targetValue)
{
}
- float operator()(float alpha, const int& property)
+ float operator()(float alpha, const unsigned int& property)
{
- return int(property + ((mTarget - property) * alpha) + 0.5f);
+ return static_cast<unsigned int>(property + ((mTarget - property) * alpha) + 0.5f);
}
- int mTarget;
+ unsigned int mTarget;
+};
+
+struct AnimateByFloat : public AnimatorFunctionBase
+{
+ AnimateByFloat(const float& relativeValue)
+ : mRelative(relativeValue)
+ {
+ }
+
+ float operator()(float alpha, const float& property)
+ {
+ return float(property + mRelative * alpha);
+ }
+
+ float mRelative;
+};
+
+struct AnimateToFloat : public AnimatorFunctionBase
+{
+ AnimateToFloat(const float& targetValue)
+ : mTarget(targetValue)
+ {
+ }
+
+ float operator()(float alpha, const float& property)
+ {
+ return float(property + ((mTarget - property) * alpha));
+ }
+
+ float mTarget;
};
struct AnimateByVector2 : public AnimatorFunctionBase
KeyFrameBooleanPtr mKeyFrames;
};
-struct KeyFrameNumberFunctor : public AnimatorFunctionBase
+struct KeyFrameIntegerFunctor : public AnimatorFunctionBase
{
- KeyFrameNumberFunctor(KeyFrameNumberPtr keyFrames, Interpolation interpolation)
+ KeyFrameIntegerFunctor(KeyFrameIntegerPtr keyFrames, Interpolation interpolation)
: mKeyFrames(keyFrames),mInterpolation(interpolation)
{
}
- float operator()(float progress, const float& property)
+ float operator()(float progress, const int& property)
{
if(mKeyFrames->IsActive(progress))
{
return property;
}
- KeyFrameNumberPtr mKeyFrames;
+ KeyFrameIntegerPtr mKeyFrames;
Interpolation mInterpolation;
};
-struct KeyFrameIntegerFunctor : public AnimatorFunctionBase
+struct KeyFrameUnsignedIntegerFunctor : public AnimatorFunctionBase
{
- KeyFrameIntegerFunctor(KeyFrameIntegerPtr keyFrames, Interpolation interpolation)
+ KeyFrameUnsignedIntegerFunctor(KeyFrameUnsignedIntegerPtr keyFrames, Interpolation interpolation)
: mKeyFrames(keyFrames),mInterpolation(interpolation)
{
}
- float operator()(float progress, const int& property)
+ float operator()(float progress, const unsigned int& property)
{
if(mKeyFrames->IsActive(progress))
{
return property;
}
- KeyFrameIntegerPtr mKeyFrames;
+ KeyFrameUnsignedIntegerPtr mKeyFrames;
+ Interpolation mInterpolation;
+};
+
+struct KeyFrameNumberFunctor : public AnimatorFunctionBase
+{
+ KeyFrameNumberFunctor(KeyFrameNumberPtr keyFrames, Interpolation interpolation)
+ : mKeyFrames(keyFrames),mInterpolation(interpolation)
+ {
+ }
+
+ float operator()(float progress, const float& property)
+ {
+ if(mKeyFrames->IsActive(progress))
+ {
+ return mKeyFrames->GetValue(progress, mInterpolation);
+ }
+ return property;
+ }
+
+ KeyFrameNumberPtr mKeyFrames;
Interpolation mInterpolation;
};
};
+
/**
- * An float animatable property of a scene-graph object.
+ * An integer animatable property of a scene-graph object.
*/
template <>
-class AnimatableProperty<float> : public AnimatablePropertyBase
+class AnimatableProperty<int> : public AnimatablePropertyBase
{
public:
* Create an animatable property.
* @param [in] initialValue The initial value of the property.
*/
- AnimatableProperty( float initialValue )
+ AnimatableProperty( int initialValue )
: mValue( initialValue ),
mBaseValue( initialValue )
{
*/
virtual Dali::Property::Type GetType() const
{
- return Dali::PropertyTypes::Get<float>();
+ return Dali::PropertyTypes::Get<int>();
}
/**
}
/**
- * @copydoc Dali::Internal::PropertyInputImpl::GetFloat()
+ * @copydoc Dali::Internal::PropertyInputImpl::GetInteger()
*/
- virtual const float& GetFloat( BufferIndex bufferIndex ) const
+ virtual const int& GetInteger( BufferIndex bufferIndex ) const
{
return mValue[ bufferIndex ];
}
* @param[in] bufferIndex The buffer to write.
* @param[in] value The new property value.
*/
- void Set(BufferIndex bufferIndex, float value)
+ void Set(BufferIndex bufferIndex, int value)
{
mValue[bufferIndex] = value;
* @param[in] bufferIndex The buffer to write.
* @param[in] delta The property will change by this amount.
*/
- void SetRelative(BufferIndex bufferIndex, float delta)
+ void SetRelative(BufferIndex bufferIndex, int delta)
{
mValue[bufferIndex] = mValue[bufferIndex] + delta;
/**
* @copydoc Dali::SceneGraph::AnimatableProperty::Get()
*/
- float& Get(size_t bufferIndex)
+ int& Get(size_t bufferIndex)
{
return mValue[bufferIndex];
}
/**
* @copydoc Dali::SceneGraph::AnimatableProperty::Get()
*/
- const float& Get(size_t bufferIndex) const
+ const int& Get(size_t bufferIndex) const
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to read.
* @return The property value.
*/
- float& operator[](size_t bufferIndex)
+ int& operator[](size_t bufferIndex)
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to read.
* @return The property value.
*/
- const float& operator[](size_t bufferIndex) const
+ const int& operator[](size_t bufferIndex) const
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to write for the property value.
* @param[in] value The new property value.
*/
- void Bake(BufferIndex bufferIndex, float value)
+ void Bake(BufferIndex bufferIndex, int value)
{
mValue[bufferIndex] = value;
mBaseValue = mValue[bufferIndex];
* @param[in] bufferIndex The buffer to write for the local property value.
* @param[in] delta The property will change by this amount.
*/
- void BakeRelative(BufferIndex bufferIndex, float delta)
+ void BakeRelative(BufferIndex bufferIndex, int delta)
{
mValue[bufferIndex] = mValue[bufferIndex] + delta;
mBaseValue = mValue[bufferIndex];
* This should only be used when the owning object has not been connected to the scene-graph.
* @param[in] value The new property value.
*/
- void SetInitial(const float& value)
+ void SetInitial(const int& value)
{
mValue[0] = value;
mValue[1] = mValue[0];
* This should only be used when the owning object has not been connected to the scene-graph.
* @param[in] delta The property will change by this amount.
*/
- void SetInitialRelative(const float& delta)
+ void SetInitialRelative(const int& delta)
{
mValue[0] = mValue[0] + delta;
mValue[1] = mValue[0];
private:
- DoubleBuffered<float> mValue; ///< The double-buffered property value
- float mBaseValue; ///< Reset to this base value at the beginning of each frame
+ DoubleBuffered<int> mValue; ///< The double-buffered property value
+ int mBaseValue; ///< Reset to this base value at the beginning of each frame
};
/**
- * An integer animatable property of a scene-graph object.
+ * An unsigned integer animatable property of a scene-graph object.
*/
template <>
-class AnimatableProperty<int> : public AnimatablePropertyBase
+class AnimatableProperty<unsigned int> : public AnimatablePropertyBase
{
public:
* Create an animatable property.
* @param [in] initialValue The initial value of the property.
*/
- AnimatableProperty( int initialValue )
+ AnimatableProperty( unsigned int initialValue )
: mValue( initialValue ),
mBaseValue( initialValue )
{
*/
virtual Dali::Property::Type GetType() const
{
- return Dali::PropertyTypes::Get<int>();
+ return Dali::PropertyTypes::Get<unsigned int>();
}
/**
}
/**
- * @copydoc Dali::Internal::PropertyInputImpl::GetInteger()
+ * @copydoc Dali::Internal::PropertyInputImpl::GetUnsignedInteger()
*/
- virtual const int& GetInteger( BufferIndex bufferIndex ) const
+ virtual const unsigned int& GetUnsignedInteger( BufferIndex bufferIndex ) const
{
return mValue[ bufferIndex ];
}
* @param[in] bufferIndex The buffer to write.
* @param[in] value The new property value.
*/
- void Set(BufferIndex bufferIndex, int value)
+ void Set(BufferIndex bufferIndex, unsigned int value)
{
mValue[bufferIndex] = value;
* @param[in] bufferIndex The buffer to write.
* @param[in] delta The property will change by this amount.
*/
- void SetRelative(BufferIndex bufferIndex, int delta)
+ void SetRelative(BufferIndex bufferIndex, unsigned int delta)
{
mValue[bufferIndex] = mValue[bufferIndex] + delta;
/**
* @copydoc Dali::SceneGraph::AnimatableProperty::Get()
*/
- int& Get(size_t bufferIndex)
+ unsigned int& Get(size_t bufferIndex)
{
return mValue[bufferIndex];
}
/**
* @copydoc Dali::SceneGraph::AnimatableProperty::Get()
*/
- const int& Get(size_t bufferIndex) const
+ const unsigned int& Get(size_t bufferIndex) const
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to read.
* @return The property value.
*/
- int& operator[](size_t bufferIndex)
+ unsigned int& operator[](size_t bufferIndex)
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to read.
* @return The property value.
*/
- const int& operator[](size_t bufferIndex) const
+ const unsigned int& operator[](size_t bufferIndex) const
{
return mValue[bufferIndex];
}
* @param[in] bufferIndex The buffer to write for the property value.
* @param[in] value The new property value.
*/
- void Bake(BufferIndex bufferIndex, int value)
+ void Bake(BufferIndex bufferIndex, unsigned int value)
{
mValue[bufferIndex] = value;
mBaseValue = mValue[bufferIndex];
* @param[in] bufferIndex The buffer to write for the local property value.
* @param[in] delta The property will change by this amount.
*/
- void BakeRelative(BufferIndex bufferIndex, int delta)
+ void BakeRelative(BufferIndex bufferIndex, unsigned int delta)
{
mValue[bufferIndex] = mValue[bufferIndex] + delta;
mBaseValue = mValue[bufferIndex];
* This should only be used when the owning object has not been connected to the scene-graph.
* @param[in] value The new property value.
*/
- void SetInitial(const int& value)
+ void SetInitial(const unsigned int& value)
{
mValue[0] = value;
mValue[1] = mValue[0];
* This should only be used when the owning object has not been connected to the scene-graph.
* @param[in] delta The property will change by this amount.
*/
- void SetInitialRelative(const int& delta)
+ void SetInitialRelative(const unsigned int& delta)
{
mValue[0] = mValue[0] + delta;
mValue[1] = mValue[0];
AnimatableProperty& operator=(const AnimatableProperty& rhs);
private:
+ DoubleBuffered<unsigned int> mValue; ///< The double-buffered property value
+ unsigned int mBaseValue; ///< Reset to this base value at the beginning of each frame
+};
- DoubleBuffered<int> mValue; ///< The double-buffered property value
- int mBaseValue; ///< Reset to this base value at the beginning of each frame
+/**
+ * An float animatable property of a scene-graph object.
+ */
+template <>
+class AnimatableProperty<float> : public AnimatablePropertyBase
+{
+public:
+
+ /**
+ * Create an animatable property.
+ * @param [in] initialValue The initial value of the property.
+ */
+ AnimatableProperty( float initialValue )
+ : mValue( initialValue ),
+ mBaseValue( initialValue )
+ {
+ }
+
+ /**
+ * Virtual destructor.
+ */
+ virtual ~AnimatableProperty()
+ {
+ }
+
+ /**
+ * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
+ */
+ virtual Dali::Property::Type GetType() const
+ {
+ return Dali::PropertyTypes::Get<float>();
+ }
+
+ /**
+ * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
+ */
+ virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
+ {
+ if (CLEAN_FLAG != mDirtyFlags)
+ {
+ mValue[updateBufferIndex] = mBaseValue;
+
+ mDirtyFlags = ( mDirtyFlags >> 1 );
+ }
+ }
+
+ /**
+ * @copydoc Dali::Internal::PropertyInputImpl::GetFloat()
+ */
+ virtual const float& GetFloat( BufferIndex bufferIndex ) const
+ {
+ return mValue[ bufferIndex ];
+ }
+
+ /**
+ * 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.
+ * @param[in] value The new property value.
+ */
+ void Set(BufferIndex bufferIndex, float value)
+ {
+ mValue[bufferIndex] = value;
+
+ OnSet();
+ }
+
+ /**
+ * Change the property value by a relative amount.
+ * @param[in] bufferIndex The buffer to write.
+ * @param[in] delta The property will change by this amount.
+ */
+ void SetRelative(BufferIndex bufferIndex, float delta)
+ {
+ mValue[bufferIndex] = mValue[bufferIndex] + delta;
+
+ OnSet();
+ }
+
+ /**
+ * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
+ */
+ float& Get(size_t bufferIndex)
+ {
+ return mValue[bufferIndex];
+ }
+
+ /**
+ * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
+ */
+ const float& Get(size_t bufferIndex) const
+ {
+ return mValue[bufferIndex];
+ }
+
+ /**
+ * Retrieve the property value.
+ * @param[in] bufferIndex The buffer to read.
+ * @return The property value.
+ */
+ float& operator[](size_t bufferIndex)
+ {
+ return mValue[bufferIndex];
+ }
+
+ /**
+ * Retrieve the property value.
+ * @param[in] bufferIndex The buffer to read.
+ * @return The property value.
+ */
+ const float& operator[](size_t bufferIndex) const
+ {
+ return mValue[bufferIndex];
+ }
+
+ /**
+ * Set both the property value & base value.
+ * @param[in] bufferIndex The buffer to write for the property value.
+ * @param[in] value The new property value.
+ */
+ void Bake(BufferIndex bufferIndex, float value)
+ {
+ mValue[bufferIndex] = value;
+ mBaseValue = mValue[bufferIndex];
+
+ OnBake();
+ }
+
+ /**
+ * Change the property value & base value by a relative amount.
+ * @param[in] bufferIndex The buffer to write for the local property value.
+ * @param[in] delta The property will change by this amount.
+ */
+ void BakeRelative(BufferIndex bufferIndex, float delta)
+ {
+ mValue[bufferIndex] = mValue[bufferIndex] + delta;
+ mBaseValue = mValue[bufferIndex];
+
+ OnBake();
+ }
+
+ /**
+ * Sets both double-buffered values & the base value.
+ * This should only be used when the owning object has not been connected to the scene-graph.
+ * @param[in] value The new property value.
+ */
+ void SetInitial(const float& value)
+ {
+ mValue[0] = value;
+ mValue[1] = mValue[0];
+ mBaseValue = mValue[0];
+ }
+
+ /**
+ * Change both double-buffered values & the base value by a relative amount.
+ * This should only be used when the owning object has not been connected to the scene-graph.
+ * @param[in] delta The property will change by this amount.
+ */
+ void SetInitialRelative(const float& delta)
+ {
+ mValue[0] = mValue[0] + delta;
+ mValue[1] = mValue[0];
+ mBaseValue = mValue[0];
+ }
+
+private:
+
+ // Undefined
+ AnimatableProperty(const AnimatableProperty& property);
+
+ // Undefined
+ AnimatableProperty& operator=(const AnimatableProperty& rhs);
+
+private:
+
+ DoubleBuffered<float> mValue; ///< The double-buffered property value
+ float mBaseValue; ///< Reset to this base value at the beginning of each frame
};
/**
function = LessThan::EvalBoolean;
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- function = LessThan::EvalFloat;
+ function = LessThan::EvalInteger;
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- function = LessThan::EvalInteger;
+ function = LessThan::EvalUnsignedInteger;
+ break;
+ }
+ case Property::FLOAT:
+ {
+ function = LessThan::EvalFloat;
break;
}
case Property::VECTOR2:
return (value.GetBoolean() < arg0);
}
-bool LessThan::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const float arg0 = arg[0];
- return (value.GetFloat() < arg0);
-}
-
bool LessThan::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const int arg0 = arg[0];
return (value.GetInteger() < arg0);
}
+bool LessThan::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const unsigned int arg0 = arg[0];
+ return (value.GetUnsignedInteger() < arg0);
+}
+
+bool LessThan::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const float arg0 = arg[0];
+ return (value.GetFloat() < arg0);
+}
+
bool LessThan::EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float arg0 = arg[0];
function = GreaterThan::EvalBoolean;
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- function = GreaterThan::EvalFloat;
+ function = GreaterThan::EvalInteger;
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- function = GreaterThan::EvalInteger;
+ function = GreaterThan::EvalUnsignedInteger;
+ break;
+ }
+ case Property::FLOAT:
+ {
+ function = GreaterThan::EvalFloat;
break;
}
case Property::VECTOR2:
return (value.GetBoolean() > arg0);
}
-bool GreaterThan::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const float arg0 = arg[0];
- return (value.GetFloat() > arg0);
-}
-
bool GreaterThan::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const int arg0 = arg[0];
return (value.GetInteger() > arg0);
}
+bool GreaterThan::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const unsigned int arg0 = arg[0];
+ return (value.GetUnsignedInteger() > arg0);
+}
+
+bool GreaterThan::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const float arg0 = arg[0];
+ return (value.GetFloat() > arg0);
+}
+
bool GreaterThan::EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float arg0 = arg[0];
function = Inside::EvalBoolean;
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- function = Inside::EvalFloat;
+ function = Inside::EvalInteger;
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- function = Inside::EvalInteger;
+ function = Inside::EvalUnsignedInteger;
+ break;
+ }
+ case Property::FLOAT:
+ {
+ function = Inside::EvalFloat;
break;
}
case Property::VECTOR2:
return ( (valueBoolean > arg[0]) && (valueBoolean < arg[1]) );
}
-bool Inside::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const float valueFloat = value.GetFloat();
- return ( (valueFloat > arg[0]) && (valueFloat < arg[1]) );
-}
-
bool Inside::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const int valueInteger = value.GetInteger();
return ( (valueInteger > arg[0]) && (valueInteger < arg[1]) );
}
+bool Inside::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const unsigned int valueUInt = value.GetUnsignedInteger();
+ return ( (valueUInt > arg[0]) && (valueUInt < arg[1]) );
+}
+
+bool Inside::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const float valueFloat = value.GetFloat();
+ return ( (valueFloat > arg[0]) && (valueFloat < arg[1]) );
+}
+
bool Inside::EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float length2 = value.GetVector2().LengthSquared();
function = Outside::EvalBoolean;
break;
}
- case Property::FLOAT:
+ case Property::INTEGER:
{
- function = Outside::EvalFloat;
+ function = Outside::EvalInteger;
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- function = Outside::EvalInteger;
+ function = Outside::EvalUnsignedInteger;
+ break;
+ }
+ case Property::FLOAT:
+ {
+ function = Outside::EvalFloat;
break;
}
case Property::VECTOR2:
return ( (valueBoolean < arg[0]) || (valueBoolean > arg[1]) );
}
-bool Outside::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+bool Outside::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
- const float valueFloat = value.GetFloat();
- return ( (valueFloat < arg[0]) || (valueFloat > arg[1]) );
+ const int valueInteger = value.GetInteger();
+ return ( (valueInteger < arg[0]) || (valueInteger > arg[1]) );
}
-bool Outside::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+bool Outside::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
- const int valueInterger = value.GetInteger();
- return ( (valueInterger < arg[0]) || (valueInterger > arg[1]) );
+ const unsigned int valueUInt = value.GetUnsignedInteger();
+ return ( (valueUInt < arg[0]) || (valueUInt > arg[1]) );
+}
+
+bool Outside::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const float valueFloat = value.GetFloat();
+ return ( (valueFloat < arg[0]) || (valueFloat > arg[1]) );
}
bool Outside::EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
static bool EvalBoolean( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if float is LessThan
+ * Checks if integer is LessThan
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if integer is LessThan
+ * Checks if unsigned integer is LessThan
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+
+ /**
+ * Checks if float is LessThan
+ * @param[in] value The value being examined.
+ * @param[in] arg The supplied arguments for the condition.
+ * @return Condition result (true if condition met, false if not)
+ */
+ static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
* Checks if Vector2.Length() is LessThan
static bool EvalBoolean( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if float is GreaterThan
+ * Checks if integer is GreaterThan
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if integer is GreaterThan
+ * Checks if unsigned integer is GreaterThan
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+
+ /**
+ * Checks if float is GreaterThan
+ * @param[in] value The value being examined.
+ * @param[in] arg The supplied arguments for the condition.
+ * @return Condition result (true if condition met, false if not)
+ */
+ static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
* Checks if Vector2.Length() is GreaterThan
static bool EvalBoolean( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if float is Inside
+ * Checks if integer is Inside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if integer is Inside
+ * Checks if unsigned integer is Inside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+
+ /**
+ * Checks if float is Inside
+ * @param[in] value The value being examined.
+ * @param[in] arg The supplied arguments for the condition.
+ * @return Condition result (true if condition met, false if not)
+ */
+ static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
* Checks if Vector2.Length() is Inside
static bool EvalBoolean( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if float is Outside
+ * Checks if integer is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if integer is Outside
+ * Checks if unsigned integer is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+
+ /**
+ * Checks if float is Outside
+ * @param[in] value The value being examined.
+ * @param[in] arg The supplied arguments for the condition.
+ * @return Condition result (true if condition met, false if not)
+ */
+ static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
* Checks if Vector2.Length() is Outside
switch(valueType)
{
- case Property::FLOAT:
+ case Property::INTEGER:
{
- function = EvalFloat;
+ function = EvalInteger;
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- function = EvalInteger;
+ function = EvalUnsignedInteger;
+ break;
+ }
+ case Property::FLOAT:
+ {
+ function = EvalFloat;
break;
}
case Property::VECTOR2:
return false;
}
-bool Step::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+
+bool Step::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
- const float propertyValue = value.GetFloat();
+ const float propertyValue = static_cast<float>( value.GetInteger() );
return Evaluate( propertyValue, arg );
}
-bool Step::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+bool Step::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
- const float propertyValue = static_cast<float>( value.GetInteger() );
+ const float propertyValue = static_cast<float>( value.GetUnsignedInteger() );
return Evaluate( propertyValue, arg );
}
+bool Step::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const float propertyValue = value.GetFloat();
+ return Evaluate( propertyValue, arg );
+}
bool Step::EvalVector2( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float propertyValue = value.GetVector2().LengthSquared();
static bool Evaluate( const float propertyValue, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if float is Outside
+ * Checks if integer is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if integer is Outside
+ * Checks if unsigned integer is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+
+ /**
+ * Checks if float is Outside
+ * @param[in] value The value being examined.
+ * @param[in] arg The supplied arguments for the condition.
+ * @return Condition result (true if condition met, false if not)
+ */
+ static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
* Checks if Vector2.Length() is Outside
switch( valueType )
{
- case Property::FLOAT:
+ case Property::INTEGER:
{
- function = EvalFloat;
+ function = EvalInteger;
break;
}
- case Property::INTEGER:
+ case Property::UNSIGNED_INTEGER:
{
- function = EvalInteger;
+ function = EvalUnsignedInteger;
+ break;
+ }
+ case Property::FLOAT:
+ {
+ function = EvalFloat;
break;
}
case Property::VECTOR2:
return false;
}
-bool VariableStep::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+bool VariableStep::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
- const float propertyValue = value.GetFloat();
+ const float propertyValue = static_cast<float>( value.GetInteger() );
return Evaluate( propertyValue, arg );
}
-bool VariableStep::EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+bool VariableStep::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
- const float propertyValue = static_cast<float>( value.GetInteger() );
+ const float propertyValue = static_cast<float>( value.GetUnsignedInteger() );
+ return Evaluate( propertyValue, arg );
+}
+
+bool VariableStep::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
+{
+ const float propertyValue = value.GetFloat();
return Evaluate( propertyValue, arg );
}
static bool Evaluate( const float propertyValue, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if float is Outside
+ * Checks if integer is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if integer is Outside
+ * Checks if unsigned integer is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
* @return Condition result (true if condition met, false if not)
*/
- static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+ static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
+
+ /**
+ * Checks if float is Outside
+ * @param[in] value The value being examined.
+ * @param[in] arg The supplied arguments for the condition.
+ * @return Condition result (true if condition met, false if not)
+ */
+ static bool EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
* Checks if Vector2.Length() is Outside
* - Property::BOOLEAN
* - Property::FLOAT
* - Property::INTEGER
+ * - Property::UNSIGNED_INTEGER
* - Property::VECTOR2
* - Property::VECTOR3
* - Property::VECTOR4
* - Property::BOOLEAN
* - Property::FLOAT
* - Property::INTEGER
+ * - Property::UNSIGNED_INTEGER
* - Property::VECTOR2
* - Property::VECTOR3
* - Property::VECTOR4
virtual const int& GetInteger() const = 0;
/**
+ * @brief Retrieve an integer value.
+ *
+ * @pre GetType() returns Property::UNSIGNED_INTEGER.
+ * @return The integer value.
+ */
+ virtual const unsigned int& GetUnsignedInteger() const = 0;
+
+ /**
* @brief Retrieve a Vector2 value.
*
* @pre GetType() returns Property::VECTOR2.
Value(bool boolValue);
/**
- * @brief Create a float property value.
- *
- * @param [in] floatValue A floating-point value.
- */
- Value(float floatValue);
-
- /**
* @brief Create an integer property value.
*
* @param [in] integerValue An integer value.
/**
* @brief Create an unsigned integer property value.
*
- * @param [in] unsignedIntegerValue An unsinged integer value.
+ * @param [in] unsignedIntegerValue An unsigned integer value.
*/
Value(unsigned int unsignedIntegerValue);
/**
+ * @brief Create a float property value.
+ *
+ * @param [in] floatValue A floating-point value.
+ */
+ Value(float floatValue);
+
+ /**
* @brief Create a Vector2 property value.
*
* @param [in] vectorValue A vector of 2 floating-point values.