Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-core.git] / dali / internal / update / common / property-owner.cpp
index 19389b8..87b3d31 100644 (file)
@@ -87,6 +87,16 @@ void PropertyOwner::Destroy()
   mConstraints.Clear();
 }
 
+void PropertyOwner::ConnectToSceneGraph()
+{
+  // Notification for observers
+  const ConstObserverIter endIter = mObservers.End();
+  for( ConstObserverIter iter = mObservers.Begin(); iter != endIter; ++iter)
+  {
+    (*iter)->PropertyOwnerConnected( *this );
+  }
+}
+
 void PropertyOwner::DisconnectFromSceneGraph( BufferIndex updateBufferIndex )
 {
   // Notification for observers
@@ -96,9 +106,6 @@ void PropertyOwner::DisconnectFromSceneGraph( BufferIndex updateBufferIndex )
     (*iter)->PropertyOwnerDisconnected( updateBufferIndex, *this );
   }
 
-  // Clear observers as they are not interested in destroyed if they have received a disconnect
-  mObservers.Clear();
-
   // Remove all constraints when disconnected from scene-graph
   mConstraints.Clear();
 }
@@ -119,13 +126,6 @@ void PropertyOwner::ResetToBaseValues( BufferIndex updateBufferIndex )
     (*iter)->ResetToBaseValue( updateBufferIndex );
   }
 
-  // Reset constraint weights
-  const ConstraintIter constraintEndIter = mConstraints.End();
-  for( ConstraintIter iter = mConstraints.Begin(); constraintEndIter != iter; ++iter )
-  {
-    (*iter)->mWeight.ResetToBaseValue( updateBufferIndex );
-  }
-
   // Notification for derived classes, to reset default properties
   ResetDefaultProperties( updateBufferIndex );
 }
@@ -144,7 +144,6 @@ void PropertyOwner::ApplyConstraint( ConstraintBase* constraint )
 
 void PropertyOwner::RemoveConstraint( ConstraintBase* constraint )
 {
-  // Reset constraint weights
   const ConstraintIter constraintEndIter = mConstraints.End();
   for( ConstraintIter iter = mConstraints.Begin(); constraintEndIter != iter; ++iter )
   {
@@ -155,14 +154,40 @@ 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()
 {
 }
 
+void PropertyOwner::AddUniformMapping( UniformPropertyMapping* map )
+{
+  mUniformMaps.Add( map );
+}
+
+void PropertyOwner::RemoveUniformMapping( const std::string& uniformName )
+{
+  mUniformMaps.Remove( uniformName );
+}
+
+const UniformMap& PropertyOwner::GetUniformMap() const
+{
+  return mUniformMaps;
+}
+
+void PropertyOwner::AddUniformMapObserver( UniformMap::Observer& observer )
+{
+  mUniformMaps.AddObserver( observer );
+}
+
+void PropertyOwner::RemoveUniformMapObserver( UniformMap::Observer& observer )
+{
+  mUniformMaps.RemoveObserver( observer );
+}
+
+
+
 } // namespace SceneGraph
 
 } // namespace Internal