Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TargetManager.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef TARGETMANAGER_H
17 #define TARGETMANAGER_H
18 
19 #include "Geometry/mathlib.h"
20 #include <vector>
21 #include <set>
22 
27 {
28 
29 public:
33  bool registerTarget(const vec3 newTarget);
35  bool registerTargets(std::vector<vec3>& newTargets);
37  void finish();
39  unsigned int getTargetsAround(const vec3 center, unsigned int nbTargets, decimal distance,
40  std::vector<vec3>& result);
42  std::vector<vec3>& getTargets()
43  {
44  return targets;
45  }
46 
47 protected:
48  std::vector<vec3> targets;
49  std::set<vec3> uniqueTargets;
50 };
51 
52 #endif
Class to manage targets.
Definition: TargetManager.h:27
bool registerTargets(std::vector< vec3 > &newTargets)
Register a vector of targets.
unsigned int getTargetsAround(const vec3 center, unsigned int nbTargets, decimal distance, std::vector< vec3 > &result)
Get the targets in a distance range from a center.
void finish()
Delete the uniqueTargets array.
TargetManager()
Constructor.
Definition: TargetManager.h:31
bool registerTarget(const vec3 newTarget)
Register a new target.
std::set< vec3 > uniqueTargets
Set of single targets.
Definition: TargetManager.h:49
std::vector< vec3 > & getTargets()
Return the targets.
Definition: TargetManager.h:42
std::vector< vec3 > targets
Vector of targets.
Definition: TargetManager.h:48
float decimal
Definition: mathlib.h:45
base_vec3< decimal > vec3
Definition: mathlib.h:387