License conversion from Flora to Apache 2.0
[platform/core/uifw/dali-core.git] / dali / public-api / dynamics / dynamics-world-config.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/dynamics/dynamics-world-config.h>
20
21 // INTERNAL HEADERS
22 #ifdef DYNAMICS_SUPPORT
23 #include <dali/internal/event/dynamics/dynamics-world-config-impl.h>
24 #endif
25
26 namespace Dali
27 {
28
29 DynamicsWorldConfig DynamicsWorldConfig::New()
30 {
31 #ifdef DYNAMICS_SUPPORT
32   Internal::DynamicsWorldConfigPtr internal( new Internal::DynamicsWorldConfig() );
33
34   return DynamicsWorldConfig( internal.Get() );
35 #else
36   return DynamicsWorldConfig();
37 #endif
38 }
39
40 DynamicsWorldConfig::DynamicsWorldConfig()
41 {
42 }
43
44 DynamicsWorldConfig::~DynamicsWorldConfig()
45 {
46 }
47
48 void DynamicsWorldConfig::SetType( const DynamicsWorldConfig::WorldType type )
49 {
50 #ifdef DYNAMICS_SUPPORT
51   GetImplementation(*this).SetType( type );
52 #endif
53 }
54
55 DynamicsWorldConfig::WorldType DynamicsWorldConfig::GetType() const
56 {
57 #ifdef DYNAMICS_SUPPORT
58   return GetImplementation(*this).GetType();
59 #else
60   return DynamicsWorldConfig::RIGID;
61 #endif
62 }
63
64 void DynamicsWorldConfig::SetUnit(float unit)
65 {
66 #ifdef DYNAMICS_SUPPORT
67   GetImplementation(*this).SetUnit( unit );
68 #endif
69 }
70
71 float DynamicsWorldConfig::GetUnit() const
72 {
73 #ifdef DYNAMICS_SUPPORT
74   return GetImplementation(*this).GetUnit();
75 #else
76   return float();
77 #endif
78 }
79
80 void DynamicsWorldConfig::SetSimulationSubSteps(int subSteps)
81 {
82 #ifdef DYNAMICS_SUPPORT
83   GetImplementation(*this).SetSimulationSubSteps( subSteps );
84 #endif
85 }
86
87 int DynamicsWorldConfig::GetSimulationSubSteps() const
88 {
89 #ifdef DYNAMICS_SUPPORT
90   return GetImplementation(*this).GetSimulationSubSteps();
91 #else
92   return int();
93 #endif
94 }
95
96 DynamicsWorldConfig::DynamicsWorldConfig( Internal::DynamicsWorldConfig* internal )
97 #ifdef DYNAMICS_SUPPORT
98 : BaseHandle(internal)
99 #else
100 : BaseHandle(NULL)
101 #endif
102 {
103 }
104
105 } // namespace Dali