--> reduces export table lookups and speeds up compilation due to less template mess
Change-Id: I22d70a20277a5b522e7c156366a266a2cce441db
/**
* Create an animatable property.
+ */
+ AnimatableProperty()
+ : mValue(),
+ mBaseValue()
+ {
+ }
+
+ /**
+ * Create an animatable property.
* @param [in] initialValue The initial value of the property.
*/
AnimatableProperty( const Vector3& initialValue )
/**
* Create an animatable property.
+ */
+ AnimatableProperty()
+ : mValue(),
+ mBaseValue()
+ {
+ }
+
+ /**
+ * Create an animatable property.
* @param [in] initialValue The initial value of the property.
*/
AnimatableProperty( const Quaternion& initialValue )
/**
* Templated class for a double-buffered value.
- * This simplifies init code, and forces explicit initialization.
*/
template <typename T>
class DoubleBuffered
{
public:
- DoubleBuffered(const T& val)
- : mValue1(val),
- mValue2(val)
- {
- }
-
- inline T& operator[](const size_t i)
- {
- DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
-
- return *(&mValue1+i);
- }
-
- inline const T& operator[](const size_t i) const
+ DoubleBuffered()
+ : mValue1(),
+ mValue2()
{
- DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
-
- return *(&mValue1+i);
}
-private:
-
- // Undefined
- DoubleBuffered<T>(const DoubleBuffered<T>&);
-
- // Undefined
- DoubleBuffered<T>& operator=(const DoubleBuffered<T>& rhs);
-
-private:
-
- T mValue1;
- T mValue2;
-};
-
-/**
- * Templated class for a double-buffered value, initialized with 3 value parameters.
- * This simplifies init code, and forces explicit initialization.
- */
-template <typename T, typename P>
-class DoubleBuffered3
-{
-public:
-
- DoubleBuffered3(const T& val)
- : mValue1(val),
- mValue2(val)
- {
- }
-
- DoubleBuffered3(P val1, P val2, P val3)
- : mValue1(val1, val2, val3),
- mValue2(val1, val2, val3)
- {
- }
-
- inline T& operator[](const size_t i)
- {
- DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
-
- return *(&mValue1+i);
- }
-
- inline const T& operator[](const size_t i) const
- {
- DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
-
- return *(&mValue1+i);
- }
-
-private:
-
- // Undefined
- DoubleBuffered3<T,P>(const DoubleBuffered3<T,P>&);
-
- // Undefined
- DoubleBuffered3<T,P>& operator=(const DoubleBuffered3<T,P>& rhs);
-
-private:
-
- T mValue1;
- T mValue2;
-};
-
-/**
- * Templated class for a double-buffered value, initialized with 4 value parameters.
- * This simplifies init code, and forces explicit initialization.
- */
-template <typename T, typename P>
-class DoubleBuffered4
-{
-public:
-
- DoubleBuffered4(const T& val)
+ DoubleBuffered(const T& val)
: mValue1(val),
mValue2(val)
{
}
- DoubleBuffered4(P val1, P val2, P val3, P val4)
- : mValue1(val1, val2, val3, val4),
- mValue2(val1, val2, val3, val4)
- {
- }
-
inline T& operator[](const size_t i)
{
DALI_ASSERT_DEBUG(i < NUM_SCENE_GRAPH_BUFFERS);
private:
// Undefined
- DoubleBuffered4<T,P>(const DoubleBuffered4<T,P>&);
+ DoubleBuffered<T>(const DoubleBuffered<T>&);
// Undefined
- DoubleBuffered4<T,P>& operator=(const DoubleBuffered4<T,P>& rhs);
+ DoubleBuffered<T>& operator=(const DoubleBuffered<T>& rhs);
private:
T mValue2;
};
-typedef DoubleBuffered<int> DoubleBufferedInt;
-typedef DoubleBuffered<float> DoubleBufferedFloat;
-typedef DoubleBuffered<bool> DoubleBufferedBool;
-
-typedef DoubleBuffered3<Vector3,float> DoubleBufferedVector3;
-typedef DoubleBuffered4<Vector4,float> DoubleBufferedVector4;
-
-typedef DoubleBuffered4<Quaternion, float> DoubleBufferedQuaternion;
-
-typedef DoubleBuffered<Matrix> DoubleBufferedMatrix;
-
} // namespace SceneGraph
} // namespace Internal
namespace SceneGraph
{
-template <class T>
-class InheritedProperty;
-
/**
* An inherited Vector3 property.
*/
-template <>
-class InheritedProperty<Vector3> : public PropertyInputImpl
+class InheritedVector3 : public PropertyInputImpl
{
public:
/**
- * Create an inherited property.
+ * Create an inherited Vector3.
+ */
+ InheritedVector3()
+ : mValue(),
+ mInheritedFlag( false ),
+ mReinheritedFlag( true )
+ {
+ }
+
+ /**
+ * Create an inherited Vector3.
* @param [in] initialValue The initial value of the property.
*/
- InheritedProperty( const Vector3& initialValue )
+ InheritedVector3( const Vector3& initialValue )
: mValue( initialValue ),
mInheritedFlag( false ),
mReinheritedFlag( true )
{
}
-
/**
* Virtual destructor.
*/
- virtual ~InheritedProperty()
+ virtual ~InheritedVector3()
{
}
private:
// Undefined
- InheritedProperty(const InheritedProperty& property);
+ InheritedVector3(const InheritedVector3& property);
// Undefined
- InheritedProperty& operator=(const InheritedProperty& rhs);
+ InheritedVector3& operator=(const InheritedVector3& rhs);
private:
/**
* An inherited Quaternion property.
*/
-template <>
-class InheritedProperty<Quaternion> : public PropertyInputImpl
+class InheritedQuaternion : public PropertyInputImpl
{
public:
/**
* Create an inherited property.
- * @param [in] initialValue The initial value of the property.
*/
- InheritedProperty( const Quaternion& initialValue )
- : mValue( initialValue ),
+ InheritedQuaternion()
+ : mValue(),
mInheritedFlag( false ),
mReinheritedFlag( true )
{
/**
* Virtual destructor.
*/
- virtual ~InheritedProperty()
+ virtual ~InheritedQuaternion()
{
}
private:
// Undefined
- InheritedProperty();
-
- // Undefined
- InheritedProperty(const InheritedProperty& property);
+ InheritedQuaternion(const InheritedQuaternion& property);
// Undefined
- InheritedProperty& operator=(const InheritedProperty& rhs);
+ InheritedQuaternion& operator=(const InheritedQuaternion& rhs);
private:
/**
* An inherited Matrix property.
*/
-template <>
-class InheritedProperty<Matrix> : public PropertyInputImpl
+class InheritedMatrix : public PropertyInputImpl
{
public:
* Create an inherited property.
* @param [in] initialValue The initial value of the property.
*/
- InheritedProperty( const Matrix& initialValue )
- : mValue( initialValue ),
+ InheritedMatrix()
+ : mValue(),
mInheritedFlag( false ),
mReinheritedFlag( true )
{
/**
* Virtual destructor.
*/
- virtual ~InheritedProperty()
+ virtual ~InheritedMatrix()
{
}
private:
// Undefined
- InheritedProperty();
-
- // Undefined
- InheritedProperty(const InheritedProperty& property);
+ InheritedMatrix(const InheritedMatrix& property);
// Undefined
- InheritedProperty& operator=(const InheritedProperty& rhs);
+ InheritedMatrix& operator=(const InheritedMatrix& rhs);
private:
: mBody(NULL),
mNode(node),
mWorld(world),
- mLinearVelocity(Vector3::ZERO),
- mAngularVelocity(Vector3::ZERO)
+ mLinearVelocity(),
+ mAngularVelocity()
{
DALI_LOG_INFO(Debug::Filter::gDynamics, Debug::Verbose, "%s\n", __PRETTY_FUNCTION__);
}
DynamicsWorld& mWorld;
Mesh* mMesh;
- DoubleBufferedVector3 mLinearVelocity;
- DoubleBufferedVector3 mAngularVelocity;
+ DoubleBuffered<Vector3> mLinearVelocity;
+ DoubleBuffered<Vector3> mAngularVelocity;
}; // class DynamicsBody
mFarClippingPlane( DEFAULT_FAR_CLIPPING_PLANE ),
mStereoBias( DEFAULT_STEREO_BIAS ),
mTargetPosition( DEFAULT_TARGET_POSITION ),
- mViewMatrix( Matrix::IDENTITY ),
- mProjectionMatrix( Matrix::IDENTITY ),
+ mViewMatrix(),
+ mProjectionMatrix(),
mInverseViewProjection( Matrix::IDENTITY )
{
}
Vector2 mStereoBias;
Vector3 mTargetPosition;
- InheritedProperty<Matrix> mViewMatrix; ///< The view-matrix; this is double buffered for input handling.
- InheritedProperty<Matrix> mProjectionMatrix; ///< The projection-matrix; this is double buffered for input handling.
+ InheritedMatrix mViewMatrix; ///< The view-matrix; this is double buffered for input handling.
+ InheritedMatrix mProjectionMatrix; ///< The projection-matrix; this is double buffered for input handling.
DoubleBuffered< Matrix > mInverseViewProjection;///< Inverted viewprojection; double buffered for input handling
Node::Node()
: mParentOrigin( ParentOrigin::DEFAULT ),
mAnchorPoint( AnchorPoint::DEFAULT ),
- mSize( Vector3::ZERO ),
- mPosition( Vector3::ZERO ),
- mRotation( Quaternion::IDENTITY ),
+ mSize(), // zero initialized by default
+ mPosition(), // zero initialized by default
+ mRotation(), // initialized to identity by default
mScale( Vector3::ONE ),
mVisible( true ),
mColor( Color::WHITE ),
- mWorldPosition( Vector3::ZERO ),
- mWorldRotation( Quaternion::IDENTITY ),
+ mWorldPosition(), // zero initialized by default
+ mWorldRotation(), // initialized to identity by default
mWorldScale( Vector3::ONE ),
- mWorldMatrix( Matrix::IDENTITY ),
+ mWorldMatrix(),
mWorldColor( Color::WHITE ),
mParent( NULL ),
mExclusiveRenderTask( NULL ),
// Inherited properties; read-only from public API
- InheritedProperty<Vector3> mWorldPosition; ///< Full inherited position
- InheritedProperty<Quaternion> mWorldRotation; ///< Full inherited rotation
- InheritedProperty<Vector3> mWorldScale; ///< Full inherited scale
- InheritedProperty<Matrix> mWorldMatrix; ///< Full inherited world matrix
- InheritedColor mWorldColor; ///< Full inherited color
+ InheritedVector3 mWorldPosition; ///< Full inherited position
+ InheritedQuaternion mWorldRotation; ///< Full inherited rotation
+ InheritedVector3 mWorldScale; ///< Full inherited scale
+ InheritedMatrix mWorldMatrix; ///< Full inherited world matrix
+ InheritedColor mWorldColor; ///< Full inherited color
protected: