Implemented the Handle assignment operators properly
[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 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 CameraActor& CameraActor::operator=(BaseHandle::NullType* rhs)
72 {
73   DALI_ASSERT_ALWAYS( (rhs == NULL) && "Can only assign NULL pointer to handle");
74   Reset();
75   return *this;
76 }
77
78 void CameraActor::SetType( Dali::Camera::Type type )
79 {
80   GetImplementation(*this).SetType(type);
81 }
82
83 Dali::Camera::Type CameraActor::GetType() const
84 {
85   return GetImplementation(*this).GetType();
86 }
87
88 void CameraActor::SetProjectionMode( Dali::Camera::ProjectionMode mode )
89 {
90   GetImplementation(*this).SetProjectionMode( mode );
91 }
92
93 Dali::Camera::ProjectionMode CameraActor::GetProjectionMode() const
94 {
95   return GetImplementation(*this).GetProjectionMode();
96 }
97
98 void CameraActor::SetFieldOfView( float fieldOfView )
99 {
100   GetImplementation(*this).SetFieldOfView(fieldOfView);
101 }
102
103 float CameraActor::GetFieldOfView( )
104 {
105   return GetImplementation(*this).GetFieldOfView();
106 }
107
108 void CameraActor::SetAspectRatio( float aspectRatio )
109 {
110   GetImplementation(*this).SetAspectRatio(aspectRatio);
111 }
112
113 float CameraActor::GetAspectRatio( )
114 {
115   return GetImplementation(*this).GetAspectRatio();
116 }
117
118 void CameraActor::SetNearClippingPlane( float nearClippingPlane )
119 {
120   GetImplementation(*this).SetNearClippingPlane(nearClippingPlane);
121 }
122
123 float CameraActor::GetNearClippingPlane( )
124 {
125   return GetImplementation(*this).GetNearClippingPlane();
126 }
127
128 void CameraActor::SetFarClippingPlane( float farClippingPlane )
129 {
130   GetImplementation(*this).SetFarClippingPlane(farClippingPlane);
131 }
132
133 float CameraActor::GetFarClippingPlane( )
134 {
135   return GetImplementation(*this).GetFarClippingPlane();
136 }
137
138 void CameraActor::SetTargetPosition( const Vector3& targetPosition )
139 {
140   GetImplementation(*this).SetTargetPosition(targetPosition);
141 }
142
143 Vector3 CameraActor::GetTargetPosition() const
144 {
145   return GetImplementation(*this).GetTargetPosition();
146 }
147
148 void CameraActor::SetInvertYAxis(bool invertYAxis)
149 {
150   GetImplementation(*this).SetInvertYAxis(invertYAxis);
151 }
152
153 bool CameraActor::GetInvertYAxis()
154 {
155   return GetImplementation(*this).GetInvertYAxis();
156 }
157
158 void CameraActor::SetPerspectiveProjection( const Size& size )
159 {
160   GetImplementation(*this).SetPerspectiveProjection( size );
161 }
162
163 void CameraActor::SetOrthographicProjection( const Vector2& size )
164 {
165   GetImplementation(*this).SetOrthographicProjection( size );
166 }
167
168 void CameraActor::SetOrthographicProjection( float left, float right, float top, float bottom, float near, float far )
169 {
170   GetImplementation(*this).SetOrthographicProjection( left, right, top, bottom, near, far );
171 }
172
173 } // namespace Dali