[dali_2.2.16] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / algorithm / path-finder-waypoint.h
1 #ifndef DALI_SCENE3D_PATH_FINDER_WAYPOINT_H
2 #define DALI_SCENE3D_PATH_FINDER_WAYPOINT_H
3
4 /*
5  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  *  You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  *  limitations under the License.
18  */
19
20 // INTERNAL INCLUDES
21 #include <dali-scene3d/public-api/api.h>
22
23 // EXTERNAL INCLUDES
24 #include <dali/public-api/math/vector2.h>
25 #include <dali/public-api/math/vector3.h>
26
27 #include <cinttypes>
28 #include <memory>
29
30 namespace Dali::Scene3D::Internal::Algorithm
31 {
32 class WayPointData;
33 }
34
35 namespace Dali::Scene3D::Algorithm
36 {
37 /**
38  * @class WayPoint
39  *
40  * The class represents a public interface to the WayPoint object
41  */
42 class DALI_SCENE3D_API WayPoint
43 {
44 public:
45
46   /**
47    * @brief Constructor
48    */
49   WayPoint();
50
51   /**
52    * @brief Destructor
53    */
54   ~WayPoint();
55
56   /**
57    * @brief Returns index of bounding face within the NavigationMesh
58    *
59    * Function returns index of face withing the NavigationMesh
60    * that the waypoint is associated with.
61    *
62    * @return Valid index of the face
63    */
64   [[nodiscard]] uint32_t GetNavigationMeshFaceIndex() const;
65
66   /**
67    * @brief Returns local 2D position in face space
68    *
69    * The face space uses the face barycentre as an origin. The x-axis is
70    * aligned with x-axis of the NavigationMesh.
71    *
72    * @return Valid 2D location vector
73    */
74   [[nodiscard]] Dali::Vector2 GetFaceLocalSpacePosition() const;
75
76   /**
77    * @brief Returns waypoint 3D position in scene space
78    *
79    * Returns the 3D position of the waypoint in the scene space
80    * of associated NavigationMesh object (using transformation set with
81    * NavigationMesh::SetSceneTransform()).
82    *
83    * @return Valid 3D location vector
84    */
85   [[nodiscard]] Dali::Vector3 GetScenePosition() const;
86
87   /**
88    * @brief Copy constructor
89    *
90    * Only copy semantics is allowed on the WayPoint object
91    */
92   WayPoint(const WayPoint&);
93
94   /**
95    * @brief Copy assignment operator
96    *
97    * Only copy semantics is allowed on the WayPoint object
98    *
99    * @return Copy of source object
100    */
101   WayPoint& operator=(const WayPoint&);
102
103 private:
104
105   std::unique_ptr<Internal::Algorithm::WayPointData> mImpl;
106
107 public:
108
109   DALI_INTERNAL operator Internal::Algorithm::WayPointData&();
110
111 };
112 }
113
114 #endif // DALI_SCENE3D_PATH_FINDER_WAYPOINT_H