1 #ifndef __DALI_ANIMATABLE_VERTEX__H__
2 #define __DALI_ANIMATABLE_VERTEX__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.
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/object/property.h>
24 #include <dali/public-api/object/property-index-ranges.h>
25 #include <dali/public-api/math/vector2.h>
26 #include <dali/public-api/math/vector3.h>
27 #include <dali/public-api/math/vector4.h>
33 namespace Internal DALI_INTERNAL
39 * @brief Represents a vertex in an AnimatableMesh.
41 * It is used by AnimatableMesh to offer an array interface for
45 * AnimatableMesh mesh = AnimatableMesh(numVerts, faces);
46 * mesh[vertex].SetColor(color);
49 class DALI_IMPORT_API AnimatableVertex
54 * @brief An enumeration of properties belonging to the AnimatableVertex class.
55 * Note: These are used by animatable mesh also.
61 Position = DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX, ///< name prefix "position-", type VECTOR3
62 Color, ///< name prefix "color-", type VECTOR4
63 TextureCoords, ///< name prefix "texture-coords-", type VECTOR2
73 * @brief Set the position of the vertex.
75 * @param[in] position (note, -0.5 - +0.5 are inside the actor's boundaries)
77 void SetPosition(const Vector3& position);
80 * @brief Set the vertex color.
81 * @param[in] color The vertex color
83 void SetColor(const Vector4& color);
86 * @brief Set the texture coordinates.
88 * @param[in] textureCoords The texture coordinates
90 void SetTextureCoords(const Vector2& textureCoords);
93 * @brief Get the current position of the vertex.
97 Vector3 GetCurrentPosition();
100 * @brief Get the current vertex color.
102 * @return The vertex color
104 Vector4 GetCurrentColor();
107 * @brief Get the current texture coordinates.
109 * @return textureCoords The texture coordinates
111 Vector2 GetCurrentTextureCoords();
114 // Only allow AnimatableMesh to construct this object.
115 friend class Dali::AnimatableMesh;
118 * @brief Constructor.
120 * @param[in] vertex The index of the vertex in the parent mesh
121 * @param[in] mesh The parent mesh
123 AnimatableVertex( unsigned int vertex, AnimatableMesh mesh );
126 * @brief Undefined Copy Constructor
128 AnimatableVertex(const AnimatableVertex& vertex);
131 * @brief Undefined Assignment Operator
133 AnimatableVertex& operator=(const AnimatableVertex& vertex);
135 int mVertex; ///< The index of this vertex in the parent mesh
136 Internal::AnimatableMesh& mMesh; ///< The parent mesh