Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYReflectionPruningStrategy.cpp
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 
18 
20  const std::vector<const TYSIntersection*>& currentReflectingSegments,
21  const std::deque<OPoint3D>& currentImageSources)
22 {
23  if (!currentReflectingSegments.empty())
24  {
25  const OPoint3D& previousImageSource = currentImageSources.back();
26  const OSegment3D& previousSegment{currentReflectingSegments.back()->segInter[1]};
28  std::make_unique<VisibilityCone>(previousImageSource, previousSegment._ptA, previousSegment._ptB);
29  }
30 }
31 
33  const TYSIntersection& nextReflectingSegment) const
34 {
35  if (_pVisibilityCone)
36  {
37  const OSegment3D& currentSegment{nextReflectingSegment.segInter[1]};
38  // pruning criterion is met (true) when the segment is not visible (segmentIsVisibleInCone = false)
39  return !_pVisibilityCone->segmentIsVisibleInCone(currentSegment);
40  }
41  else
42  {
43  return false;
44  }
45 }
All base classes related to 3D manipulation.
The 3D point class.
Definition: 3d.h:487
Class to define a segment.
Definition: 3d.h:1141
std::unique_ptr< VisibilityCone > _pVisibilityCone
void initialize(const std::vector< const TYSIntersection * > &currentReflectingSegments, const std::deque< OPoint3D > &currentImageSources) override
Inform the pruning strategy of the current reflecting segments tree state.
bool pruningCriterionMet(const TYSIntersection &nextReflectingSegment) const override
Check if the tree can be pruned before inserting the next reflecting segment.
Data structure for intersections.
OSegment3D segInter[2]