2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
18 #include <dali/public-api/actors/model-actor-factory.h>
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>
31 Actor ModelActorFactory::BuildActorTree(Model& model, const std::string& entityName)
33 Internal::ActorPtr actor = Internal::ModelActorFactory::BuildActorTree(model, entityName);
34 return Actor(actor.Get());
37 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index)
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());
45 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, float durationSeconds)
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());
53 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, AlphaFunction alpha)
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());
61 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, AlphaFunction alpha, float durationSeconds)
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());