Revert " modify license, permission and remove ^M char"
[framework/osp/uifw.git] / src / ui / effects / inc / renderer / engine-model / FUiEffects_RendererEngineModelNode.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FUiEffects_RendererEngineModelNode.h
20  * @brief       Base class for single object in scene tree for rendering. Has its own transformation matrix;
21  *
22  */
23
24 #ifndef _FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_NODE_H_
25 #define _FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_NODE_H_
26
27 #include <renderer/system/FUiEffects_RendererSystemNonCopyable.h>
28
29 #include <renderer/engine-model/FUiEffects_RendererEngineModelForwardDeclaration.h>
30 #include <renderer/engine-model/FUiEffects_RendererEngineModelVisitor.h>
31 #include <renderer/engine-model/FUiEffects_RendererEngineModelAabb.h>
32 #include <renderer/engine-model/FUiEffects_RendererEngineModelAttribute.h>
33
34 #include <renderer/math/FUiEffects_RendererMathMatrix.h>
35
36 namespace Tizen { namespace Ui { namespace Effects { namespace _Renderer { namespace EngineModel
37 {
38
39 class Node:
40         private Tizen::Ui::Effects::_Renderer::System::NonCopyable
41 {
42 public:
43         class TransformationType
44         {
45                 public:
46                         enum TransformationTypeEnum
47                         {
48                                 WORLD = 0,
49                                 RELATED
50                         };
51                         typedef TransformationTypeEnum Value;
52         };
53
54         Node(void);
55         virtual ~Node(void);
56
57         virtual void Visit(Visitor& visitor);
58
59         virtual const Math::Matrix4f& GetLocal(void);
60         virtual void SetLocal(const Math::Matrix4f& arg);
61
62         virtual const Math::Matrix4f& GetWorld(void);
63         virtual void SetWorld(const Math::Matrix4f& arg);
64
65         virtual const Aabb& GetBoundBox(void);
66         virtual Aabb GetBoundBoxInParentSpace(void); //get bound box transformed in _pParent space
67
68         virtual bool AttachedToParent(Group* pParent); //called when inserted in _pParent (call from _pParent)
69         virtual bool RemoveFromParent(Group* pParent); //called when removed from _pParent  (call from _pParent)
70         virtual void ParentMoved(Group* pParent); //called when _pParent position changed  (call from _pParent)
71
72         virtual void TouchParentBoundBox(); //call when position or bound box changed
73
74 protected:
75         virtual void ValidateLocal(void);
76         virtual void ValidateWorld(void);
77
78         Group* _pParent;
79
80         Attribute<Tizen::Ui::Effects::_Renderer::Math::Matrix4f> _relatedTransform;
81         Attribute<Tizen::Ui::Effects::_Renderer::Math::Matrix4f> _worldTransform;
82         Attribute<Aabb> _boundBox;
83
84         TransformationType::Value _transformType;
85         Math::Matrix4f _transformMatrix;
86 };
87
88 }}}}} //Tizen::Ui::Effects::_Renderer::EngineModel
89
90 #endif //_FUI_EFFECTS_INTERNAL_RENDERER_ENGINE_MODEL_NODE_H_