Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYAcousticBox.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 /*
17  *
18  */
19 
20 #ifndef __TY_ACOUSTICBOX__
21 #define __TY_ACOUSTICBOX__
22 
24 #include "TYAcousticVolume.h"
25 
30 {
34 
35  // Methodes
36 public:
40  TYAcousticBox();
41 
45  TYAcousticBox(const TYAcousticBox& other);
46 
50  virtual ~TYAcousticBox();
51 
60  void setDimension(float larg, float lon, float haut);
61 
70  void getDimension(float& larg, float& lon, float& haut);
71 
73  TYAcousticBox& operator=(const TYAcousticBox& other);
75  bool operator==(const TYAcousticBox& other) const;
77  bool operator!=(const TYAcousticBox& other) const;
78 
92  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
93 
94  virtual std::string toString() const;
95 
96  virtual DOM_Element toXML(DOM_Element& domElement);
97  virtual int fromXML(DOM_Element domElement);
98 
99  virtual void getChilds(LPTYElementArray& childs, bool recursif = true);
100 
101  virtual void setDensiteSrcsH(double densite, bool recursif = true);
102  virtual void setDensiteSrcsV(double densite, bool recursif = true);
103 
104  virtual void setRegime(TYSpectre& Spectre, int regime = -1, bool recursif = false);
105  virtual bool remRegime(int regime);
106  virtual void setCurRegime(int regime);
107  virtual void loadRegime(int regimeNb = -1);
108  // virtual int addRegime(const TYRegime& regime);
109  virtual int addRegime();
110  virtual void propagateAtt(LPTYAttenuateur pAtt);
111  virtual TYTabSourcePonctuelleGeoNode getSrcs() const;
112  virtual TYSourcePonctuelle srcPonctEquiv() const;
113  virtual void distriSrcs();
114  virtual void remAllSrcs();
115  virtual bool setSrcsLw();
116  virtual void setIsRayonnant(bool rayonnant = true, bool recursif = true);
117 
118  virtual double volume() const;
119  virtual double surface() const;
120  virtual double activeSurface() const;
121  virtual double activeSurface();
122  virtual TYTabVector normals() const;
123  virtual TYTabPoint sommets() const;
124  virtual TYTabLPPolygon faces() const;
125  virtual TYBox volEnglob() const;
126  virtual TYPoint centreGravite() const;
127  virtual int intersects(const OSegment3D& seg, TYTabPoint& ptList) const;
128  virtual int isInside(const TYPoint& pt) const;
129 
131  virtual bool findAcousticSurface(const TYAcousticSurface* pAccSurf, OMatrix* pMatrix = 0);
132 
137 
142  {
143  return _faces[numFace];
144  }
148  const LPTYAcousticRectangleNodeGeoNode getFace(int numFace) const
149  {
150  return _faces[numFace];
151  }
155  void setFace(const LPTYAcousticRectangleNode pAccRect, int numFace);
156 
160  bool updateAcoustic(const bool& force = false);
161 
165  virtual void setNextRegimeNb(const int& next);
166 
170  virtual void setRegimeName(const QString& name);
171 
173  virtual void exportCSV(std::ofstream& ofs);
174 
175  // Membres
176 protected:
178 
179  TYAcousticRectangleNode* getFaceElement(unsigned long index) const
180  {
181  TYElement* pElement = _faces[index]->getElement();
182  TYAcousticRectangleNode* pRectangleElement = TYAcousticRectangleNode::safeDownCast(pElement);
183 
184  return pRectangleElement;
185  }
186 };
187 
193 typedef std::vector<LPTYAcousticBoxGeoNode> TYTabAcousticBoxGeoNode;
194 
195 #endif // __TY_ACOUSTICBOX__
QDomElement DOM_Element
Definition: QT2DOM.h:30
TYGeometryNode TYAcousticBoxGeoNode
Noeud geometrique de type TYAcousticBox.
SmartPtr< TYAcousticBoxGeoNode > LPTYAcousticBoxGeoNode
Smart Pointer sur TYAcousticBoxGeoNode.
std::vector< LPTYAcousticBoxGeoNode > TYTabAcousticBoxGeoNode
Collection de noeuds geometriques de type TYAcousticBox.
std::vector< LPTYAcousticSurface > TYTabLPAcousticSurface
Tableau de TYAcousticSurfaces.
std::vector< LPTYAcousticSurfaceGeoNode > TYTabAcousticSurfaceGeoNode
Collection de noeuds geometriques de type TYAcousticSurface.
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
Definition: TYDefines.h:340
std::vector< OVector3D > TYTabVector
Collection de OVector3D.
Definition: TYDefines.h:398
std::vector< LPTYPolygon > TYTabLPPolygon
Collection de pointeurs de TYPolygon.
Definition: TYDefines.h:349
#define TY_EXT_GRAPHIC_DECL_ONLY(classname)
Definition: TYElement.h:432
std::vector< LPTYElement > LPTYElementArray
Definition: TYElement.h:345
#define OPROTODECL(classname)
Definition: TYElement.h:65
#define TY_EXTENSION_DECL_ONLY(classname)
Definition: TYElement.h:386
const char * name
std::vector< LPTYSourcePonctuelleGeoNode > TYTabSourcePonctuelleGeoNode
Collection de noeuds geometriques de type TYSourcePonctuelle.
The 4x4 matrix class.
Definition: 3d.h:625
static OPrototype * safeDownCast(OPrototype *pObject)
Definition: TYElement.cpp:71
Class to define a segment.
Definition: 3d.h:1089
Spectrum class.
Definition: Spectre.h:25
virtual void remAllSrcs()
virtual int addRegime()
virtual bool remRegime(int regime)
virtual TYTabPoint sommets() const
virtual int isInside(const TYPoint &pt) const
void setFace(const LPTYAcousticRectangleNode pAccRect, int numFace)
virtual TYTabAcousticSurfaceGeoNode acousticFaces()
virtual TYTabLPPolygon faces() const
virtual TYPoint centreGravite() const
LPTYAcousticRectangleNodeGeoNode getFace(int numFace)
virtual void propagateAtt(LPTYAttenuateur pAtt)
void setDimension(float larg, float lon, float haut)
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
virtual TYTabVector normals() const
void getDimension(float &larg, float &lon, float &haut)
virtual ~TYAcousticBox()
virtual void loadRegime(int regimeNb=-1)
virtual void distriSrcs()
virtual int intersects(const OSegment3D &seg, TYTabPoint &ptList) const
TYTabLPAcousticSurface getSubFace()
virtual double activeSurface() const
TYAcousticRectangleNode * getFaceElement(unsigned long index) const
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
bool operator!=(const TYAcousticBox &other) const
Operateur !=.
virtual bool findAcousticSurface(const TYAcousticSurface *pAccSurf, OMatrix *pMatrix=0)
virtual TYBox volEnglob() const
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
TYAcousticBox & operator=(const TYAcousticBox &other)
Operateur =.
const LPTYAcousticRectangleNodeGeoNode getFace(int numFace) const
LPTYAcousticRectangleNodeGeoNode _faces[6]
virtual void setRegime(TYSpectre &Spectre, int regime=-1, bool recursif=false)
virtual void setRegimeName(const QString &name)
virtual void setCurRegime(int regime)
virtual void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
virtual void setDensiteSrcsV(double densite, bool recursif=true)
bool operator==(const TYAcousticBox &other) const
Operateur ==.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual void setNextRegimeNb(const int &next)
virtual void setDensiteSrcsH(double densite, bool recursif=true)
virtual int fromXML(DOM_Element domElement)
bool updateAcoustic(const bool &force=false)
virtual std::string toString() const
virtual double surface() const
virtual TYSourcePonctuelle srcPonctEquiv() const
virtual bool setSrcsLw()
virtual double volume() const
virtual DOM_Element toXML(DOM_Element &domElement)
Definition: TYBox.h:34
TYElement * getElement() const