[3.0] Clipping API feature in Actor
[platform/core/uifw/dali-core.git] / dali / internal / update / nodes / node.cpp
index e1d5847..e873a6f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
@@ -21,7 +21,6 @@
 // INTERNAL INCLUDES
 #include <dali/internal/common/internal-constants.h>
 #include <dali/internal/common/memory-pool-object-allocator.h>
-#include <dali/internal/update/node-attachments/node-attachment.h>
 #include <dali/internal/update/common/discard-queue.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/common/constants.h>
@@ -54,27 +53,29 @@ Node::Node()
   mTransformId( INVALID_TRANSFORM_ID ),
   mParentOrigin( TRANSFORM_PROPERTY_PARENT_ORIGIN ),
   mAnchorPoint( TRANSFORM_PROPERTY_ANCHOR_POINT ),
-  mSize(TRANSFORM_PROPERTY_SIZE),     // zero initialized by default
-  mPosition(TRANSFORM_PROPERTY_POSITION), // zero initialized by default
-  mOrientation(), // initialized to identity by default
+  mSize( TRANSFORM_PROPERTY_SIZE ),                                               // Zero initialized by default
+  mPosition( TRANSFORM_PROPERTY_POSITION ),                                       // Zero initialized by default
+  mOrientation(),                                                                 // Initialized to identity by default
   mScale( TRANSFORM_PROPERTY_SCALE ),
   mVisible( true ),
   mColor( Color::WHITE ),
-  mWorldPosition(TRANSFORM_PROPERTY_WORLD_POSITION, Vector3(0.0f,0.0f,0.0f)), // zero initialized by default
-  mWorldScale( TRANSFORM_PROPERTY_WORLD_SCALE, Vector3(1.0f,1.0f,1.0f) ),
-  mWorldOrientation(), // initialized to identity by default
+  mWorldPosition( TRANSFORM_PROPERTY_WORLD_POSITION, Vector3( 0.0f,0.0f,0.0f ) ), // Zero initialized by default
+  mWorldScale( TRANSFORM_PROPERTY_WORLD_SCALE, Vector3( 1.0f,1.0f,1.0f ) ),
+  mWorldOrientation(),                                                            // Initialized to identity by default
   mWorldMatrix(),
   mWorldColor( Color::WHITE ),
+  mClippingSortModifier( 0u ),
   mParent( NULL ),
   mExclusiveRenderTask( NULL ),
-  mAttachment( NULL ),
   mChildren(),
+  mClippingDepth( 0u ),
   mRegenerateUniformMap( 0 ),
-  mDepth(0u),
-  mDirtyFlags(AllFlags),
-  mIsRoot( false ),
+  mDepth( 0u ),
+  mDirtyFlags( AllFlags ),
   mDrawMode( DrawMode::NORMAL ),
-  mColorMode( DEFAULT_COLOR_MODE )
+  mColorMode( DEFAULT_COLOR_MODE ),
+  mClippingMode( ClippingMode::DISABLED ),
+  mIsRoot( false )
 {
   mUniformMapChanged[0] = 0u;
   mUniformMapChanged[1] = 0u;
@@ -95,12 +96,6 @@ void Node::operator delete( void* ptr )
 
 void Node::OnDestroy()
 {
-  // Node attachments should be notified about the disconnection.
-  if ( mAttachment )
-  {
-    mAttachment->OnDestroy();
-  }
-
   // Animators, Constraints etc. should be disconnected from the child's properties.
   PropertyOwner::Destroy();
 }
@@ -126,18 +121,6 @@ void Node::CreateTransform( SceneGraph::TransformManager* transformManager )
   mWorldMatrix.Initialize( transformManager, mTransformId );
 }
 
-void Node::Attach( NodeAttachment& object )
-{
-  DALI_ASSERT_DEBUG(!mAttachment);
-
-  object.SetParent(*this);
-
-  mAttachment = &object;
-  SetAllDirtyFlags();
-
-  mAttachment->ConnectedToSceneGraph();
-}
-
 void Node::SetRoot(bool isRoot)
 {
   DALI_ASSERT_DEBUG(!isRoot || mParent == NULL); // Root nodes cannot have a parent
@@ -205,12 +188,6 @@ void Node::ConnectChild( Node* childNode )
 
   // Inform property observers of new connection
   childNode->ConnectToSceneGraph();
-
-  // Inform child node attachment that the node has been added to the stage
-  if( childNode->mAttachment )
-  {
-    childNode->mAttachment->ConnectedToSceneGraph();
-  }
 }
 
 void Node::DisconnectChild( BufferIndex updateBufferIndex, Node& childNode )
@@ -314,12 +291,6 @@ void Node::RecursiveDisconnectFromSceneGraph( BufferIndex updateBufferIndex )
   // Remove all child pointers
   mChildren.Clear();
 
-  // Inform child node attachment that the node has been removed from the stage
-  if( mAttachment )
-  {
-    mAttachment->DisconnectedFromSceneGraph();
-  }
-
   if( mTransformId != INVALID_TRANSFORM_ID )
   {
     mTransformManager->SetParent( mTransformId, INVALID_TRANSFORM_ID );