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 * @addtogroup CAPI_DALI_GEOMETRY_MODULE
27 #include <dali/public-api/common/dali-common.h>
28 #include <dali/public-api/object/property.h>
29 #include <dali/public-api/math/vector2.h>
30 #include <dali/public-api/math/vector3.h>
31 #include <dali/public-api/math/vector4.h>
33 namespace Dali DALI_IMPORT_API
37 namespace Internal DALI_INTERNAL
43 * @brief Represents a vertex in an AnimatableMesh.
45 * It is used by AnimatableMesh to offer an array interface for
49 * AnimatableMesh mesh = AnimatableMesh(numVerts, faces);
50 * mesh[vertex].SetColor(color);
53 class AnimatableVertex
58 static const Property::Index POSITION; ///< Property 0, name prefix "position-", type VECTOR3
59 static const Property::Index COLOR; ///< Property 1, name prefix "color-", type VECTOR4
60 static const Property::Index TEXTURE_COORDS; ///< Property 2, name prefix "texture-coords-", type VECTOR2
68 * @brief Set the position of the vertex.
70 * @param[in] position (note, -0.5 - +0.5 are inside the actor's boundaries)
72 void SetPosition(const Vector3& position);
75 * @brief Set the vertex color.
76 * @param[in] color The vertex color
78 void SetColor(const Vector4& color);
81 * @brief Set the texture coordinates.
83 * @param[in] textureCoords The texture coordinates
85 void SetTextureCoords(const Vector2& textureCoords);
88 * @brief Get the current position of the vertex.
92 Vector3 GetCurrentPosition();
95 * @brief Get the current vertex color.
97 * @return The vertex color
99 Vector4 GetCurrentColor();
102 * @brief Get the current texture coordinates.
104 * @return textureCoords The texture coordinates
106 Vector2 GetCurrentTextureCoords();
109 // Only allow AnimatableMesh to construct this object.
110 friend class Dali::AnimatableMesh;
113 * @brief Constructor.
115 * @param[in] vertex The index of the vertex in the parent mesh
116 * @param[in] mesh The parent mesh
118 AnimatableVertex( unsigned int vertex, AnimatableMesh mesh );
121 * @brief Undefined Copy Constructor
123 AnimatableVertex(const AnimatableVertex& vertex);
126 * @brief Undefined Assignment Operator
128 AnimatableVertex& operator=(const AnimatableVertex& vertex);
130 int mVertex; ///< The index of this vertex in the parent mesh
131 Internal::AnimatableMesh& mMesh; ///< The parent mesh