[Tizen] Revert "Remove StereoMode"
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / camera-actor-impl.cpp
index 4530783..3383f00 100644 (file)
@@ -64,7 +64,7 @@ DALI_PROPERTY( "targetPosition",         VECTOR3,  true,    false,   true,   Dal
 DALI_PROPERTY( "projectionMatrix",       MATRIX,   false,   false,   true,   Dali::CameraActor::Property::PROJECTION_MATRIX     )
 DALI_PROPERTY( "viewMatrix",             MATRIX,   false,   false,   true,   Dali::CameraActor::Property::VIEW_MATRIX           )
 DALI_PROPERTY( "invertYAxis",            BOOLEAN,  true,    false,   true,   Dali::CameraActor::Property::INVERT_Y_AXIS         )
-DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, CameraDefaultProperties )
 
 // calculate the far plane distance for a 16bit depth buffer with 4 bits per unit precision
 void CalculateClippingAndZ( float width, float height, float& nearClippingPlane, float& farClippingPlane, float& cameraZ )
@@ -79,7 +79,7 @@ BaseHandle Create()
   return Dali::CameraActor::New();
 }
 
-TypeRegistration mType( typeid( Dali::CameraActor ), typeid( Dali::Actor ), Create );
+TypeRegistration mType( typeid( Dali::CameraActor ), typeid( Dali::Actor ), Create, CameraDefaultProperties );
 
 /**
  * Builds the picking ray in the world reference system from an orthographic camera
@@ -140,7 +140,7 @@ void BuildOrthoPickingRay( const Matrix& viewMatrix,
 
 CameraActorPtr CameraActor::New( const Size& size )
 {
-  CameraActorPtr actor( new CameraActor() );
+  CameraActorPtr actor( new CameraActor( *CreateNode() ) );
 
   // Second-phase construction
   actor->Initialize();
@@ -155,8 +155,8 @@ CameraActorPtr CameraActor::New( const Size& size )
   return actor;
 }
 
-CameraActor::CameraActor()
-: Actor( Actor::BASIC ),
+CameraActor::CameraActor( const SceneGraph::Node& node )
+: Actor( Actor::BASIC, node ),
   mSceneObject( NULL ),
   mTarget( SceneGraph::Camera::DEFAULT_TARGET_POSITION ),
   mType( SceneGraph::Camera::DEFAULT_TYPE ),
@@ -188,7 +188,7 @@ void CameraActor::OnInitialize()
   SceneGraph::Camera* sceneGraphCamera = SceneGraph::Camera::New();
 
   // Store a pointer to this camera node inside the scene-graph camera.
-  sceneGraphCamera->SetNode( mNode );
+  sceneGraphCamera->SetNode( &mNode );
 
   mSceneObject = sceneGraphCamera;
   OwnerPointer< SceneGraph::Camera > sceneGraphCameraOwner( sceneGraphCamera );
@@ -453,7 +453,7 @@ bool CameraActor::BuildPickingRay( const Vector2& screenCoordinates,
   {
     // Build a picking ray in the world reference system.
     // ray starts from the camera world position
-    rayOrigin = mNode->GetWorldMatrix(0).GetTranslation();
+    rayOrigin = mNode.GetWorldMatrix(0).GetTranslation();
     rayOrigin.w = 1.0f;
 
     // Transform the touch point from the screen coordinate system to the world coordinates system.
@@ -513,117 +513,6 @@ const SceneGraph::Camera* CameraActor::GetCamera() const
   return mSceneObject;
 }
 
-unsigned int CameraActor::GetDefaultPropertyCount() const
-{
-  return Actor::GetDefaultPropertyCount() + DEFAULT_PROPERTY_COUNT;
-}
-
-void CameraActor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
-{
-  Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
-
-  indices.Reserve( indices.Size() + DEFAULT_PROPERTY_COUNT );
-
-  int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-  for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
-  {
-    indices.PushBack( index );
-  }
-}
-
-bool CameraActor::IsDefaultPropertyWritable( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyWritable( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].writable;
-}
-
-bool CameraActor::IsDefaultPropertyAnimatable( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyAnimatable( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].animatable;
-}
-
-bool CameraActor::IsDefaultPropertyAConstraintInput( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::IsDefaultPropertyAConstraintInput( index );
-  }
-
-  return DEFAULT_PROPERTY_DETAILS[index - DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX].constraintInput;
-}
-
-Property::Type CameraActor::GetDefaultPropertyType( Property::Index index ) const
-{
-  if( index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT )
-  {
-    return Actor::GetDefaultPropertyType( index );
-  }
-  else
-  {
-    index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-
-    if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-    {
-      return DEFAULT_PROPERTY_DETAILS[index].type;
-    }
-    else
-    {
-      // index out-of-bounds
-      return Property::NONE;
-    }
-  }
-}
-
-const char* CameraActor::GetDefaultPropertyName( Property::Index index ) const
-{
-  if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)
-  {
-    return Actor::GetDefaultPropertyName(index);
-  }
-  else
-  {
-    index -= DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-
-    if ( ( index >= 0 ) && ( index < DEFAULT_PROPERTY_COUNT ) )
-    {
-      return DEFAULT_PROPERTY_DETAILS[index].name;
-    }
-    return NULL;
-  }
-}
-
-Property::Index CameraActor::GetDefaultPropertyIndex(const std::string& name) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  // Look for name in current class' default properties
-  for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
-  {
-    if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_DETAILS[i].name ) ) // dont want to convert rhs to string
-    {
-      index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
-      break;
-    }
-  }
-
-  // If not found, check in base class
-  if( Property::INVALID_INDEX == index )
-  {
-    index = Actor::GetDefaultPropertyIndex( name );
-  }
-
-  return index;
-}
-
 void CameraActor::SetDefaultProperty( Property::Index index, const Property::Value& propertyValue )
 {
   if(index < DEFAULT_ACTOR_PROPERTY_MAX_COUNT)