2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/public-api/actors/model-actor-factory.h>
22 #include <dali/public-api/actors/actor.h>
23 #include <dali/public-api/modeling/model.h>
24 #include <dali/internal/event/actors/actor-impl.h>
25 #include <dali/internal/event/modeling/model-impl.h>
26 #include <dali/internal/event/actors/model-actor-factory-impl.h>
32 Actor ModelActorFactory::BuildActorTree(Model& model, const std::string& entityName)
34 Internal::ActorPtr actor = Internal::ModelActorFactory::BuildActorTree(model, entityName);
35 return Actor(actor.Get());
38 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index)
40 Internal::Model& modelImpl = GetImplementation(model);
41 Internal::Actor& actorImpl = GetImplementation(rootActor);
42 Internal::AnimationPtr internal = Internal::ModelActorFactory::BuildAnimation(modelImpl, actorImpl, index);
43 return Animation(internal.Get());
46 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, float durationSeconds)
48 Internal::Model& modelImpl = GetImplementation(model);
49 Internal::Actor& actorImpl = GetImplementation(rootActor);
50 Internal::AnimationPtr internal = Internal::ModelActorFactory::BuildAnimation(modelImpl, actorImpl, index, durationSeconds);
51 return Animation(internal.Get());
54 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, AlphaFunction alpha)
56 Internal::Model& modelImpl = GetImplementation(model);
57 Internal::Actor& actorImpl = GetImplementation(rootActor);
58 Internal::AnimationPtr internal = Internal::ModelActorFactory::BuildAnimation(modelImpl, actorImpl, index, alpha);
59 return Animation(internal.Get());
62 Animation ModelActorFactory::BuildAnimation(Model& model, Actor rootActor, size_t index, AlphaFunction alpha, float durationSeconds)
64 Internal::Model& modelImpl = GetImplementation(model);
65 Internal::Actor& actorImpl = GetImplementation(rootActor);
66 Internal::AnimationPtr internal = Internal::ModelActorFactory::BuildAnimation(modelImpl, actorImpl, index, alpha, durationSeconds);
67 return Animation(internal.Get());