[dali_2.3.21] 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 // EXTERNAL INCLUDES
21 #include <dali/public-api/math/vector2.h>
22 #include <dali/public-api/math/vector3.h>
23
24 #include <cinttypes>
25 #include <memory>
26
27 // INTERNAL INCLUDES
28 #include <dali-scene3d/public-api/api.h>
29
30 namespace Dali::Scene3D::Internal::Algorithm
31 {
32 struct 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  * @SINCE_2_2.12
42  */
43 class DALI_SCENE3D_API WayPoint
44 {
45 public:
46   /**
47    * @brief Constructor
48    * @SINCE_2_2.12
49    */
50   WayPoint();
51
52   /**
53    * @brief Destructor
54    * @SINCE_2_2.12
55    */
56   ~WayPoint();
57
58   /**
59    * @brief Returns index of bounding face within the NavigationMesh
60    *
61    * Function returns index of face withing the NavigationMesh
62    * that the waypoint is associated with.
63    *
64    * @SINCE_2_2.12
65    * @return Valid index of the face
66    */
67   [[nodiscard]] uint32_t GetNavigationMeshFaceIndex() const;
68
69   /**
70    * @brief Returns local 2D position in face space
71    *
72    * The face space uses the face barycentre as an origin. The x-axis is
73    * aligned with x-axis of the NavigationMesh.
74    *
75    * @SINCE_2_2.12
76    * @return Valid 2D location vector
77    */
78   [[nodiscard]] Dali::Vector2 GetFaceLocalSpacePosition() const;
79
80   /**
81    * @brief Returns waypoint 3D position in scene space
82    *
83    * Returns the 3D position of the waypoint in the scene space
84    * of associated NavigationMesh object (using transformation set with
85    * NavigationMesh::SetSceneTransform()).
86    *
87    * @SINCE_2_2.12
88    * @return Valid 3D location vector
89    */
90   [[nodiscard]] Dali::Vector3 GetScenePosition() const;
91
92   /**
93    * @brief Copy constructor
94    *
95    * Only copy semantics is allowed on the WayPoint object
96    * @SINCE_2_2.12
97    */
98   WayPoint(const WayPoint&);
99
100   /**
101    * @brief Copy assignment operator
102    *
103    * Only copy semantics is allowed on the WayPoint object
104    *
105    * @SINCE_2_2.12
106    * @return Copy of source object
107    */
108   WayPoint& operator=(const WayPoint&);
109
110 private:
111   std::unique_ptr<Internal::Algorithm::WayPointData> mImpl;
112
113 public:
114   DALI_INTERNAL operator Internal::Algorithm::WayPointData&();
115 };
116 } // namespace Dali::Scene3D::Algorithm
117
118 #endif // DALI_SCENE3D_PATH_FINDER_WAYPOINT_H