Code_TYMPAN  4.2.0
Industrial site acoustic simulation
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TYElement Class Reference

#include <TYElement.h>

Inheritance diagram for TYElement:
Inheritance graph
[legend]
Collaboration diagram for TYElement:
Collaboration graph
[legend]

Public Member Functions

void * getAllUses ()
 
void setAllUses (void *allUses)
 
void cleanAllUses ()
 
Construction et Destruction
 TYElement ()
 
 TYElement (TYElement *pParent, bool PutInInstanceList=true)
 
 TYElement (const TYElement &other, bool PutInInstanceList=true)
 
virtual ~TYElement ()
 
Interface XML
virtual DOM_Element toXML (DOM_Element &domElement)
 
virtual int fromXML (DOM_Element domElement)
 
Accesseurs
void setID (TYUUID id)
 
void setID (const QString &str_id)
 
const TYUUIDgetID () 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)
 
TYElementgetParent () const
 
Indicateurs de modification.
virtual void setIsAcousticModified (bool isModified)
 
bool getIsAcousticModified ()
 
virtual void setIsGeometryModified (bool isModified)
 
bool getIsGeometryModified ()
 
Operateurs
TYElementoperator= (const TYElement &other)
 
bool operator== (const TYElement &other) const
 
bool operator!= (const TYElement &other) const
 
virtual bool deepCopy (const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
 
Methodes Utilitaires
virtual std::string toString () const
 
bool callFromXMLIfEqual (DOM_Element &domElement, int *pRetVal=NULL)
 
std::string getMetierName ()
 
- 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 OPrototypeclone () const =0
 
virtual const char * getClassName () const
 
bool isA (const char *className) const
 

Static Public Member Functions

static LPTYElementArray findTypeCollectionAndCallFromXML (DOM_Element parentElem, const char *type)
 
static void setLogInstances (bool log)
 
static bool getLogInstances ()
 
static TYElementgetInstance (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 OPrototypefindAndClone (const char *className)
 
static int findPrototype (const char *className)
 
static OPrototypesafeDownCast (OPrototype *pObject)
 
static void add_factory (const char *, IOProtoFactory::ptr_type factory)
 

Protected Attributes

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...
 

Private Member Functions

void addInstance ()
 
void remInstance ()
 

Static Private Member Functions

static TYElementContainergetInstances ()
 

Private Attributes

TYUUID _uuid
 Identifiant unique de l'element. More...
 

Static Private Attributes

static bool _logInstances = false
 Indique si on souhaite registrer toutes les instances de type TYElement et derivees. More...
 
static TYElementContainer_instances = NULL
 Collection de toutes les instances de type TYElement et derivees. More...
 
static bool _toSave = false
 Indicateur de modification. Passe a true si un TYElement a ete modifie, Indique la necessite de sauvegarder. More...
 
static bool _bRegenerateID = false
 Indicateur de regeneration d'ID true si regeneration d'ID a la lecture d'un fichier XML. More...
 
static uint64 ty_created_counter = 0
 
static uint64 ty_destroyed_counter = 0
 
static uint64 ty_regen_id_counter = 0
 

Gestion du Calcul courant

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...
 
void OnChildInCalculStatusChange ()
 

Additional Inherited Members

- Protected Member Functions inherited from OPrototype
 OPrototype ()
 

Detailed Description

Classe de base des composants et elements metiers.

Definition at line 436 of file TYElement.h.

Constructor & Destructor Documentation

◆ TYElement() [1/3]

TYElement::TYElement ( )

Definition at line 114 of file TYElement.cpp.

Here is the call graph for this function:

◆ TYElement() [2/3]

TYElement::TYElement ( TYElement pParent,
bool  PutInInstanceList = true 
)

Constructeur par defaut. Initialise un nouvel element metier. L'element parent permet de parcourir l'arborescence dans les elements metiers.

Parameters
PutInInstanceList: booleen indiquant si le TYElement cree utilisera la fonctionalite TYElement::getInstance(TYUUID uuid)

Definition at line 130 of file TYElement.cpp.

Here is the call graph for this function:

◆ TYElement() [3/3]

TYElement::TYElement ( const TYElement other,
bool  PutInInstanceList = true 
)

Constructeur par copie.

Parameters
PutInInstanceList: booleen indiquant si le TYElement cree utilisera la fonctionalite TYElement::getInstance(TYUUID uuid)

Definition at line 148 of file TYElement.cpp.

Here is the call graph for this function:

◆ ~TYElement()

TYElement::~TYElement ( )
virtual

Destructeur.

Definition at line 159 of file TYElement.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addCopy()

void TYElement::addCopy ( )
inline

Increment le compteur de nombre de copies.

Definition at line 531 of file TYElement.h.

◆ addInstance()

void TYElement::addInstance ( )
private

Ajoute l'instance this au tableau d'enregistrement des instances

Definition at line 245 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ callFromXMLIfEqual()

bool TYElement::callFromXMLIfEqual ( DOM_Element domElement,
int *  pRetVal = NULL 
)

Teste si l'element porte le meme nom que celui de la classe (sans le prefixe TY). Si tel est le cas, la methode 'fromXML' est appellee et true est retourne.

Parameters
domElementLe noeud XML a tester.
pRetValAdresse d'un 'int' pour la valeur de retour de 'fromXML'.
Returns
true si l'element porte le meme nom que la classe.

Definition at line 545 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cleanAllUses()

void TYElement::cleanAllUses ( )
inline

Definition at line 863 of file TYElement.h.

Here is the caller graph for this function:

◆ deepCopy()

bool TYElement::deepCopy ( const TYElement pOther,
bool  copyId = true,
bool  pUseCopyTag = false 
)
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.

Parameters
pOtherL'element a copier.
copyIdCopie l'identifiant unique ou pas.
Returns
true si la copie est possible; false sinon.

Reimplemented in TYRectangle, TYGeometryNode, TYCalcul, TYDirectivity, TYMaillage, TYPalette, TYTopographie, TYPointCalcul, TYRoute, TYRectangularMaillage, TYAcousticBox, TYLinearMaillage, TYPointControl, TYSpectre, TYBoundaryNoiseMap, TYSourcePonctuelle, TYRepere, TYPoint, TYEtage, TYPanel, TYEcran, TYTrafic, TYAcousticSemiCircle, TYAltimetrie, TYAcousticRectangle, TYAcousticSurfaceNode, TYSegment, TYPlanEau, TYMur, TYRegime, TYUserSourcePonctuelle, TYSiteNode, TYAcousticSurface, TYPolygon, TYDalle, TYCourbeNiveau, TYAttenuateur, TYSourceCheminee, TYAcousticCircle, TYAcousticFaceSet, TYAcousticLine, TYAcousticSemiCylinder, TYAcousticVolume, TYInfrastructure, TYMachine, TYMurElement, TYSourceBafflee, TYAcousticPolygon, TYBox, TYParoi, TYReseauTransport, TYTerrain, TYSource, TYSourceLineic, TYAcousticCylinder, TYAcousticRectangleNode, TYAcousticVolumeNode, TYFaceSet, TYSourceSurfacic, TYVegetation, TYMateriauConstruction, TYUserSrcRegime, and TYSol.

Definition at line 319 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findTypeCollectionAndCallFromXML()

LPTYElementArray TYElement::findTypeCollectionAndCallFromXML ( DOM_Element  parentElem,
const char *  type 
)
static

Recherche un type particuler d'element ou un type derive dans un noeud XML et instancie un element du type trouve. Si des elements sont trouves, leur methode 'fromXML' est appelee.

Parameters
parentElemL'element XML parent.
typeLe nom du type a chercher (ou un type derive).
Returns
Une instance du type trouve, sinon NULL.

Definition at line 568 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromString()

TYUUID TYElement::fromString ( QString  id)
static

conversion d'une string en identifiant 128 bits.

Definition at line 616 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromXML()

int TYElement::fromXML ( DOM_Element  domElement)
virtual

◆ getAllUses()

void* TYElement::getAllUses ( )
inline

Definition at line 861 of file TYElement.h.

Here is the caller graph for this function:

◆ getChilds()

virtual void TYElement::getChilds ( LPTYElementArray childs,
bool  recursif = true 
)
inlinevirtual

Collecte les enfants de cet element de facon recursive ou non.

Reimplemented in TYGeometryNode, TYAcousticBox, TYEtage, TYEcran, TYAcousticSurfaceNode, TYSiteNode, TYAcousticFaceSet, TYAcousticSemiCylinder, TYInfrastructure, TYAcousticCylinder, and TYAcousticVolumeNode.

Definition at line 517 of file TYElement.h.

Here is the caller graph for this function:

◆ getConstructorCount()

uint64 TYElement::getConstructorCount ( )
static

Renvoie le nombre d'appels aux constructeurs d'objets metiers. (utilise pour faire des tests de performance)

Definition at line 627 of file TYElement.cpp.

◆ getDestructorCount()

uint64 TYElement::getDestructorCount ( )
static

Renvoie le nombre d'appels aux destructeurs d'objets metiers. (utilise pour faire des tests de performance)

Definition at line 631 of file TYElement.cpp.

◆ getID()

const TYUUID & TYElement::getID ( ) const

Set/Get de l'identifiant de l'element.

Definition at line 197 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIdGenerationCount()

uint64 TYElement::getIdGenerationCount ( )
static

Renvoie le nombre de (re)generation of UUID (utilise pour faire des tests de performance)

Definition at line 636 of file TYElement.cpp.

◆ getInstance()

TYElement * TYElement::getInstance ( TYUUID  uuid)
static

Recherche une instance particuliere de type TYElement ou derive a partir de son ID.

Parameters
uuidL'ID de l'element a rechercher.
Returns
L'instance ayant l'ID correspondant, sinon NULL.

Definition at line 178 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInstances()

TYElementContainer & TYElement::getInstances ( )
staticprivate

Definition at line 104 of file TYElement.cpp.

Here is the caller graph for this function:

◆ getIsAcousticModified()

bool TYElement::getIsAcousticModified ( )
inline

Set/Get de l'indicateur de modification acoustique.

Definition at line 672 of file TYElement.h.

Here is the caller graph for this function:

◆ getIsGeometryModified()

bool TYElement::getIsGeometryModified ( )
inline

Set/Get de l'indicateur de modification de la geometrie.

Definition at line 682 of file TYElement.h.

◆ getIsSavedOk()

static bool TYElement::getIsSavedOk ( )
inlinestatic

Get/Set de l'etat de l'indicateur de sauvegarde

Definition at line 848 of file TYElement.h.

Here is the caller graph for this function:

◆ getLogInstances()

static bool TYElement::getLogInstances ( )
inlinestatic

Retourne l'etat de l'indicateur d'enregistrement des instances de type TYElement ou derive.

Returns
L'etat de l'enregistrement.

Definition at line 785 of file TYElement.h.

Here is the call graph for this function:

◆ getMetierName()

std::string TYElement::getMetierName ( )

Retourne le nom de la donnee metier associee a cette classe. Ce nom est utilise pour le nom des tables en BDD ainsi que pour le nom des noeuds XML.

Returns
Le nom de la donnee metier.

Definition at line 562 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getName()

virtual QString TYElement::getName ( ) const
inlinevirtual

Set/Get du nom de l'element.

Definition at line 647 of file TYElement.h.

Here is the caller graph for this function:

◆ getParent()

TYElement* TYElement::getParent ( ) const
inline

Set/Get de la reference sur le parent de cet element.

Definition at line 656 of file TYElement.h.

Here is the caller graph for this function:

◆ getRegenerateID()

static bool TYElement::getRegenerateID ( )
inlinestatic

Definition at line 859 of file TYElement.h.

Here is the caller graph for this function:

◆ getStringID()

QString TYElement::getStringID ( ) const
inline

Get de l'identifiant de l'element sous forme de string.

Definition at line 628 of file TYElement.h.

Here is the caller graph for this function:

◆ hasNullID()

bool TYElement::hasNullID ( ) const
inline

Definition at line 630 of file TYElement.h.

Here is the caller graph for this function:

◆ isInCurrentCalcul()

virtual bool TYElement::isInCurrentCalcul ( )
inlinevirtual

Set/Get de l'indicateur d'appartenance au Calcul courant.

Definition at line 526 of file TYElement.h.

Here is the caller graph for this function:

◆ newID()

TYUUID TYElement::newID ( )
static

Retourne un nouvel identifiant unique.

Returns
Un nouvel identifiant unique.

Definition at line 609 of file TYElement.cpp.

Here is the caller graph for this function:

◆ OnChildInCalculStatusChange()

void TYElement::OnChildInCalculStatusChange ( )
private

Called by children to inform parents that they change their "in calcul" state.

Definition at line 441 of file TYElement.cpp.

Here is the call graph for this function:

◆ operator!=()

bool TYElement::operator!= ( const TYElement other) const

Operateur de comparaison.

Definition at line 314 of file TYElement.cpp.

Here is the call graph for this function:

◆ operator=()

TYElement & TYElement::operator= ( const TYElement other)

Operateur de copie.

Definition at line 286 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==()

bool TYElement::operator== ( const TYElement other) const

Operateur de comparaison.

Definition at line 303 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ purgeInstances()

void TYElement::purgeInstances ( )
static

Vide le tableau de l'enregistrement des instances.

Definition at line 192 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ regenerateID()

void TYElement::regenerateID ( )

Genere un nouvel Id pour l'element (utilise lors de l'import d'un element dans un projet)

Definition at line 264 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remInstance()

void TYElement::remInstance ( )
private

Supprime une instance au tableau d'enregistrement des instances

Definition at line 255 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAllUses()

void TYElement::setAllUses ( void *  allUses)
inline

Definition at line 862 of file TYElement.h.

Here is the caller graph for this function:

◆ setCopyCount()

void TYElement::setCopyCount ( const unsigned int  copyCount)
inline

Modifie la vaeur du compteur.

Definition at line 536 of file TYElement.h.

Here is the caller graph for this function:

◆ setID() [1/2]

void TYElement::setID ( TYUUID  id)

Set/Get de l'identifiant de l'element.

Definition at line 207 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setID() [2/2]

void TYElement::setID ( const QString &  str_id)

Definition at line 231 of file TYElement.cpp.

Here is the call graph for this function:

◆ setInCurrentCalcul()

void TYElement::setInCurrentCalcul ( bool  state,
bool  recurschild = true,
bool  recursparent = true 
)
virtual

Set/Get de l'indicateur d'appartenance au Calcul courant.

Definition at line 413 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIsAcousticModified()

void TYElement::setIsAcousticModified ( bool  isModified)
virtual

Set/Get de l'indicateur de modification acoustique.

Reimplemented in TYAcousticSurfaceNode, TYAcousticSurface, and TYAcousticVolume.

Definition at line 269 of file TYElement.cpp.

Here is the caller graph for this function:

◆ setIsGeometryModified()

void TYElement::setIsGeometryModified ( bool  isModified)
virtual

Set/Get de l'indicateur de modification de la geometrie.

Reimplemented in TYTopographie, TYSiteNode, TYPlanEau, and TYCourbeNiveau.

Definition at line 274 of file TYElement.cpp.

Here is the call graph for this function:

◆ setIsSavedOk()

static void TYElement::setIsSavedOk ( const bool &  toSave)
inlinestatic

Get/Set de l'etat de l'indicateur de sauvegarde

Definition at line 853 of file TYElement.h.

Here is the caller graph for this function:

◆ setLogInstances()

static void TYElement::setLogInstances ( bool  log)
inlinestatic

Active ou desactive l'enregistrement de toutes les instances creees de type TYElement ou derive.

Parameters
logActive ou desactive.

Definition at line 778 of file TYElement.h.

Here is the caller graph for this function:

◆ setName() [1/2]

void TYElement::setName ( QString  name)
inline

Set/Get du nom de l'element.

Definition at line 640 of file TYElement.h.

Here is the caller graph for this function:

◆ setName() [2/2]

void TYElement::setName ( std::string  name)
inline

Definition at line 642 of file TYElement.h.

◆ setParent()

void TYElement::setParent ( TYElement pParent)
inline

Set/Get de la reference sur le parent de cet element.

Definition at line 652 of file TYElement.h.

◆ setRegenerateID()

static void TYElement::setRegenerateID ( const bool &  bRegenerate)
inlinestatic

Get/Set de l'etat de regerneration d'ID

Definition at line 858 of file TYElement.h.

Here is the caller graph for this function:

◆ testId()

bool TYElement::testId ( const TYUUID id,
const TYElement pElem 
)
static

Verification de l'existence d'un doublon dans la liste des instances

Definition at line 238 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString() [1/2]

virtual std::string TYElement::toString ( ) const
inlinevirtual

◆ toString() [2/2]

QString TYElement::toString ( TYUUID uuid)
static

conversion d'un identifiant 128 bits en string.

Definition at line 622 of file TYElement.cpp.

◆ toXML()

DOM_Element TYElement::toXML ( DOM_Element domElement)
virtual

◆ updateCurrentCalcul()

void TYElement::updateCurrentCalcul ( TYListID listID,
bool  recursif = true 
)
virtual

Verifie si cet element est present dans la liste d'ID passee. S'il est present cela signifie qu'il est actif dans le Calcul courant, c'est cet etat qui est retourne.

Parameters
listIDLa liste d'ID du Calcul courant.
recursifIndique si la mise a jour du Calcul courant doit etre recursive.
Returns
true si cet objet est actif dans le Calcul concerne; false sinon.

Reimplemented in TYSiteNode, TYTopographie, and TYInfrastructure.

Definition at line 461 of file TYElement.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _allUses

void* TYElement::_allUses
protected

Multi purpose void pointer (use for compatibility actually)

Definition at line 909 of file TYElement.h.

◆ _bPutInInstanceList

bool TYElement::_bPutInInstanceList
protected

Definition at line 891 of file TYElement.h.

◆ _bRegenerateID

bool TYElement::_bRegenerateID = false
staticprivate

Indicateur de regeneration d'ID true si regeneration d'ID a la lecture d'un fichier XML.

Definition at line 921 of file TYElement.h.

◆ _copyCount

unsigned int TYElement::_copyCount
protected

Definition at line 894 of file TYElement.h.

◆ _inCurrentCalcul

bool TYElement::_inCurrentCalcul
protected

Indique si cet element est actif dans le Calcul courant.

Definition at line 897 of file TYElement.h.

◆ _instances

TYElementContainer * TYElement::_instances = NULL
staticprivate

Collection de toutes les instances de type TYElement et derivees.

Definition at line 916 of file TYElement.h.

◆ _isAcousticModified

bool TYElement::_isAcousticModified
protected

Indicateur de modification acoustique.

Definition at line 900 of file TYElement.h.

◆ _isGeometryModified

bool TYElement::_isGeometryModified
protected

Indicateur de modification de la geometrie.

Definition at line 903 of file TYElement.h.

◆ _logInstances

bool TYElement::_logInstances = false
staticprivate

Indique si on souhaite registrer toutes les instances de type TYElement et derivees.

Le log des instances ne doit absolument pas etre active au lancement de l'application, le log des instances statiques provoque un crash.

Definition at line 913 of file TYElement.h.

◆ _name

QString TYElement::_name
protected

Nom courant de l'element.

Definition at line 885 of file TYElement.h.

◆ _pGraphicObject

LPTYElementGraphic TYElement::_pGraphicObject
protected

L'object graphique metier associe a cet element.

Definition at line 906 of file TYElement.h.

◆ _pParent

TYElement* TYElement::_pParent
protected

Reference sur l'element parent.

Definition at line 888 of file TYElement.h.

◆ _toSave

bool TYElement::_toSave = false
staticprivate

Indicateur de modification. Passe a true si un TYElement a ete modifie, Indique la necessite de sauvegarder.

Definition at line 919 of file TYElement.h.

◆ _uuid

TYUUID TYElement::_uuid
mutableprivate

Identifiant unique de l'element.

Definition at line 881 of file TYElement.h.

◆ ty_created_counter

uint64 TYElement::ty_created_counter = 0
staticprivate

Definition at line 923 of file TYElement.h.

◆ ty_destroyed_counter

uint64 TYElement::ty_destroyed_counter = 0
staticprivate

Definition at line 924 of file TYElement.h.

◆ ty_regen_id_counter

uint64 TYElement::ty_regen_id_counter = 0
staticprivate

Definition at line 925 of file TYElement.h.


The documentation for this class was generated from the following files: