X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Freflection-demo%2Freflection-example.cpp;h=013c0b644ba6987a6a7c9533a7032b6f40f60556;hb=2e182925204bf3ef9f2a36cbfbf998e79fbafaf5;hp=c0eb8803aa079a690b49d5076fb6332ef467c0ed;hpb=58c85134a26e3a8d565861f55d24f78ba21c90ad;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/reflection-demo/reflection-example.cpp b/examples/reflection-demo/reflection-example.cpp index c0eb880..013c0b6 100644 --- a/examples/reflection-demo/reflection-example.cpp +++ b/examples/reflection-demo/reflection-example.cpp @@ -192,11 +192,11 @@ private: stage.GetRenderTaskList().GetTask(0).SetClearEnabled(false); mLayer3D = Layer::New(); - mLayer3D.SetSize( stageWidth, stageHeight ); + mLayer3D.SetProperty( Actor::Property::SIZE, Vector2( 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 ); @@ -301,11 +301,11 @@ 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::SIZE, Vector2( stageSize.width, stageSize.height ) ); + 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() ); + panScreen.SetProperty( Actor::Property::POSITION, Vector3( 0, 0, camera2d.GetNearClippingPlane() )); camera2d.Add(panScreen); camera2d.RotateBy( Degree(180.0f), Vector3( 0.0, 1.0, 0.0 ) ); mPanGestureDetector = PanGestureDetector::New(); @@ -330,13 +330,13 @@ 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.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::SIZE, Vector3( 1, 1, 1 ) ); + 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.SetProperty( Actor::Property::POSITION, Vector3( node.translation[0], node.translation[1], node.translation[2] )); + actor.SetProperty( Actor::Property::SCALE, Vector3( node.scale[0], node.scale[1], node.scale[2] ) ); + 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 mActors; - std::vector mCameras; - std::vector> mModels; - std::vector mTextureSets; + std::vector mActors {}; + std::vector mCameras {}; + std::vector> mModels {}; + std::vector 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 )