License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-core.git] / dali / public-api / actors / camera-actor.cpp
1 /*
2  * Copyright (c) 2014 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 void CameraActor::SetType( Dali::Camera::Type type )
61 {
62   GetImplementation(*this).SetType(type);
63 }
64
65 Dali::Camera::Type CameraActor::GetType() const
66 {
67   return GetImplementation(*this).GetType();
68 }
69
70 void CameraActor::SetProjectionMode( Dali::Camera::ProjectionMode mode )
71 {
72   GetImplementation(*this).SetProjectionMode( mode );
73 }
74
75 Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
76 {
77   return GetImplementation(*this).GetProjectionMode();
78 }
79
80 void CameraActor::SetFieldOfView( float fieldOfView )
81 {
82   GetImplementation(*this).SetFieldOfView(fieldOfView);
83 }
84
85 float CameraActor::GetFieldOfView( )
86 {
87   return GetImplementation(*this).GetFieldOfView();
88 }
89
90 void CameraActor::SetAspectRatio( float aspectRatio )
91 {
92   GetImplementation(*this).SetAspectRatio(aspectRatio);
93 }
94
95 float CameraActor::GetAspectRatio( )
96 {
97   return GetImplementation(*this).GetAspectRatio();
98 }
99
100 void CameraActor::SetNearClippingPlane( float nearClippingPlane )
101 {
102   GetImplementation(*this).SetNearClippingPlane(nearClippingPlane);
103 }
104
105 float CameraActor::GetNearClippingPlane( )
106 {
107   return GetImplementation(*this).GetNearClippingPlane();
108 }
109
110 void CameraActor::SetFarClippingPlane( float farClippingPlane )
111 {
112   GetImplementation(*this).SetFarClippingPlane(farClippingPlane);
113 }
114
115 float CameraActor::GetFarClippingPlane( )
116 {
117   return GetImplementation(*this).GetFarClippingPlane();
118 }
119
120 void CameraActor::SetTargetPosition( const Vector3& targetPosition )
121 {
122   GetImplementation(*this).SetTargetPosition(targetPosition);
123 }
124
125 Vector3 CameraActor::GetTargetPosition() const
126 {
127   return GetImplementation(*this).GetTargetPosition();
128 }
129
130 void CameraActor::SetInvertYAxis(bool invertYAxis)
131 {
132   GetImplementation(*this).SetInvertYAxis(invertYAxis);
133 }
134
135 bool CameraActor::GetInvertYAxis()
136 {
137   return GetImplementation(*this).GetInvertYAxis();
138 }
139
140 void CameraActor::SetPerspectiveProjection( const Size& size )
141 {
142   GetImplementation(*this).SetPerspectiveProjection( size );
143 }
144
145 void CameraActor::SetOrthographicProjection( const Vector2& size )
146 {
147   GetImplementation(*this).SetOrthographicProjection( size );
148 }
149
150 void CameraActor::SetOrthographicProjection( float left, float right, float top, float bottom, float near, float far )
151 {
152   GetImplementation(*this).SetOrthographicProjection( left, right, top, bottom, near, far );
153 }
154
155 } // namespace Dali