-
Notifications
You must be signed in to change notification settings - Fork 292
[Core] Adding SearchInBoundingBox into GeometricalObjectsBins
#12601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a2b1187
0347848
642948d
100ad59
894b744
83f4960
b1f2b9a
8c186ef
bd1cdeb
24c9940
a2c6300
4163e6b
9d1e6ac
e7b2efe
3166d2c
d07203c
2b541d4
0c9b167
addf69a
0dd1f21
a578b6a
83faa98
5f2877c
c77eafa
21a07e5
7272735
fc292b4
5510fb2
414d98a
a43a5be
6ce983a
e400cb5
1b0e72d
0752d27
2005b05
037ccb8
8306f3d
20106e5
ef47ebe
3f03d22
cebb6d6
2deef86
a605c08
52cec88
120f5a5
e1433ee
5b8409d
10e86dc
cce7436
2519ec1
9c2fdb9
df97ff4
8a8eb7e
8828365
77e8bb4
f19a61f
30362fb
53c010d
68c326d
32b1301
0373197
bdeed6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -222,6 +222,47 @@ class KRATOS_API(KRATOS_CORE) GeometricalObjectsBins | |
| return results; | ||
| } | ||
|
|
||
| /** | ||
| * @brief This method takes a point and finds all of the objects in the given bounding box to it. | ||
| * @details The result contains the object and also its distance to the point. | ||
| * @param rPoint The point to be checked | ||
| * @param rMinPoint The minimum point of the bounding box | ||
| * @param rMaxPoint The maximum point of the bounding box | ||
| * @param rResults The results of the search | ||
| */ | ||
| void SearchInBoundingBox( | ||
| const PointType& rPoint, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why this point? what to be checked? |
||
| const array_1d<double, 3>& rMinPoint, | ||
| const array_1d<double, 3>& rMaxPoint, | ||
| std::vector<ResultType>& rResults | ||
| ); | ||
|
|
||
| /** | ||
| * @brief This method takes a point and finds all of the objects in the given bounding box to it (iterative version). | ||
| * @details The result contains the object and also its distance to the point. | ||
| * @param itPointBegin The first point iterator | ||
| * @param itPointEnd The last point iterator | ||
| * @param rMinPoint The minimum point of the bounding box | ||
| * @param rMaxPoint The maximum point of the bounding box | ||
| * @param rResults The results of the search | ||
| * @tparam TPointIteratorType The type of the point iterator | ||
| */ | ||
| template<typename TPointIteratorType> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand what this method does? The result should not depend on the point!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand how do you search without a point to be searched |
||
| void SearchInBoundingBox( | ||
| TPointIteratorType itPointBegin, | ||
| TPointIteratorType itPointEnd, | ||
| const array_1d<double, 3>& rMinPoint, | ||
| const array_1d<double, 3>& rMaxPoint, | ||
| std::vector<std::vector<ResultType>>& rResults | ||
| ) | ||
| { | ||
| const std::size_t number_of_points = std::distance(itPointBegin, itPointEnd); | ||
| rResults.resize(number_of_points); | ||
| for (auto it_point = itPointBegin ; it_point != itPointEnd ; it_point++){ | ||
| SearchInBoundingBox(*it_point, rMinPoint, rMaxPoint, rResults[it_point - itPointBegin]); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * @brief This method takes a point and finds the nearest object to it. | ||
| * @details If there are more than one object in the same minimum distance only one is returned | ||
|
|
@@ -386,6 +427,24 @@ class KRATOS_API(KRATOS_CORE) GeometricalObjectsBins | |
| ///@name Protected Operations | ||
| ///@{ | ||
|
|
||
| /** | ||
| * @brief Checks if a 3D bounding box is fully inside a given bounding box from a point. | ||
| * @details This function determines if a 3D bounding box, defined by the indices of the cell studied, is fully within a specified bounding box from a given point. It calculates the farthest point in the bounding box from the reference point and checks if the distance from this point to the reference point is within the specified bounding box. | ||
| * @param I The index in x direction | ||
| * @param J The index in y direction | ||
| * @param K The index in z direction | ||
| * @param rPoint The reference point from which the distance is measured. | ||
| * @param rBoundingBox The bounding box within which the bounding box should be. | ||
| * @return True if the bounding box is fully inside the bounding box, false otherwise. | ||
| */ | ||
| bool IsCellInsideBoundingBox( | ||
| const std::size_t I, | ||
| const std::size_t J, | ||
| const std::size_t K, | ||
| const Point& rPoint, | ||
|
loumalouomega marked this conversation as resolved.
|
||
| const BoundingBox<PointType>& rBoundingBox | ||
| ); | ||
|
|
||
| /** | ||
| * @brief This method checks if a point is inside any bounding box of the global bounding boxes | ||
| * @param rCoords The coordinates of the point | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need the point