Unnecessary export removal 54/29354/4
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Fri, 24 Oct 2014 16:44:32 +0000 (17:44 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Fri, 24 Oct 2014 17:13:03 +0000 (10:13 -0700)
[Problem] binary is too big
[Cause] too many things exported
[Solution] dont export unnecessary stuff

Change-Id: Iece7cceb0192f6c872718fd58e64d01b80e163c8

20 files changed:
dali/integration-api/gl-sync-abstraction.h
dali/integration-api/platform-abstraction.h
dali/integration-api/render-controller.h
dali/integration-api/resource-cache.h
dali/integration-api/resource-request.h
dali/internal/common/internal-constants.h
dali/internal/event/animation/constraint-impl.cpp
dali/public-api/animation/interpolator-functions.cpp
dali/public-api/animation/interpolator-functions.h
dali/public-api/common/constants.h
dali/public-api/file.list
dali/public-api/images/distance-field.cpp
dali/public-api/math/degree.cpp
dali/public-api/math/math-utils.cpp [deleted file]
dali/public-api/math/math-utils.h
dali/public-api/math/quaternion.cpp
dali/public-api/math/radian.cpp
dali/public-api/math/vector2.h
dali/public-api/math/vector3.h
dali/public-api/math/vector4.h

index 174c561..a06cf8b 100644 (file)
@@ -30,7 +30,7 @@ namespace Integration
  * A typical use case is to determine when GL draw calls have finished drawing
  * to a framebuffer.
  */
-class DALI_IMPORT_API GlSyncAbstraction
+class GlSyncAbstraction
 {
 protected:
   /**
index bc34896..925546e 100644 (file)
@@ -37,7 +37,7 @@ class DynamicsFactory;
  * A concrete implementation must be created for each platform, and provided when creating the
  * Dali::Integration::Core object.
  */
-class DALI_IMPORT_API PlatformAbstraction
+class PlatformAbstraction
 {
 public:
 
index dc72190..253c67e 100644 (file)
@@ -28,7 +28,7 @@ namespace Integration
  * Abstract interface for an object which controls rendering.
  * This will be informed when Dali has new content to render.
  */
-class DALI_IMPORT_API RenderController
+class RenderController
 {
 protected:
 
index 31ee19a..f094033 100644 (file)
@@ -47,7 +47,7 @@ typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
  * Abstract interface to receive notifications of resource IO operations.
  * This is used when pulling loaded resources from the PlatformAbstraction.
  */
-class DALI_IMPORT_API ResourceCache
+class ResourceCache
 {
 protected:
 
index 25b11f0..ba3c7de 100644 (file)
@@ -51,7 +51,7 @@ enum LoadResourcePriority
 /**
  * Used to request a resource from the native filesystem.
  */
-class DALI_IMPORT_API ResourceRequest
+class ResourceRequest
 {
 public:
 
index 951be29..b0b3a75 100644 (file)
@@ -18,9 +18,6 @@
  *
  */
 
-// INTERNAL INCLUDES
-#include <dali/public-api/common/constants.h>
-
 namespace Dali
 {
 
index 1b7fc86..1f0569e 100644 (file)
 #include <dali/internal/event/animation/property-constraint-ptr.h>
 #include <dali/internal/event/animation/property-constraint.h>
 #include <dali/internal/event/animation/property-input-accessor.h>
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector3.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/math/quaternion.h>
+#include <dali/public-api/math/matrix.h>
+#include <dali/public-api/math/matrix3.h>
+
+namespace
+{
+// Constraint Interpolation function prototypes
+typedef boost::function<bool (const bool& start, const bool& target, float progress)> BoolInterpolator;
+typedef boost::function<float (const float& start, const float& target, float progress)> FloatInterpolator;
+typedef boost::function<int (const int& start, const int& target, float progress)> IntegerInterpolator;
+typedef boost::function<Dali::Vector2 (const Dali::Vector2& current, const Dali::Vector2& target, float progress)> Vector2Interpolator;
+typedef boost::function<Dali::Vector3 (const Dali::Vector3& current, const Dali::Vector3& target, float progress)> Vector3Interpolator;
+typedef boost::function<Dali::Vector4 (const Dali::Vector4& current, const Dali::Vector4& target, float progress)> Vector4Interpolator;
+typedef boost::function<Dali::Quaternion (const Dali::Quaternion& current, const Dali::Quaternion& target, float progress)> QuaternionInterpolator;
+typedef boost::function<Dali::Matrix3 (const Dali::Matrix3& current, const Dali::Matrix3& target, float progress)> Matrix3Interpolator;
+typedef boost::function<Dali::Matrix (const Dali::Matrix& current, const Dali::Matrix& target, float progress)> MatrixInterpolator;
+
+}
 
 namespace Dali
 {
index ab3b6b0..0d95a16 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/public-api/animation/interpolator-functions.h>
-
-namespace Dali
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector3.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/math/quaternion.h>
+#include <dali/public-api/math/matrix.h>
+#include <dali/public-api/math/matrix3.h>
+
+namespace
 {
 
 bool LerpBoolean( const bool& current, const bool& target, float progress )
@@ -45,27 +51,27 @@ int LerpInteger( const int& current, const int& target, float progress )
   return static_cast<int>( current + ( (target - current) * progress ) + 0.5f );
 }
 
-Vector2 LerpVector2( const Vector2& current, const Vector2& target, float progress )
+Dali::Vector2 LerpVector2( const Dali::Vector2& current, const Dali::Vector2& target, float progress )
 {
   return current + ((target - current) * progress);
 }
 
-Vector3 LerpVector3( const Vector3& current, const Vector3& target, float progress )
+Dali::Vector3 LerpVector3( const Dali::Vector3& current, const Dali::Vector3& target, float progress )
 {
   return current + ((target - current) * progress);
 }
 
-Vector4 LerpVector4( const Vector4& current, const Vector4& target, float progress )
+Dali::Vector4 LerpVector4( const Dali::Vector4& current, const Dali::Vector4& target, float progress )
 {
   return current + ((target - current) * progress);
 }
 
-Quaternion SlerpQuaternion( const Quaternion& current, const Quaternion& target, float progress )
+Dali::Quaternion SlerpQuaternion( const Dali::Quaternion& current, const Dali::Quaternion& target, float progress )
 {
-  return Quaternion::Slerp(current, target, progress);
+  return Dali::Quaternion::Slerp(current, target, progress);
 }
 
-Matrix LerpMatrix( const Matrix& current, const Matrix& target, float progress )
+Dali::Matrix LerpMatrix( const Dali::Matrix& current, const Dali::Matrix& target, float progress )
 {
   if (progress > 0.5f)
   {
@@ -75,7 +81,7 @@ Matrix LerpMatrix( const Matrix& current, const Matrix& target, float progress )
   return current;
 }
 
-Matrix3 LerpMatrix3( const Matrix3& current, const Matrix3& target, float progress )
+Dali::Matrix3 LerpMatrix3( const Dali::Matrix3& current, const Dali::Matrix3& target, float progress )
 {
   if (progress > 0.5f)
   {
@@ -85,6 +91,11 @@ Matrix3 LerpMatrix3( const Matrix3& current, const Matrix3& target, float progre
   return current;
 }
 
+} // unnamed namespace
+
+namespace Dali
+{
+
 AnyInterpolator GetDefaultInterpolator( Property::Type type )
 {
   AnyInterpolator function;
index 6bd8dbd..d1e58d7 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/public-api/object/any.h>
-#include <dali/public-api/math/vector2.h>
-#include <dali/public-api/math/vector3.h>
-#include <dali/public-api/math/vector4.h>
-#include <dali/public-api/math/quaternion.h>
-#include <dali/public-api/math/matrix.h>
-#include <dali/public-api/math/matrix3.h>
 #include <dali/public-api/object/property.h>
 
 namespace Dali DALI_IMPORT_API
 {
 
-// Interpolation functions used by Constraints
-
-/**
- * @brief Interpolate linearly between two boolean values.
- * @param [in] current The current value.
- * @param [in] target The target value.
- * @param [in] progress The current progress (between 0 & 1).
- * @return The interpolated value.
- */
-bool LerpBoolean( const bool& current, const bool& target, float progress );
-
-/**
- * @brief Interpolate linearly between two float values.
- *
- * @param [in] current The current value.
- * @param [in] target The target value.
- * @param [in] progress The current progress (between 0 & 1).
- * @return The interpolated value.
- */
-float LerpFloat( const float& current, const float& target, float progress );
-
-/**
- * @brief Interpolate linearly between two integer values.
- *
- * @param [in] current The current value.
- * @param [in] target The target value.
- * @param [in] progress The current progress (between 0 & 1).
- * @return The interpolated value.
- */
-int LerpInteger( const int& current, const int& target, float progress );
-
-/**
- * @brief Interpolate linearly between two Vector2 values.
- *
- * @param [in] current The current value.
- * @param [in] target The target value.
- * @param [in] progress The current progress (between 0 & 1).
- * @return The interpolated value.
- */
-Vector2 LerpVector2( const Vector2& current, const Vector2& target, float progress );
-
-/**
- * @brief Interpolate linearly between two Vector3 values.
- *
- * @param [in] current The current value.
- * @param [in] target The target value.
- * @param [in] progress The current progress (between 0 & 1).
- * @return The interpolated value.
- */
-Vector3 LerpVector3( const Vector3& current, const Vector3& target, float progress );
-
-/**
- * @brief Interpolate linearly between two Vector4 values.
- *
- * @param [in] current The current value.
- * @param [in] target The target value.
- * @param [in] progress The current progress (between 0 & 1).
- * @return The interpolated value.
- */
-Vector4 LerpVector4( const Vector4& current, const Vector4& target, float progress );
-
-/**
- * @brief Spherical linear interpolation between two Quaternion values.
- *
- * @param [in] current The current value.
- * @param [in] target The target value.
- * @param [in] progress The current progress (between 0 & 1).
- * @return The interpolated value.
- */
-Quaternion SlerpQuaternion( const Quaternion& current, const Quaternion& target, float progress );
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<bool (const bool& start, const bool& target, float progress)> BoolInterpolator;
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<float (const float& start, const float& target, float progress)> FloatInterpolator;
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<int (const int& start, const int& target, float progress)> IntegerInterpolator;
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<Vector2 (const Vector2& current, const Vector2& target, float progress)> Vector2Interpolator;
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<Vector3 (const Vector3& current, const Vector3& target, float progress)> Vector3Interpolator;
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<Vector4 (const Vector4& current, const Vector4& target, float progress)> Vector4Interpolator;
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<Quaternion (const Quaternion& current, const Quaternion& target, float progress)> QuaternionInterpolator;
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<Matrix3 (const Matrix3& current, const Matrix3& target, float progress)> Matrix3Interpolator;
-
-/**
- * @brief A function which interpolates between a start and target value.
- *
- * @param[in] start The start value.
- * @param[in] target The target value.
- * @param[in] progress The current progress (between 0 and 1).
- * @return The interpolated value.
- */
-typedef boost::function<Matrix (const Matrix& current, const Matrix& target, float progress)> MatrixInterpolator;
-
 /**
  * @brief Any interpolator function.
  */
index 053642a..ec7d8ee 100644 (file)
@@ -22,7 +22,6 @@
 #include <math.h> // M_PI
 
 // INTERNAL INCLUDES
-#include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector3.h>
 #include <dali/public-api/math/vector4.h>
 #include <dali/public-api/math/radian.h>
index aecf4b7..f7f4053 100644 (file)
@@ -70,7 +70,6 @@ public_api_src_files = \
   $(public_api_src_dir)/math/angle-axis.cpp \
   $(public_api_src_dir)/math/compile-time-math.cpp \
   $(public_api_src_dir)/math/degree.cpp \
-  $(public_api_src_dir)/math/math-utils.cpp \
   $(public_api_src_dir)/math/matrix.cpp \
   $(public_api_src_dir)/math/matrix3.cpp \
   $(public_api_src_dir)/math/quaternion.cpp \
index 7d1133e..fc89a4a 100644 (file)
@@ -28,6 +28,7 @@
 #include <dali/public-api/common/constants.h>
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/math-utils.h>
 
 namespace Dali
 {
index d059a79..1e7d5ae 100644 (file)
@@ -19,7 +19,7 @@
 #include <dali/public-api/math/degree.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/constants.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/math/radian.h>
 
 namespace
diff --git a/dali/public-api/math/math-utils.cpp b/dali/public-api/math/math-utils.cpp
deleted file mode 100644 (file)
index 02dd6db..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/public-api/math/math-utils.h>
-
-// EXTERNAL INCLUDES
-#include <math.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/common/constants.h>
-
-
-namespace Dali
-{
-
-unsigned int NextPowerOfTwo(unsigned int i)
-{
-  DALI_ASSERT_DEBUG(i <= 1U << (sizeof(unsigned) * 8 - 1) && "Return type cannot represent the next power of two greater than the argument.");
-  if(i==0)
-  {
-    return 1;
-  }
-
-  i--;
-  i |= i >> 1;
-  i |= i >> 2;
-  i |= i >> 4;
-  i |= i >> 8;
-  i |= i >> 16;
-  i++;
-  return i;
-}
-
-bool IsPowerOfTwo(unsigned int i)
-{
-  return (i != 0) && ((i & (i - 1)) == 0);
-}
-
-float GetRangedEpsilon(float a, float b)
-{
-  float abs_f = std::max(fabsf(a), fabsf(b));
-  int abs_i = (int) abs_f;
-
-  float epsilon = Math::MACHINE_EPSILON_10000;
-  if (abs_f < 0.1f)
-  {
-    return Math::MACHINE_EPSILON_0;
-  }
-  else if (abs_i < 2)
-  {
-    return Math::MACHINE_EPSILON_1;
-  }
-  else if (abs_i < 20)
-  {
-    return Math::MACHINE_EPSILON_10;
-  }
-  else if (abs_i < 200)
-  {
-    return Math::MACHINE_EPSILON_100;
-  }
-  else if (abs_i < 2000)
-  {
-    return Math::MACHINE_EPSILON_1000;
-  }
-  return epsilon;
-}
-
-// TODO: Change this to use #pragma GCC diagnostic push / pop when the compiler is updated to 4.6.0+
-#pragma GCC diagnostic ignored "-Wfloat-equal"
-bool EqualsZero( float value )
-{
-  return value == 0.0f;
-}
-#pragma GCC diagnostic error "-Wfloat-equal"
-
-bool Equals( float a, float b )
-{
-  return ( fabsf( a - b ) <= GetRangedEpsilon( a, b ) );
-}
-
-bool Equals( float a, float b, float epsilon )
-{
-  return ( fabsf( a - b ) <= epsilon );
-}
-
-float Round(float value, int pos)
-{
-  float temp;
-  temp = value * powf( 10, pos );
-  temp = floorf( temp + 0.5 );
-  temp *= powf( 10, -pos );
-  return temp;
-}
-
-float WrapInDomain(float x, float start, float end)
-{
-  float domain = end - start;
-  x -= start;
-
-  if(fabsf(domain) > Math::MACHINE_EPSILON_1)
-  {
-    return start + (x - floorf(x / domain) * domain);
-  }
-
-  return start;
-}
-
-float ShortestDistanceInDomain(float a, float b, float start, float end)
-{
-  //  (a-start + end-b)
-  float size = end-start;
-  float vect = b-a;
-
-  if(vect > 0)
-  {
-    // +ve vector, let's try perspective 1 domain to the right,
-    // and see if closer.
-    float aRight = a+size;
-    if( aRight-b < vect )
-    {
-      return b-aRight;
-    }
-  }
-  else
-  {
-    // -ve vector, let's try perspective 1 domain to the left,
-    // and see if closer.
-    float aLeft = a-size;
-    if( aLeft-b > vect )
-    {
-      return b-aLeft;
-    }
-  }
-
-  return vect;
-}
-
-} // namespace Dali
index 769ebe6..2c74ea3 100644 (file)
@@ -23,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/common/constants.h>
 
 namespace Dali
 {
@@ -35,7 +36,23 @@ namespace Dali
  * @param[in] i input number
  * @return    next power of two or i itself in case it's a power of two
  */
-DALI_IMPORT_API unsigned int NextPowerOfTwo( unsigned int i );
+inline unsigned int NextPowerOfTwo( unsigned int i )
+{
+  DALI_ASSERT_DEBUG(i <= 1U << (sizeof(unsigned) * 8 - 1) && "Return type cannot represent the next power of two greater than the argument.");
+  if(i==0)
+  {
+    return 1;
+  }
+
+  i--;
+  i |= i >> 1;
+  i |= i >> 2;
+  i |= i >> 4;
+  i |= i >> 8;
+  i |= i >> 16;
+  i++;
+  return i;
+}
 
 /**
  * @brief Whether a number is power of two.
@@ -43,7 +60,10 @@ DALI_IMPORT_API unsigned int NextPowerOfTwo( unsigned int i );
  * @param[in] i input number
  * @return    true if i is power of two
  */
-DALI_IMPORT_API bool IsPowerOfTwo( unsigned int i );
+inline bool IsPowerOfTwo( unsigned int i )
+{
+  return (i != 0) && ((i & (i - 1)) == 0);
+}
 
 /**
  * @brief Clamp a value.
@@ -54,7 +74,7 @@ DALI_IMPORT_API bool IsPowerOfTwo( unsigned int i );
  * @return T the clamped value
  */
 template< typename T >
-const T& Clamp( const T& value, const T& min, const T& max )
+inline const T& Clamp( const T& value, const T& min, const T& max )
 {
   return std::max( std::min( value, max ), min );
 }
@@ -67,7 +87,7 @@ const T& Clamp( const T& value, const T& min, const T& max )
  * @param[in] max The maximum allowed value.
  */
 template< typename T >
-void ClampInPlace( T& value, const T& min, const T& max )
+inline void ClampInPlace( T& value, const T& min, const T& max )
 {
   value =  std::max( std::min( value, max ), min );
 }
@@ -95,7 +115,34 @@ inline const T Lerp( const float offset, const T& low, const T& high )
  * @param[in] b the second value in the range.
  * @return a suitable epsilon
  */
-DALI_IMPORT_API float GetRangedEpsilon(float a, float b);
+inline float GetRangedEpsilon(float a, float b)
+{
+  float abs_f = std::max(fabsf(a), fabsf(b));
+  int abs_i = (int) abs_f;
+
+  float epsilon = Math::MACHINE_EPSILON_10000;
+  if (abs_f < 0.1f)
+  {
+    return Math::MACHINE_EPSILON_0;
+  }
+  else if (abs_i < 2)
+  {
+    return Math::MACHINE_EPSILON_1;
+  }
+  else if (abs_i < 20)
+  {
+    return Math::MACHINE_EPSILON_10;
+  }
+  else if (abs_i < 200)
+  {
+    return Math::MACHINE_EPSILON_100;
+  }
+  else if (abs_i < 2000)
+  {
+    return Math::MACHINE_EPSILON_1000;
+  }
+  return epsilon;
+}
 
 /**
  * @brief Helper function to compare equality of a floating point value with zero.
@@ -103,7 +150,13 @@ DALI_IMPORT_API float GetRangedEpsilon(float a, float b);
  * @param[in] value the value to compare
  * @return true if the value is equal to zero
  */
-DALI_IMPORT_API bool EqualsZero( float value );
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+inline bool EqualsZero( float value )
+{
+  return value == 0.0f;
+}
+#pragma GCC diagnostic pop
 
 /**
  * @brief Helper function to compare equality of two floating point values.
@@ -112,7 +165,10 @@ DALI_IMPORT_API bool EqualsZero( float value );
  * @param[in] b the second value to compare
  * @return true if the values are equal within a minimal epsilon for their values
  */
-DALI_IMPORT_API bool Equals( float a, float b );
+inline bool Equals( float a, float b )
+{
+  return ( fabsf( a - b ) <= GetRangedEpsilon( a, b ) );
+}
 
 /**
  * @brief Helper function to compare equality of two floating point values.
@@ -122,7 +178,10 @@ DALI_IMPORT_API bool Equals( float a, float b );
  * @param[in] epsilon the minimum epsilon value that will be used to consider the values different
  * @return true if the difference between the values is less than the epsilon
  */
-DALI_IMPORT_API bool Equals( float a, float b, float epsilon );
+inline bool Equals( float a, float b, float epsilon )
+{
+  return ( fabsf( a - b ) <= epsilon );
+}
 
 /**
  * @brief Get an float that is rounded at specified place of decimals.
@@ -131,7 +190,14 @@ DALI_IMPORT_API bool Equals( float a, float b, float epsilon );
  * @param[in] pos decimal place
  * @return a rounded float
  */
-DALI_IMPORT_API float Round( float value, int pos );
+inline float Round(float value, int pos)
+{
+  float temp;
+  temp = value * powf( 10, pos );
+  temp = floorf( temp + 0.5 );
+  temp *= powf( 10, -pos );
+  return temp;
+}
 
 /**
  * @brief Wrap x in domain (start) to (end).
@@ -165,7 +231,19 @@ DALI_IMPORT_API float Round( float value, int pos );
  *
  * @return the wrapped value over the domain (start) (end)
  */
-DALI_IMPORT_API float WrapInDomain(float x, float start, float end);
+inline float WrapInDomain(float x, float start, float end)
+{
+  float domain = end - start;
+  x -= start;
+
+  if(fabsf(domain) > Math::MACHINE_EPSILON_1)
+  {
+    return start + (x - floorf(x / domain) * domain);
+  }
+
+  return start;
+}
+
 
 /**
  * @brief Find the shortest distance (magnitude) and direction (sign)
@@ -195,7 +273,35 @@ DALI_IMPORT_API float WrapInDomain(float x, float start, float end);
  * @param end the end of the domain
  * @return the shortest direction (the sign) and distance (the magnitude)
  */
-DALI_IMPORT_API float ShortestDistanceInDomain(float a, float b, float start, float end);
+inline float ShortestDistanceInDomain( float a, float b, float start, float end )
+{
+  //  (a-start + end-b)
+  float size = end-start;
+  float vect = b-a;
+
+  if(vect > 0)
+  {
+    // +ve vector, let's try perspective 1 domain to the right,
+    // and see if closer.
+    float aRight = a+size;
+    if( aRight-b < vect )
+    {
+      return b-aRight;
+    }
+  }
+  else
+  {
+    // -ve vector, let's try perspective 1 domain to the left,
+    // and see if closer.
+    float aLeft = a-size;
+    if( aLeft-b > vect )
+    {
+      return b-aLeft;
+    }
+  }
+
+  return vect;
+}
 
 } // namespace Dali
 
index 97d34a9..fb5b9ad 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/math/degree.h>
 #include <dali/public-api/math/matrix.h>
 #include <dali/public-api/math/radian.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/internal/render/common/performance-monitor.h>
 
 namespace Dali
index e712557..5206ab7 100644 (file)
@@ -19,7 +19,7 @@
 #include <dali/public-api/math/radian.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/constants.h>
+#include <dali/public-api/math/math-utils.h>
 #include <dali/public-api/math/degree.h>
 
 namespace
index a5a8071..eb63cb0 100644 (file)
@@ -23,7 +23,7 @@
 #include <iostream>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/math/math-utils.h>
+#include <dali/public-api/common/dali-common.h>
 
 namespace Dali DALI_IMPORT_API
 {
index 079d25a..75c716f 100644 (file)
@@ -23,8 +23,7 @@
 #include <iostream>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/math/math-utils.h>
-#include <dali/public-api/common/constants.h>
+#include <dali/public-api/common/dali-common.h>
 
 namespace Dali DALI_IMPORT_API
 {
index 8461d9b..0665287 100644 (file)
@@ -24,7 +24,7 @@
 #include <math.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/math/math-utils.h>
+#include <dali/public-api/common/dali-common.h>
 
 namespace Dali DALI_IMPORT_API
 {