1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
21 #include <dali/public-api/common/dali-common.h>
22 #include <dali/public-api/math/vector3.h>
23 #include <dali/public-api/object/property.h>
24 #include <dali/public-api/object/property-input.h>
25 #include <dali/public-api/object/property-types.h>
26 #include <dali/internal/common/buffer-index.h>
27 #include <dali/internal/event/common/property-input-impl.h>
39 * A Vector3 non-animatable property.
41 template <int DirtyFlagMask>
42 class PropertyVector3 : public PropertyInputImpl
47 * Create an non-animatable property.
48 * @param [in] initialValue The initial value of the property.
49 * @param [in] dirtyFlags One bit of this mask will be set when the property changes.
51 PropertyVector3( Vector3 initialValue, int& dirtyFlags )
52 : mValue( initialValue ), mDirtyFlags( dirtyFlags )
59 virtual ~PropertyVector3()
64 * @copydoc Dali::Internal::PropertyInputImpl::GetType()
66 virtual Dali::Property::Type GetType() const
68 return Dali::PropertyTypes::Get<Vector3>();
72 * @copydoc Dali::Internal::PropertyInputImpl::InputInitialized()
74 virtual bool InputInitialized() const
76 return true; // Animatable properties are always valid
80 * @copydoc Dali::Internal::PropertyInputImpl::InputChanged()
82 virtual bool InputChanged() const
84 return (mDirtyFlags & DirtyFlagMask);
88 * @copydoc Dali::PropertyInput::GetVector3()
90 virtual const Vector3& GetVector3( BufferIndex bufferIndex ) const
96 * Flag that the property has been Set during the current frame.
100 mDirtyFlags |= DirtyFlagMask;
106 PropertyVector3(const PropertyVector3& property);
109 PropertyVector3& operator=(const PropertyVector3& rhs);
113 Vector3 mValue; ///< The property value
120 } // namespace SceneGraph
122 } // namespace Internal
126 #endif // __DALI_INTERNAL_SCENE_GRAPH_VECTOR3_PROPERTY_H__