mTargetPropertyIndex( targetPropertyIndex ),
mTargetProxy( NULL ),
mSceneGraphConstraint( NULL ),
+ mCustomWeight( NULL ),
mOffstageWeight( Dali::ActiveConstraint::DEFAULT_WEIGHT ),
mRemoveTime( 0.0f ),
mAlphaFunction( Dali::Constraint::DEFAULT_ALPHA_FUNCTION ),
mRemoveAction( Dali::Constraint::DEFAULT_REMOVE_ACTION ),
+ mTag(0),
mApplyAnimation(),
mRemoveAnimation()
{
}
}
-void ActiveConstraintBase::FirstApply( ProxyObject& parent, TimePeriod applyTime, ActiveConstraintCallbackType* callback )
+void ActiveConstraintBase::SetCustomWeightObject( ProxyObject& weightObject, Property::Index weightIndex )
+{
+ const SceneGraph::PropertyBase* base = weightObject.GetSceneObjectAnimatableProperty( weightIndex );
+ const SceneGraph::AnimatableProperty<float>* sceneProperty = dynamic_cast< const SceneGraph::AnimatableProperty<float>* >( base );
+
+ if( sceneProperty )
+ {
+ mCustomWeight = sceneProperty;
+
+ OnCustomWeightSet( weightObject );
+ }
+}
+
+void ActiveConstraintBase::FirstApply( ProxyObject& parent, TimePeriod applyTime )
{
// Notify derived classes
OnFirstApply( parent );
return mRemoveAction;
}
+void ActiveConstraintBase::SetTag(const unsigned int tag)
+{
+ mTag = tag;
+}
+
+unsigned int ActiveConstraintBase::GetTag() const
+{
+ return mTag;
+}
+
+
bool ActiveConstraintBase::IsSceneObjectRemovable() const
{
return true; // The constraint removed when target SceneGraph::PropertyOwner is destroyed
return DEFAULT_PROPERTY_COUNT;
}
+void ActiveConstraintBase::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
+{
+ indices.reserve( DEFAULT_PROPERTY_COUNT );
+
+ for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
+ {
+ indices.push_back( i );
+ }
+}
+
const std::string& ActiveConstraintBase::GetDefaultPropertyName( Property::Index index ) const
{
- // ProxyObject guarantees that index is within range
- return DEFAULT_PROPERTY_NAMES[index];
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
+ {
+ return DEFAULT_PROPERTY_NAMES[index];
+ }
+ else
+ {
+ // index out of range..return empty string
+ static const std::string INVALID_PROPERTY_NAME;
+ return INVALID_PROPERTY_NAME;
+ }
}
Property::Index ActiveConstraintBase::GetDefaultPropertyIndex( const std::string& name ) const
return true; // All default properties are currently animatable
}
+bool ActiveConstraintBase::IsDefaultPropertyAConstraintInput( Property::Index index ) const
+{
+ return true; // All default properties can currently be used as a constraint input
+}
+
Property::Type ActiveConstraintBase::GetDefaultPropertyType( Property::Index index ) const
{
- // ProxyObject guarantees that index is within range
- return DEFAULT_PROPERTY_TYPES[index];
+ if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
+ {
+ return DEFAULT_PROPERTY_TYPES[index];
+ }
+ else
+ {
+ // Index out-of-range
+ return Property::NONE;
+ }
}
void ActiveConstraintBase::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
{
- // ProxyObject guarantees the property is writable and index is in range
switch ( index )
{
case Dali::ActiveConstraint::WEIGHT:
{
Property::Value value;
- // ProxyObject guarantees that index is within range
switch ( index )
{
case Dali::ActiveConstraint::WEIGHT: