Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYReflectionPruningStrategy.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 __TY_ABSTRACT_REFLECTION_PRUNING_STRATEGY__
17 #define __TY_ABSTRACT_REFLECTION_PRUNING_STRATEGY__
18 
20 #include "TYVisibilityCone.h"
21 
37 {
38 public:
40 
44  virtual std::unique_ptr<TYAbstractReflectionPruningStrategy> instanciate() const = 0;
45 
51  virtual void initialize(const std::vector<const TYSIntersection*>& currentReflectingSegments,
52  const std::deque<OPoint3D>& currentImageSources) = 0;
53 
58  virtual bool pruningCriterionMet(const TYSIntersection& nextReflectingSegment) const = 0;
59 
60 protected:
62 };
63 
68 {
69 public:
70  std::unique_ptr<TYAbstractReflectionPruningStrategy> instanciate() const override
71  {
72  return std::make_unique<TYReflectionNoPruningStrategy>();
73  }
74 
75  void initialize(const std::vector<const TYSIntersection*>& currentReflectingSegments,
76  const std::deque<OPoint3D>& currentImageSources) override
77  {
78  }
79 
80  bool pruningCriterionMet(const TYSIntersection& nextReflectingSegment) const override
81  {
82  return false;
83  }
84 };
85 
91 {
92 public:
94 
95  std::unique_ptr<TYAbstractReflectionPruningStrategy> instanciate() const override
96  {
97  return std::make_unique<TYReflectionVisibilityPruningStrategy>();
98  }
99 
100  void initialize(const std::vector<const TYSIntersection*>& currentReflectingSegments,
101  const std::deque<OPoint3D>& currentImageSources) override;
102 
103  bool pruningCriterionMet(const TYSIntersection& nextReflectingSegment) const override;
104 
105 private:
106  std::unique_ptr<VisibilityCone> _pVisibilityCone;
107 };
108 
109 #endif // __TY_ABSTRACT_REFLECTION_PRUNING_STRATEGY__
Abstract class representing a pruning strategy to prune the tree of reflecting segments during comput...
virtual std::unique_ptr< TYAbstractReflectionPruningStrategy > instanciate() const =0
Instanciate a new pruning strategy of the same type.
virtual bool pruningCriterionMet(const TYSIntersection &nextReflectingSegment) const =0
Check if the tree can be pruned before inserting the next reflecting segment.
virtual void initialize(const std::vector< const TYSIntersection * > &currentReflectingSegments, const std::deque< OPoint3D > &currentImageSources)=0
Inform the pruning strategy of the current reflecting segments tree state.
virtual ~TYAbstractReflectionPruningStrategy()=default
Pruning strategy which never prunes the tree of reflecting segments (bruteforce image source method)
std::unique_ptr< TYAbstractReflectionPruningStrategy > instanciate() const override
Instanciate a new pruning strategy of the same type.
bool pruningCriterionMet(const TYSIntersection &nextReflectingSegment) const override
Check if the tree can be pruned before inserting the next reflecting segment.
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.
Pruning strategy which prunes the tree when the reflecting segment to be added in the tree is not vis...
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.
std::unique_ptr< TYAbstractReflectionPruningStrategy > instanciate() const override
Instanciate a new pruning strategy of the same type.
Data structure for intersections.