X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene3d%2Fpublic-api%2Falgorithm%2Fpath-finder.cpp;h=f48ffb3a776b7bd00cbbb48948f3e927498e417e;hb=daaba487704577efc014bdd0ef268eccd0f872a7;hp=42d227fd44f5231bbad3bc0ce5c4baf8a72da2fb;hpb=5f8ec0a150ade71735820fd0b90bb2323afef2b0;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-scene3d/public-api/algorithm/path-finder.cpp b/dali-scene3d/public-api/algorithm/path-finder.cpp index 42d227f..f48ffb3 100644 --- a/dali-scene3d/public-api/algorithm/path-finder.cpp +++ b/dali-scene3d/public-api/algorithm/path-finder.cpp @@ -19,6 +19,8 @@ // default algorithm #include +#include +#include namespace Dali::Scene3D::Algorithm { @@ -26,9 +28,23 @@ std::unique_ptr PathFinder::New(NavigationMesh& navigationMesh, Path { PathFinderBase* impl = nullptr; - if(algorithm == PathFinderAlgorithm::DJIKSTRA_SHORTEST_PATH) + switch(algorithm) { - impl = new Dali::Scene3D::Internal::Algorithm::PathFinderAlgorithmDjikstra(navigationMesh); + case PathFinderAlgorithm::DJIKSTRA_SHORTEST_PATH: + { + impl = new Dali::Scene3D::Internal::Algorithm::PathFinderAlgorithmDjikstra(navigationMesh); + break; + } + case PathFinderAlgorithm::SPFA: + { + impl = new Dali::Scene3D::Internal::Algorithm::PathFinderAlgorithmSPFA(navigationMesh); + break; + } + case PathFinderAlgorithm::SPFA_DOUBLE_WAY: + { + impl = new Dali::Scene3D::Internal::Algorithm::PathFinderAlgorithmSPFADoubleWay(navigationMesh); + break; + } } if(!impl) @@ -43,19 +59,17 @@ std::unique_ptr PathFinder::New(NavigationMesh& navigationMesh, Path WayPointList PathFinder::FindPath(const Dali::Vector3& positionFrom, const Dali::Vector3& positionTo) { - return mImpl->FindPath( positionFrom, positionTo ); + return mImpl->FindPath(positionFrom, positionTo); } WayPointList PathFinder::FindPath(uint32_t polyIndexFrom, uint32_t polyIndexTo) { - return mImpl->FindPath( polyIndexFrom, polyIndexTo ); + return mImpl->FindPath(polyIndexFrom, polyIndexTo); } - PathFinder::PathFinder(std::unique_ptr&& baseImpl) { mImpl = std::move(baseImpl); } - } // namespace Dali::Scene3D::Algorithm