93c1cfdbf4786355c60127a3df0d4da9e4f433eb
[platform/core/uifw/dali-core.git] / dali / public-api / actors / camera-actor.cpp
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/public-api/actors/camera-actor.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/actors/camera-actor-impl.h>
23
24 namespace Dali
25 {
26 CameraActor CameraActor::New()
27 {
28   Internal::CameraActorPtr internal = Internal::CameraActor::New(Size::ZERO);
29
30   return CameraActor(internal.Get());
31 }
32
33 CameraActor CameraActor::New(const Size& size)
34 {
35   Internal::CameraActorPtr internal = Internal::CameraActor::New(size);
36
37   return CameraActor(internal.Get());
38 }
39
40 CameraActor::CameraActor(Internal::CameraActor* internal)
41 : Actor(internal)
42 {
43 }
44
45 CameraActor CameraActor::DownCast(BaseHandle handle)
46 {
47   return CameraActor(dynamic_cast<Dali::Internal::CameraActor*>(handle.GetObjectPtr()));
48 }
49
50 CameraActor::CameraActor() = default;
51
52 CameraActor::~CameraActor() = default;
53
54 CameraActor::CameraActor(const CameraActor& copy) = default;
55
56 CameraActor& CameraActor::operator=(const CameraActor& rhs)
57 {
58   BaseHandle::operator=(rhs);
59   return *this;
60 }
61
62 void CameraActor::SetType(Dali::Camera::Type type)
63 {
64   GetImplementation(*this).SetType(type);
65 }
66
67 Dali::Camera::Type CameraActor::GetType() const
68 {
69   return GetImplementation(*this).GetType();
70 }
71
72 void CameraActor::SetProjectionMode(Dali::Camera::ProjectionMode mode)
73 {
74   GetImplementation(*this).SetProjectionMode(mode);
75 }
76
77 Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
78 {
79   return GetImplementation(*this).GetProjectionMode();
80 }
81
82 void CameraActor::SetFieldOfView(float fieldOfView)
83 {
84   GetImplementation(*this).SetFieldOfView(fieldOfView);
85 }
86
87 float CameraActor::GetFieldOfView()
88 {
89   return GetImplementation(*this).GetFieldOfView();
90 }
91
92 void CameraActor::SetAspectRatio(float aspectRatio)
93 {
94   GetImplementation(*this).SetAspectRatio(aspectRatio);
95 }
96
97 float CameraActor::GetAspectRatio()
98 {
99   return GetImplementation(*this).GetAspectRatio();
100 }
101
102 void CameraActor::SetNearClippingPlane(float nearClippingPlane)
103 {
104   GetImplementation(*this).SetNearClippingPlane(nearClippingPlane);
105 }
106
107 float CameraActor::GetNearClippingPlane()
108 {
109   return GetImplementation(*this).GetNearClippingPlane();
110 }
111
112 void CameraActor::SetFarClippingPlane(float farClippingPlane)
113 {
114   GetImplementation(*this).SetFarClippingPlane(farClippingPlane);
115 }
116
117 float CameraActor::GetFarClippingPlane()
118 {
119   return GetImplementation(*this).GetFarClippingPlane();
120 }
121
122 void CameraActor::SetTargetPosition(const Vector3& targetPosition)
123 {
124   GetImplementation(*this).SetTarget(targetPosition);
125 }
126
127 Vector3 CameraActor::GetTargetPosition() const
128 {
129   return GetImplementation(*this).GetTarget();
130 }
131
132 void CameraActor::SetInvertYAxis(bool invertYAxis)
133 {
134   GetImplementation(*this).SetInvertYAxis(invertYAxis);
135 }
136
137 bool CameraActor::GetInvertYAxis()
138 {
139   return GetImplementation(*this).GetInvertYAxis();
140 }
141
142 void CameraActor::SetPerspectiveProjection(const Size& size)
143 {
144   GetImplementation(*this).SetPerspectiveProjection(size);
145 }
146
147 void CameraActor::SetOrthographicProjection(const Vector2& size)
148 {
149   GetImplementation(*this).SetOrthographicProjection(size);
150 }
151
152 void CameraActor::SetOrthographicProjection(float left, float right, float top, float bottom, float near, float far)
153 {
154   GetImplementation(*this).SetOrthographicProjection(left, right, top, bottom, near, far);
155 }
156
157 } // namespace Dali