Remove more public Setter/Getter APIs from Dali::Actor
[platform/core/uifw/dali-demo.git] / examples / reflection-demo / reflection-example.cpp
index c0eb880..4ffaf31 100644 (file)
@@ -195,8 +195,8 @@ private:
     mLayer3D.SetSize( stageWidth, stageHeight );
     stage.Add(mLayer3D);
 
-    mLayer3D.SetAnchorPoint( AnchorPoint::CENTER );
-    mLayer3D.SetParentOrigin( ParentOrigin::CENTER );
+    mLayer3D.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+    mLayer3D.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     mLayer3D.SetBehavior( Layer::LAYER_3D );
     mLayer3D.SetDepthTestDisabled( false );
 
@@ -302,8 +302,8 @@ private:
     Actor panScreen = Actor::New();
     auto stageSize = stage.GetSize();
     panScreen.SetSize( stageSize.width, stageSize.height );
-    panScreen.SetAnchorPoint( AnchorPoint::CENTER );
-    panScreen.SetParentOrigin( ParentOrigin::CENTER );
+    panScreen.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+    panScreen.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     auto camera2d = stage.GetRenderTaskList().GetTask(0).GetCameraActor();
     panScreen.SetPosition( 0, 0, camera2d.GetNearClippingPlane() );
     camera2d.Add(panScreen);
@@ -331,12 +331,12 @@ private:
       auto actor = node.cameraId != 0xffffffff ? CameraActor::New( stage.GetSize() ) : Actor::New();
 
       actor.SetSize( 1, 1, 1 );
-      actor.SetName( node.name );
-      actor.SetAnchorPoint( AnchorPoint::CENTER );
-      actor.SetParentOrigin( ParentOrigin::CENTER );
+      actor.SetProperty( Dali::Actor::Property::NAME, node.name );
+      actor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+      actor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
       actor.SetPosition( node.translation[0], node.translation[1], node.translation[2] );
       actor.SetScale( node.scale[0], node.scale[1], node.scale[2] );
-      actor.SetOrientation( Quaternion(node.rotationQuaternion[3],
+      actor.SetProperty( Actor::Property::ORIENTATION, Quaternion(node.rotationQuaternion[3],
                                        node.rotationQuaternion[0],
                                        node.rotationQuaternion[1],
                                        node.rotationQuaternion[2]));
@@ -374,7 +374,7 @@ private:
         mCameraPos = Vector3(node.translation[0], node.translation[1], node.translation[2]);
         auto quatY = Quaternion( Degree(180.0f), Vector3( 0.0, 1.0, 0.0) );
         auto cameraActor = CameraActor::DownCast( actor );
-        cameraActor.SetOrientation( Quaternion(node.rotationQuaternion[3],
+        cameraActor.SetProperty( Actor::Property::ORIENTATION, Quaternion(node.rotationQuaternion[3],
                                                node.rotationQuaternion[0],
                                                node.rotationQuaternion[1],
                                                node.rotationQuaternion[2] )
@@ -388,8 +388,8 @@ private:
         cameraActor.SetFieldOfView( camera->yfov );
 
         cameraActor.SetProperty( CameraActor::Property::INVERT_Y_AXIS, true);
-        cameraActor.SetAnchorPoint( AnchorPoint::CENTER );
-        cameraActor.SetParentOrigin( ParentOrigin::CENTER );
+        cameraActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+        cameraActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
 
         mCameras.emplace_back( cameraActor );
       }
@@ -634,35 +634,36 @@ private:
     auto sun = root.FindChildByName( "sun" );
     sun.SetProperty( mSunTimeUniformIndex, mMockTime );
     sun.SetProperty( mSunKFactorUniformIndex, mKFactor );
-    sun.SetOrientation( Quaternion( Radian(Degree(rotationAngle)), Vector3(0.0, 1.0, 0.0)));
+    sun.SetProperty( Actor::Property::ORIENTATION, Quaternion( Radian(Degree(rotationAngle)), Vector3(0.0, 1.0, 0.0)));
     return true;
   }
 
 private:
+
   Application&  mApplication;
 
-  Layer mLayer3D;
+  Layer mLayer3D{};
 
-  std::vector<Actor>                      mActors;
-  std::vector<CameraActor>                mCameras;
-  std::vector<std::unique_ptr<Model>>     mModels;
-  std::vector<TextureSet>                 mTextureSets;
+  std::vector<Actor>                      mActors {};
+  std::vector<CameraActor>                mCameras {};
+  std::vector<std::unique_ptr<Model>>     mModels {};
+  std::vector<TextureSet>                 mTextureSets {};
 
-  Animation mAnimation;
-  float mMockTime = 0.0f;
-  float mKFactor = 0.0f;
-  Property::Index mSunTimeUniformIndex;
-  Property::Index mSunKFactorUniformIndex;
-  PanGestureDetector mPanGestureDetector;
+  Animation mAnimation {};
+  float mMockTime { 0.0f };
+  float mKFactor { 0.0f };
+  Property::Index mSunTimeUniformIndex {};
+  Property::Index mSunKFactorUniformIndex {};
+  PanGestureDetector mPanGestureDetector {};
 
-  Vector3 mCameraPos;
-  Vector3 mLightDir;
-  Timer mTickTimer;
+  Vector3 mCameraPos { Vector3::ZERO };
+  Vector3 mLightDir { Vector3::ZERO };
+  Timer mTickTimer {};
 
-  CameraActor mCamera3D;
-  CameraActor mReflectionCamera3D;
-  Actor mCenterActor;
-  Actor mCenterHorizActor;
+  CameraActor mCamera3D {};
+  CameraActor mReflectionCamera3D {};
+  Actor mCenterActor {};
+  Actor mCenterHorizActor {};
 };
 
 int DALI_EXPORT_API main( int argc, char **argv )