Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-core.git] / dali / public-api / actors / model-actor-factory.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/actors/model-actor-factory.h>
19
20 // INTERNAL INCLUDES
21 #include <dali/public-api/actors/actor.h>
22 #include <dali/public-api/modeling/model.h>
23 #include <dali/internal/event/actors/actor-impl.h>
24 #include <dali/internal/event/modeling/model-impl.h>
25 #include <dali/internal/event/actors/model-actor-factory-impl.h>
26
27
28 namespace Dali
29 {
30
31 Actor ModelActorFactory::BuildActorTree(Model& model, const std::string& entityName)
32 {
33   Internal::ActorPtr actor = Internal::ModelActorFactory::BuildActorTree(model, entityName);
34   return Actor(actor.Get());
35 }
36
37 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index)
38 {
39   Internal::Model& modelImpl = GetImplementation(model);
40   Internal::Actor& actorImpl = GetImplementation(rootActor);
41   Internal::AnimationPtr internal = Internal::ModelActorFactory::BuildAnimation(modelImpl, actorImpl, index);
42   return Animation(internal.Get());
43 }
44
45 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, float durationSeconds)
46 {
47   Internal::Model& modelImpl = GetImplementation(model);
48   Internal::Actor& actorImpl = GetImplementation(rootActor);
49   Internal::AnimationPtr internal = Internal::ModelActorFactory::BuildAnimation(modelImpl, actorImpl, index, durationSeconds);
50   return Animation(internal.Get());
51 }
52
53 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, AlphaFunction alpha)
54 {
55   Internal::Model& modelImpl = GetImplementation(model);
56   Internal::Actor& actorImpl = GetImplementation(rootActor);
57   Internal::AnimationPtr internal = Internal::ModelActorFactory::BuildAnimation(modelImpl, actorImpl, index, alpha);
58   return Animation(internal.Get());
59 }
60
61 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, AlphaFunction alpha, float durationSeconds)
62 {
63   Internal::Model& modelImpl = GetImplementation(model);
64   Internal::Actor& actorImpl = GetImplementation(rootActor);
65   Internal::AnimationPtr internal = Internal::ModelActorFactory::BuildAnimation(modelImpl, actorImpl, index, alpha, durationSeconds);
66   return Animation(internal.Get());
67 }
68
69
70 } // namespace Dali