Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticRectangleFromCylinder.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_ACOUSTIC_RECTANGLE_FROM_CYLINDER__
17 #define __TY_ACOUSTIC_RECTANGLE_FROM_CYLINDER__
18 
19 #include "TYAcousticRectangle.h"
20 
26 {
27 public:
28  TYAcousticRectangleFromCylinder(double cylinderRadius, double cylinderHeight,
29  const OPoint3D& cylinderCenter, const OVector3D& cylinderAxis)
30  : _cylinderRadius(cylinderRadius), _cylinderHeight(cylinderHeight), _cylinderCenter(cylinderCenter),
31  _cylinderAxis(cylinderAxis)
32  {
33  }
34 
45  double getVerticalExtensionInRefCoordSystem(const TYGeometryNode& refCoordSystem) const override
46  {
47  return _cylinderHeight;
48  }
49 
60  double getHorizontalExtensionInRefCoordSystem(const TYGeometryNode& refCoordSystem) const override
61  {
62  return 2. * _cylinderRadius;
63  }
64 
69  double getRadius() const
70  {
71  return _cylinderRadius;
72  }
73 
80  OPoint3D getCenterInRefCoordSystem(const TYGeometryNode& refCoordSystem) const
81  {
82  return refCoordSystem.localToGlobal() * _cylinderCenter;
83  }
84 
91  OVector3D getAxisInRefCoordSystem(const TYGeometryNode& refCoordSystem) const
92  {
93  return refCoordSystem.localToGlobal() * _cylinderAxis;
94  }
95 
96 private:
101 };
102 
103 #endif // _TY_ACOUSTIC_RECTANGLE_FROM_CYLINDER_
The 3D point class.
Definition: 3d.h:487
The 3D vector class.
Definition: 3d.h:298
Represents an acoustic rectangle arising from the discretization of the curved surface of a TYAcousti...
TYAcousticRectangleFromCylinder(double cylinderRadius, double cylinderHeight, const OPoint3D &cylinderCenter, const OVector3D &cylinderAxis)
double getRadius() const
Provide the radius of the cylinder.
OPoint3D getCenterInRefCoordSystem(const TYGeometryNode &refCoordSystem) const
Provide a point along the axis of the cylinder in the reference coordinate system.
OVector3D getAxisInRefCoordSystem(const TYGeometryNode &refCoordSystem) const
Provide a vector colinear to the axis of the cylinder in the reference coordinate system.
double getVerticalExtensionInRefCoordSystem(const TYGeometryNode &refCoordSystem) const override
Compute the vertical extension of the surface. For a cylinder, the vertical extension is its height r...
double getHorizontalExtensionInRefCoordSystem(const TYGeometryNode &refCoordSystem) const override
Compute the horizontal extension of the surface. For a cylinder, the horizontal extension is its diam...
OMatrix localToGlobal() const