[dali_1.1.31] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / public-api / actors / camera-actor.cpp
1 /*
2  * Copyright (c) 2015 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
27 CameraActor CameraActor::New()
28 {
29   Internal::CameraActorPtr internal = Internal::CameraActor::New( Size::ZERO );
30
31   return CameraActor(internal.Get());
32 }
33
34
35 CameraActor CameraActor::New( const Size& size )
36 {
37   Internal::CameraActorPtr internal = Internal::CameraActor::New( size );
38
39   return CameraActor(internal.Get());
40 }
41
42 CameraActor::CameraActor(Internal::CameraActor* internal)
43 : Actor(internal)
44 {
45 }
46
47 CameraActor CameraActor::DownCast( BaseHandle handle )
48 {
49   return CameraActor( dynamic_cast<Dali::Internal::CameraActor*>(handle.GetObjectPtr()) );
50 }
51
52 CameraActor::CameraActor()
53 {
54 }
55
56 CameraActor::~CameraActor()
57 {
58 }
59
60 CameraActor::CameraActor(const CameraActor& copy)
61 : Actor(copy)
62 {
63 }
64
65 CameraActor& CameraActor::operator=(const CameraActor& rhs)
66 {
67   BaseHandle::operator=(rhs);
68   return *this;
69 }
70
71 void CameraActor::SetType( Dali::Camera::Type type )
72 {
73   GetImplementation(*this).SetType(type);
74 }
75
76 Dali::Camera::Type CameraActor::GetType() const
77 {
78   return GetImplementation(*this).GetType();
79 }
80
81 void CameraActor::SetProjectionMode( Dali::Camera::ProjectionMode mode )
82 {
83   GetImplementation(*this).SetProjectionMode( mode );
84 }
85
86 Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
87 {
88   return GetImplementation(*this).GetProjectionMode();
89 }
90
91 void CameraActor::SetFieldOfView( float fieldOfView )
92 {
93   GetImplementation(*this).SetFieldOfView(fieldOfView);
94 }
95
96 float CameraActor::GetFieldOfView( )
97 {
98   return GetImplementation(*this).GetFieldOfView();
99 }
100
101 void CameraActor::SetAspectRatio( float aspectRatio )
102 {
103   GetImplementation(*this).SetAspectRatio(aspectRatio);
104 }
105
106 float CameraActor::GetAspectRatio( )
107 {
108   return GetImplementation(*this).GetAspectRatio();
109 }
110
111 void CameraActor::SetNearClippingPlane( float nearClippingPlane )
112 {
113   GetImplementation(*this).SetNearClippingPlane(nearClippingPlane);
114 }
115
116 float CameraActor::GetNearClippingPlane( )
117 {
118   return GetImplementation(*this).GetNearClippingPlane();
119 }
120
121 void CameraActor::SetFarClippingPlane( float farClippingPlane )
122 {
123   GetImplementation(*this).SetFarClippingPlane(farClippingPlane);
124 }
125
126 float CameraActor::GetFarClippingPlane( )
127 {
128   return GetImplementation(*this).GetFarClippingPlane();
129 }
130
131 void CameraActor::SetTargetPosition( const Vector3& targetPosition )
132 {
133   GetImplementation(*this).SetTarget(targetPosition);
134 }
135
136 Vector3 CameraActor::GetTargetPosition() const
137 {
138   return GetImplementation(*this).GetTarget();
139 }
140
141 void CameraActor::SetInvertYAxis(bool invertYAxis)
142 {
143   GetImplementation(*this).SetInvertYAxis(invertYAxis);
144 }
145
146 bool CameraActor::GetInvertYAxis()
147 {
148   return GetImplementation(*this).GetInvertYAxis();
149 }
150
151 void CameraActor::SetPerspectiveProjection( const Size& size )
152 {
153   GetImplementation(*this).SetPerspectiveProjection( size );
154 }
155
156 void CameraActor::SetOrthographicProjection( const Vector2& size )
157 {
158   GetImplementation(*this).SetOrthographicProjection( size );
159 }
160
161 void CameraActor::SetOrthographicProjection( float left, float right, float top, float bottom, float near, float far )
162 {
163   GetImplementation(*this).SetOrthographicProjection( left, right, top, bottom, near, far );
164 }
165
166 } // namespace Dali