* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
* @remarks Can only increase bounding volume size, call AdjustBoundingVolume() to readjust.
- * @see GetVertex(), AdjustBoundingVolume()
+ * @see GetVertex()
+ * @see SetVertices()
+ * @see AdjustBoundingVolume()
*/
result SetVertex(int arrayIndex, const Tizen::Graphics::FloatPoint3& point);
/**
+ * Replaces the vertex with the specified @c pVertiecs.
+ *
+ * @since 3.0
+ *
+ * @return An error code
+ * @param[in] pVertiecs The vertex array, a each vertex has x,y,z value
+ * @param[in] size The size of the @c pVertices array
+ * @exception E_SUCCESS The method is successful
+ * @exception E_INVALID_STATE Vertices haven't been allocated yet
+ * @exception E_OUT_OF_RANGE Invalid position of the vertices array. Either of the following conditions has occurred:
+ * - The arrayIndex is bigger then count of allocated vertices;
+ * - The arrayIndex is minus value.
+ * @remarks Can only increase bounding volume size, call AdjustBoundingVolume() to readjust.
+ * @see GetVertex()
+ * @see SetVertex()
+ * @see AdjustBoundingVolume()
+ */
+ result SetVertices(float* pVertiecs, int size);
+
+ /**
* Gets the vertex at the specified @c arrayIndex of the vertices array.
*
* @since 3.0
* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
* @see SetVertex()
+ * @see SetVertices()
*/
Tizen::Graphics::FloatPoint3 GetVertex(int arrayIndex) const;
* @return Vertex count
* @see SetVertex()
* @see GetVertex()
+ * @see SetVertices()
*/
int GetVertexCount(void) const;
* @exception E_OUT_OF_RANGE Invalid position of the texture coordinates array. Either of the following conditions has occurred:
* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
- * @see GetTextureCoord()
+ * @see GetTextureCoordinate()
+ * @see SetTextureCoordinates()
*/
- result SetTextureCoord(int arrayIndex, const Tizen::Graphics::FloatPoint& textureCoord);
+ result SetTextureCoordinate(int arrayIndex, const Tizen::Graphics::FloatPoint& textureCoord);
+
+ /**
+ * Replaces the texture coordinate with the specified @c pTextureCoords.
+ *
+ * @since 3.0
+ *
+ * @return An error code
+ * @param[in] pTextureCoords The texture coordinates array, a each texture coordinates has u,v value
+ * @param[in] size The size of the pTextureCoords array
+ * @exception E_SUCCESS The method is successful
+ * @exception E_OUT_OF_MEMORY Insufficient memory for allocating texture coordinates
+ * @exception E_INVALID_STATE Texture coordinates haven't been allocated
+ * @exception E_OUT_OF_RANGE Invalid position of the texture coordinates array. Either of the following conditions has occurred:
+ * - The arrayIndex is bigger then count of allocated vertices;
+ * - The arrayIndex is minus value.
+ * @see SetTextureCoordinate()
+ * @see GetTextureCoordinate()
+ */
+ result SetTextureCoordinates(float* pTextureCoords, int size);
/**
* Gets the texture coordinate at the specified @c arrayIndex of the texture coordinates array.
* @exception E_INVALID_ARG Invalid position of the texture coordinates array. Either of the following conditions has occurred:
* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
- * @see SetTextureCoord()
+ * @see SetTextureCoordinate()
+ * @see SetTextureCoordinates()
*/
- Tizen::Graphics::FloatPoint GetTextureCoord(int arrayIndex) const;
+ Tizen::Graphics::FloatPoint GetTextureCoordinate(int arrayIndex) const;
/**
* Replaces the normal vector at the specified @c index with the specified value.
* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
* @see GetNormal()
+ * @see SetNormals()
*/
result SetNormal(int arrayIndex, const Tizen::Graphics::FloatPoint3& normal);
/**
+ * Replaces the normal vectorswith the specified @c pNormals.
+ *
+ * @since 3.0
+ *
+ * @return An error code
+ * @param[in] pNormals The normal vector array, a each normal vector has x,y,z value
+ * @param[in] size The size of the pNormals array
+ * @exception E_SUCCESS The method is successful
+ * @exception E_OUT_OF_MEMORY Insufficient memory for allocating normals
+ * @exception E_OUT_OF_RANGE Invalid position of the normals array. Either of the following conditions has occurred:
+ * - The arrayIndex is bigger then count of allocated vertices;
+ * - The arrayIndex is minus value.
+ * @see GetNormal()
+ * @see SetNormal()
+ */
+ result SetNormals(float* pNormals, int size);
+
+ /**
* Gets the normal vector at the specified @c arrayIndex of the normal vectors array.
*
* @since 3.0
* @exception E_INVALID_ARG Invalid position of the normals array. Either of the following conditions has occurred:
* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
- * @see SetTextureCoord()
+ * @see SetNormal()
+ * @see SetNormals()
*/
Tizen::Graphics::FloatPoint3 GetNormal(int arrayIndex) const;
* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
* @see GetColor()
+ * @see SetColors()
*/
result SetColor(int arrayIndex, const Tizen::Graphics::Color& color);
/**
+ * Replaces the colors with the specified @ pColors.
+ *
+ * @since 3.0
+ *
+ * @return An error code
+ * @param[in] pColors The color array, a value range is 0.0 to 1.0 and each color has r,g,b,a value
+ * @param[in] size The size of the @c pColors array
+ * @exception E_SUCCESS The method is successful
+ * @exception E_OUT_OF_MEMORY Insufficient memory for allocating colors
+ * @exception E_OUT_OF_RANGE Invalid position of the colors. Either of the following conditions has occurred:
+ * - The arrayIndex is bigger then count of allocated vertices;
+ * - The arrayIndex is minus value.
+ * @see GetColor()
+ * @see SetColor()
+ */
+ result SetColors(float* pColors, int size);
+
+ /**
* Gets the color at the specified @c arrayIndex of the colors array.
*
* @since 3.0
* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
* @see SetColor()
+ * @see SetColors()
*/
Tizen::Graphics::Color GetColor(int arrayIndex) const;
/**
- * Replaces the vertexIndex at the specified @c index with the specified value.
+ * Replaces the index of the vertex index array at the specified @c arrayIndex with the @c vertexIndex.
*
* @since 3.0
*
* - The arrayIndex is bigger then count of allocated vertices;
* - The arrayIndex is minus value.
* @see GetIndex()
+ * @see SetIndices()
*/
result SetIndex(int arrayIndex, int vertexIndex);
/**
+ * Replaces the vertex array indices with the specified @c pIndices.
+ *
+ * @since 3.0
+ *
+ * @return An error code
+ * @param[in] pIndices The vertex index array
+ * @param[in] size The size of the @c pIndices array
+ * @exception E_SUCCESS The method is successful
+ * @exception E_INVALID_STATE Indices haven't been allocated
+ * @exception E_OUT_OF_RANGE Invalid position of the indices. Either of the following conditions has occurred:
+ * - The arrayIndex is bigger then count of allocated vertices;
+ * - The arrayIndex is minus value.
+ * @see GetIndex()
+ * @see SetIndex()
+ */
+ result SetIndices(int* pIndices, int size);
+
+ /**
* Gets the index at the specified @c arrayIndex of the indices array.
*
* @since 3.0
* - The arrayIndex is bigger then count of allocated indices;
* - The arrayIndex is minus value.
* @see SetIndex()
+ * @see SetIndices()
*/
int GetIndex(int arrayIndex) const;
* @return An index count
* @remarks The specific error code can be accessed using the GetLastResult() method.
* @see SetIndex()
+ * @see SetIndices()
* @see GetIndex()
*/
int GetIndexCount(void) const;
*
* @return Mesh's name
*/
- Tizen::Base::String GetName(void);
Tizen::Base::String GetName(void) const;
//--------------------------------------------------TEMP
CHECK_CONSTRUCTED;
return __pMeshImpl->SetVertex(arrayIndex, point);
}
+result
+Mesh::SetVertices(float* pVertiecs, int size)
+{
+ SetLastResult(E_SUCCESS);
+ CHECK_CONSTRUCTED;
+ return __pMeshImpl->SetVertices(pVertiecs, size);
+}
result
-Mesh::SetTextureCoord(int arrayIndex, const Tizen::Graphics::FloatPoint& textureCoord)
+Mesh::SetTextureCoordinate(int arrayIndex, const Tizen::Graphics::FloatPoint& textureCoord)
{
SetLastResult(E_SUCCESS);
CHECK_CONSTRUCTED;
- return __pMeshImpl->SetTextureCoord(arrayIndex, textureCoord);
+ return __pMeshImpl->SetTextureCoord(arrayIndex, textureCoord);
+}
+
+result
+Mesh::SetTextureCoordinates(float* pTextureCoords, int size)
+{
+ SetLastResult(E_SUCCESS);
+ CHECK_CONSTRUCTED;
+ return __pMeshImpl->SetTextureCoords(pTextureCoords, size);
}
result
}
result
+Mesh::SetNormals(float* pNormals, int size)
+{
+ SetLastResult(E_SUCCESS);
+ CHECK_CONSTRUCTED;
+ return __pMeshImpl->SetNormals(pNormals, size);
+}
+
+result
Mesh::SetColor(int arrayIndex, const Tizen::Graphics::Color& color)
{
SetLastResult(E_SUCCESS);
}
result
+Mesh::SetColors(float* pColors, int size)
+{
+ SetLastResult(E_SUCCESS);
+ CHECK_CONSTRUCTED;
+ return __pMeshImpl->SetColors(pColors, size);
+}
+
+result
Mesh::SetIndex(int arrayIndex, int vertexIndex)
{
SetLastResult(E_SUCCESS);
return __pMeshImpl->SetIndex(arrayIndex, vertexIndex);
}
+result
+Mesh::SetIndices(int* pIndices, int size)
+{
+ SetLastResult(E_SUCCESS);
+ CHECK_CONSTRUCTED;
+ return __pMeshImpl->SetIndices(pIndices, size);
+}
+
Tizen::Graphics::FloatPoint3
Mesh::GetVertex(int arrayIndex) const
{
}
Tizen::Graphics::FloatPoint
-Mesh::GetTextureCoord(int arrayIndex) const
+Mesh::GetTextureCoordinate(int arrayIndex) const
{
SetLastResult(E_SUCCESS);
CHECK_CONSTRUCTED;
}
Tizen::Base::String
-Mesh::GetName(void)
-{
- SetLastResult(E_SUCCESS);
- return Tizen::Base::String(__pMeshImpl->GetName().c_str());
-}
-
-Tizen::Base::String
Mesh::GetName() const
{
return Tizen::Base::String(__pMeshImpl->GetName().c_str());
{
if (__pEventListener)
{
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == false, "Invalid thread");
__pEventListener->OnAnimationTransactionStarted(transactionId);
}
{
if (__pEventListener)
{
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == false, "Invalid thread");
__pEventListener->OnAnimationTransactionStopped(transactionId);
}
{
if (__pEventListener)
{
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == false, "Invalid thread");
__pEventListener->OnAnimationTransactionFinished(transactionId);
}
return;
}
+ _AutoMutex renderLock(*_VisualElementEnvironment::GetTreeLock());
+
// __needClear = true;
__pRenderManager->GetRenderQueue()->SetClear();
- _AutoMutex renderLock(*_VisualElementEnvironment::GetTreeLock());
bool isUpdated = pLayer->UpdateNativeNodes();
__pTempNode->__pVertices[15] = bounds.width;
__pTempNode->__pVertices[16] = bounds.height;
-#if 0
-#ifdef VE_USE_GL_MULTI_CONTEXT
- __pGlContext = (_GlContext*)pLayer->GetContext();
- __pGlContext->MakeCurrent();
-#else
- __pGlContext->MakeCurrent(pLayer->GetNativeSurface());
-#endif
-#else
+
+//#ifdef VE_USE_GL_MULTI_CONTEXT
+// __pGlContext = (_GlContext*)pLayer->GetContext();
+// __pGlContext->MakeCurrent();
+//#else
+// __pGlContext->MakeCurrent(pLayer->GetNativeSurface());
+//#endif
__pRenderManager->GetRenderQueue()->SetLayer(pLayer);
// __pGlLayerForFlush = pLayer;
-#endif
+
int count = pLayer->GetViewCount();
_DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
+
if (pGlLayer && pGlLayer->IsMapped())
{
CompositeLayer(pGlLayer);
return true;
}
-
-#if 0
-
-void*
-_GlCompositor::CompositeProc(void* pData)
-{
- _GlCompositor* pThis = reinterpret_cast< _GlCompositor* >(pData);
-
- _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
-
- pThis->__pAnimationManager = _AnimationManager::GetInstance();
-
- for (;;)
- {
- _GlLayer* pGlLayer = null;
- bool needFullComposite = false;
- {
- _AutoMutex commandLock(pThis->__commandLock);
- pThis->__commandRequest.WaitForSignal(&pThis->__commandLock,pThis->__pAnimationManager->GetTimeout(false));
- pGlLayer = pThis->__commandArg.__pCommandGlLayer;
- pThis->__commandArg.__pCommandGlLayer = null;
- if( pGlLayer == null)
- {
- needFullComposite = true;
- }
- }
-
- RPRINT(">> CommandHandlerComposite() COMMAND_COMPOSITE - start \n");
- needFullComposite = pThis->Animate();
-
-// _AutoMutex treeLock(*_VisualElementEnvironment::GetTreeLock());
-
- if(needFullComposite)
- {
- int count = pDisplayManager->GetLayerCount();
-
- for (int i = 0; i < count; i++)
- {
- _GlLayer* pGlLayer = dynamic_cast<_GlLayer*>(pDisplayManager->GetLayer(i));
- #ifdef LINUX
- if (!pGlLayer || !pGlLayer->IsMapped())
- {
- continue;
- }
- #elif _WIN32
- if (!pGlLayer)
- {
- continue;
- }
- #endif
-
- pThis->CompositeLayer(pGlLayer);
- }
-
- }
- else if (pGlLayer && pGlLayer->IsMapped())
- {
- pThis->CompositeLayer(pGlLayer);
- }
-
-
-
- RPRINT(">> CommandHandlerComposite() COMMAND_COMPOSITE - end \n");
-
-// else
-// {
-
-
-// if (commandArg.__pCommandGlLayer)
-// {
-// pThis->CommandHandlerComposite(commandArg.__pCommandGlLayer);
-// }
-// RPRINT("pThis->Animate() skipped \n");
-// }
- }
- return null;
-}
-
-#endif
void*
_GlCompositor::CompositeProc(void* pData)
{
case COMMAND_COMPOSITE:
RPRINT(">> CommandHandlerComposite() COMMAND_COMPOSITE - start \n");
+ {
if (pThis->Animate())
{
pThis->CommandHandlerComposite(null);
needReply = false;
RPRINT(">> CommandHandlerComposite() COMMAND_COMPOSITE - end \n");
+ }
break;
//continue; // WARNING: reply already done
#include "FUiAnim_GlVisualElementSurfaceImpl.h"
#include "FUiAnim_VisualElementSurfaceManager.h"
+#include "FUiAnim_GlCompositor.h"
#include "FUiAnim_GlRenderManager.h"
#include "FUiAnimMesh.h"
_GlNode::SyncStatus(VisualElementSurface* pSurface, _VisualElementImpl& element)
{
_VisualElementSurfaceImpl* pSurfaceImpl = null;
-// SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == true, "Invalid thread GL reconfigure");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == true, "Invalid thread GL reconfigure");
if (!__syncNeeded)
{
}
if(pRenderTarget)
{
+ pRenderTarget->AddRef();
__pRenderTarget = pRenderTarget;
- __pRenderTarget->AddRef();
}
}
// if (__textureInfo.updated != invalidate)
{
__textureInfo.updated = invalidate;
-
}
+// if(__textureInfo.updated && __textureInfo.type == TEXTURE_NORMAL)
+// {
+// _VisualElementSurfaceManager::GetInstance()->InvalidateTexture(&__textureInfo);
+// __textureInfo.updated = false;
+// }
}
const _GlLayer*
_MeshGeneratorImpl::Square::Square(float sideLength):
pSquareVertex(null),
- pSquareIndex(null),
pSquareNormal(null),
- pSquareTexCoord(null)
+ pSquareTexCoord(null),
+ pSquareIndex(null)
{
pSquareVertex = new (std::nothrow) float[SQUARE_VERTEX_COUNT*3];
SysTryReturnVoidResult(NID_UI_ANIM, pSquareVertex != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
_MeshGeneratorImpl::Triangle::Triangle(float sideLength):
pTriangleVertex(null),
- pTriangleIndex(null),
pTriangleNormal(null),
- pTriangleTexCoord(null)
+ pTriangleTexCoord(null),
+ pTriangleIndex(null)
{
pTriangleVertex = new (std::nothrow) float[TRIANGLE_VERTEX_COUNT*3];
SysTryReturnVoidResult(NID_UI_ANIM, pTriangleVertex != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
_MeshGeneratorImpl::Cube::Cube(float sideLength):
pCubeVertex(null),
- pCubeIndex(null),
pCubeNormal(null),
- pCubeTexCoord(null)
+ pCubeTexCoord(null),
+ pCubeIndex(null)
{
pCubeVertex = new (std::nothrow) float[CUBE_VERTEX_COUNT*3];
SysTryReturnVoidResult(NID_UI_ANIM, pCubeVertex != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
_MeshGeneratorImpl::Pyramid::Pyramid(float height, float downSideLength):
pPyramidVertex(null),
- pPyramidIndex(null),
pPyramidNormal(null),
- pPyramidTexCoord(null)
+ pPyramidTexCoord(null),
+ pPyramidIndex(null)
{
pPyramidVertex = new (std::nothrow) float[PYRAMID_VERTEX_COUNT*3];
SysTryReturnVoidResult(NID_UI_ANIM, pPyramidVertex != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
_MeshGeneratorImpl::TruncatedPyramid::TruncatedPyramid(float upLength, float downLength):
pTruncatedPyramidVertex(null),
- pTruncatedPyramidIndeces(null),
pTruncatedPyramidNormals(null),
- pTruncatedPyramidTexCoords(null)
+ pTruncatedPyramidTexCoords(null),
+ pTruncatedPyramidIndeces(null)
{
pTruncatedPyramidVertex = new (std::nothrow) float[TRUNC_PYRAMID_VERTEX_COUNT*3];
SysTryReturnVoidResult(NID_UI_ANIM, pTruncatedPyramidVertex != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
_MeshGeneratorImpl::Cylinder::Cylinder(float height, float radius):
pCylinderVertex(null),
- pCylinderIndex(null),
pCylinderNormal(null),
- pCylinderTexCoord(null)
+ pCylinderTexCoord(null),
+ pCylinderIndex(null)
{
pCylinderVertex = new (std::nothrow) float[CYLINDER_VERTEX_COUNT*3];
SysTryReturnVoidResult(NID_UI_ANIM, pCylinderVertex != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
_MeshGeneratorImpl::Coniform::Coniform(float height, float radius):
pConiformVertex(null),
- pConiformIndex(null),
pConiformNormal(null),
- pConiformTexCoord(null)
+ pConiformTexCoord(null),
+ pConiformIndex(null)
{
pConiformVertex = new (std::nothrow) float[CONIFORM_VERTEX_COUNT*3];
SysTryReturnVoidResult(NID_UI_ANIM, pConiformVertex != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
_MeshGeneratorImpl::Sphere::Sphere(float radius):
pSphereVertex(null),
+ pSphereNormal(null),
pSphereTexCoord(null)
{
pSphereVertex = new (std::nothrow) float[SPHERE_VERTEX_COUNT*3];
public:
float* pSquareVertex;
float* pSquareNormal;
- Tizen::Ui::Animations::_MeshImpl::IndexType* pSquareIndex;
float* pSquareTexCoord;
+ Tizen::Ui::Animations::_MeshImpl::IndexType* pSquareIndex;
static const int SQUARE_VERTEX_COUNT;
static const int SQUARE_INDEX_COUNT;
static const int SQUARE_TEX_COORD_COUNT;
public:
float* pTriangleVertex;
float* pTriangleNormal;
- Tizen::Ui::Animations::_MeshImpl::IndexType* pTriangleIndex;
float* pTriangleTexCoord;
+ Tizen::Ui::Animations::_MeshImpl::IndexType* pTriangleIndex;
static const int TRIANGLE_VERTEX_COUNT;
static const int TRIANGLE_INDEX_COUNT;
static const int TRIANGLE_TEX_COORD_COUNT;
public:
float* pCubeVertex;
float* pCubeNormal;
- Tizen::Ui::Animations::_MeshImpl::IndexType* pCubeIndex;
float* pCubeTexCoord;
+ Tizen::Ui::Animations::_MeshImpl::IndexType* pCubeIndex;
+
static const int CUBE_VERTEX_COUNT;
static const int CUBE_INDEX_COUNT;
static const int CUBE_TEX_COORD_COUNT;
public:
float* pPyramidVertex;
float* pPyramidNormal;
- Tizen::Ui::Animations::_MeshImpl::IndexType* pPyramidIndex;
float* pPyramidTexCoord;
+ Tizen::Ui::Animations::_MeshImpl::IndexType* pPyramidIndex;
+
static const int PYRAMID_VERTEX_COUNT;
static const int PYRAMID_INDEX_COUNT;
static const int PYRAMID_TEX_COORD_COUNT;
public:
float* pTruncatedPyramidVertex;
float* pTruncatedPyramidNormals;
- Tizen::Ui::Animations::_MeshImpl::IndexType* pTruncatedPyramidIndeces;
float* pTruncatedPyramidTexCoords;
+ Tizen::Ui::Animations::_MeshImpl::IndexType* pTruncatedPyramidIndeces;
+
static const int TRUNC_PYRAMID_VERTEX_COUNT;
static const int TRUNC_PYRAMID_INDEX_COUNT;
static const int TRUNC_PYRAMID_TEX_COORD_COUNT;
public:
float* pCylinderVertex;
float* pCylinderNormal;
- Tizen::Ui::Animations::_MeshImpl::IndexType* pCylinderIndex;
float* pCylinderTexCoord;
+ Tizen::Ui::Animations::_MeshImpl::IndexType* pCylinderIndex;
+
static const int CYLINDER_VERTEX_COUNT;
static const int CYLINDER_INDEX_COUNT;
static const int CYLINDER_TEX_COORD_COUNT;
public:
float* pConiformVertex;
float* pConiformNormal;
- Tizen::Ui::Animations::_MeshImpl::IndexType* pConiformIndex;
float* pConiformTexCoord;
+ Tizen::Ui::Animations::_MeshImpl::IndexType* pConiformIndex;
+
static const int CONIFORM_VERTEX_COUNT;
static const int CONIFORM_INDEX_COUNT;
static const int CONIFORM_TEX_COORD_COUNT;
}
result
+_MeshImpl::SetVertices(float* pVertices, int size)
+{
+ MESH_LOCK();
+
+ int arrayIndex = size/APPROPRIATE_COUNT_VERTICES;
+
+ SysTryReturnResult(NID_UI_ANIM, __pVertices != null, E_INVALID_STATE, " Vertices haven't been allocated yet");
+ SysTryReturnResult(NID_UI_ANIM, ((size % APPROPRIATE_COUNT_VERTICES) == 0), E_INVALID_ARG, " size is not invalid, it should be divided with %d", APPROPRIATE_COUNT_VERTICES);
+ bool arrayIndexState = ((arrayIndex < __countOfAllocatedVertex) && (arrayIndex >= 0));
+ SysTryReturnResult(NID_UI_ANIM, arrayIndexState, E_OUT_OF_RANGE, " arrayIndex is big in order to SetVertex (%d, %d)", arrayIndex, __countOfAllocatedVertex);
+
+ memcpy(__pVertices, pVertices, size);
+
+ if (__countOfVertex <= arrayIndex)
+ {
+ __countOfVertex = arrayIndex + 1;
+ }
+ AdjustBoundingVolume();
+ return E_SUCCESS;
+}
+
+
+result
_MeshImpl::SetVertex(int arrayIndex, const FloatPoint3& vertex)
{
MESH_LOCK();
}
result
+_MeshImpl::SetTextureCoords(float* pTextureCoords, int size)
+{
+ result r;
+ MESH_LOCK();
+
+ if(__pTexCoordinates == null)
+ {
+ r = AllocTextureCoordinates();
+ SysTryReturnResult(NID_UI_ANIM, r != E_OUT_OF_MEMORY, r, " Memory allocation failed due to out of memory");
+ }
+
+ SysTryReturnResult(NID_UI_ANIM, __pTexCoordinates, E_INVALID_STATE, " TexCoordinates haven't been allocated");
+
+ int arrayIndex = size/APPROPRIATE_COUNT_TEXTCOORDINATES;
+
+ bool arrayIndexState = ((arrayIndex < __countOfAllocatedVertex) && (arrayIndex >= 0));
+ SysTryReturnResult(NID_UI_ANIM, ((size % APPROPRIATE_COUNT_TEXTCOORDINATES) == 0), E_INVALID_ARG, "The size is not invalid, it should be divided with %d",APPROPRIATE_COUNT_TEXTCOORDINATES);
+ SysTryReturnResult(NID_UI_ANIM, arrayIndexState, E_OUT_OF_RANGE, " arrayIndex is big in order to set TextureCoord(%d, %d)", arrayIndex, __countOfAllocatedVertex);
+
+ memcpy(__pTexCoordinates, pTextureCoords, size);
+
+ return E_SUCCESS;
+}
+
+result
_MeshImpl::SetTextureCoord(int arrayIndex, const FloatPoint& textureCoord)
{
result r;
}
result
+_MeshImpl::SetNormals(float* pNormals, int size)
+{
+ result r;
+ MESH_LOCK();
+
+ if(__pNormals == null)
+ {
+ r = AllocNormals();
+ SysTryReturnResult(NID_UI_ANIM, r != E_OUT_OF_MEMORY, r, " Memory allocation failed due to out of memory");
+ }
+ int arrayIndex = size/APPROPRIATE_COUNT_NORMALS;
+
+ bool arrayIndexState = ((arrayIndex < __countOfAllocatedVertex) && (arrayIndex >= 0));
+ SysTryReturnResult(NID_UI_ANIM, ((size % APPROPRIATE_COUNT_NORMALS) == 0), E_INVALID_ARG, "The size is not invalid, it should be divided with %d", APPROPRIATE_COUNT_NORMALS);
+ SysTryReturnResult(NID_UI_ANIM, arrayIndexState, E_OUT_OF_RANGE, " arrayIndex is big in order to set Normal(%d, %d)", arrayIndex, __countOfAllocatedVertex);
+
+ memcpy(__pNormals, pNormals, size);
+
+ return E_SUCCESS;
+}
+
+
+result
_MeshImpl::SetNormal(int arrayIndex, const FloatPoint3& normal)
{
result r;
}
result
+_MeshImpl::SetColors(float* pColors, int size)
+{
+ result r;
+ MESH_LOCK();
+
+ if(__pColors == null)
+ {
+ r = AllocColors();
+ SysTryReturnResult(NID_UI_ANIM, r != E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, " Memory allocation failed due to out of memory");
+ }
+ int arrayIndex = size/APPROPRIATE_COUNT_COLORS;
+
+ bool arrayIndexState = ((arrayIndex < __countOfAllocatedVertex) && (arrayIndex >= 0));
+ SysTryReturnResult(NID_UI_ANIM, ((size % APPROPRIATE_COUNT_COLORS) == 0), E_INVALID_ARG, "The size is not invalid, it should be divided with %d", APPROPRIATE_COUNT_COLORS);
+ SysTryReturnResult(NID_UI_ANIM, arrayIndexState, E_OUT_OF_RANGE, " arrayIndex is big in order to set Color(%d, %d)", arrayIndex, __countOfAllocatedVertex);
+
+ memcpy(__pColors, pColors, size);
+
+ return E_SUCCESS;
+}
+
+result
_MeshImpl::SetColor(int arrayIndex, const Color& color)
{
result r;
}
result
+_MeshImpl::SetIndices(int* pIndices, int size)
+{
+ MESH_LOCK();
+
+ SysTryReturnResult(NID_UI_ANIM, __pIndices != null, E_INVALID_STATE, " Indices haven't been allocated yet");
+
+ int arrayIndex = size;
+
+ bool arrayIndexState = ((arrayIndex < __countOfAllocatedIndex) && (arrayIndex >= 0));
+ SysTryReturnResult(NID_UI_ANIM, arrayIndexState, E_OUT_OF_RANGE, " arrayIndex is big in order to set Indices(%d, %d)", arrayIndex, __countOfAllocatedIndex);
+
+ memcpy(__pIndices, pIndices,size);
+
+ if(__countOfIndex <= arrayIndex)
+ {
+ __countOfIndex = arrayIndex + 1;
+ }
+ return E_SUCCESS;
+}
+
+
+result
_MeshImpl::SetIndex(int arrayIndex, int vertexIndex)
{
MESH_LOCK();
tmpIdx[0] = tIndex = atoi(pCur);
texCoord.x = (__uvMode & UV_U_REVERSE)?(1 - MESH_TVERTLIST[tIndex*2]):(MESH_TVERTLIST[tIndex*2]);
texCoord.y = (__uvMode & UV_V_REVERSE)?(1 - MESH_TVERTLIST[tIndex*2 + 1]):(MESH_TVERTLIST[tIndex*2 + 1]);
- pMesh->SetTextureCoord(j++, texCoord);
+ pMesh->SetTextureCoordinate(j++, texCoord);
//tIndex = pMesh->MESH_TFACELIST[j++] = atoi(pCur);
// pMesh->MESH_TFACELIST_REAL[k++] = (__uvMode & UV_U_REVERSE)?(1 - pMesh->MESH_TVERTLIST[tIndex*2]):(pMesh->MESH_TVERTLIST[tIndex*2]);
// pMesh->MESH_TFACELIST_REAL[k++] = (__uvMode & UV_V_REVERSE)?(1 - pMesh->MESH_TVERTLIST[tIndex*2 + 1]):(pMesh->MESH_TVERTLIST[tIndex*2 + 1]);
tmpIdx[1] = tIndex = atoi(pCur);
texCoord.x = (__uvMode & UV_U_REVERSE)?(1 - MESH_TVERTLIST[tIndex*2]):(MESH_TVERTLIST[tIndex*2]);
texCoord.y = (__uvMode & UV_V_REVERSE)?(1 - MESH_TVERTLIST[tIndex*2 + 1]):(MESH_TVERTLIST[tIndex*2 + 1]);
- pMesh->SetTextureCoord(j++, texCoord);
+ pMesh->SetTextureCoordinate(j++, texCoord);
// tIndex = pMesh->MESH_TFACELIST[j++] = atoi(pCur);
// pMesh->MESH_TFACELIST_REAL[k++] = (__uvMode & UV_U_REVERSE)?(1 - pMesh->MESH_TVERTLIST[tIndex*2]):(pMesh->MESH_TVERTLIST[tIndex*2]);
// pMesh->MESH_TFACELIST_REAL[k++] = (__uvMode & UV_V_REVERSE)?(1 - pMesh->MESH_TVERTLIST[tIndex*2 + 1]):(pMesh->MESH_TVERTLIST[tIndex*2 + 1]);
tmpIdx[2] = tIndex = atoi(pCur);
texCoord.x = (__uvMode & UV_U_REVERSE)?(1 - MESH_TVERTLIST[tIndex*2]):(MESH_TVERTLIST[tIndex*2]);
texCoord.y = (__uvMode & UV_V_REVERSE)?(1 - MESH_TVERTLIST[tIndex*2 + 1]):(MESH_TVERTLIST[tIndex*2 + 1]);
- pMesh->SetTextureCoord(j++, texCoord);
+ pMesh->SetTextureCoordinate(j++, texCoord);
// tIndex = pMesh->MESH_TFACELIST[j++] = atoi(pCur);
// pMesh->MESH_TFACELIST_REAL[k++] = (__uvMode & UV_U_REVERSE)?(1 - pMesh->MESH_TVERTLIST[tIndex*2]):(pMesh->MESH_TVERTLIST[tIndex*2]);
// pMesh->MESH_TFACELIST_REAL[k++] = (__uvMode & UV_V_REVERSE)?(1 - pMesh->MESH_TVERTLIST[tIndex*2 + 1]):(pMesh->MESH_TVERTLIST[tIndex*2 + 1]);
{
pMesh.SetVertex(index, i->pos);
pMesh.SetNormal(index, i->norm);
- pMesh.SetTextureCoord(index, i->texC);
+ pMesh.SetTextureCoordinate(index, i->texC);
}
//indices
#ifndef BUILD_UI_CORE
#include "FUiAnim_Looper.h"
#endif
-
+#include "FUiAnim_GlCompositor.h"
#include "FUiAnim_GlRenderManager.h"
#endif
return;
}
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread()== false, "Invalid thread");
switch (__status)
{
return;
}
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == false, "Invalid thread");
switch (__status)
{
return;
}
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == false, "Invalid thread");
pListener->OnVisualElementAnimationFinished(__animation, __name, static_cast< VisualElement& >(pAnimationImpl->GetEventTarget()), completed);
}
return;
}
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == false, "Invalid thread");
pListener->OnObjectAnimationFinished(__animation, __name, pAnimationImpl->GetEventTarget(), completed);
}
if (pTickListener != null)
{
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == false, "Invalid thread");
pTickListener->OnTickOccurred(*pValueAnimation, __name, static_cast< VisualElement& >(pValueAnimationImpl->GetEventTarget()), currentValue);
}
if (pTickListener != null)
{
- SysAssertf(_GlRenderManager::GetInstance()->IsInRenderThread() == false, "Invalid thread");
+ SysAssertf(_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread() == false, "Invalid thread");
pTickListener->OnTickOccurred(*pValueAnimation, __name, pValueAnimationImpl->GetEventTarget(), currentValue);
}
rawEvent.data.transaction.pNode = this;
rawEvent.data.transaction.pChild = pChild;
rawEvent.data.transaction.completed = true;
- rawEvent.data.transaction.mainThread = !_GlRenderManager::GetInstance()->IsInRenderThread();
+ rawEvent.data.transaction.mainThread = !_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread();
_Looper::GetInstance()->PostRawEvent(rawEvent, false);
#endif
if (pAnimationData->GetStatus() == _AnimationData::_STATUS_START)
{
// __pRoot->RemoveAnimationByDuplicatedProperty(*pAnimationData);
- _AnimationManager::GetInstance()->RemoveAnimationByDuplicatedProperty(*pAnimationData, !_GlRenderManager::GetInstance()->IsInRenderThread());
+// _AnimationManager::GetInstance()->RemoveAnimationByDuplicatedProperty(*pAnimationData, !_GlCompositor::GetInstance()->IsInRenderThread());
+ _AnimationManager::GetInstance()->RemoveAnimationByDuplicatedProperty(*pAnimationData, !_GlRenderManager::GetInstance()->GetCompositor()->IsInCompositorThread());
}
// Send start, repeat notification
namespace Tizen { namespace Ui { namespace Animations { namespace _Math {
+const float fEPS = std::numeric_limits<float>::epsilon();
+const float fMAX = std::numeric_limits<float>::max();
+const float fMIN = std::numeric_limits<float>::min();
+
+const float fPI_2 = 6.283185307179586232f;
+const float fPI = fPI_2 * 0.5f;
+//const float PI = 3.141592654f;
+
+const float fDEG2RADCoeff = fPI / 180.0f;
+const float fRAD2DEGCoeff = 180.0f / fPI;
+
float
FDegrees2Radians(float aDEG)
{
namespace Tizen { namespace Ui { namespace Animations { namespace _Math {
-const float fEPS = std::numeric_limits<float>::epsilon();
-const float fMAX = std::numeric_limits<float>::max();
-const float fMIN = std::numeric_limits<float>::min();
+extern const float fEPS;
+extern const float fMAX;
+extern const float fMIN;
-const float fPI_2 = 6.283185307179586232f;
-const float fPI = fPI_2 * 0.5f;
+extern const float fPI_2;
+extern const float fPI;
//const float PI = 3.141592654f;
-const float fDEG2RADCoeff = fPI / 180.0f;
-const float fRAD2DEGCoeff = 180.0f / fPI;
+extern const float fDEG2RADCoeff;
+extern const float fRAD2DEGCoeff;
float FDegrees2Radians(float aDEG);
float FRadians2Degrees(float aRAD);
if (Equal(axe.Length(), 0.f, 1e-5))
{
// ASSERT(!Equal(prev.x, 0.f) || !Equal(prev.y, 0.f) || !Equal(prev.z, 0.f));
- float x;
- float y;
- float z;
+ float x = 0.0f;
+ float y = 0.0f;
+ float z = 0.0f;
if (!Equal(prev.z, 0.f))
{
x = 1.f;
#include "FUiAnim_NativeLayer.h"
#include "FUiAnim_RootVisualElement.h"
#include "FUiAnim_VisualElementImpl.h"
+#include "FUiAnim_VisualElementEnvironment.h"
#include "FUiAnim_AnimationManager.h"
#include "FUiAnim_DisplayManager.h"
#include "FUiAnim_EcoreXLooper.h"
static Mesh* LoadMeshN(const Tizen::Base::String& fileName, bool loadWithoutController);
result SetVertex(int arrayIndex, const Tizen::Graphics::FloatPoint3& point);
+ result SetVertices(float* pVertiecs, int size);
result SetTextureCoord(int arrayIndex, const Tizen::Graphics::FloatPoint& textureCoord);
+ result SetTextureCoords(float* pTextureCoords, int size);
result SetNormal(int arrayIndex, const Tizen::Graphics::FloatPoint3& normal);
+ result SetNormals(float* pNormals, int size);
result SetColor(int arrayIndex, const Tizen::Graphics::Color& color);
+ result SetColors(float* pColors, int size);
result SetIndex(int arrayIndex, int vertexIndex);
+ result SetIndices(int* pIndices, int size);
Tizen::Graphics::FloatPoint3 GetVertex(int arrayIndex) const;
Tizen::Graphics::FloatPoint GetTextureCoord(int arrayIndex) const;