#include <FGrpFloatVector4.h>
#include <FGrpFloatPoint3.h>
+
+namespace Tizen { namespace Ui {
+class Variant;
+}}
+
namespace Tizen { namespace Ui { namespace Animations {
class _OSP_EXPORT_ Light
*/
void SetEnabled(bool enabled);
+ result SetProperty(const Tizen::Base::String& name, const Tizen::Ui::Variant& value);
+ Variant GetProperty(const Tizen::Base::String& name) const;
+
private:
class _LightImpl* __pLightImpl;
#define _FUI_ANIM_MATERIAL_H_
#include <FOspConfig.h>
+#include <FBaseObject.h>
#include <FGrpFloatVector4.h>
+namespace Tizen { namespace Ui {
+class Variant;
+}}
+
namespace Tizen { namespace Ui { namespace Animations
{
*/
void SetEmissivePower(const float& value);
+ result SetProperty(const Tizen::Base::String& name, const Tizen::Ui::Variant& value);
+ Tizen::Ui::Variant GetProperty(const Tizen::Base::String& name) const;
+
+
private:
class _MaterialImpl* __pMaterialImpl;
class Color;
}}
+namespace Tizen { namespace Ui{
+class Variant;
+}}
+
namespace Tizen { namespace Ui { namespace Animations{
class BoundingVolume;
bool IsNormalEnabled() const;
void SetName(Tizen::Base::String name);
- Tizen::Base::String GetName();
+ Tizen::Base::String GetName() const;
MeshController* GetMeshController(void);
+ result SetProperty(const Tizen::Base::String& name, const Tizen::Ui::Variant& value);
+ Variant GetProperty(const Tizen::Base::String& name) const;
+
private:
class _MeshImpl* __pMeshImpl;
bool Equals(const ShaderProgram& obj) const;
+ result SetProperty(const Tizen::Base::String& name, const Tizen::Ui::Variant& value);
+ Variant GetProperty(const Tizen::Base::String& name) const;
+
private:
ShaderProgram& operator =(const ShaderProgram& rhs);
__pLightImpl->SetEnabled(enabled);
}
+result
+Light::SetProperty(const Tizen::Base::String& name, const Tizen::Ui::Variant& value)
+{
+ SysAssertf(__pLightImpl != null, "Not yet constructed.");
+ return __pLightImpl->SetProperty(name, value);
+}
+
+Variant
+Light::GetProperty(const Tizen::Base::String& name) const
+{
+ SysAssertf(__pLightImpl != null, "Not yet constructed.");
+ return __pLightImpl->GetProperty(name);
+}
+
+
}}} //Tizen::Ui::Animations
__pMaterialImpl->SetEmissivePower(value);
}
+
+result
+Material::SetProperty(const Tizen::Base::String& name, const Tizen::Ui::Variant& value)
+{
+ SysAssertf(__pMaterialImpl != null, "Not yet constructed.");
+ return __pMaterialImpl->SetProperty(name, value);
+
+}
+
+Tizen::Ui::Variant
+Material::GetProperty(const Tizen::Base::String& name) const
+{
+ SysAssertf(__pMaterialImpl != null, "Not yet constructed.");
+ return __pMaterialImpl->GetProperty(name);
+}
+
}}} // namespace Tizen::Ui::Animations
}
Tizen::Base::String
-Mesh::GetName()
+Mesh::GetName() const
{
return Tizen::Base::String(__pMeshImpl->GetName().c_str());
}
return __pMeshImpl->__pMeshController;
}
+result
+Mesh::SetProperty(const Tizen::Base::String& name, const Variant& value)
+{
+ return __pMeshImpl->SetProperty(name, value);
+}
+
+Variant
+Mesh::GetProperty(const Tizen::Base::String& name) const
+{
+ return __pMeshImpl->GetProperty(name);
+}
+
}}}//namespace Tizen { namespace Ui { namespace Animations{
return __pShaderProgramImpl->Equals(obj);
}
+result
+ShaderProgram::SetProperty(const Tizen::Base::String& name, const Variant& value)
+{
+ ClearLastResult();
+ SysAssertf(__pShaderProgramImpl != null,
+ "Not yet constructed. Construct() should be called before use.");
+
+ return __pShaderProgramImpl->SetProperty(name, value);
+
+
+}
+
+Variant
+ShaderProgram::GetProperty(const Tizen::Base::String& name) const
+{
+ ClearLastResult();
+ SysAssertf(__pShaderProgramImpl != null,
+ "Not yet constructed. Construct() should be called before use.");
+
+ return __pShaderProgramImpl->GetProperty(name);
+
+}
+
}}} // Tizen::Ui::Animations
-_DynamicKeyString::_DynamicKeyString(const Tizen::Base::String& keyString, int id)
+_DynamicKeyString::_DynamicKeyString(const Tizen::Base::String& keyString, int id, int dataType)
{
__id = id;
+ __dataType = dataType;
__name = keyString;
const wchar_t* pDelimiter = L".";
}while(pToken);
}
-_DynamicKeyString::_DynamicKeyString(const wchar_t* pKeyString, int id)
+_DynamicKeyString::_DynamicKeyString(const wchar_t* pKeyString, int id, int dataType)
{
__id = id;
+ __dataType = dataType;
__name.Append(pKeyString);
const wchar_t* pDelimiter = L".";
static wchar_t __valueString[1024];
-_DyanamicPropertyString::_DyanamicPropertyString(_DynamicKeyString& keyString, const Tizen::Base::String& property, int at)
+_DyanamicPropertyString::_DyanamicPropertyString(const _DynamicKeyString& keyString, const Tizen::Base::String& property, int at)
:__keyString(keyString)
{
__isAvailable = __keyString.Compare(property,at);
class _DynamicKeyString : public Tizen::Base::Object
{
public:
- explicit _DynamicKeyString(const Tizen::Base::String& keyString, int id);
- explicit _DynamicKeyString(const wchar_t* pKeyString, int id);
+ explicit _DynamicKeyString(const Tizen::Base::String& keyString, int id, int dataType = 0);
+ explicit _DynamicKeyString(const wchar_t* pKeyString, int id, int dataType = 0);
int GetSubStringCount() const
{
return __subStrings.GetCount();
}
- const Tizen::Base::String GetKeyString() const
+ const Tizen::Base::String& GetKeyString() const
{
return __name;
}
const Tizen::Base::String GetSubString(int index) const;
bool Compare(const Tizen::Base::String& comparekey, int at = 0) const;
- int GetId(){return __id;}
+ int GetId() const {return __id;}
+ int GetDataType(void)const {return __dataType;}
private:
_DynamicKeyString(const _DynamicKeyString& rhs);
private:
Tizen::Base::String __name;
int __id;
+ int __dataType;
Tizen::Base::Collection::ArrayListT<Tizen::Base::String> __subStrings;
};
class _DyanamicPropertyString: public Tizen::Base::Object
{
public:
- explicit _DyanamicPropertyString(_DynamicKeyString& keyString, const Tizen::Base::String& property, int at = 0);
+ explicit _DyanamicPropertyString(const _DynamicKeyString& keyString, const Tizen::Base::String& property, int at = 0);
- _DynamicKeyString& GetKey(void) const{return __keyString;}
+ const _DynamicKeyString& GetKey(void) const {return __keyString;}
Tizen::Base::String GetValue(const Tizen::Base::String& key) const;
result GetValueToInteger(const Tizen::Base::String& key, long& value) const;
const _DyanamicPropertyString& operator = (const _DyanamicPropertyString& rhs);
private:
- _DynamicKeyString& __keyString;
+ const _DynamicKeyString& __keyString;
Tizen::Base::Collection::HashMapT<Tizen::Base::String, Tizen::Base::String> __map;
bool __isAvailable;
#include <stdio.h>
-//#define PRINT(FMT__,...) print(FMT__, __VA_ARGS__)
+//#define PRINT(FMT__,...) fprint(stderr, __VA_ARGS__)
//#define PRINT(...) SysLog(NID_UI_ANIM, __VA_ARGS__)
#define PRINT(...)
namespace Tizen { namespace Ui { namespace Animations{
-// 3.0 properties
-extern _DynamicKeyString* pVeMeshPropVertexCount;
-extern _DynamicKeyString* pVeMeshPropVertex;
-extern _DynamicKeyString* pVeMeshPropColor;
-extern _DynamicKeyString* pVeMeshPropTextureCoord;
-extern _DynamicKeyString* pVeMeshPropNormal;
-extern _DynamicKeyString* pVeMeshPropVertexIndex;
-extern _DynamicKeyString* pVeMeshPropBoneCount;
-extern _DynamicKeyString* pVeMeshPropBone;
-extern _DynamicKeyString* pVeMeshPropBoneIndex;
-extern _DynamicKeyString* pVeMeshPropBoneWeight;
-
-extern _DynamicKeyString* pVeMaterialDiffuse;
-extern _DynamicKeyString* pVeMaterialSpecular;
-extern _DynamicKeyString* pVeMaterialAmbient;
-extern _DynamicKeyString* pVeMaterialEmissive;
-extern _DynamicKeyString* pVeMaterialShiness;
-
-// is it needed ?
-extern _DynamicKeyString* pVeShadowColor;
-
-extern _DynamicKeyString* pVeLightCount;
-extern _DynamicKeyString* pVeLightType;
-extern _DynamicKeyString* pVeLightDiffuse;
-extern _DynamicKeyString* pVeLightSpecular;
-extern _DynamicKeyString* pVeLightAmbient;
-extern _DynamicKeyString* pVeLightPosition;
-extern _DynamicKeyString* pVeLightDirection;
-extern _DynamicKeyString* pVeLightExponent;
-extern _DynamicKeyString* pVeLightCutOff;
-extern _DynamicKeyString* pVeLightConstantAttenuation;
-extern _DynamicKeyString* pVeLightLinearAttenuation;
-extern _DynamicKeyString* pVeLightQuadraticAttenuation;
-// need to design
-//extern _DynamicKeyString* pVeShaderUniform;
_GeometryInfo::_GeometryInfo()
: __pMesh(null)
* This file contains implementation _LightImpl class.
*/
+#include <unique_ptr.h>
+#include <FGrpFloatVector4.h>
+#include "FUiAnim_DynamicProperty.h"
+#include "FUiAnim_VisualElementImpl.h"
#include "FUiAnim_LightImpl.h"
+using namespace Tizen::Graphics;
+
+//#define PRINT(...) fprintf(stderr, __VA_ARGS__)
+#define PRINT(...)
+
+namespace {
+static const char* STR_ERROR_INVALID_VARIANT_ARG_TYPE = "[E_INVALID_ARG] Invalid argument(s) is used. Variant type is invalid.";
+}
+
namespace Tizen { namespace Ui { namespace Animations
{
return light.__pLightImpl;
}
+
+static const _DynamicKeyString*
+GetDynamicKeyString(const Tizen::Base::String& name)
+{
+ static const _DynamicKeyString *properties[]=
+ {
+ PROP_STRING(LightPropName),
+ PROP_STRING(LightPropType),
+ PROP_STRING(LightPropDiffuse),
+ PROP_STRING(LightPropSpecular),
+ PROP_STRING(LightPropAmbient),
+ PROP_STRING(LightPropPosition),
+ PROP_STRING(LightPropDirection),
+ PROP_STRING(LightPropExponent),
+ PROP_STRING(LightPropCutOff),
+ PROP_STRING(LightPropConstantAttenuation),
+ PROP_STRING(LightPropLinearAttenuation),
+ PROP_STRING(LightPropQuadraticAttenuation),
+ PROP_STRING(LightPropEnable),
+ null
+ };
+
+ for( int i=0; properties[i] != null ; i++ )
+ {
+ if(properties[i]->Compare(name))
+ {
+ return properties[i];
+ }
+ }
+ return null;
+}
+
+result
+_LightImpl::SetProperty(const Tizen::Base::String& name, const Variant& value)
+{
+ const _DynamicKeyString* pProp = GetDynamicKeyString(name);
+
+ PRINT("GetProperty:%ls -> key:%ls\n",name.GetPointer(),(pProp == null)?L"none":pProp->GetKeyString().GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp != null, E_KEY_NOT_FOUND, E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND] Cannot find property!: [%ls]",name.GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp->GetDataType() == value.GetType(), E_INVALID_ARG, E_INVALID_ARG, STR_ERROR_INVALID_VARIANT_ARG_TYPE);
+
+ switch(pProp->GetId())
+ {
+ case PROP_ID(LightPropName):
+ {
+ SetName(value.ToString());
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropEnable):
+ {
+ SetEnabled(value.ToBool());
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropType):
+ {
+ SetType(static_cast<Light::LightType>(value.ToInt()));
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropDiffuse):
+ { float color[4];
+ FloatVector4 vec = value.ToFloatVector4();
+ color[0] = vec.x;
+ color[1] = vec.y;
+ color[2] = vec.z;
+ color[3] = vec.w;
+ SetDiffuse(color);
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropSpecular):
+ {
+ float color[4];
+ FloatVector4 vec = value.ToFloatVector4();
+ color[0] = vec.x;
+ color[1] = vec.y;
+ color[2] = vec.z;
+ color[3] = vec.w;
+ SetSpecular(color);
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropAmbient):
+ {
+ float color[4];
+ FloatVector4 vec = value.ToFloatVector4();
+ color[0] = vec.x;
+ color[1] = vec.y;
+ color[2] = vec.z;
+ color[3] = vec.w;
+ SetAmbient(color);
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropPosition):
+ {
+ float pos[4];
+ FloatVector4 vec = value.ToFloatVector4();
+ pos[0] = vec.x;
+ pos[1] = vec.y;
+ pos[2] = vec.z;
+ pos[3] = vec.w;
+ SetPosition(pos);
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropDirection):
+ {
+ float dir[3];
+ FloatPoint3 point = value.ToFloatPoint3();
+ dir[0] = point.x;
+ dir[1] = point.y;
+ dir[2] = point.z;
+
+ SetDirection(dir);
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropExponent):
+ {
+ SetExponent(value.ToFloat());
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropCutOff):
+ {
+ SetCutOff(value.ToFloat());
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropConstantAttenuation):
+ {
+ SetConstantAttenuation(value.ToFloat());
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropLinearAttenuation):
+ {
+ SetLinearAttenuation(value.ToFloat());
+ return E_SUCCESS;
+ }
+ case PROP_ID(LightPropQuadraticAttenuation):
+ {
+ SetQuadraticAttenuation(value.ToFloat());
+ return E_SUCCESS;
+ }
+ }
+ return E_KEY_NOT_FOUND;
+}
+Variant
+_LightImpl::GetProperty(const Tizen::Base::String& name) const
+{
+ const _DynamicKeyString* pProp = GetDynamicKeyString(name);
+
+ PRINT("GetProperty:%ls -> key:%ls\n",name.GetPointer(),(pProp == null)?L"none":pProp->GetKeyString().GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp != null, Variant(), E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND] Cannot find property!: [%ls]",name.GetPointer());
+
+ switch(pProp->GetId())
+ {
+ case PROP_ID(LightPropName):
+ {
+ return Variant(__name);
+ }
+ case PROP_ID(LightPropEnable):
+ {
+ return Variant(__enabled);
+ }
+ case PROP_ID(LightPropType):
+ {
+ return Variant(static_cast<int>(__lightType));
+ }
+ case PROP_ID(LightPropDiffuse):
+ {
+ return Variant(FloatVector4(__diffuse));
+ }
+ case PROP_ID(LightPropSpecular):
+ {
+ return Variant(FloatVector4(__specular));
+ }
+ case PROP_ID(LightPropAmbient):
+ {
+ return Variant(FloatVector4(__ambient));
+ }
+ case PROP_ID(LightPropPosition):
+ {
+ return Variant(FloatVector4(__position));
+ }
+ case PROP_ID(LightPropDirection):
+ {
+ return Variant(FloatPoint3(__direction));
+ }
+ case PROP_ID(LightPropExponent):
+ {
+ return Variant(__exponent);
+ }
+ case PROP_ID(LightPropCutOff):
+ {
+ return Variant(__cutOff);
+ }
+ case PROP_ID(LightPropConstantAttenuation):
+ {
+ return Variant(__attenuation[0]);
+ }
+ case PROP_ID(LightPropLinearAttenuation):
+ {
+ return Variant(__attenuation[1]);
+ }
+ case PROP_ID(LightPropQuadraticAttenuation):
+ {
+ return Variant(__attenuation[2]);
+ }
+ }
+ return Variant();
+}
+
+
+
}}} // Tizen::Ui::Animations
namespace Tizen { namespace Ui { namespace Animations
{
+class _DynamicKeyString;
+
+EXTERN_DYNAMIC_PROPERTY(L"name", LightPropName ,1) //String
+EXTERN_DYNAMIC_PROPERTY(L"type", LightPropType ,3) //int : LightType
+EXTERN_DYNAMIC_PROPERTY(L"diffuse", LightPropDiffuse ,4) //FloatVector4
+EXTERN_DYNAMIC_PROPERTY(L"specular", LightPropSpecular ,5) //FloatVector4
+EXTERN_DYNAMIC_PROPERTY(L"ambient", LightPropAmbient ,6) //FloatVector4
+EXTERN_DYNAMIC_PROPERTY(L"position", LightPropPosition ,7) //FloatPoint3
+EXTERN_DYNAMIC_PROPERTY(L"direction", LightPropDirection ,8) //FloatVector4
+EXTERN_DYNAMIC_PROPERTY(L"exponent", LightPropExponent ,9) //float
+EXTERN_DYNAMIC_PROPERTY(L"cutOff", LightPropCutOff ,10) //float
+EXTERN_DYNAMIC_PROPERTY(L"constantAttenuation", LightPropConstantAttenuation ,11) //float
+EXTERN_DYNAMIC_PROPERTY(L"linearAttenuation", LightPropLinearAttenuation ,12) //float
+EXTERN_DYNAMIC_PROPERTY(L"quadraticAttenuation", LightPropQuadraticAttenuation ,13) //float
+EXTERN_DYNAMIC_PROPERTY(L"enable", LightPropEnable ,14) //int
class _LightImpl
: public RefObject
public:
+ static _LightImpl* GetInstance(Light& light);
+ static const _LightImpl* GetInstance(const Light& light);
+
+
/**
* Sets light type.
*
result SetName(const Tizen::Base::String& name);
Tizen::Base::String GetName(void) const;
- static _LightImpl* GetInstance(Light& light);
- static const _LightImpl* GetInstance(const Light& light);
+ virtual result SetProperty(const Tizen::Base::String& name, const Variant& value);
+ virtual Variant GetProperty(const Tizen::Base::String& name) const;
private:
_LightImpl& operator =(const _LightImpl& rhs);
*
* This file contains implementation _MaterialImpl class.
*/
-
+#include <unique_ptr.h>
+#include <FGrpFloatVector4.h>
+#include "FUiAnim_DynamicProperty.h"
+#include "FUiAnim_VisualElementImpl.h"
#include "FUiAnim_MaterialImpl.h"
+using namespace Tizen::Graphics;
+using namespace Tizen::Ui;
+
+//#define PRINT(...) fprintf(stderr, __VA_ARGS__)
+#define PRINT(...)
+
+
+namespace {
+static const char* STR_ERROR_INVALID_VARIANT_ARG_TYPE = "[E_INVALID_ARG] Invalid argument(s) is used. Variant type is invalid.";
+}
+
namespace Tizen { namespace Ui { namespace Animations
{
return material.__pMaterialImpl;
}
+static const _DynamicKeyString*
+GetDynamicKeyString(const Tizen::Base::String& name)
+{
+ static const _DynamicKeyString *properties[]=
+ {
+ PROP_STRING(MaterialPropName),
+ PROP_STRING(MaterialPropDiffuse),
+ PROP_STRING(MaterialPropSpecular),
+ PROP_STRING(MaterialPropAmbient),
+ PROP_STRING(MaterialPropEmissive),
+ PROP_STRING(MaterialPropShiness),
+ null
+ };
+
+ for( int i=0; properties[i] != null ; i++ )
+ {
+ if(properties[i]->Compare(name))
+ {
+ return properties[i];
+ }
+ }
+ return null;
+}
+
+result
+_MaterialImpl::SetProperty(const Tizen::Base::String& name, const Variant& value)
+{
+ const _DynamicKeyString* pProp = GetDynamicKeyString(name);
+
+ PRINT("GetProperty:%ls -> key:%ls\n",name.GetPointer(),(pProp == null)?L"none":pProp->GetKeyString().GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp != null, E_KEY_NOT_FOUND, E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND] Cannot find property!: [%ls]",name.GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp->GetDataType() == value.GetType(), E_INVALID_ARG, E_INVALID_ARG, STR_ERROR_INVALID_VARIANT_ARG_TYPE);
+
+ switch(pProp->GetId())
+ {
+ case PROP_ID(MaterialPropName):
+ {
+ SetName(value.ToString());
+ return E_SUCCESS;
+ }
+ case PROP_ID(MaterialPropDiffuse):
+ {
+ FloatVector4 vec = value.ToFloatVector4();
+ float color[4];
+ color[0] = vec.x;
+ color[1] = vec.y;
+ color[2] = vec.z;
+ color[3] = vec.w;
+ SetDiffuse(color);
+ return E_SUCCESS;
+ }
+ case PROP_ID(MaterialPropSpecular):
+ {
+ FloatVector4 vec = value.ToFloatVector4();
+ float color[4];
+ color[0] = vec.x;
+ color[1] = vec.y;
+ color[2] = vec.z;
+ color[3] = vec.w;
+ SetSpecular(color);
+ return E_SUCCESS;
+ }
+
+ case PROP_ID(MaterialPropAmbient):
+ {
+ FloatVector4 vec = value.ToFloatVector4();
+ float color[4];
+ color[0] = vec.x;
+ color[1] = vec.y;
+ color[2] = vec.z;
+ color[3] = vec.w;
+ SetAmbient(color);
+ return E_SUCCESS;
+ }
+ case PROP_ID(MaterialPropEmissive):
+ {
+ FloatVector4 vec = value.ToFloatVector4();
+ float color[4];
+ color[0] = vec.x;
+ color[1] = vec.y;
+ color[2] = vec.z;
+ color[3] = vec.w;
+ SetEmissive(color);
+ return E_SUCCESS;
+ }
+ case PROP_ID(MaterialPropShiness):
+ {
+ SetShininess(value.ToFloat());
+ return E_SUCCESS;
+ }
+ }
+ return E_KEY_NOT_FOUND;
+}
+
+Variant
+_MaterialImpl::GetProperty(const Tizen::Base::String& name) const
+{
+ const _DynamicKeyString* pProp = GetDynamicKeyString(name);
+
+ PRINT("GetProperty:%ls -> key:%ls\n",name.GetPointer(),(pProp == null)?L"none":pProp->GetKeyString().GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp != null, Variant(), E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND] Cannot find property!: [%ls]",name.GetPointer());
+
+ switch(pProp->GetId())
+ {
+ case PROP_ID(MaterialPropName):
+ {
+ return Variant(__name);
+ }
+ case PROP_ID(MaterialPropDiffuse):
+ {
+ return Variant(FloatVector4(__diffuse));
+ }
+ case PROP_ID(MaterialPropSpecular):
+ {
+ return Variant(FloatVector4(__specular));
+ }
+
+ case PROP_ID(MaterialPropAmbient):
+ {
+ return Variant(FloatVector4(__ambient));
+ }
+ case PROP_ID(MaterialPropEmissive):
+ {
+ return Variant(FloatVector4(__emissive));
+ }
+ case PROP_ID(MaterialPropShiness):
+ {
+ return Variant(__shininess);
+ }
+ }
+ return Variant();
+}
///////
namespace Tizen { namespace Ui { namespace Animations
{
+class _DynamicKeyString;
+
+EXTERN_DYNAMIC_PROPERTY(L"name", MaterialPropName , 1) //String
+EXTERN_DYNAMIC_PROPERTY(L"diffuse", MaterialPropDiffuse , 2) //FloatVector4
+EXTERN_DYNAMIC_PROPERTY(L"specular", MaterialPropSpecular , 3) //FloatVector4
+EXTERN_DYNAMIC_PROPERTY(L"ambient", MaterialPropAmbient , 4) //FloatVector4
+EXTERN_DYNAMIC_PROPERTY(L"emissive", MaterialPropEmissive , 5) //FloatVector4
+EXTERN_DYNAMIC_PROPERTY(L"shiness", MaterialPropShiness , 6) //float
+
+
class _MaterialImpl
: public RefObject
{
virtual ~_MaterialImpl(void);
+ static _MaterialImpl* GetInstance(Material& material);
+ static const _MaterialImpl* GetInstance(const Material& material);
+
/**
* Set Material ambient color.
*
*/
result SetName(const Tizen::Base::String& name);
- static _MaterialImpl* GetInstance(Material& material);
- static const _MaterialImpl* GetInstance(const Material& material);
+ virtual result SetProperty(const Tizen::Base::String& name, const Variant& value);
+ virtual Variant GetProperty(const Tizen::Base::String& name) const;
private:
_MaterialImpl& operator=(const _MaterialImpl& rhs);
void SetOpacity(float value);
bool GetCastingShadow() const;
+public:
float __specularPower;
float __opacity;
+#include <stdint.h>
+#include <string>
+#include <unique_ptr.h>
+
#include "FUiAnim_MeshController.h"
#include "FGrpFloatPoint3.h"
#include "FGrpFloatDimension.h"
#include "FGrpColor.h"
#include "FUi_Math.h"
#include "FUiAnim_Mutex.h"
+#include "FUiAnim_DynamicProperty.h"
#include "FUiAnim_VisualElementImpl.h"
#include "FUiAnim_MeshImpl.h"
-#include <stdint.h>
-#include <string>
#include "FUiAnim_MathMatrix4.h"
+using namespace Tizen::Base;
using namespace Tizen::Graphics;
using namespace Tizen::Ui::Animations::_Math;
+//#define PRINT(...) fprintf(stderr, __VA_ARGS__)
+#define PRINT(...)
+
+namespace {
+static const char* STR_ERROR_INVALID_VARIANT_ARG_TYPE = "[E_INVALID_ARG] Invalid argument(s) is used. Variant type is invalid.";
+}
namespace Tizen { namespace Ui { namespace Animations {
_MeshImpl::Clear()
{
MESH_LOCK();
-#define FREE( __POINTER) if( __POINTER) delete __POINTER; __POINTER = null
+#define FREE( __POINTER)if( __POINTER) delete __POINTER; __POINTER = null
FREE(__pVertices);
FREE(__pTexCoordinates);
FREE(__pColors);
{
return (__pMeshController)?__pMeshController->__pMeshController:null;
}
+
+static _DyanamicPropertyString*
+GetDynamicPropertyStringN(const Tizen::Base::String& name)
+{
+ static const _DynamicKeyString *properties[]=
+ {
+ PROP_STRING(MeshPropName),
+ PROP_STRING(MeshPropVertexCount),
+ PROP_STRING(MeshPropVertex),
+ PROP_STRING(MeshPropColor),
+ PROP_STRING(MeshPropTextureCoord),
+ PROP_STRING(MeshPropNormal),
+ PROP_STRING(MeshPropVertexIndex),
+// PROP_STRING(MeshPropBoneCount),
+// PROP_STRING(MeshPropBone),
+// PROP_STRING(MeshPropBoneIndex),
+// PROP_STRING(MeshPropBoneWeight),
+ null
+ };
+
+ for( int i=0; properties[i] != null ; i++ )
+ {
+ if(properties[i]->Compare(name))
+ {
+ _DyanamicPropertyString* pPropString = new (std::nothrow) _DyanamicPropertyString(*properties[i], name);
+ if(!pPropString->IsAvailable())
+ {
+ delete pPropString;
+ return null;
+ }
+ return pPropString;
+ }
+ }
+ return null;
+}
+
+result
+_MeshImpl::SetProperty(const Tizen::Base::String& name, const Variant& value)
+{
+ std::unique_ptr<_DyanamicPropertyString> pProp( GetDynamicPropertyStringN(name) );
+
+ PRINT("GetProperty:%ls -> key:%ls\n",name.GetPointer(),(pProp == null)?L"none":pProp->GetKey().GetKeyString().GetPointer());
+
+ SysTryReturn(NID_UI_ANIM, pProp != null, E_KEY_NOT_FOUND, E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND] Cannot find property!: [%ls]",name.GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp->GetKey().GetDataType() == value.GetType(), E_INVALID_ARG, E_INVALID_ARG, STR_ERROR_INVALID_VARIANT_ARG_TYPE);
+
+
+ switch(pProp->GetKey().GetId())
+ {
+ case PROP_ID(MeshPropName):
+ {
+ std::wstring wStr(value.ToString().GetPointer());
+ std::string str(wStr.begin(), wStr.end());
+ SetName(str);
+ return E_SUCCESS;
+ }
+ case PROP_ID(MeshPropVertexCount):
+ {
+ SysLogException(NID_UI_ANIM, E_INVALID_OPERATION, "[%ls] is read only property", MeshPropVertexCount);
+ return E_INVALID_OPERATION;
+ }
+ case PROP_ID(MeshPropVertex):
+ {
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+ SetVertex(index, value.ToFloatPoint3());
+ return E_SUCCESS;
+ }
+ return E_INVALID_ARG;
+ }
+ case PROP_ID(MeshPropColor):
+ {
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+ SetColor(index, value.ToColor());
+ return E_SUCCESS;
+ }
+ return E_INVALID_ARG;
+ }
+ case PROP_ID(MeshPropTextureCoord):
+ {
+
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+ SetTextureCoord(index, value.ToFloatPoint());
+ return E_SUCCESS;
+ }
+ return E_INVALID_ARG;
+ }
+ case PROP_ID(MeshPropNormal):
+ {
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+
+ SetNormal(index, value.ToFloatPoint3());
+ return E_SUCCESS;
+ }
+
+ return E_INVALID_ARG;
+
+ }
+ case PROP_ID(MeshPropVertexIndex):
+ {
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+
+ SetIndex(index, value.ToInt());
+ return E_SUCCESS;
+ }
+ return E_INVALID_ARG;
+ }
+ default:
+ return E_KEY_NOT_FOUND;
+ }
+
+ return E_SUCCESS;
+}
+
+Variant
+_MeshImpl::GetProperty(const Tizen::Base::String& name) const
+{
+ std::unique_ptr<_DyanamicPropertyString> pProp( GetDynamicPropertyStringN(name) );
+
+ PRINT("GetProperty:%ls -> key:%ls\n",name.GetPointer(),(pProp == null)?L"none":pProp->GetKey().GetKeyString().GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp != null, Variant(), E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND] Cannot find property!: [%ls]",name.GetPointer());
+
+
+ switch(pProp->GetKey().GetId())
+ {
+ case PROP_ID(MeshPropName):
+ {
+ return Variant(String(__name.c_str()));
+ }
+ case PROP_ID(MeshPropVertexCount):
+ {
+ return Variant(__countOfVertex);
+ }
+ case PROP_ID(MeshPropVertex):
+ {
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+ return Variant(GetVertex(index));
+ }
+ return Variant();
+ }
+ case PROP_ID(MeshPropColor):
+ {
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+ return Variant(GetColor(index));
+ }
+ return Variant();
+ }
+ case PROP_ID(MeshPropTextureCoord):
+ {
+
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+ return Variant(GetTextureCoord(index));
+ }
+ return Variant();
+ }
+ case PROP_ID(MeshPropNormal):
+ {
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+
+ return Variant(GetNormal(index));
+ }
+
+ return Variant();
+
+ }
+ case PROP_ID(MeshPropVertexIndex):
+ {
+ long index = -1;
+ if(pProp->GetValueToInteger(String(L"index"), index) == E_SUCCESS)
+ {
+
+ return Variant(GetIndex(index));
+ }
+ return Variant();
+ }
+ }
+ return Variant();
+}
+
}}} //namespace Tizen { namespace Ui { namespace Animations {
proj.MakeToOrthogonal(left, right, bottom, top, near, far);
pImpl->SetProjectionMatrix(&proj);
-
}
void
* This file contains implementation _ShaderProgramImpl class.
*/
+#include <unique_ptr.h>
#include <FBaseSysLog.h>
+#include "FUiAnim_DynamicProperty.h"
+#include "FUiAnim_VisualElementImpl.h"
#include "FUiAnim_ShaderImpl.h"
#include "FUiAnim_ShaderProgramImpl.h"
#include "FUiAnim_GlRenderManager.h"
using namespace Tizen::Base;
+using namespace Tizen::Ui;
+
+//#define PRINT(...) fprintf(stderr, __VA_ARGS__)
+#define PRINT(...)
namespace Tizen { namespace Ui { namespace Animations
{
delete pValue;
}
}
+
+static _DyanamicPropertyString*
+GetDynamicPropertyStringN(const Tizen::Base::String& name)
+{
+ static const _DynamicKeyString *properties[]=
+ {
+// PROP_STRING(ShaderPropName),
+ PROP_STRING(ShaderPropUniform),
+ null
+ };
+
+ for( int i=0; properties[i] != null ; i++ )
+ {
+ if(properties[i]->Compare(name))
+ {
+ _DyanamicPropertyString* pPropString = new (std::nothrow) _DyanamicPropertyString(*properties[i], name);
+ if(!pPropString->IsAvailable())
+ {
+ delete pPropString;
+ return null;
+ }
+ return pPropString;
+ }
+ }
+ return null;
+}
+
+result
+_ShaderProgramImpl::SetProperty(const Tizen::Base::String& name, const Variant& value)
+{
+ std::unique_ptr<_DyanamicPropertyString> pProp( GetDynamicPropertyStringN(name));
+
+ PRINT("GetProperty:%ls -> key:%ls\n",name.GetPointer(),(pProp == null)?L"none":pProp->GetKey().GetKeyString().GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp != null, E_KEY_NOT_FOUND, E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND] Cannot find property!: [%ls]",name.GetPointer());
+
+
+// uniform is VARIANT, not need type checking.
+// if( pProp->GetKey().GetDataType() != value.GetType())
+// {
+// return E_INVALID_ARG;
+// }
+
+ switch(pProp->GetKey().GetId())
+ {
+ //case PROP_ID(ShaderPropName):
+ case PROP_ID(ShaderPropUniform):
+ {
+ String uniform = pProp->GetValue(L"#id");
+ return SetUniform(uniform, value);
+ }
+ }
+ return E_KEY_NOT_FOUND;
+
+}
+
+Variant
+_ShaderProgramImpl::GetProperty(const Tizen::Base::String& name) const
+{
+ std::unique_ptr<_DyanamicPropertyString> pProp( GetDynamicPropertyStringN(name) );
+
+ PRINT("GetProperty:%ls -> key:%ls\n",name.GetPointer(),(pProp == null)?L"none":pProp->GetKey().GetKeyString().GetPointer());
+ SysTryReturn(NID_UI_ANIM, pProp != null, Variant(), E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND] Cannot find property!: [%ls]",name.GetPointer());
+
+
+ switch(pProp->GetKey().GetId())
+ {
+ //case PROP_ID(ShaderPropName):
+ case PROP_ID(ShaderPropUniform):
+ {
+ String uniform = pProp->GetValue(L"#id");
+
+ Variant value = GetUniform(uniform);
+ return value;
+ }
+ }
+ return Variant();
+}
+
+
}}} // Tizen::Ui::Animations
namespace Tizen { namespace Ui { namespace Animations
{
+class _DynamicKeyString;
extern const wchar_t* VeAttrPosition;
extern const wchar_t* VeAttrTexCoord;
extern const wchar_t* VeUniformMaterialEmissive;
extern const wchar_t* VeUniformMaterialShininess;
+EXTERN_DYNAMIC_PROPERTY(L"uniform.#id", ShaderPropUniform ,2) //Variant
+
+
enum AttributeLocation
{
ATTRIBUTE_VEC4_POSITION = 0, /**< Attribute for position */
bool Equals(const ShaderProgram& program) const;
+ virtual result SetProperty(const Tizen::Base::String& name, const Variant& value);
+ virtual Variant GetProperty(const Tizen::Base::String& name) const;
+
static _ShaderProgramImpl* GetInstance(ShaderProgram& program);
static const _ShaderProgramImpl* GetInstance(const ShaderProgram& program);
#include "FUiAnim_VisualElementCoordinateSystem.h"
-#include "FUiAnim_VisualElementImpl.h"
#include "FUiAnim_DynamicProperty.h"
+#include "FUiAnim_MeshImpl.h"
+#include "FUiAnim_LightImpl.h"
+#include "FUiAnim_MaterialImpl.h"
+#include "FUiAnim_ShaderProgramImpl.h"
+#include "FUiAnim_VisualElementImpl.h"
+
#include "FUiAnim_VisualElementEnvironment.h"
#include "FUiAnim_Mutex.h"
#define STRING_INIT(_VAR) p##_VAR = new(std::nothrow) String(_VAR)
-#define DYNAMIC_STRING_INIT(_VAR) p##_VAR = new(std::nothrow) _DynamicKeyString(_VAR, i##_VAR)
-
+#define DYNAMIC_STRING_INIT(_VAR, _DATA_TYPE) p##_VAR = new(std::nothrow) _DynamicKeyString(_VAR, i##_VAR, _DATA_TYPE)
+#define STRING_RELEASE(_VAR) delete p##_VAR; p##_VAR = null
DECL_PROPERTY(L"bounds", VePropBounds )
DECL_PROPERTY(L"contentBounds", VePropContentBounds )
DECL_PROPERTY(L"contentOpacity", VePropContentOpacity )
DECL_DYNAMIC_PROPERTY(L"light.#name.linearAttenuation", VeLightLinearAttenuation ) //float
DECL_DYNAMIC_PROPERTY(L"light.#name.quadraticAttenuation", VeLightQuadraticAttenuation ) //float
-//DECL_DYNAMIC_PROPERTY(L"Shader#.uniform#.", VeShaderUniform )
-
+DECL_DYNAMIC_PROPERTY(L"shader.uniform.#id", VeShaderUniform ) //Variant
+
+//Mesh
+DECL_DYNAMIC_PROPERTY(L"name", MeshPropName ) //String
+DECL_DYNAMIC_PROPERTY(L"vertex.count", MeshPropVertexCount ) //int
+DECL_DYNAMIC_PROPERTY(L"vertex.#index", MeshPropVertex ) //FloatPoint3
+DECL_DYNAMIC_PROPERTY(L"color.#index", MeshPropColor ) //Color ( FloatColor will be needed )
+DECL_DYNAMIC_PROPERTY(L"textureCoordinates.#index", MeshPropTextureCoord ) //FloatDimension
+DECL_DYNAMIC_PROPERTY(L"normal.#index", MeshPropNormal ) //FloatPoint3
+DECL_DYNAMIC_PROPERTY(L"index.#index", MeshPropVertexIndex ) //int
+//DECL_DYNAMIC_PROPERTY(L"bone.count", MeshPropBoneCount ) //int
+//DECL_DYNAMIC_PROPERTY(L"bone.#index", MeshPropBone ) //FloatMatrix4
+//DECL_DYNAMIC_PROPERTY(L"bone.index.#index", MeshPropBoneIndex ) //int
+//DECL_DYNAMIC_PROPERTY(L"bone.weight.#index", MeshPropBoneWeight ) //float
+
+//Light
+DECL_DYNAMIC_PROPERTY(L"name", LightPropName ) //String
+DECL_DYNAMIC_PROPERTY(L"type", LightPropType ) //int : LightType
+DECL_DYNAMIC_PROPERTY(L"diffuse", LightPropDiffuse ) //FloatVector4
+DECL_DYNAMIC_PROPERTY(L"specular", LightPropSpecular ) //FloatVector4
+DECL_DYNAMIC_PROPERTY(L"ambient", LightPropAmbient ) //FloatVector4
+DECL_DYNAMIC_PROPERTY(L"position", LightPropPosition ) //FloatPoint3
+DECL_DYNAMIC_PROPERTY(L"direction", LightPropDirection ) //FloatVector4
+DECL_DYNAMIC_PROPERTY(L"exponent", LightPropExponent ) //float
+DECL_DYNAMIC_PROPERTY(L"cutOff", LightPropCutOff ) //float
+DECL_DYNAMIC_PROPERTY(L"constantAttenuation", LightPropConstantAttenuation ) //float
+DECL_DYNAMIC_PROPERTY(L"linearAttenuation", LightPropLinearAttenuation ) //float
+DECL_DYNAMIC_PROPERTY(L"quadraticAttenuation", LightPropQuadraticAttenuation ) //float
+DECL_DYNAMIC_PROPERTY(L"enable", LightPropEnable ) //int
+
+//Material
+DECL_DYNAMIC_PROPERTY(L"name", MaterialPropName ) //String
+DECL_DYNAMIC_PROPERTY(L"diffuse", MaterialPropDiffuse ) //FloatVector4
+DECL_DYNAMIC_PROPERTY(L"specular", MaterialPropSpecular ) //FloatVector4
+DECL_DYNAMIC_PROPERTY(L"ambient", MaterialPropAmbient ) //FloatVector4
+DECL_DYNAMIC_PROPERTY(L"emissive", MaterialPropEmissive ) //FloatVector4
+DECL_DYNAMIC_PROPERTY(L"shiness", MaterialPropShiness ) //float
+
+//ShaderProgram
+//DECL_DYNAMIC_PROPERTY(L"name", ShaderPropName ) //String
+DECL_DYNAMIC_PROPERTY(L"uniform.#id", ShaderPropUniform ) //Variant
_Mutex* _VisualElementEnvironment::__pMethodLock = NULL;
STRING_INIT(VeSubPropProjectionNear);
STRING_INIT(VeSubPropProjectionFar);
-
- DYNAMIC_STRING_INIT(VeMeshPropVertexCount);
- DYNAMIC_STRING_INIT(VeMeshPropVertex);
- DYNAMIC_STRING_INIT(VeMeshPropColor);
- DYNAMIC_STRING_INIT(VeMeshPropTextureCoord);
- DYNAMIC_STRING_INIT(VeMeshPropNormal);
- DYNAMIC_STRING_INIT(VeMeshPropVertexIndex);
- DYNAMIC_STRING_INIT(VeMeshPropBoneCount);
- DYNAMIC_STRING_INIT(VeMeshPropBone);
- DYNAMIC_STRING_INIT(VeMeshPropBoneIndex);
- DYNAMIC_STRING_INIT(VeMeshPropBoneWeight);
-
- DYNAMIC_STRING_INIT(VeMaterialDiffuse);
- DYNAMIC_STRING_INIT(VeMaterialSpecular);
- DYNAMIC_STRING_INIT(VeMaterialAmbient);
- DYNAMIC_STRING_INIT(VeMaterialEmissive);
- DYNAMIC_STRING_INIT(VeMaterialShiness);
-
// is it needed ? / is it needed ?
- DYNAMIC_STRING_INIT(VeShadowColor);
-
- DYNAMIC_STRING_INIT(VeLightCount);
- DYNAMIC_STRING_INIT(VeLightType);
- DYNAMIC_STRING_INIT(VeLightDiffuse);
- DYNAMIC_STRING_INIT(VeLightSpecular);
- DYNAMIC_STRING_INIT(VeLightAmbient);
- DYNAMIC_STRING_INIT(VeLightPosition);
- DYNAMIC_STRING_INIT(VeLightDirection);
- DYNAMIC_STRING_INIT(VeLightExponent);
- DYNAMIC_STRING_INIT(VeLightCutOff);
- DYNAMIC_STRING_INIT(VeLightConstantAttenuation);
- DYNAMIC_STRING_INIT(VeLightLinearAttenuation);
- DYNAMIC_STRING_INIT(VeLightQuadraticAttenuation);
+ DYNAMIC_STRING_INIT(VeShadowColor, 0);
+
+
+ DYNAMIC_STRING_INIT(VeMeshPropVertexCount, VARIANT_TYPE_INT);
+ DYNAMIC_STRING_INIT(VeMeshPropVertex, VARIANT_TYPE_FLOAT_POINT3);
+ DYNAMIC_STRING_INIT(VeMeshPropColor, VARIANT_TYPE_COLOR);
+ DYNAMIC_STRING_INIT(VeMeshPropTextureCoord, VARIANT_TYPE_FLOAT_DIMENSION);
+ DYNAMIC_STRING_INIT(VeMeshPropNormal, VARIANT_TYPE_FLOAT_POINT3);
+ DYNAMIC_STRING_INIT(VeMeshPropVertexIndex, VARIANT_TYPE_INT);
+ DYNAMIC_STRING_INIT(VeMeshPropBoneCount, 0);
+ DYNAMIC_STRING_INIT(VeMeshPropBone, 0);
+ DYNAMIC_STRING_INIT(VeMeshPropBoneIndex, 0);
+ DYNAMIC_STRING_INIT(VeMeshPropBoneWeight, 0);
+
+ DYNAMIC_STRING_INIT(VeMaterialDiffuse, 0);
+ DYNAMIC_STRING_INIT(VeMaterialSpecular, 0);
+ DYNAMIC_STRING_INIT(VeMaterialAmbient, 0);
+ DYNAMIC_STRING_INIT(VeMaterialEmissive, 0);
+ DYNAMIC_STRING_INIT(VeMaterialShiness, 0);
+
+ DYNAMIC_STRING_INIT(VeLightCount, 0);
+ DYNAMIC_STRING_INIT(VeLightType, 0);
+ DYNAMIC_STRING_INIT(VeLightDiffuse, 0);
+ DYNAMIC_STRING_INIT(VeLightSpecular, 0);
+ DYNAMIC_STRING_INIT(VeLightAmbient, 0);
+ DYNAMIC_STRING_INIT(VeLightPosition, 0);
+ DYNAMIC_STRING_INIT(VeLightDirection, 0);
+ DYNAMIC_STRING_INIT(VeLightExponent, 0);
+ DYNAMIC_STRING_INIT(VeLightCutOff, 0);
+ DYNAMIC_STRING_INIT(VeLightConstantAttenuation, 0);
+ DYNAMIC_STRING_INIT(VeLightLinearAttenuation, 0);
+ DYNAMIC_STRING_INIT(VeLightQuadraticAttenuation, 0);
// need to design / need to design
- //pVeShaderUniform = /pVeShaderUniform ;
+ DYNAMIC_STRING_INIT(VeShaderUniform, 0);
+
+
+ //Mesh
+ DYNAMIC_STRING_INIT(MeshPropName , VARIANT_TYPE_STRING);
+ DYNAMIC_STRING_INIT(MeshPropVertexCount , VARIANT_TYPE_INT);
+ DYNAMIC_STRING_INIT(MeshPropVertex , VARIANT_TYPE_FLOAT_POINT3);
+ DYNAMIC_STRING_INIT(MeshPropColor , VARIANT_TYPE_COLOR);
+ DYNAMIC_STRING_INIT(MeshPropTextureCoord , VARIANT_TYPE_FLOAT_DIMENSION);
+ DYNAMIC_STRING_INIT(MeshPropNormal , VARIANT_TYPE_FLOAT_POINT3);
+ DYNAMIC_STRING_INIT(MeshPropVertexIndex , VARIANT_TYPE_INT);
+ //DYNAMIC_STRING_INIT(MeshPropBoneCount , VARIANT_TYPE_INT);
+ //DYNAMIC_STRING_INIT(MeshPropBone , VARIANT_TYPE_FLOAT_MATRIX4);
+ //DYNAMIC_STRING_INIT(MeshPropBoneIndex , VARIANT_TYPE_INT);
+ //DYNAMIC_STRING_INIT(MeshPropBoneWeight , VARIANT_TYPE_FLOAT);
+
+ //Light
+ DYNAMIC_STRING_INIT(LightPropName , VARIANT_TYPE_STRING);
+ DYNAMIC_STRING_INIT(LightPropType , VARIANT_TYPE_INT);
+ DYNAMIC_STRING_INIT(LightPropDiffuse , VARIANT_TYPE_FLOAT_VECTOR4);
+ DYNAMIC_STRING_INIT(LightPropSpecular , VARIANT_TYPE_FLOAT_VECTOR4);
+ DYNAMIC_STRING_INIT(LightPropAmbient , VARIANT_TYPE_FLOAT_VECTOR4);
+ DYNAMIC_STRING_INIT(LightPropPosition , VARIANT_TYPE_FLOAT_POINT3);
+ DYNAMIC_STRING_INIT(LightPropDirection , VARIANT_TYPE_FLOAT_VECTOR4);
+ DYNAMIC_STRING_INIT(LightPropExponent , VARIANT_TYPE_FLOAT);
+ DYNAMIC_STRING_INIT(LightPropCutOff , VARIANT_TYPE_FLOAT);
+ DYNAMIC_STRING_INIT(LightPropConstantAttenuation , VARIANT_TYPE_FLOAT);
+ DYNAMIC_STRING_INIT(LightPropLinearAttenuation , VARIANT_TYPE_FLOAT);
+ DYNAMIC_STRING_INIT(LightPropQuadraticAttenuation , VARIANT_TYPE_FLOAT);
+ DYNAMIC_STRING_INIT(LightPropEnable , VARIANT_TYPE_INT);
+
+ //Material
+ DYNAMIC_STRING_INIT(MaterialPropName , VARIANT_TYPE_STRING);
+ DYNAMIC_STRING_INIT(MaterialPropDiffuse , VARIANT_TYPE_FLOAT_VECTOR4);
+ DYNAMIC_STRING_INIT(MaterialPropSpecular , VARIANT_TYPE_FLOAT_VECTOR4);
+ DYNAMIC_STRING_INIT(MaterialPropAmbient , VARIANT_TYPE_FLOAT_VECTOR4);
+ DYNAMIC_STRING_INIT(MaterialPropEmissive , VARIANT_TYPE_FLOAT_VECTOR4);
+ DYNAMIC_STRING_INIT(MaterialPropShiness , VARIANT_TYPE_FLOAT);
+
+ //ShaderProgram
+// DYNAMIC_STRING_INIT(ShaderPropName , VARIANT_TYPE_STRING);
+ DYNAMIC_STRING_INIT(ShaderPropUniform ,0);
+
+
__pMethodLock = new _Mutex(true);
__pTreeLock = new _Mutex(true);
__pSurfaceLock = new _Mutex(true);
_VisualElementEnvironment::~_VisualElementEnvironment(void)
{
- delete PROP_STRING(VePropBounds);
- delete PROP_STRING(VePropContentBounds);
- delete PROP_STRING(VePropContentOpacity);
- delete PROP_STRING(VePropRenderOperation);
- delete PROP_STRING(VePropOpacity);
- delete PROP_STRING(VePropShowState);
- delete PROP_STRING(VePropAnchor);
- delete PROP_STRING(VePropAnchorZ);
- delete PROP_STRING(VePropTransform);
- delete PROP_STRING(VePropChildrenTransform);
- delete PROP_STRING(VePropZPosition);
- delete PROP_STRING(VePropZOrderGroup);
- delete PROP_STRING(VePropClipToParent);
- delete PROP_STRING(VePropClipChildren);
- delete PROP_STRING(VePropSurfaceOpaque);
- delete PROP_STRING(VePropName);
- delete PROP_STRING(VePropPropertyPropagationEnabled);
- delete PROP_STRING(VePropImplicitAnimationEnabled);
+ STRING_RELEASE(VePropBounds);
+ STRING_RELEASE(VePropContentBounds);
+ STRING_RELEASE(VePropContentOpacity);
+ STRING_RELEASE(VePropRenderOperation);
+ STRING_RELEASE(VePropOpacity);
+ STRING_RELEASE(VePropShowState);
+ STRING_RELEASE(VePropAnchor);
+ STRING_RELEASE(VePropAnchorZ);
+ STRING_RELEASE(VePropTransform);
+ STRING_RELEASE(VePropChildrenTransform);
+ STRING_RELEASE(VePropZPosition);
+ STRING_RELEASE(VePropZOrderGroup);
+ STRING_RELEASE(VePropClipToParent);
+ STRING_RELEASE(VePropClipChildren);
+ STRING_RELEASE(VePropSurfaceOpaque);
+ STRING_RELEASE(VePropName);
+ STRING_RELEASE(VePropPropertyPropagationEnabled);
+ STRING_RELEASE(VePropImplicitAnimationEnabled);
#if defined(SUPPORT_CUSTOMIZING_ATTACH_DETACH_ANIMATION)
- delete PROP_STRING(VePropActionDetach);
- delete PROP_STRING(VePropActionAttach);
+ STRING_RELEASE(VePropActionDetach);
+ STRING_RELEASE(VePropActionAttach);
#endif
- delete PROP_STRING(VeSubPropBounds);
- delete PROP_STRING(VeSubPropBoundsPosition);
- delete PROP_STRING(VeSubPropBoundsSize);
-
- delete PROP_STRING(VeSubPropTransform);
- delete PROP_STRING(VeSubPropTransformRotationX);
- delete PROP_STRING(VeSubPropTransformRotationY);
- delete PROP_STRING(VeSubPropTransformRotationZ);
- delete PROP_STRING(VeSubPropTransformScaleX);
- delete PROP_STRING(VeSubPropTransformScaleY);
- delete PROP_STRING(VeSubPropTransformScaleZ);
- delete PROP_STRING(VeSubPropTransformTranslationX);
- delete PROP_STRING(VeSubPropTransformTranslationY);
- delete PROP_STRING(VeSubPropTransformTranslationZ);
- delete PROP_STRING(VeSubPropTransformRotationAnchorX);
- delete PROP_STRING(VeSubPropTransformRotationAnchorY);
- delete PROP_STRING(VeSubPropTransformRotationAnchorZ);
- delete PROP_STRING(VeSubPropTransformScaleAnchorX);
- delete PROP_STRING(VeSubPropTransformScaleAnchorY);
- delete PROP_STRING(VeSubPropTransformScaleAnchorZ);
-
- delete PROP_STRING(VeSubPropTransformRotationXY);
- delete PROP_STRING(VeSubPropTransformScaleXY);
- delete PROP_STRING(VeSubPropTransformTranslationXY);
- delete PROP_STRING(VeSubPropTransformRotationAnchorXY);
- delete PROP_STRING(VeSubPropTransformScaleAnchorXY);
-
- delete PROP_STRING(VeSubPropChildrenTransform);
- delete PROP_STRING(VeSubPropChildrenTransformRotationX);
- delete PROP_STRING(VeSubPropChildrenTransformRotationY);
- delete PROP_STRING(VeSubPropChildrenTransformRotationZ);
- delete PROP_STRING(VeSubPropChildrenTransformScaleX);
- delete PROP_STRING(VeSubPropChildrenTransformScaleY);
- delete PROP_STRING(VeSubPropChildrenTransformScaleZ);
- delete PROP_STRING(VeSubPropChildrenTransformTranslationX);
- delete PROP_STRING(VeSubPropChildrenTransformTranslationY);
- delete PROP_STRING(VeSubPropChildrenTransformTranslationZ);
- delete PROP_STRING(VeSubPropChildrenTransformRotationAnchorX);
- delete PROP_STRING(VeSubPropChildrenTransformRotationAnchorY);
- delete PROP_STRING(VeSubPropChildrenTransformRotationAnchorZ);
- delete PROP_STRING(VeSubPropChildrenTransformScaleAnchorX);
- delete PROP_STRING(VeSubPropChildrenTransformScaleAnchorY);
- delete PROP_STRING(VeSubPropChildrenTransformScaleAnchorZ);
-
- delete PROP_STRING(VeSubPropChildrenTransformRotationXY);
- delete PROP_STRING(VeSubPropChildrenTransformScaleXY);
- delete PROP_STRING(VeSubPropChildrenTransformTranslationXY);
- delete PROP_STRING(VeSubPropChildrenTransformRotationAnchorXY);
- delete PROP_STRING(VeSubPropChildrenTransformScaleAnchorXY);
-
- delete PROP_STRING(VePrivPropShowOpacity);
+ STRING_RELEASE(VeSubPropBounds);
+ STRING_RELEASE(VeSubPropBoundsPosition);
+ STRING_RELEASE(VeSubPropBoundsSize);
+
+ STRING_RELEASE(VeSubPropTransform);
+ STRING_RELEASE(VeSubPropTransformRotationX);
+ STRING_RELEASE(VeSubPropTransformRotationY);
+ STRING_RELEASE(VeSubPropTransformRotationZ);
+ STRING_RELEASE(VeSubPropTransformScaleX);
+ STRING_RELEASE(VeSubPropTransformScaleY);
+ STRING_RELEASE(VeSubPropTransformScaleZ);
+ STRING_RELEASE(VeSubPropTransformTranslationX);
+ STRING_RELEASE(VeSubPropTransformTranslationY);
+ STRING_RELEASE(VeSubPropTransformTranslationZ);
+ STRING_RELEASE(VeSubPropTransformRotationAnchorX);
+ STRING_RELEASE(VeSubPropTransformRotationAnchorY);
+ STRING_RELEASE(VeSubPropTransformRotationAnchorZ);
+ STRING_RELEASE(VeSubPropTransformScaleAnchorX);
+ STRING_RELEASE(VeSubPropTransformScaleAnchorY);
+ STRING_RELEASE(VeSubPropTransformScaleAnchorZ);
+
+ STRING_RELEASE(VeSubPropTransformRotationXY);
+ STRING_RELEASE(VeSubPropTransformScaleXY);
+ STRING_RELEASE(VeSubPropTransformTranslationXY);
+ STRING_RELEASE(VeSubPropTransformRotationAnchorXY);
+ STRING_RELEASE(VeSubPropTransformScaleAnchorXY);
+
+ STRING_RELEASE(VeSubPropChildrenTransform);
+ STRING_RELEASE(VeSubPropChildrenTransformRotationX);
+ STRING_RELEASE(VeSubPropChildrenTransformRotationY);
+ STRING_RELEASE(VeSubPropChildrenTransformRotationZ);
+ STRING_RELEASE(VeSubPropChildrenTransformScaleX);
+ STRING_RELEASE(VeSubPropChildrenTransformScaleY);
+ STRING_RELEASE(VeSubPropChildrenTransformScaleZ);
+ STRING_RELEASE(VeSubPropChildrenTransformTranslationX);
+ STRING_RELEASE(VeSubPropChildrenTransformTranslationY);
+ STRING_RELEASE(VeSubPropChildrenTransformTranslationZ);
+ STRING_RELEASE(VeSubPropChildrenTransformRotationAnchorX);
+ STRING_RELEASE(VeSubPropChildrenTransformRotationAnchorY);
+ STRING_RELEASE(VeSubPropChildrenTransformRotationAnchorZ);
+ STRING_RELEASE(VeSubPropChildrenTransformScaleAnchorX);
+ STRING_RELEASE(VeSubPropChildrenTransformScaleAnchorY);
+ STRING_RELEASE(VeSubPropChildrenTransformScaleAnchorZ);
+
+ STRING_RELEASE(VeSubPropChildrenTransformRotationXY);
+ STRING_RELEASE(VeSubPropChildrenTransformScaleXY);
+ STRING_RELEASE(VeSubPropChildrenTransformTranslationXY);
+ STRING_RELEASE(VeSubPropChildrenTransformRotationAnchorXY);
+ STRING_RELEASE(VeSubPropChildrenTransformScaleAnchorXY);
+
+ STRING_RELEASE(VePrivPropShowOpacity);
// 3.0 properties
- delete PROP_STRING(VeMeshPropVertexCount);
- delete PROP_STRING(VeMeshPropVertex);
- delete PROP_STRING(VeMeshPropColor);
- delete PROP_STRING(VeMeshPropTextureCoord);
- delete PROP_STRING(VeMeshPropNormal);
- delete PROP_STRING(VeMeshPropVertexIndex);
- delete PROP_STRING(VeMeshPropBoneCount);
- delete PROP_STRING(VeMeshPropBone);
- delete PROP_STRING(VeMeshPropBoneIndex);
- delete PROP_STRING(VeMeshPropBoneWeight);
-
- delete PROP_STRING(VeMaterialDiffuse);
- delete PROP_STRING(VeMaterialSpecular);
- delete PROP_STRING(VeMaterialAmbient);
- delete PROP_STRING(VeMaterialEmissive);
- delete PROP_STRING(VeMaterialShiness);
+ STRING_RELEASE(VeMeshPropVertexCount);
+ STRING_RELEASE(VeMeshPropVertex);
+ STRING_RELEASE(VeMeshPropColor);
+ STRING_RELEASE(VeMeshPropTextureCoord);
+ STRING_RELEASE(VeMeshPropNormal);
+ STRING_RELEASE(VeMeshPropVertexIndex);
+ STRING_RELEASE(VeMeshPropBoneCount);
+ STRING_RELEASE(VeMeshPropBone);
+ STRING_RELEASE(VeMeshPropBoneIndex);
+ STRING_RELEASE(VeMeshPropBoneWeight);
+
+ STRING_RELEASE(VeMaterialDiffuse);
+ STRING_RELEASE(VeMaterialSpecular);
+ STRING_RELEASE(VeMaterialAmbient);
+ STRING_RELEASE(VeMaterialEmissive);
+ STRING_RELEASE(VeMaterialShiness);
// is it needed ?
- delete PROP_STRING(VeShadowColor);
-
- delete PROP_STRING(VeLightCount);
- delete PROP_STRING(VeLightType);
- delete PROP_STRING(VeLightDiffuse);
- delete PROP_STRING(VeLightSpecular);
- delete PROP_STRING(VeLightAmbient);
- delete PROP_STRING(VeLightPosition);
- delete PROP_STRING(VeLightDirection);
- delete PROP_STRING(VeLightExponent);
- delete PROP_STRING(VeLightCutOff);
- delete PROP_STRING(VeLightConstantAttenuation);
- delete PROP_STRING(VeLightLinearAttenuation);
- delete PROP_STRING(VeLightQuadraticAttenuation);
+ STRING_RELEASE(VeShadowColor);
+
+ STRING_RELEASE(VeLightCount);
+ STRING_RELEASE(VeLightType);
+ STRING_RELEASE(VeLightDiffuse);
+ STRING_RELEASE(VeLightSpecular);
+ STRING_RELEASE(VeLightAmbient);
+ STRING_RELEASE(VeLightPosition);
+ STRING_RELEASE(VeLightDirection);
+ STRING_RELEASE(VeLightExponent);
+ STRING_RELEASE(VeLightCutOff);
+ STRING_RELEASE(VeLightConstantAttenuation);
+ STRING_RELEASE(VeLightLinearAttenuation);
+ STRING_RELEASE(VeLightQuadraticAttenuation);
+
+
+ //Mesh
+ STRING_RELEASE(MeshPropName);
+ STRING_RELEASE(MeshPropVertexCount);
+ STRING_RELEASE(MeshPropVertex);
+ STRING_RELEASE(MeshPropColor);
+ STRING_RELEASE(MeshPropTextureCoord);
+ STRING_RELEASE(MeshPropNormal);
+ STRING_RELEASE(MeshPropVertexIndex);
+ //STRING_RELEASE(MeshPropBoneCount);
+ //STRING_RELEASE(MeshPropBone);
+ //STRING_RELEASE(MeshPropBoneIndex);
+ //STRING_RELEASE(MeshPropBoneWeight);
+
+ //Light
+ STRING_RELEASE(LightPropName);
+ STRING_RELEASE(LightPropType);
+ STRING_RELEASE(LightPropDiffuse);
+ STRING_RELEASE(LightPropSpecular);
+ STRING_RELEASE(LightPropAmbient);
+ STRING_RELEASE(LightPropPosition);
+ STRING_RELEASE(LightPropDirection);
+ STRING_RELEASE(LightPropExponent);
+ STRING_RELEASE(LightPropCutOff);
+ STRING_RELEASE(LightPropConstantAttenuation);
+ STRING_RELEASE(LightPropLinearAttenuation);
+ STRING_RELEASE(LightPropQuadraticAttenuation);
+ STRING_RELEASE(LightPropEnable);
+
+ //Material
+ STRING_RELEASE(MaterialPropName);
+ STRING_RELEASE(MaterialPropDiffuse);
+ STRING_RELEASE(MaterialPropSpecular);
+ STRING_RELEASE(MaterialPropAmbient);
+ STRING_RELEASE(MaterialPropEmissive);
+ STRING_RELEASE(MaterialPropShiness);
+
+ //ShaderProgram
+// STRING_RELEASE(ShaderPropName);
+ STRING_RELEASE(ShaderPropUniform);
// need to design
//pVeShaderUniform;
class _Mutex;
class VisualElement;
+class _DynamicKeyString;
+
+EXTERN_DYNAMIC_PROPERTY(L"count", MeshPropName , 1) //String
+EXTERN_DYNAMIC_PROPERTY(L"vertex.count", MeshPropVertexCount , 2) //int
+EXTERN_DYNAMIC_PROPERTY(L"vertex.#index", MeshPropVertex , 3) //FloatPoint3
+EXTERN_DYNAMIC_PROPERTY(L"color.#index", MeshPropColor , 4) //Color ( FloatColor will be needed )
+EXTERN_DYNAMIC_PROPERTY(L"textureCoordinates.#index", MeshPropTextureCoord , 5) //FloatDimension
+EXTERN_DYNAMIC_PROPERTY(L"normal.#index", MeshPropNormal , 6) //FloatPoint3
+EXTERN_DYNAMIC_PROPERTY(L"index.#index", MeshPropVertexIndex , 7) //int
+//EXTERN_DYNAMIC_PROPERTY(L"bone.count", MeshPropBoneCount , 8) //int
+//EXTERN_DYNAMIC_PROPERTY(L"bone.#index", MeshPropBone , 9) //FloatMatrix4
+//EXTERN_DYNAMIC_PROPERTY(L"bone.index.#index", MeshPropBoneIndex , 10) //int
+//EXTERN_DYNAMIC_PROPERTY(L"bone.weight.#index", MeshPropBoneWeight , 11) //float
+
class _OSP_EXPORT_ _MeshImpl
: public RefObject
static _MeshImpl* GetInstance(Mesh& mesh);
static const _MeshImpl* GetInstance(const Mesh& mesh);
+
static Mesh* LoadMeshFromBinaryN(const std::string& fileName, const std::string& modelName);
result SetVertex(int arrayIndex, const Tizen::Graphics::FloatPoint3& point);
return __name;
}
+ virtual result SetProperty(const Tizen::Base::String& name, const Variant& value);
+ virtual Variant GetProperty(const Tizen::Base::String& name) const;
+
+
result SaveMeshToBin(const Tizen::Base::String& fileName);
MeshController* CreateMeshController(VisualElement* pRootJoint, const Tizen::Graphics::FloatMatrix4& bindShapeMatrix);
#ifndef _FUI_ANIM_REFOBJECT_H_
#define _FUI_ANIM_REFOBJECT_H_
#include <FBaseObject.h>
+#include <FUi_PropertyBase.h>
#include <FBaseErrors.h>
namespace Tizen { namespace Ui { namespace Animations {
+// macro definition for property (FUi_PropertyBase.h)
+
+#define EXTERN_PROPERTY(_STRING, _VAR, id) \
+ extern const wchar_t* _VAR; \
+ extern Tizen::Base::String* p##_VAR; \
+ const int i##_VAR =id;
+#define PROP_STRING(_VAR) p##_VAR
+#define PROP_ID(_VAR) i##_VAR
+
+#define EXTERN_DYNAMIC_PROPERTY(_STRING, _VAR, id) \
+ extern const wchar_t* _VAR; \
+ extern _DynamicKeyString* p##_VAR; \
+ const int i##_VAR =id;
+
+
class _OSP_EXPORT_ RefObject
- : public Tizen::Base::Object
+ : public Tizen::Ui::_PropertyBase
{
public:
RefObject():__ref(0){}
#include <FUiAnimVisualElement.h>
#include "FUi_PropertyBase.h"
+#include "FUiAnim_RefObject.h" // for macro EXTERN_PROPERTY
#include "FUiAnimBoundingVolume.h"
class IVisualElementEventListener;
class _AnimationManager;
class _IVisualElementCaptureProvider;
+class _DynamicKeyString;
class Mesh;
typedef std::pair<float, _Math::Vector3> DistToPoint;
typedef std::vector<DistToPoint> Intersections;
typedef Intersections::iterator IntersectionsIt;
-#define EXTERN_PROPERTY(_STRING, _VAR, id) \
- extern const wchar_t* _VAR; \
- extern Tizen::Base::String* p##_VAR; \
- const int i##_VAR =id;
-#define PROP_STRING(_VAR) p##_VAR
-#define PROP_ID(_VAR) i##_VAR
-
-#define EXTERN_DYNAMIC_PROPERTY(_STRING, _VAR, id) \
- extern const wchar_t* _VAR; \
- const int i##_VAR =id;
-
EXTERN_PROPERTY(L"bounds", VePropBounds ,1) //FloatRectnagle
EXTERN_DYNAMIC_PROPERTY(L"light.#name.linearAttenuation", VeLightLinearAttenuation ,526) //float
EXTERN_DYNAMIC_PROPERTY(L"light.#name.quadraticAttenuation", VeLightQuadraticAttenuation ,527) //float
-//EXTERN_DYNAMIC_PROPERTY(L"Shader#.uniform#.", VeShaderUniform ,95)
+EXTERN_DYNAMIC_PROPERTY(L"shader.uniform.#id", VeShaderUniform ,528) //Variant
/**
* @class _VisualElementImpl
* @brief This class provides methods to control VisualElement.