/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
mConstraints.Clear();
}
-void PropertyOwner::InstallCustomProperty(PropertyBase* property)
+void PropertyOwner::InstallCustomProperty( OwnerPointer<PropertyBase>& property )
{
- DALI_ASSERT_DEBUG( NULL != property );
-
- mCustomProperties.PushBack( property );
+ mCustomProperties.PushBack( property.Release() );
}
-void PropertyOwner::ResetToBaseValues( BufferIndex updateBufferIndex )
-{
- // Reset custom properties
- const OwnedPropertyIter endIter = mCustomProperties.End();
- for ( OwnedPropertyIter iter = mCustomProperties.Begin(); endIter != iter; ++iter )
- {
- (*iter)->ResetToBaseValue( updateBufferIndex );
- }
-
- // Notification for derived classes, to reset default properties
- ResetDefaultProperties( updateBufferIndex );
-}
ConstraintOwnerContainer& PropertyOwner::GetConstraints()
{
return mConstraints;
}
-void PropertyOwner::ApplyConstraint( ConstraintBase* constraint )
+void PropertyOwner::ApplyConstraint( OwnerPointer<ConstraintBase>& constraint )
{
- mConstraints.PushBack( constraint );
-
constraint->OnConnect();
+ mConstraints.PushBack( constraint.Release() );
}
void PropertyOwner::RemoveConstraint( ConstraintBase* constraint )
}
}
- // Should not come here
- DALI_ASSERT_DEBUG( false && "Constraint missing in RemoveConstraint" );
+ //it may be that the constraint has already been removed e.g. from disconnection from scene graph, so nothing needs to be done
}
PropertyOwner::PropertyOwner()
+:mPropertyDirty( false )
{
}
-void PropertyOwner::AddUniformMapping( UniformPropertyMapping* map )
+void PropertyOwner::AddUniformMapping( OwnerPointer< UniformPropertyMapping >& map )
{
- mUniformMaps.Add( map );
+ mUniformMaps.Add( map.Release() );
}
void PropertyOwner::RemoveUniformMapping( const std::string& uniformName )
mUniformMaps.RemoveObserver( observer );
}
+void PropertyOwner::SetPropertyDirty( bool value )
+{
+ mPropertyDirty = value;
+}
+bool PropertyOwner::IsPropertyDirty() const
+{
+ return mPropertyDirty;
+}
} // namespace SceneGraph