#define DALI_INTERNAL_GEOMETRY_H
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h> // DALI_ASSERT_ALWAYS
#include <dali/public-api/common/intrusive-ptr.h> // Dali::IntrusivePtr
-#include <dali/devel-api/rendering/geometry.h> // Dali::Geometry
+#include <dali/public-api/rendering/geometry.h> // Dali::Geometry
#include <dali/internal/event/common/connectable.h> // Dali::Internal::Connectable
#include <dali/internal/event/common/object-connector.h> // Dali::Internal::ObjectConnector
#include <dali/internal/event/common/object-impl.h> // Dali::Internal::Object
#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
+#include <dali/internal/render/renderers/render-geometry.h>
namespace Dali
{
* Geometry is an object that contains an array of structures of values that
* can be accessed as properties.
*/
-class Geometry : public Object, public Connectable
+class Geometry : public BaseObject
{
public:
/**
* @copydoc Dali::Geometry::SetIndexBuffer()
*/
- void SetIndexBuffer( PropertyBuffer& indexBuffer );
+ void SetIndexBuffer( const unsigned short* indices, size_t count );
/**
- * @copydoc Dali::Geometry::SetGeometryType()
+ * @copydoc Dali::Geometry::SetType()
*/
- void SetGeometryType( Dali::Geometry::GeometryType geometryType );
+ void SetType( Dali::Geometry::Type geometryType );
/**
- * @copydoc Dali::Geometry::GetGeometryType()
+ * @copydoc Dali::Geometry::GetType()
*/
- Dali::Geometry::GeometryType GetGeometryType() const;
-
- /**
- * @copydoc Dali::Geometry::SetRequiresDepthTesting()
- */
- void SetRequiresDepthTesting( bool requiresDepthTest );
-
- /**
- * @copydoc Dali::Geometry::GetRequiresDepthTesting()
- */
- bool GetRequiresDepthTesting() const;
+ Dali::Geometry::Type GetType() const;
/**
* @brief Get the geometry scene object
*
* @return the geometry scene object
*/
- const SceneGraph::Geometry* GetGeometrySceneObject() const;
-
-public: // Default property extensions from Object
-
- /**
- * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
- */
- virtual unsigned int GetDefaultPropertyCount() const;
-
- /**
- * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
- */
- virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
-
- /**
- * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
- */
- virtual const char* GetDefaultPropertyName(Property::Index index) const;
-
- /**
- * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
- */
- virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
-
- /**
- * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
- */
- virtual bool IsDefaultPropertyWritable(Property::Index index) const;
-
- /**
- * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
- */
- virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
-
- /**
- * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
- */
- virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
-
- /**
- * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
- */
- virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
-
- /**
- * @copydoc Dali::Internal::Object::SetDefaultProperty()
- */
- virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
+ const Render::Geometry* GetRenderObject() const;
- /**
- * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
- */
- virtual void SetSceneGraphProperty( Property::Index index, const PropertyMetadata& entry, const Property::Value& value );
-
- /**
- * @copydoc Dali::Internal::Object::GetDefaultProperty()
- */
- virtual Property::Value GetDefaultProperty( Property::Index index ) const;
-
- /**
- * @copydoc Dali::Internal::Object::GetPropertyOwner()
- */
- virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
-
- /**
- * @copydoc Dali::Internal::Object::GetSceneObject()
- */
- virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
-
- /**
- * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
- */
- virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
-
- /**
- * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
- */
- virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
-
- /**
- * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
- */
- virtual int GetPropertyComponentIndex( Property::Index index ) const;
-
-public: // Functions from Connectable
- /**
- * @copydoc Dali::Internal::Connectable::OnStage()
- */
- virtual bool OnStage() const;
-
- /**
- * @copydoc Dali::Internal::Connectable::Connect()
- */
- virtual void Connect();
+private: // implementation
/**
- * @copydoc Dali::Internal::Connectable::Disconnect()
+ * Constructor
*/
- virtual void Disconnect();
-
-private: // implementation
Geometry();
/**
void Initialize();
protected:
+
/**
* A reference counted object may only be deleted by calling Unreference()
*/
Geometry& operator=( const Geometry& );
private: // data
- typedef ObjectConnector<PropertyBuffer> PropertyBufferConnector;
- typedef std::vector< PropertyBufferConnector > PropertyBufferConnectorContainer;
- PropertyBufferConnectorContainer mVertexBufferConnectors; ///< Vector of connectors that hold the property buffers used by this geometry
- PropertyBufferConnector mIndexBufferConnector; ///< Connector that holds the index buffer used by this geometry
- SceneGraph::Geometry* mSceneObject;
- bool mOnStage;
+
+ EventThreadServices& mEventThreadServices; ///<Used to send messages to the render thread via update thread
+ Render::Geometry* mRenderObject;
+
+ std::vector<PropertyBufferPtr> mVertexBuffers; ///< Vector of intrusive pointers to vertex buffers
+ Dali::Geometry::Type mType; ///< Geometry type (cached)
};
} // namespace Internal