Dali 3D User Interface Engine
property-input-indexer.h
Go to the documentation of this file.
1 #ifndef __DALI_PROPERTY_INPUT_INDEXER_H__
2 #define __DALI_PROPERTY_INPUT_INDEXER_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
23 
24 namespace Dali
25 {
26 
27 namespace Internal
28 {
29 
34 template < typename AccessorType >
36 {
37 public:
38 
44  PropertyInputIndexer( BufferIndex bufferIndex, const AccessorType* input )
45  : mBufferIndex( bufferIndex ),
46  mInput( input )
47  {
48  }
49 
54  : mBufferIndex( other.mBufferIndex ),
55  mInput( other.mInput )
56  {
57  }
58 
63  {
64  mBufferIndex = other.mBufferIndex;
65  mInput = other.mInput;
66 
67  return *this;
68  }
69 
74  {
75  }
76 
80  virtual Property::Type GetType() const
81  {
82  return mInput->GetType();
83  }
84 
88  virtual const bool& GetBoolean() const
89  {
90  return mInput->GetConstraintInputBoolean( mBufferIndex );
91  }
92 
96  virtual const int& GetInteger() const
97  {
98  return mInput->GetConstraintInputInteger( mBufferIndex );
99  }
100 
104  virtual const float& GetFloat() const
105  {
106  return mInput->GetConstraintInputFloat( mBufferIndex );
107  }
108 
112  virtual const Vector2& GetVector2() const
113  {
114  return mInput->GetConstraintInputVector2( mBufferIndex );
115  }
116 
120  virtual const Vector3& GetVector3() const
121  {
122  return mInput->GetConstraintInputVector3( mBufferIndex );
123  }
124 
128  virtual const Vector4& GetVector4() const
129  {
130  return mInput->GetConstraintInputVector4( mBufferIndex );
131  }
132 
136  virtual const Matrix3& GetMatrix3() const
137  {
138  return mInput->GetConstraintInputMatrix3( mBufferIndex );
139  }
140 
144  virtual const Matrix& GetMatrix() const
145  {
146  return mInput->GetConstraintInputMatrix( mBufferIndex );
147  }
148 
152  virtual const Quaternion& GetQuaternion() const
153  {
154  return mInput->GetConstraintInputQuaternion( mBufferIndex );
155  }
156 
157 public:
158 
159  unsigned int mBufferIndex;
160  const AccessorType* mInput;
161 };
162 
163 } // namespace Internal
164 
165 } // namespace Dali
166 
167 #endif // __DALI_PROPERTY_INPUT_INDEXER_H__
Dali Docs Home
Read more about Dali