Merge "Merge branch 'devel/new_mesh' into devel/master" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / render / common / render-item.h
1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/public-api/actors/layer.h>
24 #include <dali/public-api/math/matrix.h>
25
26 namespace Dali
27 {
28
29 namespace Internal
30 {
31
32 namespace SceneGraph
33 {
34
35 class Renderer;
36 class RenderItem;
37
38 typedef std::vector< RenderItem > RendererItemContainer;
39
40 /**
41  * A render-item is a renderer & modelView matrix pair.
42  */
43 class RenderItem
44 {
45 public:
46
47   /**
48    * Create a new render-item.
49    */
50   RenderItem();
51
52   /**
53    * Non-virtual destructor; RenderItem is not suitable as a base class.
54    */
55   ~RenderItem();
56
57   /**
58    * Reset the render-item.
59    */
60   void Reset();
61
62   /**
63    * Retrieve the renderer.
64    * @return The renderer.
65    */
66   const Renderer* GetRenderer() const;
67
68   /**
69    * Set the renderer
70    * @param[in] renderer The renderer
71    */
72   void SetRenderer( Renderer* renderer );
73
74   /**
75    * Retrieve the modelView matrix.
76    * @return The modelView matrix.
77    */
78   Matrix& GetModelViewMatrix();
79
80   /**
81    * Retrieve the modelView matrix.
82    * @return The modelView matrix.
83    */
84   const Matrix& GetModelViewMatrix() const;
85
86   /**
87    * Retrieve the depth index
88    */
89   int GetDepthIndex() const
90   {
91     return mDepthIndex;
92   }
93
94   /**
95    * Set the depth index
96    */
97   void SetDepthIndex( int depthIndex );
98
99 private:
100
101   // RenderItems should not be copied as they are heavy
102   RenderItem( const RenderItem& item );
103   RenderItem& operator = ( const RenderItem& item );
104
105   Matrix    mModelViewMatrix;
106   Renderer* mRenderer;
107   int       mDepthIndex;
108 };
109
110 } // namespace SceneGraph
111
112 } // namespace Internal
113
114 } // namespace Dali
115
116 #endif // __DALI_INTERNAL_SCENE_GRAPH_RENDER_ITEM_H__