1 #ifndef __DALI_MESH_H__
2 #define __DALI_MESH_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/geometry/mesh-data.h>
24 #include <dali/public-api/math/rect.h>
25 #include <dali/public-api/object/base-handle.h>
30 namespace Internal DALI_INTERNAL
36 * @brief A Mesh holds a MeshData object supplied by the application writer.
38 * It is used to tell the Scene Graph if the mesh data has changed.
40 class DALI_IMPORT_API Mesh : public BaseHandle
45 * @brief Create an initialized Mesh.
47 * @param[in] meshData The mesh data with which to initialize the handle
48 * @return A handle to a newly allocated Dali resource.
50 static Mesh New( const MeshData& meshData );
53 * @brief Create an uninitialized Mesh; this can be initialized with Mesh::New().
55 * Calling member functions with an uninitialized Dali::Object is not allowed.
62 * This is non-virtual since derived Handle types must not contain data or virtual methods.
67 * @brief This copy constructor is required for (smart) pointer semantics.
69 * @param [in] handle A reference to the copied handle
71 Mesh(const Mesh& handle);
74 * @brief This assignment operator is required for (smart) pointer semantics.
76 * @param [in] rhs A reference to the copied handle
77 * @return A reference to this
79 Mesh& operator=(const Mesh& rhs);
82 * @brief Create an initialized plane aligned on the XY axis.
84 * @param[in] width The width of the plane
85 * @param[in] height The height of the plane
86 * @param[in] xSteps The number of vertices along the X axis
87 * @param[in] ySteps The number of vertices along the Y axis
88 * @param[in] textureCoordinates UV coordinates.
89 * @return A handle to a newly allocated Dali resource.
91 static Mesh NewPlane(const float width,
95 const Rect<float>& textureCoordinates = Rect<float>(0.0f, 0.0f, 1.0f, 1.0f));
98 * @brief Downcast an Object handle to Mesh handle.
100 * If handle points to a Mesh object the downcast produces valid
101 * handle. If not the returned handle is left uninitialized.
103 * @param[in] handle to An object
104 * @return handle to an Mesh object or an uninitialized handle
106 static Mesh DownCast( BaseHandle handle );
109 * @brief Tell Dali to update it's internal meshes from the changed mesh data.
111 * @param[in] meshData
113 void UpdateMeshData( const MeshData& meshData );
115 public: // Not intended for application developers
118 * @brief This constructor is used by Dali New() methods.
120 * @param [in] mesh A pointer to a newly allocated Dali resource
122 explicit DALI_INTERNAL Mesh(Internal::Mesh* mesh);
127 #endif // __DALI_MESH_H__