use modern construct 'override' in the derive class.
[platform/core/uifw/dali-core.git] / dali / internal / event / animation / path-impl.h
index 26a1a01..2371a3b 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_PATH_H__
-#define __DALI_INTERNAL_PATH_H__
+#ifndef DALI_INTERNAL_PATH_H
+#define DALI_INTERNAL_PATH_H
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -30,7 +30,7 @@ namespace Dali
 
 namespace Internal
 {
-typedef IntrusivePtr<Path> PathPtr;
+using PathPtr = IntrusivePtr<Path>;
 
 /**
  * A 3D path
@@ -54,88 +54,19 @@ protected:
   /**
    * virtual destructor
    */
-  virtual ~Path();
+  ~Path() override;
 
 private:
-  /**
-   * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded()
-   */
-  virtual void SceneObjectAdded(Object& object){}
-
-  /**
-   * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded()
-   */
-  virtual void SceneObjectRemoved(Object& object){}
-
-  /**
-   * @copydoc Dali::Internal::Object::Observer::ObjectDestroyed()
-   */
-  virtual void ObjectDestroyed(Object& 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);
+  void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue) override;
 
    /**
    * @copydoc Dali::Internal::Object::GetDefaultProperty()
    */
-  virtual Property::Value GetDefaultProperty( Property::Index index ) const;
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObject()
-   */
-  virtual const SceneGraph::PropertyOwner* GetSceneObject() const{ return NULL; }
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
-   */
-  virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const{ return NULL; }
-
-  /**
-   * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
-   */
-  virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const{ return NULL; }
+  Property::Value GetDefaultProperty( Property::Index index ) const override;
 
 public:
 
@@ -165,35 +96,47 @@ public:
   void Sample( float t, Vector3& position, Vector3& tangent ) const;
 
   /**
+   * @brief Sample path at a given progress. Calculates position and tangent at that point of the curve
+   *
+   * @param[in]  progress  A floating point value between 0.0 and 1.0.
+   * @param[out] position The interpolated position at that progress.
+   * @param[out] tangent The interpolated tangent at that progress.
+   * @return true if Sample could be calculated
+   */
+  bool SampleAt( float t, Vector3& position, Vector3& tangent ) const;
+
+  /**
    * Sample position at point t.
    *
    * @param[in] progress  A floating point value between 0.0 and 1.0.
    * @param[out] position The interpolated position at that progress.
+   * @return true if sample could be calculated
    */
-  Vector3 SamplePosition( float t ) const;
+  bool SamplePosition( float t, Vector3& position ) const;
 
   /**
    * @brief Sample tangent at point t.
    *
    * @param[in] progress  A floating point value between 0.0 and 1.0.
    * @param[out] tangent The interpolated tangent at that progress.
+   * @return true if sample could be calculated
    */
-  Vector3 SampleTangent( float t ) const;
+  bool SampleTangent( float t, Vector3& tangent ) const;
 
   /**
    * @copydoc Dali::Path::GetPoint
    */
-  Vector3& GetPoint( size_t index );
+  Vector3& GetPoint( uint32_t index );
 
   /**
    * @copydoc Dali::Path::GetControlPoint
    */
-  Vector3& GetControlPoint( size_t index );
+  Vector3& GetControlPoint( uint32_t index );
 
   /**
    * @copydoc Dali::Path::GetPointCount
    */
-  size_t GetPointCount() const;
+  uint32_t GetPointCount() const;
 
   /**
    * Clears the points of the path
@@ -254,12 +197,12 @@ private:
    * @param[out] tLocal Local progress in the segment
    *
    */
-  void FindSegmentAndProgress( float t, unsigned int& segment, float& tLocal ) const;
+  void FindSegmentAndProgress( float t, uint32_t& segment, float& tLocal ) const;
 
   /**
    * Helper function to calculate to number of segments in the path
    */
-  unsigned int GetNumberOfSegments() const;
+  uint32_t GetNumberOfSegments() const;
 
   Dali::Vector<Vector3> mPoint;            ///< Interpolation points
   Dali::Vector<Vector3> mControlPoint;     ///< Control points
@@ -285,4 +228,4 @@ inline const Internal::Path& GetImplementation(const Dali::Path& path)
 
 } // Dali
 
-#endif //__DALI_INTERNAL_KEY_FRAMES_H__
+#endif // DALI_INTERNAL_PATH_H