Code_TYMPAN
4.2.0
Industrial site acoustic simulation
|
#include <TYSpectre.h>
Public Member Functions | |
TYSpectre (const double &defaultValue=TY_SPECTRE_DEFAULT_VALUE) | |
TYSpectre (const OSpectre &spectre) | |
TYSpectre (const OSpectreComplex &spectre) | |
Constructeur a partir d'un OSpectreComplex. More... | |
TYSpectre (const TYSpectre &other) | |
virtual | ~TYSpectre () |
virtual TYSpectre & | operator= (const TYSpectre &other) |
Operateur d'affectation. More... | |
virtual TYSpectre & | operator= (const OSpectre &other) |
Operateur d'affectation depuis un OSpectre. More... | |
virtual bool | operator== (const TYSpectre &other) const |
Operateur d'egalite. More... | |
virtual bool | operator!= (const TYSpectre &otehr) const |
Operateur d'inegalite. More... | |
virtual bool | deepCopy (const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false) |
virtual std::string | toString () const |
virtual DOM_Element | toXML (DOM_Element &domElement) |
virtual int | fromXML (DOM_Element domElement) |
virtual bool | toXML (const std::string &sFilePath) |
virtual bool | fromXML (const std::string &sFilePath) |
virtual std::string | toXMLString () |
virtual bool | fromXMLString (const std::string &sXMLString) |
virtual TYSpectreForm | getForm () |
Set/Get de la forme du spectre. More... | |
virtual void | setForm (const TYSpectreForm &form) |
virtual QString | getRemarque () const |
Set/Get des remarques. More... | |
virtual void | setRemarque (QString rq) |
Set/Get des remarques. More... | |
virtual bool | getIsReadOnly () |
Set/Get du flag de conservation en BDD. More... | |
virtual void | setIsReadOnly (bool flag) |
Set/Get du flag _isReadOnly. More... | |
virtual void | exportCSV (const std::string &filename) |
Export du spectre au format csv en creant le fichier. More... | |
virtual void | exportCSV (std::ofstream &ofs) |
Export du spectre au format csv sur un flux transmis. More... | |
OSpectre * | downcast_ospectre () |
: return spectrum casted as OSpectre More... | |
Public Member Functions inherited from TYElement | |
void * | getAllUses () |
void | setAllUses (void *allUses) |
void | cleanAllUses () |
TYElement () | |
TYElement (TYElement *pParent, bool PutInInstanceList=true) | |
TYElement (const TYElement &other, bool PutInInstanceList=true) | |
virtual | ~TYElement () |
void | setID (TYUUID id) |
void | setID (const QString &str_id) |
const TYUUID & | getID () const |
QString | getStringID () const |
bool | hasNullID () const |
void | regenerateID () |
void | setName (QString name) |
void | setName (std::string name) |
virtual QString | getName () const |
void | setParent (TYElement *pParent) |
TYElement * | getParent () const |
virtual void | setIsAcousticModified (bool isModified) |
bool | getIsAcousticModified () |
virtual void | setIsGeometryModified (bool isModified) |
bool | getIsGeometryModified () |
TYElement & | operator= (const TYElement &other) |
bool | operator== (const TYElement &other) const |
bool | operator!= (const TYElement &other) const |
bool | callFromXMLIfEqual (DOM_Element &domElement, int *pRetVal=NULL) |
std::string | getMetierName () |
virtual void | updateCurrentCalcul (TYListID &listID, bool recursif=true) |
virtual void | getChilds (LPTYElementArray &childs, bool recursif=true) |
virtual void | setInCurrentCalcul (bool state, bool recurschild=true, bool recursparent=true) |
virtual bool | isInCurrentCalcul () |
void | addCopy () |
Increment le compteur de nombre de copies. More... | |
void | setCopyCount (const unsigned int copyCount) |
Modifie la vaeur du compteur. More... | |
Public Member Functions inherited from IRefCount | |
IRefCount () | |
virtual | ~IRefCount () |
virtual int | incRef () |
virtual int | decRef () |
int | getRefCount () const |
Public Member Functions inherited from OPrototype | |
virtual | ~OPrototype () |
virtual OPrototype * | clone () const =0 |
virtual const char * | getClassName () const |
bool | isA (const char *className) const |
Public Member Functions inherited from OSpectre | |
OSpectre () | |
Default constructor, the spectrum module is defined by the _defaultValue. More... | |
OSpectre (double defaultValue) | |
Constructor, the spectrum module is defined by the defaultValue given in parameter. More... | |
OSpectre (const OSpectre &other) | |
Copy constructor. More... | |
OSpectre (const double *valeurs, unsigned nbVal, unsigned decalage) | |
Constructor from an array (needed for the Harmonoise model) More... | |
virtual | ~OSpectre () |
Destructor. More... | |
virtual bool | operator== (const OSpectre &other) const |
operator== More... | |
virtual bool | operator!= (const OSpectre &other) const |
operator != More... | |
OSpectre | operator* (const OSpectre &spectre) const |
Multiplication by a Spectre spectrum. More... | |
OSpectre | operator* (const double &coefficient) const |
Multiplication by a double coefficient. More... | |
virtual OSpectre | operator+ (const double &valeur) const |
Add a constant value to all the spectrum. More... | |
virtual OSpectre | operator+ (const OSpectre &spectre) const |
Arithmetic sum of two spectrums in one-third Octave. More... | |
virtual OSpectre | operator- (const OSpectre &spectre) const |
Arithmetic subtraction of two spectrums in one-third Octave. More... | |
virtual bool | isValid () const |
Check the spectrum validity. Invalidity is caused by: corrupted data, impossible calculation. More... | |
virtual void | setValid (const bool &valid=true) |
virtual TYSpectreType | getType () const |
Get the spectrum type. More... | |
virtual void | setType (TYSpectreType type) |
Set the spectrum type. More... | |
virtual TYSpectreEtat | getEtat () const |
Get the spectrum state. More... | |
virtual const TYSpectreEtat | getEtat () |
void | setEtat (TYSpectreEtat etat) |
Force the spectrum state (to use carefully ...) More... | |
virtual double * | getTabValReel () |
virtual const double * | getTabValReel () const |
virtual unsigned int | getNbValues () const |
Number of values in the spectrum. More... | |
virtual void | setDefaultValue (const double &valeur=TY_SPECTRE_DEFAULT_VALUE) |
virtual void | setValue (const float &freq, const double &reel=0.0) |
virtual double | getValueReal (double freq) |
virtual void | getRangeValueReal (double *valeurs, const short &nbVal, const short &decalage) |
virtual double | valGlobDBLin () const |
Compute the global value dB[Lin] of a one-third Octave spectrum. More... | |
virtual double | valGlobDBA () const |
Compute the global value dB[A] of a one-third Octave spectrum. More... | |
virtual OSpectre | toDB () const |
Converts to dB. More... | |
virtual OSpectre | toGPhy () const |
Converts to physical quantity. More... | |
virtual OSpectre | sum (const OSpectre &spectre) const |
Arithmetic sum of two spectrums in one-third Octave. More... | |
virtual OSpectre | sum (const double &valeur) const |
Add a constant value to this spectrum. More... | |
virtual OSpectre | sumdB (const OSpectre &spectre) const |
Energetic sum of two spectrums in one-third Octave. More... | |
virtual OSpectre | subst (const OSpectre &spectre) const |
Arithmetic subtraction of two spectrums in one-third Octave. More... | |
virtual OSpectre | subst (const double &valeur) const |
Subtract a constant value to this spectrum. More... | |
virtual OSpectre | mult (const OSpectre &spectre) const |
Multiplication of two spectrums. More... | |
virtual OSpectre | mult (const double &coefficient) const |
Multiply this spectrum par a double scalar. More... | |
virtual OSpectre | div (const OSpectre &spectre) const |
Division of two spectrums. More... | |
virtual OSpectre | div (const double &coefficient) const |
Division of this spectrum by a double scalar. More... | |
virtual OSpectre | invMult (const double &coefficient=1.0) const |
Division of a double constant by this spectrum. More... | |
virtual OSpectre | inv () const |
Division of one by this spectrum. More... | |
virtual OSpectre | power (const double &puissance) const |
Return a spectrum as this spectrum raised to a double power. More... | |
virtual OSpectre | log (const double &base=10.0) const |
Compute the log base n of this spectrum (n=10 by default). More... | |
virtual OSpectre | racine () const |
Compute the root square of this spectrum. More... | |
virtual OSpectre | exp (const double coef=1.0) |
Compute e^(coef * spectre) of this spectrum. More... | |
virtual OSpectre | sin () const |
Compute the sin of this spectrum. More... | |
virtual OSpectre | cos () const |
Compute the cos of this spectrum. More... | |
virtual OSpectre | abs () const |
Return the absolute value of this spectrum. More... | |
virtual OSpectre | sqrt () const |
Return the root square of a spectrum. More... | |
virtual double | valMax () |
Return the maximum value of a spectrum. More... | |
virtual OSpectre | seuillage (const double &min=-200.0, const double max=200.0) |
Limit the spectrum values (min and max) More... | |
virtual double | sigma () |
Sum the values of the spectrum. More... | |
virtual const double | sigma () const |
virtual bool | isTonalite () const |
Existence d'une tonalite marquee. More... | |
virtual OSpectre | toTOct () const |
Converts to one-third Octave. More... | |
virtual OSpectre | toOct () const |
Converts to Octave. More... | |
virtual void | printme () const |
Print the spectrum. More... | |
Static Public Member Functions | |
static TYSpectre | getEmptyLinSpectre (const double &valInit=1.0E-20) |
Cree un spectre en lin. More... | |
static TYSpectre | pondA () |
Construit un spectre de ponderation A. More... | |
static TYSpectre | pondB () |
Construit un spectre de ponderation B. More... | |
static TYSpectre | pondC () |
Construit un spectre de ponderation C. More... | |
static TYSpectre | getLambda (const double &c) |
static void | setXMLPrecision (const int precision=1) |
Get/Set de la precision de stockage des resultats (XML) More... | |
static int | getXMLPrecision () |
Get/Set de la precision de stockage des resultats (XML) More... | |
static const TYTabFreq | getTabFreqNorm (TYSpectreForm form=SPECTRE_FORM_TIERS) |
static const float | getFreqNorm (int freqIndex) |
Static Public Member Functions inherited from TYElement | |
static LPTYElementArray | findTypeCollectionAndCallFromXML (DOM_Element parentElem, const char *type) |
static void | setLogInstances (bool log) |
static bool | getLogInstances () |
static TYElement * | getInstance (TYUUID uuid) |
static void | purgeInstances () |
static bool | testId (const TYUUID &id, const TYElement *pElem) |
static TYUUID | newID () |
static TYUUID | fromString (QString id) |
static QString | toString (TYUUID &uuid) |
static uint64 | getConstructorCount () |
static uint64 | getDestructorCount () |
static uint64 | getIdGenerationCount () |
static bool | getIsSavedOk () |
static void | setIsSavedOk (const bool &toSave) |
static void | setRegenerateID (const bool &bRegenerate) |
static bool | getRegenerateID () |
Static Public Member Functions inherited from OPrototype | |
static OPrototype * | findAndClone (const char *className) |
static int | findPrototype (const char *className) |
static OPrototype * | safeDownCast (OPrototype *pObject) |
static void | add_factory (const char *, IOProtoFactory::ptr_type factory) |
Static Public Member Functions inherited from OSpectre | |
static OSpectre | getEmptyLinSpectre (const double &valInit=1.0E-20) |
Create a physical quantity spectrum. More... | |
static OSpectre | makeOctSpect () |
Make a spectrum in Octave. More... | |
static int | getIndice (const float &freq) |
Return the index associated to a frequency. More... | |
static void | setFMin (const float &fMin) |
Define minimal frequency. More... | |
static void | setFMax (const float &fMax) |
Define maximal frequency. More... | |
static OTabFreq | getTabFreqExact () |
static OSpectre | getOSpectreFreqExact () |
Return the spectrum of the exact frequencies. More... | |
static std::map< double, int > | setMapFreqIndice () |
Construction du tableau frequence/indice. More... | |
static OSpectre | pondA () |
Build a weighted spectrum A. More... | |
static OSpectre | pondB () |
Build a weighted spectrum B. More... | |
static OSpectre | pondC () |
Build a weighted spectrum C. More... | |
static OSpectre | getLambda (const double &c) |
Protected Attributes | |
bool | _isReadOnly |
Indique si la widget du spectre est read-only. More... | |
QString | _remarque |
Remarques. More... | |
Protected Attributes inherited from TYElement | |
QString | _name |
Nom courant de l'element. More... | |
TYElement * | _pParent |
Reference sur l'element parent. More... | |
bool | _bPutInInstanceList |
unsigned int | _copyCount |
bool | _inCurrentCalcul |
Indique si cet element est actif dans le Calcul courant. More... | |
bool | _isAcousticModified |
Indicateur de modification acoustique. More... | |
bool | _isGeometryModified |
Indicateur de modification de la geometrie. More... | |
LPTYElementGraphic | _pGraphicObject |
L'object graphique metier associe a cet element. More... | |
void * | _allUses |
Multi purpose void pointer (use for compatibility actually) More... | |
Protected Attributes inherited from IRefCount | |
int | m_refCount |
The reference counter. More... | |
Protected Attributes inherited from OSpectre | |
bool | _valid |
Spectrum validity. More... | |
TYSpectreType | _type |
Spectrum type. More... | |
TYSpectreEtat | _etat |
Spectrum state (physical quantity or dB). More... | |
TYSpectreForm | _form |
Representation of the spectrum: one-third Octave, Octave, constant delta f, unstructured. More... | |
double | _module [TY_SPECTRE_DEFAULT_NB_ELMT] |
Real values array for module. More... | |
Static Protected Attributes | |
static int | _XMLprecision = 1 |
Precision de stockage des resultats. More... | |
Static Protected Attributes inherited from OSpectre | |
static const double | _freqNorm [] |
Array of center frequencies (Hz) normalized in one-third Octave. More... | |
static double | _fMin = 16 |
Minimal frequency. More... | |
static double | _fMax = 16000 |
Maximal frequency. More... | |
static double | _defaultValue = TY_SPECTRE_DEFAULT_VALUE |
Default value for the spectrum. More... | |
static std::map< double, int > | _mapFreqIndice = setMapFreqIndice() |
Mapping between frequency and array index. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from OPrototype | |
OPrototype () | |
Permet de stocker des valeurs de puissance accoustique pour differentes frequences.
Definition at line 32 of file TYSpectre.h.
TYSpectre::TYSpectre | ( | const double & | defaultValue = TY_SPECTRE_DEFAULT_VALUE | ) |
Constructeur par defaut.
Definition at line 31 of file TYSpectre.cpp.
TYSpectre::TYSpectre | ( | const OSpectre & | spectre | ) |
Constructeur a partir d'un OSpectre
Definition at line 44 of file TYSpectre.cpp.
TYSpectre::TYSpectre | ( | const OSpectreComplex & | spectre | ) |
Constructeur a partir d'un OSpectreComplex.
Definition at line 52 of file TYSpectre.cpp.
TYSpectre::TYSpectre | ( | const TYSpectre & | other | ) |
Constructeur par copie.
Definition at line 39 of file TYSpectre.cpp.
|
virtual |
Destructeur.
Definition at line 62 of file TYSpectre.cpp.
|
virtual |
Effectue une copie en allouant de la memoire (deep copy) et non pas en copiant seulement les pointeurs (shallow copy). Cette methode s'utilise comme l'operateur egal. L'ID peut ne pas etre copie, le parent n'est jamais copie.
pOther | L'element a copier. |
copyId | Copie l'identifiant unique ou pas. |
true
si la copie est possible; false
sinon. Reimplemented from TYElement.
Definition at line 110 of file TYSpectre.cpp.
|
inline |
: return spectrum casted as OSpectre
Definition at line 164 of file TYSpectre.h.
|
virtual |
Export du spectre au format csv en creant le fichier.
Definition at line 356 of file TYSpectre.cpp.
|
virtual |
Export du spectre au format csv sur un flux transmis.
Definition at line 367 of file TYSpectre.cpp.
|
virtual |
Extrait les informations a partir du noeud DOM passe afin de recuperer les parametres de la classe.
domElement | Le noeud DOM a partir duquel les parametres doivent etre recuperes. |
Reimplemented from TYElement.
Definition at line 171 of file TYSpectre.cpp.
|
virtual |
|
virtual |
|
static |
Cree un spectre en lin.
Definition at line 418 of file TYSpectre.cpp.
|
inlinevirtual |
Set/Get de la forme du spectre.
Definition at line 92 of file TYSpectre.h.
|
static |
Retourne la frequence correspondant a l'index freqIndex.
Definition at line 408 of file TYSpectre.cpp.
|
inlinevirtual |
Set/Get du flag de conservation en BDD.
Set/Get du flag de conservation en BDD. Set/Get du flag _isReadOnly.
Definition at line 108 of file TYSpectre.h.
|
static |
Retourne un spectre representant la longueur d'onde associee a chaque frequence
c | Vitesse de propagation de l'onde |
Definition at line 446 of file TYSpectre.cpp.
|
inlinevirtual |
Set/Get des remarques.
Definition at line 96 of file TYSpectre.h.
|
static |
Retourne le tableau des frequences normalisees. L'appelant ne doit pas liberer la memoire allouee pour creer ce tableau.
Definition at line 386 of file TYSpectre.cpp.
|
inlinestatic |
Get/Set de la precision de stockage des resultats (XML)
Definition at line 145 of file TYSpectre.h.
|
virtual |
Operateur d'inegalite.
Definition at line 105 of file TYSpectre.cpp.
Operateur d'affectation.
Definition at line 66 of file TYSpectre.cpp.
Operateur d'affectation depuis un OSpectre.
Reimplemented from OSpectre.
Definition at line 80 of file TYSpectre.cpp.
|
virtual |
Operateur d'egalite.
Definition at line 91 of file TYSpectre.cpp.
|
static |
Construit un spectre de ponderation A.
Definition at line 424 of file TYSpectre.cpp.
|
static |
Construit un spectre de ponderation B.
Definition at line 430 of file TYSpectre.cpp.
|
static |
Construit un spectre de ponderation C.
Definition at line 436 of file TYSpectre.cpp.
|
inlinevirtual |
|
inlinevirtual |
Set/Get du flag _isReadOnly.
Definition at line 111 of file TYSpectre.h.
|
inlinevirtual |
Set/Get des remarques.
Definition at line 99 of file TYSpectre.h.
|
inlinestatic |
Get/Set de la precision de stockage des resultats (XML)
Definition at line 142 of file TYSpectre.h.
|
virtual |
Retourne une chaine de caractere donnant des informations sur cet objet (utile pour le debugage).
Reimplemented from TYElement.
Definition at line 124 of file TYSpectre.cpp.
|
virtual |
Construit une arborescence DOM a partir du noeud passe afin de sauvegarder les parametres au format XML.
domElement | Le noeud DOM parent a partir duquel l'arborescence doit etre creee. |
Reimplemented from TYElement.
Definition at line 130 of file TYSpectre.cpp.
|
virtual |
|
virtual |
|
protected |
Indique si la widget du spectre est read-only.
Definition at line 176 of file TYSpectre.h.
|
protected |
Remarques.
Definition at line 179 of file TYSpectre.h.
|
staticprotected |
Precision de stockage des resultats.
Definition at line 173 of file TYSpectre.h.