Ensure BaseHandle class move noexcept (core public-api)
[platform/core/uifw/dali-core.git] / dali / public-api / actors / camera-actor.cpp
index 988d2b7..fa8f08c 100644 (file)
@@ -1,18 +1,19 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2023 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // CLASS HEADER
 #include <dali/public-api/actors/camera-actor.h>
 
 namespace Dali
 {
-
 CameraActor CameraActor::New()
 {
-  Internal::CameraActorPtr internal = Internal::CameraActor::New( Size::ZERO );
+  Internal::CameraActorPtr internal = Internal::CameraActor::New(Size::ZERO);
 
   return CameraActor(internal.Get());
 }
 
+CameraActor CameraActor::New(const Size& size)
+{
+  Internal::CameraActorPtr internal = Internal::CameraActor::New(size);
+
+  return CameraActor(internal.Get());
+}
 
-CameraActor CameraActor::New( const Size& size )
+CameraActor CameraActor::New3DCamera()
 {
-  Internal::CameraActorPtr internal = Internal::CameraActor::New( size );
+  Internal::CameraActorPtr internal = Internal::CameraActor::New(Size::ZERO, true);
 
   return CameraActor(internal.Get());
 }
@@ -43,20 +49,24 @@ CameraActor::CameraActor(Internal::CameraActor* internal)
 {
 }
 
-CameraActor CameraActor::DownCast( BaseHandle handle )
+CameraActor CameraActor::DownCast(BaseHandle handle)
 {
-  return CameraActor( dynamic_cast<Dali::Internal::CameraActor*>(handle.GetObjectPtr()) );
+  return CameraActor(dynamic_cast<Dali::Internal::CameraActor*>(handle.GetObjectPtr()));
 }
 
-CameraActor::CameraActor()
-{
-}
+CameraActor::CameraActor() = default;
 
-CameraActor::~CameraActor()
-{
-}
+CameraActor::~CameraActor() = default;
+
+CameraActor::CameraActor(const CameraActor& copy) = default;
+
+CameraActor& CameraActor::operator=(const CameraActor& rhs) = default;
+
+CameraActor::CameraActor(CameraActor&& rhs) noexcept = default;
 
-void CameraActor::SetType( Dali::Camera::Type type )
+CameraActor& CameraActor::operator=(CameraActor&& rhs) noexcept = default;
+
+void CameraActor::SetType(Dali::Camera::Type type)
 {
   GetImplementation(*this).SetType(type);
 }
@@ -66,9 +76,9 @@ Dali::Camera::Type CameraActor::GetType() const
   return GetImplementation(*this).GetType();
 }
 
-void CameraActor::SetProjectionMode( Dali::Camera::ProjectionMode mode )
+void CameraActor::SetProjectionMode(Dali::Camera::ProjectionMode mode)
 {
-  GetImplementation(*this).SetProjectionMode( mode );
+  GetImplementation(*this).SetProjectionMode(mode);
 }
 
 Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
@@ -76,54 +86,54 @@ Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
   return GetImplementation(*this).GetProjectionMode();
 }
 
-void CameraActor::SetFieldOfView( float fieldOfView )
+void CameraActor::SetFieldOfView(float fieldOfView)
 {
   GetImplementation(*this).SetFieldOfView(fieldOfView);
 }
 
-float CameraActor::GetFieldOfView( )
+float CameraActor::GetFieldOfView()
 {
   return GetImplementation(*this).GetFieldOfView();
 }
 
-void CameraActor::SetAspectRatio( float aspectRatio )
+void CameraActor::SetAspectRatio(float aspectRatio)
 {
   GetImplementation(*this).SetAspectRatio(aspectRatio);
 }
 
-float CameraActor::GetAspectRatio( )
+float CameraActor::GetAspectRatio()
 {
   return GetImplementation(*this).GetAspectRatio();
 }
 
-void CameraActor::SetNearClippingPlane( float nearClippingPlane )
+void CameraActor::SetNearClippingPlane(float nearClippingPlane)
 {
   GetImplementation(*this).SetNearClippingPlane(nearClippingPlane);
 }
 
-float CameraActor::GetNearClippingPlane( )
+float CameraActor::GetNearClippingPlane()
 {
   return GetImplementation(*this).GetNearClippingPlane();
 }
 
-void CameraActor::SetFarClippingPlane( float farClippingPlane )
+void CameraActor::SetFarClippingPlane(float farClippingPlane)
 {
   GetImplementation(*this).SetFarClippingPlane(farClippingPlane);
 }
 
-float CameraActor::GetFarClippingPlane( )
+float CameraActor::GetFarClippingPlane()
 {
   return GetImplementation(*this).GetFarClippingPlane();
 }
 
-void CameraActor::SetTargetPosition( const Vector3& targetPosition )
+void CameraActor::SetTargetPosition(const Vector3& targetPosition)
 {
-  GetImplementation(*this).SetTargetPosition(targetPosition);
+  GetImplementation(*this).SetTarget(targetPosition);
 }
 
 Vector3 CameraActor::GetTargetPosition() const
 {
-  return GetImplementation(*this).GetTargetPosition();
+  return GetImplementation(*this).GetTarget();
 }
 
 void CameraActor::SetInvertYAxis(bool invertYAxis)
@@ -136,19 +146,14 @@ bool CameraActor::GetInvertYAxis()
   return GetImplementation(*this).GetInvertYAxis();
 }
 
-void CameraActor::SetPerspectiveProjection( const Size& size )
-{
-  GetImplementation(*this).SetPerspectiveProjection( size );
-}
-
-void CameraActor::SetOrthographicProjection( const Vector2& size )
+void CameraActor::SetPerspectiveProjection(const Size& size)
 {
-  GetImplementation(*this).SetOrthographicProjection( size );
+  GetImplementation(*this).SetPerspectiveProjection(size);
 }
 
-void CameraActor::SetOrthographicProjection( float left, float right, float top, float bottom, float near, float far )
+void CameraActor::SetOrthographicProjection(const Size& size)
 {
-  GetImplementation(*this).SetOrthographicProjection( left, right, top, bottom, near, far );
+  GetImplementation(*this).SetOrthographicProjection(size);
 }
 
 } // namespace Dali