61 if (TYElement::operator!=(other))
65 if (TYColorInterface::operator!=(other))
69 if (TYAcousticInterface::operator!=(other))
102 for (
int i = 0; i < pOtherAccVolNode->
getNbChild(); i++)
115 return "TYAcousticVolumeNode";
152 QDomNodeList childs = domElement.childNodes();
153 for (
unsigned int i = 0; i < childs.length(); i++)
155 elemCur = childs.item(i).toElement();
207 pVolume->setRegime(
Spectre, regime, recursif);
222 pVolume->setRegimeName(
name);
236 pVolume->remRegime(regime);
253 pVolume->loadRegime(regimeNb);
265 pVolume->setCurRegime(regime);
290 for (
size_t i = 0; i < childs.size(); i++)
300 if (pVolume->getNbRegimes() > nbRegimes)
302 pVolume->setNbRegimes(
static_cast<int>(nbRegimes));
305 pVolume->correctNbRegimes();
318 pVol->propagateAtt(pAtt);
334 if (pVolume->getIsRayonnant())
341 for (
unsigned int j = 0; j < tabChild.size(); j++)
343 tabChild[j]->setMatrix(matrix * tabChild[j]->getMatrix());
347 tab.insert(tab.end(), tabChild.begin(), tabChild.end());
404 if (pVolume->getIsRayonnant())
406 pVolume->distriSrcs();
420 if (pVolume->getIsRayonnant())
422 pVolume->setSrcsLw();
437 pVolume->remAllSrcs();
483 if (volCourant->getIsRayonnant())
485 LWv = volCourant->setGlobalLW(LWg, surfTotale);
487 ret &= volCourant->updateAcoustic();
492 volCourant->setRegime(aTYSpectre);
505 if (volCourant->getIsRayonnant())
507 LWc = LWc.
sum(volCourant->getCurrentSpectre().toGPhy());
516 double residu =
ABS(10 * log10(LWg.
sigma()) - 10 * log10(LWc.
sigma()));
519 ret = residu < 1 ? true :
false;
544 res += pVolume->volume();
558 res += pVolume->surface();
572 if (pVolume->getIsRayonnant())
574 res += pVolume->activeSurface();
589 if (pVolume->getIsRayonnant())
591 res += pVolume->activeSurface();
610 for (
unsigned int j = 0; j < tabTmp.size(); j++)
613 tabTmp[j] = matrix * tabTmp[j];
617 tab.insert(tab.end(), tabTmp.begin(), tabTmp.end());
635 for (
unsigned int j = 0; j < tabTmp.size(); j++)
638 tabTmp[j] = matrix * tabTmp[j];
642 tab.insert(tab.end(), tabTmp.begin(), tabTmp.end());
660 for (
unsigned int j = 0; j < tabTmp.size(); j++)
670 tab.insert(tab.end(), tabTmp.begin(), tabTmp.end());
683 printf(
"TYAcousticVolumeNode::centreGravite non implemente.\n");
710 ptTest = matrix * pt;
715 res = pVolume->isInside(ptTest);
731 for (
unsigned int j = 0; j < tabTmp.size(); j++)
733 tabTmp[j]->setMatrix(matrixVol * tabTmp[j]->getMatrix());
734 tab.push_back(tabTmp[j]);
749 assert(pAccVolGeoNode);
756 pVolume->setParent(
this);
770 pVolume->addRegime();
778 pVolume->setCurRegime(i);
779 pVolume->setRegimeName(nomReg);
799 pVolGeoNode->
setParent(pAccVol->getParent());
812 TYTabAcousticVolumeGeoNode::iterator ite;
832 assert(pAccVolGeoNode);
834 TYTabAcousticVolumeGeoNode::iterator ite;
838 if ((*ite) == pAccVolGeoNode)
855 TYTabAcousticVolumeGeoNode::iterator ite;
888 TYTabAcousticVolumeGeoNode::iterator ite;
914 for (
unsigned int i = 0; i < childs.size(); i++)
917 if (pSurf.
_pObj !=
nullptr)
932 ofs <<
getName().toLatin1().data() <<
'\n';
939 TYTabAcousticVolumeGeoNode::iterator ite;
948 pVol->exportCSV(ofs);
double ABS(double a)
Return the absolute value.
#define INTERS_NULLE
No intersection.
std::vector< LPTYAcousticSurfaceGeoNode > TYTabAcousticSurfaceGeoNode
Collection de noeuds geometriques de type TYAcousticSurface.
TY_EXTENSION_INST(TYAcousticVolumeNode)
TYGeometryNode TYAcousticVolumeGeoNode
Noeud geometrique de type TYAcousticVolume.
std::vector< TYPoint > TYTabPoint
Collection de TYPoint.
std::vector< OVector3D > TYTabVector
Collection de OVector3D.
std::vector< LPTYPolygon > TYTabLPPolygon
Collection de pointeurs de TYPolygon.
std::vector< LPTYElement > LPTYElementArray
std::vector< LPTYSourcePonctuelleGeoNode > TYTabSourcePonctuelleGeoNode
Collection de noeuds geometriques de type TYSourcePonctuelle.
int invert()
Matrix inversion.
virtual const char * getClassName() const
static OPrototype * safeDownCast(OPrototype *pObject)
Class to define a segment.
OSpectreAbstract & sum(const OSpectreAbstract &spectre) const
Arithmetic sum of two spectrums in one-third Octave.
OSpectreAbstract & toGPhy() const
Converts to physical quantity.
void setType(TYSpectreType type)
Set the spectrum type.
double sigma()
Sum the values of the spectrum.
OSpectreAbstract & toDB() const
Converts to dB.
OSpectreAbstract & sumdB(const OSpectreAbstract &spectre) const
Energetic sum of two spectrums.
static OSpectre getEmptyLinSpectre(const double &valInit=1.0E-20)
Create a physical quantity spectrum.
T * _pObj
The real pointer, must derived IRefCount.
double _densiteSrcsV
Densite verticale de sources.
double getDensiteSrcsH() const
virtual void setDensiteSrcsH(double densite, bool recursif=true)
TYRegime & getRegimeNb(const int &nb, bool &status)
size_t getNbRegimes() const
double getDensiteSrcsV() const
int _curRegime
Numero du regime de fonctionnement courant.
int _typeDistribution
Indique le type de distribution a utiliser. pour l'etat courant.
virtual void loadRegime(int regimeNb=-1)
TYSpectre & getCurrentSpectre()
TYTabRegimes _tabRegimes
Tableau des regimes de fonctionnement.
virtual void setDensiteSrcsV(double densite, bool recursif=true)
DOM_Element toXML(DOM_Element &domElement)
virtual void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
TYAcousticInterface & operator=(const TYAcousticInterface &other)
virtual void setRegime(TYSpectre &Spectre, int regime=-1, bool recursif=false)
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
virtual void setCurRegime(int regimeNumber)
int fromXML(DOM_Element domElement)
bool _regimeChangeAble
Indique si un element peux changer de regime de lui meme.
virtual int getNextRegimeNb()
void deepCopy(const TYAcousticInterface *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual void propagateAtt(LPTYAttenuateur pAtt)
double _densiteSrcsH
Densite horizontale de sources.
virtual bool remRegime(int regime)
virtual void setRegimeName(const QString &name)
virtual LPTYSpectre getRealPowerSpectrum()
virtual TYTabAcousticSurfaceGeoNode acousticFaces()
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual void exportCSV(std::ofstream &ofs)
Export au format csv sur un flux transmis.
virtual ~TYAcousticVolumeNode()
virtual void setDensiteSrcsV(double densite, bool recursif=true)
virtual TYTabVector normals() const
virtual int fromXML(DOM_Element domElement)
virtual TYPoint centreGravite() const
bool addAcousticVol(LPTYAcousticVolumeGeoNode pAccVolGeoNode, bool recursif=true)
virtual void setRegime(TYSpectre &Spectre, int regime=-1, bool recursif=false)
size_t getNbChild() const
virtual bool updateAcoustic(const bool &force=false)
virtual void distriSrcs()
virtual void setIsRayonnant(bool rayonnant=true, bool recursif=true)
virtual double activeSurface() const
TYTabAcousticVolumeGeoNode _tabAcousticVol
Tableau des AcousticVolumes.
virtual int isInside(const TYPoint &pt) const
virtual TYBox volEnglob() const
virtual void propagateAtt(LPTYAttenuateur pAtt)
virtual TYTabPoint sommets() const
virtual TYTabSourcePonctuelleGeoNode getSrcs() const
virtual DOM_Element toXML(DOM_Element &domElement)
virtual LPTYSpectre getRealPowerSpectrum()
virtual void correctNbRegimes()
virtual std::string toString() const
LPTYAcousticVolume getAcousticVol(int index)
LPTYAcousticVolumeGeoNode findAcousticVol(const LPTYAcousticVolume pAccVol)
TYAcousticVolumeNode & operator=(const TYAcousticVolumeNode &other)
Operateur =.
virtual double surface() const
virtual void loadRegime(int regimeNb=-1)
virtual TYTabLPPolygon faces() const
bool remAcousticVol(const LPTYAcousticVolumeGeoNode pAccVolGeoNode)
virtual bool remRegime(int regime)
bool operator==(const TYAcousticVolumeNode &other) const
Operateur ==.
virtual double volume() const
virtual int intersects(const OSegment3D &seg, TYTabPoint &ptList) const
virtual void remAllSrcs()
virtual void setDensiteSrcsH(double densite, bool recursif=true)
bool operator!=(const TYAcousticVolumeNode &other) const
Operateur !=.
virtual void setCurRegime(int regime)
virtual void setRegimeName(const QString &name)
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
virtual TYSourcePonctuelle srcPonctEquiv() const
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
int fromXML(DOM_Element domElement)
TYColorInterface & operator=(const TYColorInterface &other)
void deepCopy(const TYColorInterface *pOther, bool copyId=true, bool pUseCopyTag=false)
DOM_Element toXML(DOM_Element &domElement)
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual DOM_Element toXML(DOM_Element &domElement)
QString _name
Nom courant de l'element.
TYElement & operator=(const TYElement &other)
bool callFromXMLIfEqual(DOM_Element &domElement, int *pRetVal=NULL)
virtual QString getName() const
bool getIsAcousticModified()
virtual void getChilds(LPTYElementArray &childs, bool recursif=true)
void setParent(TYElement *pParent)
virtual int fromXML(DOM_Element domElement)
virtual void setIsAcousticModified(bool isModified)
virtual void setIsGeometryModified(bool isModified)
TYElement * getElement() const
QString generateName(const char *classname)
Retourne le nom de la classe associe a un nombre.
static TYNameManager * get()
Retourne l'instance singleton.
void transform(const OMatrix &matrix)
static TYSpectre getEmptyLinSpectre(const double &valInit=1.0E-20)
Cree un spectre en lin.
virtual int intersects(const OSegment3D &seg, TYTabPoint &ptList) const
virtual TYBox volEnglob() const