Documentation 6b54b78464
Loading...
Searching...
No Matches
CBBoxTargetClass.hpp
Go to the documentation of this file.
1/*!
2 * \file CBBoxTargetClass.hpp
3 * \brief Class for storing the information of a possible bounding box candidate
4 during a minimum distance search.
5 * \author E. van der Weide
6 * \version 8.5.0 "Harrier"
7 *
8 * SU2 Project Website: https://su2code.github.io
9 *
10 * The SU2 Project is maintained by the SU2 Foundation
11 * (http://su2foundation.org)
12 *
13 * Copyright 2012-2026, SU2 Contributors (cf. AUTHORS.md)
14 *
15 * SU2 is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Lesser General Public
17 * License as published by the Free Software Foundation; either
18 * version 2.1 of the License, or (at your option) any later version.
19 *
20 * SU2 is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with SU2. If not, see <http://www.gnu.org/licenses/>.
27 */
28
29#pragma once
30#include "../basic_types/datatype_structure.hpp"
31
32/*!
33 * \class CBBoxTargetClass
34 * \ingroup ADT
35 * \brief Class for storing the information of a possible bounding box candidate
36 during a minimum distance search.
37 * \author E. van der Weide
38 * \version 8.5.0 "Harrier"
39 */
41 unsigned long boundingBoxID; /*!< \brief Corresponding bounding box ID. */
42 su2double possibleMinDist2; /*!< \brief Possible minimimum distance squared to the
43 given coordinate. */
44 su2double guaranteedMinDist2; /*!< \brief Guaranteed minimum distance squared to the
45 given coordinate. */
46
47 /*!
48 * \brief Constructor of the class. Nothing to be done.
49 */
50 CBBoxTargetClass() = default;
51
52 /*!
53 * \brief Constructor of the class, which initializes the member variables.
54 * \param[in] val_BBoxID - ID of the bounding box to be stored.
55 * \param[in] val_posDist2 - Possible minimum distance squared to the target
56 for this bounding box.
57 * \param[in] val_guarDist2 - Guaranteed minimum distance squared to the target
58 for this bounding box.
59 */
60 inline CBBoxTargetClass(const unsigned long val_BBoxID, const su2double val_posDist2, const su2double val_guarDist2)
61 : boundingBoxID(val_BBoxID), possibleMinDist2(val_posDist2), guaranteedMinDist2(val_guarDist2) {}
62
63 /*!
64 * \brief Less than operator. Needed for the sorting of the candidates.
65 * \param[in] other Object to which the current object must be compared.
66 */
67 inline bool operator<(const CBBoxTargetClass& other) const {
68 /* Make sure that the bounding boxes with the smallest possible distances
69 are stored first. */
70 if (possibleMinDist2 < other.possibleMinDist2) return true;
71 if (possibleMinDist2 > other.possibleMinDist2) return false;
72 if (guaranteedMinDist2 < other.guaranteedMinDist2) return true;
73 if (guaranteedMinDist2 > other.guaranteedMinDist2) return false;
74 if (boundingBoxID < other.boundingBoxID) return true;
75 return false;
76 }
77};
passivedouble su2double
Definition code_config.hpp:181
Class for storing the information of a possible bounding box candidate during a minimum distance sear...
Definition CBBoxTargetClass.hpp:40
CBBoxTargetClass(const unsigned long val_BBoxID, const su2double val_posDist2, const su2double val_guarDist2)
Constructor of the class, which initializes the member variables.
Definition CBBoxTargetClass.hpp:60
unsigned long boundingBoxID
Corresponding bounding box ID.
Definition CBBoxTargetClass.hpp:41
su2double possibleMinDist2
Possible minimimum distance squared to the given coordinate.
Definition CBBoxTargetClass.hpp:42
bool operator<(const CBBoxTargetClass &other) const
Less than operator. Needed for the sorting of the candidates.
Definition CBBoxTargetClass.hpp:67
CBBoxTargetClass()=default
Constructor of the class. Nothing to be done.
su2double guaranteedMinDist2
Guaranteed minimum distance squared to the given coordinate.
Definition CBBoxTargetClass.hpp:44