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