1 #ifndef DALI_INTERNAL_UPDATE_PROXY_IMPL_H
2 #define DALI_INTERNAL_UPDATE_PROXY_IMPL_H
5 * Copyright (c) 2018 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/vector-wrapper.h>
25 #include <dali/public-api/math/matrix.h>
26 #include <dali/public-api/math/vector3.h>
27 #include <dali/internal/common/buffer-index.h>
28 #include <dali/internal/update/manager/transform-manager.h>
29 #include <dali/internal/update/nodes/node.h>
38 * @brief The implementation of Dali::UpdateProxy.
40 * Ref-counting is not required for this object.
42 * @see Dali::UpdateProxy
50 * @param[in] transformManager Ref to the TransformManager in order to set/get transform properties of nodes
51 * @param[in] rootNode The root node for this proxy
53 UpdateProxy( SceneGraph::TransformManager& transformManager, SceneGraph::Node& rootNode );
60 // Movable but not copyable
62 UpdateProxy( const UpdateProxy& ) = delete; ///< Deleted copy constructor.
63 UpdateProxy( UpdateProxy&& ) = default; ///< Default move constructor.
64 UpdateProxy& operator=( const UpdateProxy& ) = delete; ///< Deleted copy assignment operator.
65 UpdateProxy& operator=( UpdateProxy&& ) = default; ///< Default move assignment operator.
68 * @copydoc Dali::UpdateProxy::GetPosition()
70 Vector3 GetPosition( unsigned int id ) const;
73 * @copydoc Dali::UpdateProxy::SetPosition()
75 void SetPosition( unsigned int id, const Vector3& position );
78 * @copydoc Dali::UpdateProxy::GetSize()
80 const Vector3& GetSize( unsigned int id ) const;
83 * @copydoc Dali::UpdateProxy::SetSize()
85 void SetSize( unsigned int id, const Vector3& size );
88 * @copydoc Dali::UpdateProxy::GetPositionAndSize()
90 void GetPositionAndSize( unsigned int id, Vector3& position, Vector3& size ) const;
93 * @copydoc Dali::UpdateProxy::GetColor()
95 Vector4 GetWorldColor( unsigned int id ) const;
98 * @copydoc Dali::UpdateProxy::SetColor()
100 void SetWorldColor( unsigned int id, const Vector4& color ) const;
103 * @copydoc Dali::UpdateProxy::GetWorldMatrixAndSize()
105 void GetWorldMatrixAndSize( unsigned int id, Matrix& worldMatrix, Vector3& size ) const;
108 * @copydoc Dali::UpdateProxy::GetWorldMatrix()
110 const Matrix& GetWorldMatrix( unsigned int id ) const;
113 * @copydoc Dali::UpdateProxy::SetWorldMatrix()
115 void SetWorldMatrix( unsigned int id, const Matrix& worldMatrix );
118 * @brief Retrieves the root-node used by this class
119 * @return The root node used by this class.
121 SceneGraph::Node& GetRootNode() const
126 void SetCurrentBufferIndex( BufferIndex bufferIndex )
128 mCurrentBufferIndex = bufferIndex;
134 * @brief Retrieves the node with the specified ID.
135 * @param[in] id The ID of the node required
136 * @return A pointer to the required node if found.
137 * @note This caches the last accessed node.
139 SceneGraph::Node* GetNodeWithId( unsigned int id ) const;
144 * Structure to store the ID & Node pair
148 unsigned int id; ///< The ID of the node
149 SceneGraph::Node* node; ///< The node itself
152 mutable std::vector< IdNodePair > mNodeContainer; ///< Used to store cached pointers to already searched for Nodes.
153 mutable IdNodePair mLastCachedIdNodePair; ///< Used to cache the last retrieved id-node pair.
154 unsigned int mCurrentBufferIndex;
156 SceneGraph::TransformManager& mTransformManager; ///< Reference to the Transform Manager.
157 SceneGraph::Node& mRootNode; ///< The root node of this update proxy.
160 } // namespace Internal
164 #endif // DALI_INTERNAL_UPDATE_PROXY_IMPL_H