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/actors/actor.h>
24 #include <dali/public-api/geometry/mesh-data.h>
25 #include <dali/public-api/math/rect.h>
26 #include <dali/public-api/math/vector4.h>
27 #include <dali/public-api/modeling/material.h>
28 #include <dali/public-api/modeling/bone.h>
29 #include <dali/public-api/object/base-handle.h>
31 namespace Dali DALI_IMPORT_API
34 namespace Internal DALI_INTERNAL
40 * @brief A Mesh holds a MeshData object supplied by the application writer.
42 * It is used to tell the Scene Graph if the mesh data has changed.
44 class Mesh : public BaseHandle
49 * @brief Create an initialized Mesh.
51 * @param[in] meshData The mesh data with which to initialize the handle
52 * @return A handle to a newly allocated Dali resource.
54 static Mesh New( const MeshData& meshData );
57 * @brief Create an uninitialized Mesh; this can be initialized with Mesh::New().
59 * Calling member functions with an uninitialized Dali::Object is not allowed.
64 * @brief Virtual destructor.
69 * @copydoc Dali::BaseHandle::operator=
71 using BaseHandle::operator=;
74 * @brief Create an initialized plane aligned on the XY axis.
76 * @param[in] width The width of the plane
77 * @param[in] height The height of the plane
78 * @param[in] xSteps The number of vertices along the X axis
79 * @param[in] ySteps The number of vertices along the Y axis
80 * @param[in] textureCoordinates UV coordinates.
81 * @return A handle to a newly allocated Dali resource.
83 static Mesh NewPlane(const float width,
87 const Rect<float>& textureCoordinates = Rect<float>(0.0f, 0.0f, 1.0f, 1.0f));
90 * @brief Downcast an Object handle to Mesh handle.
92 * If handle points to a Mesh object the downcast produces valid
93 * handle. If not the returned handle is left uninitialized.
95 * @param[in] handle to An object
96 * @return handle to an Mesh object or an uninitialized handle
98 static Mesh DownCast( BaseHandle handle );
101 * @brief Tell Dali to update it's internal meshes from the changed mesh data.
103 * @param[in] meshData
105 void UpdateMeshData( const MeshData& meshData );
107 public: // Not intended for application developers
110 * @brief This constructor is used by Dali New() methods.
112 * @param [in] mesh A pointer to a newly allocated Dali resource
114 explicit DALI_INTERNAL Mesh(Internal::Mesh* mesh);
119 #endif // __DALI_MESH_H__