1 #ifndef __DALI_CLOTH_H__
2 #define __DALI_CLOTH_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/math/rect.h>
24 #include <dali/public-api/math/vector4.h>
25 #include <dali/public-api/object/base-handle.h>
26 #include <dali/public-api/geometry/mesh.h>
28 namespace Dali DALI_IMPORT_API
31 namespace Internal DALI_INTERNAL
37 * @brief A Cloth is a specialized mesh that can be used and modified
38 * by the Dynamics engine.
40 class Cloth : public Mesh
45 * @brief Create an initialized plane aligned on the XY axis.
47 * @param[in] width The width of the plane
48 * @param[in] height The height of the plane
49 * @param[in] xSteps The number of vertices along the X axis
50 * @param[in] ySteps The number of vertices along the Y axis
51 * @param[in] textureCoordinates UV coordinates.
52 * @return A handle to a newly allocated Dali resource.
54 static Cloth New(const float width,
58 const Rect<float>& textureCoordinates = Rect<float>(0.0f, 0.0f, 1.0f, 1.0f));
62 * @brief Create an uninitialized Cloth; this can be initialized with Cloth::New().
64 * Calling member functions with an uninitialized Dali::Object is not allowed.
71 * This is non-virtual since derived Handle types must not contain data or virtual methods.
76 * @brief This copy constructor is required for (smart) pointer semantics.
78 * @param [in] handle A reference to the copied handle
80 Cloth(const Cloth& handle);
83 * @brief This assignment operator is required for (smart) pointer semantics.
85 * @param [in] rhs A reference to the copied handle
86 * @return A reference to this
88 Cloth& operator=(const Cloth& rhs);
91 * @brief This method is defined to allow assignment of the NULL value,
92 * and will throw an exception if passed any other value.
94 * Assigning to NULL is an alias for Reset().
95 * @param [in] rhs A NULL pointer
96 * @return A reference to this handle
98 Cloth& operator=(BaseHandle::NullType* rhs);
101 * @brief Downcast an Object handle to a Cloth handle.
103 * If handle points to a Cloth object the downcast produces valid
104 * handle. If not the returned handle is left uninitialized.
106 * @param[in] handle to an object
107 * @return handle to a Cloth object or an uninitialized handle
109 static Cloth DownCast( BaseHandle handle );
111 public: // Not intended for application developers
114 * @brief This constructor is used by Dali New() methods.
116 * @param [in] cloth A pointer to a newly allocated Dali resource
118 explicit DALI_INTERNAL Cloth(Internal::Cloth* cloth);
123 #endif // __DALI_CLOTH_H__