Merge "Ensured that messages are aligned to 8 byte words on 64bit ARM" into tizen
[platform/core/uifw/dali-core.git] / dali / internal / update / common / property-vector3.h
1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_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/dali-common.h>
23 #include <dali/public-api/math/vector3.h>
24 #include <dali/public-api/object/property.h>
25 #include <dali/public-api/object/property-input.h>
26 #include <dali/public-api/object/property-types.h>
27 #include <dali/internal/common/buffer-index.h>
28 #include <dali/internal/event/common/property-input-impl.h>
29
30 namespace Dali
31 {
32
33 namespace Internal
34 {
35
36 namespace SceneGraph
37 {
38
39 /**
40  * A Vector3 non-animatable property.
41  */
42 class PropertyVector3 : public PropertyInputImpl
43 {
44 public:
45
46   /**
47    * Create an non-animatable property.
48    * @param [in] initialValue The initial value of the property.
49    */
50   PropertyVector3( Vector3 initialValue )
51   : mValue( initialValue ),
52     mDirtyFlag( true )
53   {
54   }
55
56   /**
57    * Virtual destructor.
58    */
59   virtual ~PropertyVector3()
60   {
61   }
62
63   /**
64    * Clear the dirty flag
65    */
66   void Clear()
67   {
68     mDirtyFlag = false;
69   }
70
71   /**
72    * @copydoc Dali::Internal::PropertyInputImpl::GetType()
73    */
74   virtual Dali::Property::Type GetType() const
75   {
76     return Dali::PropertyTypes::Get<Vector3>();
77   }
78
79   /**
80    * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
81    */
82   virtual bool InputInitialized() const
83   {
84     return true;
85   }
86
87   /**
88    * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
89    */
90   virtual bool InputChanged() const
91   {
92     return mDirtyFlag;
93   }
94
95   /**
96    * @copydoc Dali::PropertyInput::GetVector3()
97    */
98   virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
99   {
100     return mValue;
101   }
102
103   /**
104    * Flag that the property has been Set during the current frame.
105    */
106   void OnSet()
107   {
108     mDirtyFlag = true;
109   }
110
111 private:
112
113   // Undefined
114   PropertyVector3(const PropertyVector3& property);
115
116   // Undefined
117   PropertyVector3& operator=(const PropertyVector3& rhs);
118
119 public:
120
121   Vector3 mValue; ///< The property value
122
123 private:
124
125   bool mDirtyFlag;
126
127 };
128
129 } // namespace SceneGraph
130
131 } // namespace Internal
132
133 } // namespace Dali
134
135 #endif // __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_H__