1 #ifndef __DALI_ENTITY_ANIMATOR_MAP_H__
2 #define __DALI_ENTITY_ANIMATOR_MAP_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
23 #include <dali/public-api/animation/key-frames.h>
24 #include <dali/public-api/modeling/entity.h>
31 class EntityAnimatorMap;
32 typedef std::vector<EntityAnimatorMap> EntityAnimatorMapContainer; ///< Container of Entity - Animator mappings
33 typedef EntityAnimatorMapContainer::const_iterator EntityAnimatorMapIter; ///< Iterator for @ref Dali::EntityAnimatorMapContainer
37 * @brief The entity animator map class is a mapping from an entity name to raw animation
38 * data for that entity, stored in 3 KeyFrames for position, scale and rotation.
40 class DALI_IMPORT_API EntityAnimatorMap
46 EntityAnimatorMap(const std::string& name);
51 virtual ~EntityAnimatorMap();
54 * @brief Set the entity name.
56 * @param[in] name - the entity name
58 void SetEntityName(const std::string& name)
64 * @brief Get the entity name.
66 * @return the name of the entity to which this animator applies
68 const std::string& GetEntityName() const
74 * @brief Set the animated entity.
76 * @param[in] animatedEntity The animated entity
78 void SetAnimatedEntity(Entity animatedEntity)
80 mAnimatedEntity = animatedEntity;
84 * @brief Get the animated entity.
86 * @return the animated entity
88 Entity GetAnimatedEntity(void)
90 return mAnimatedEntity;
94 * @brief Set the key frames for animating the entity position.
96 * @param[in] keyFrames The keyframe data
98 void SetPositionKeyFrames(KeyFrames keyFrames)
100 mPositionKeyFrames = keyFrames;
104 * @brief Set the key frames for animating the entity scale.
106 * @param[in] keyFrames The keyframe data
108 void SetScaleKeyFrames(KeyFrames keyFrames)
110 mScaleKeyFrames = keyFrames;
114 * @brief Set the key frames for animating the entity rotation.
116 * @param[in] keyFrames The keyframe data
118 void SetRotationKeyFrames(KeyFrames keyFrames)
120 mRotationKeyFrames = keyFrames;
124 * @brief Get the keyframes for animating the entity position.
126 * @return A handle to the keyframes
128 KeyFrames GetPositionKeyFrames() const
130 return mPositionKeyFrames;
134 * @brief Get the keyframes for animating the entity scale.
136 * @return A handle to the keyframes
138 KeyFrames GetScaleKeyFrames() const
140 return mScaleKeyFrames;
144 * @brief Get the keyframes for animating the entity rotation.
146 * @return A handle to the keyframes
148 KeyFrames GetRotationKeyFrames() const
150 return mRotationKeyFrames;
154 * @brief Set the duration of the animation on this entity.
156 * @param[in] duration - the duration in seconds.
158 void SetDuration(float duration) { mDuration = duration; }
161 * @brief Get the duration of the animation on this entity.
163 * @return the duration in seconds
165 float GetDuration() const { return mDuration; }
168 std::string mEntityName; ///< The entity name
169 Entity mAnimatedEntity; ///< Unused
170 float mDuration; ///< Duration of this animator
172 KeyFrames mPositionKeyFrames; ///< Position key frames (may be null)
173 KeyFrames mScaleKeyFrames; ///< Scale key frames (may be null)
174 KeyFrames mRotationKeyFrames; ///< Rotation key frames (may be null)
180 #endif // __DALI_ENTITY_ANIMATOR_MAP_H__