use modern construct 'override' in the derive class.
[platform/core/uifw/dali-core.git] / dali / internal / event / rendering / geometry-impl.h
index c8636fa..c75909f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_GEOMETRY_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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/event/rendering/vertex-buffer-impl.h> // Dali::Internal::VertexBuffer
+#include <dali/internal/render/renderers/render-geometry.h>
 
 namespace Dali
 {
@@ -40,13 +41,13 @@ class Geometry;
 }
 
 class Geometry;
-typedef IntrusivePtr<Geometry> GeometryPtr;
+using GeometryPtr = IntrusivePtr<Geometry>;
 
 /**
  * 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:
 
@@ -59,149 +60,45 @@ public:
   /**
    * @copydoc Dali::Geometry::AddVertexBuffer()
    */
-  std::size_t AddVertexBuffer( PropertyBuffer& vertexBuffer );
+  uint32_t AddVertexBuffer( VertexBuffer& vertexBuffer );
 
   /**
    * @copydoc Dali::Geometry::GetNumberOfVertexBuffers()
    */
-  std::size_t GetNumberOfVertexBuffers() const;
+  uint32_t GetNumberOfVertexBuffers() const;
 
   /**
    * @copydoc Dali::Geometry::RemoveVertexBuffer()
    */
-  void RemoveVertexBuffer( std::size_t index );
+  void RemoveVertexBuffer( uint32_t index );
 
   /**
    * @copydoc Dali::Geometry::SetIndexBuffer()
    */
-  void SetIndexBuffer( PropertyBuffer& indexBuffer );
+  void SetIndexBuffer( const uint16_t* indices, uint32_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
+  const Render::Geometry* GetRenderObject() const;
 
-  /**
-   * @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);
-
-  /**
-   * @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();
 
   /**
@@ -210,10 +107,11 @@ private: // implementation
   void Initialize();
 
 protected:
+
   /**
    * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual ~Geometry();
+  ~Geometry() override;
 
 private: // unimplemented methods
   Geometry( const Geometry& );
@@ -221,10 +119,11 @@ private: // unimplemented methods
 
 private: // data
 
-  std::vector<PropertyBufferPtr> mVertexBuffers; ///< Vector of intrusive pointers to vertex buffers
-  PropertyBufferPtr mIndexBuffer;                ///< Intrusive pointer to index buffer
-  SceneGraph::Geometry* mSceneObject;
-  bool mOnStage;
+  EventThreadServices& mEventThreadServices;    ///<Used to send messages to the render thread via update thread
+  Render::Geometry* mRenderObject;
+
+  std::vector<VertexBufferPtr> mVertexBuffers; ///< Vector of intrusive pointers to vertex buffers
+  Dali::Geometry::Type mType;      ///< Geometry type (cached)
 };
 
 } // namespace Internal