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

Assigne une altitude a chaque point de l'espace. More...

#include <TYAltimetrie.h>

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

Classes

struct  grid_index
 Integer coordinates into the grid. More...
 

Public Member Functions

 TYAltimetrie ()
 
 TYAltimetrie (const TYAltimetrie &other)
 
virtual ~TYAltimetrie ()
 
TYAltimetrieoperator= (const TYAltimetrie &other)
 Operateur =. More...
 
bool operator== (const TYAltimetrie &other) const
 Operateur ==. More...
 
bool operator!= (const TYAltimetrie &other) const
 Operateur !=. 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)
 
void plugBackTriangulation (const std::deque< OPoint3D > &points, std::deque< OTriangle > &triangles, const std::deque< LPTYSol > &materials)
 plug back triangulation providfed by the TYTopographie More...
 
TYTabLPPolygongetListFaces ()
 
const TYTabLPPolygongetListFaces () const
 
void setListFaces (const TYTabLPPolygon &list)
 
bool addFace (LPTYPolygon pFace)
 
bool remFace (const LPTYPolygon pFace)
 
bool remFace (QString idFace)
 
LPTYPolygon getFace (int index)
 
const TYPolygongetFace (int index) const
 
double altitude (const OPoint3D &pt)
 
bool updateAltitude (OPoint3D &pt) const
 Modifie l'altitude d'un point donn�. Si le point est hors de la zone dans laquelle l'altim�trie est d�finie, la valeur z du point est mise a TYAltimetry::invalid_altitude. More...
 
OPoint3D projection (const OPoint3D &pt) const
 Calcule les coordonnees de la projection au sol d'un point de l'espace. More...
 
double HauteurMoyenne (TYTabPoint &pts)
 
double PremiereHauteurPositiveOuNulle (TYTabPoint &ptsIn)
 
LPTYPolygon getFaceUnder (OPoint3D pt)
 Return the face under a point. More...
 
unsigned int getFacesInBox (const OBox2 &box, TYTabLPPolygon &tabPolygon)
 find a list of triangle partialy or totaly included in a box More...
 
unsigned int getPointsInBox (const OPoint3D &pt0, const OPoint3D &pt1, const OPoint3D &pt2, const OPoint3D &pt3, TYTabPoint &tabPolygon)
 find a list of point included in a box defined by four points More...
 
void exportMesh (std::deque< OPoint3D > &vertices, std::deque< OTriangle > &faces, std::deque< LPTYSol > &materials)
 
bool containsData ()
 
- 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 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
 
virtual void setIsAcousticModified (bool isModified)
 
bool getIsAcousticModified ()
 
virtual void setIsGeometryModified (bool isModified)
 
bool getIsGeometryModified ()
 
TYElementoperator= (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 OPrototypeclone () const =0
 
virtual const char * getClassName () const
 
bool isA (const char *className) const
 

Static Public Attributes

static const double invalid_altitude = -1E5
 

Protected Member Functions

 FRIEND_TEST (TYAltimetryTest, dummy_grid)
 
 FRIEND_TEST (TYAltimetryTest, simple_grid)
 
 FRIEND_TEST (TYAltimetryTest, simple_terrain)
 
bool getGridIndices (const OPoint3D &pt, grid_index &indXY) const
 Select indices of faces to test. More...
 
bool getGridIndices (const OPoint3D *pts, unsigned int *iMinMax) const
 Select indices of faces to test. More...
 
bool getGridIndices (const OBox2 &box, unsigned int *iMinMax) const
 Select indices of faces to test. More...
 
void getFacesinIndices (unsigned int &minX, unsigned int &maxX, unsigned int &minY, unsigned int &maxY, TYTabLPPolygon &faces)
 Select faces in the interval minX, maxX, minY, maxY. More...
 
void initNullGrid ()
 Initilise the grid related attributes for a null grid. More...
 
void clearAcceleratingGrid ()
 clean the accelerating structure More...
 
void initAcceleratingGrid (unsigned to_be_reserved=0)
 initialise the accelerating structure given current _bbox and _gridS{XY} More...
 
void copyAcceleratingGrid (const TYAltimetrie &other)
 Clear the grid and reinitialise it as a copy of other. More...
 
- Protected Member Functions inherited from OPrototype
 OPrototype ()
 

Protected Attributes

TYTabLPPolygon _listFaces
 Liste des polygones correspondant aux faces de cet altimetrie. More...
 
OBox _bbox
 Bounding Box 2D de l'altimetrie. More...
 
TYTabLPPolygon ** _pSortedFaces
 
unsigned _gridSX
 Size along each dimension of the accelerating grid. More...
 
unsigned _gridSY
 
double _gridDX
 Step along each dimension of the accelerating grid. More...
 
double _gridDY
 
std::deque< OPoint3D_vertices
 
std::deque< OTriangle_faces
 
std::deque< LPTYSol_materials
 
- 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...
 

Private Member Functions

bool IsInsideFace (const TYTabPoint &pts, OPoint3D &pt) const
 

Additional Inherited Members

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

Detailed Description

Assigne une altitude a chaque point de l'espace.

Author
Projet_Tympan

Definition at line 34 of file TYAltimetrie.h.

Constructor & Destructor Documentation

◆ TYAltimetrie() [1/2]

TYAltimetrie::TYAltimetrie ( )

Constructeur.

Definition at line 53 of file TYAltimetrie.cpp.

Here is the call graph for this function:

◆ TYAltimetrie() [2/2]

TYAltimetrie::TYAltimetrie ( const TYAltimetrie other)

Constructeur par copie.

Definition at line 59 of file TYAltimetrie.cpp.

◆ ~TYAltimetrie()

TYAltimetrie::~TYAltimetrie ( )
virtual

Destructeur.

Definition at line 65 of file TYAltimetrie.cpp.

Member Function Documentation

◆ addFace()

bool TYAltimetrie::addFace ( LPTYPolygon  pFace)

Ajoute une face a la liste des faces.

Definition at line 281 of file TYAltimetrie.cpp.

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

◆ altitude()

double TYAltimetrie::altitude ( const OPoint3D pt)

Calcule l'altitude d'un point de l'espace. La coordonee Z du point est mise a jour si le point est situe dans la zone de definition de l'altimetrie.

Returns
false si l'altitude du point n'a pu etre determinee; false sinon.

Definition at line 643 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ clearAcceleratingGrid()

void TYAltimetrie::clearAcceleratingGrid ( )
protected

clean the accelerating structure

Definition at line 708 of file TYAltimetrie.cpp.

◆ containsData()

bool TYAltimetrie::containsData ( )
inline

Definition at line 206 of file TYAltimetrie.h.

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

◆ copyAcceleratingGrid()

void TYAltimetrie::copyAcceleratingGrid ( const TYAltimetrie other)
protected

Clear the grid and reinitialise it as a copy of other.

Definition at line 743 of file TYAltimetrie.cpp.

◆ deepCopy()

bool TYAltimetrie::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 from TYElement.

Definition at line 98 of file TYAltimetrie.cpp.

Here is the call graph for this function:

◆ exportMesh()

void TYAltimetrie::exportMesh ( std::deque< OPoint3D > &  vertices,
std::deque< OTriangle > &  faces,
std::deque< LPTYSol > &  materials 
)

Definition at line 152 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ FRIEND_TEST() [1/3]

TYAltimetrie::FRIEND_TEST ( TYAltimetryTest  ,
dummy_grid   
)
protected
Here is the caller graph for this function:

◆ FRIEND_TEST() [2/3]

TYAltimetrie::FRIEND_TEST ( TYAltimetryTest  ,
simple_grid   
)
protected

◆ FRIEND_TEST() [3/3]

TYAltimetrie::FRIEND_TEST ( TYAltimetryTest  ,
simple_terrain   
)
protected

◆ fromXML()

int TYAltimetrie::fromXML ( DOM_Element  domElement)
virtual

Extrait les informations a partir du noeud DOM passe afin de recuperer les parametres de la classe.

Parameters
domElementLe noeud DOM a partir duquel les parametres doivent etre recuperes.
Returns
1 si la recuperation des parametres a reussie.

Reimplemented from TYElement.

Definition at line 145 of file TYAltimetrie.cpp.

Here is the call graph for this function:

◆ getFace() [1/2]

LPTYPolygon TYAltimetrie::getFace ( int  index)
inline

Retourne une face de la liste des faces.

Definition at line 142 of file TYAltimetrie.h.

Here is the caller graph for this function:

◆ getFace() [2/2]

const TYPolygon* TYAltimetrie::getFace ( int  index) const
inline

Definition at line 143 of file TYAltimetrie.h.

Here is the call graph for this function:

◆ getFacesInBox()

unsigned int TYAltimetrie::getFacesInBox ( const OBox2 box,
TYTabLPPolygon tabPolygon 
)

find a list of triangle partialy or totaly included in a box

A return value equal 0 means all triangle near the boxes are included

Definition at line 401 of file TYAltimetrie.cpp.

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

◆ getFacesinIndices()

void TYAltimetrie::getFacesinIndices ( unsigned int &  minX,
unsigned int &  maxX,
unsigned int &  minY,
unsigned int &  maxY,
TYTabLPPolygon faces 
)
protected

Select faces in the interval minX, maxX, minY, maxY.

Definition at line 562 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ getFaceUnder()

LPTYPolygon TYAltimetrie::getFaceUnder ( OPoint3D  pt)

Return the face under a point.

Definition at line 370 of file TYAltimetrie.cpp.

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

◆ getGridIndices() [1/3]

bool TYAltimetrie::getGridIndices ( const OPoint3D pt,
grid_index indXY 
) const
protected

Select indices of faces to test.

Definition at line 476 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ getGridIndices() [2/3]

bool TYAltimetrie::getGridIndices ( const OPoint3D pts,
unsigned int *  iMinMax 
) const
protected

Select indices of faces to test.

Definition at line 520 of file TYAltimetrie.cpp.

◆ getGridIndices() [3/3]

bool TYAltimetrie::getGridIndices ( const OBox2 box,
unsigned int *  iMinMax 
) const
protected

Select indices of faces to test.

Definition at line 549 of file TYAltimetrie.cpp.

Here is the call graph for this function:

◆ getListFaces() [1/2]

TYTabLPPolygon& TYAltimetrie::getListFaces ( )
inline

Set/Get de la liste des faces.

Definition at line 112 of file TYAltimetrie.h.

Here is the caller graph for this function:

◆ getListFaces() [2/2]

const TYTabLPPolygon& TYAltimetrie::getListFaces ( ) const
inline

Set/Get de la liste des faces.

Definition at line 117 of file TYAltimetrie.h.

◆ getPointsInBox()

unsigned int TYAltimetrie::getPointsInBox ( const OPoint3D pt0,
const OPoint3D pt1,
const OPoint3D pt2,
const OPoint3D pt3,
TYTabPoint tabPolygon 
)

find a list of point included in a box defined by four points

Value returned is the number of point

Definition at line 440 of file TYAltimetrie.cpp.

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

◆ HauteurMoyenne()

double TYAltimetrie::HauteurMoyenne ( TYTabPoint pts)

Retourne la hauteur moyenne des points passes en arguments.

Definition at line 648 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ initAcceleratingGrid()

void TYAltimetrie::initAcceleratingGrid ( unsigned  to_be_reserved = 0)
protected

initialise the accelerating structure given current _bbox and _gridS{XY}

Definition at line 726 of file TYAltimetrie.cpp.

◆ initNullGrid()

void TYAltimetrie::initNullGrid ( )
protected

Initilise the grid related attributes for a null grid.

Definition at line 698 of file TYAltimetrie.cpp.

◆ IsInsideFace()

bool TYAltimetrie::IsInsideFace ( const TYTabPoint pts,
OPoint3D pt 
) const
inlineprivate

Definition at line 334 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ operator!=()

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

Operateur !=.

Definition at line 93 of file TYAltimetrie.cpp.

◆ operator=()

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

Operateur =.

Definition at line 71 of file TYAltimetrie.cpp.

Here is the call graph for this function:

◆ operator==()

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

Operateur ==.

Definition at line 83 of file TYAltimetrie.cpp.

◆ plugBackTriangulation()

void TYAltimetrie::plugBackTriangulation ( const std::deque< OPoint3D > &  points,
std::deque< OTriangle > &  triangles,
const std::deque< LPTYSol > &  materials 
)

plug back triangulation providfed by the TYTopographie

Calcul l'altimetrie a partir d'une collection de points. L'altimetrie est le resultat de la triangulation de Delaunay calculee a partir des points passes.

Parameters
pointsLes points pour calculer l'altimetrie. Calcul l'altimetrie a partir d'une collection de points et de segments. L'altimetrie est le resultat de la triangulation de Delaunay contrainte calculee a partir des points passes et des segments. This function expect to be passed the deques of points and triangles computed by TYTopographie::computeAltimetricTriangulation, which itself calls the new tympan::AltimetryBuilder.
pointsthe vertices of the triangulation
trianglesthe faces of the triangulation

Definition at line 167 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ PremiereHauteurPositiveOuNulle()

double TYAltimetrie::PremiereHauteurPositiveOuNulle ( TYTabPoint ptsIn)

Retourne la premiere (ordre de parsing du tableau passes en arguments) hauteur positive ou nulle des points ptsIn.

Definition at line 672 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ projection()

OPoint3D TYAltimetrie::projection ( const OPoint3D pt) const

Calcule les coordonnees de la projection au sol d'un point de l'espace.

Returns
les coordonnees du pt d'intersection

Definition at line 588 of file TYAltimetrie.cpp.

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

◆ remFace() [1/2]

bool TYAltimetrie::remFace ( const LPTYPolygon  pFace)

Supprime une face a la liste des faces.

Definition at line 293 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

◆ remFace() [2/2]

bool TYAltimetrie::remFace ( QString  idFace)

Supprime une face a la liste des faces a partir de son ID.

Definition at line 314 of file TYAltimetrie.cpp.

◆ setListFaces()

void TYAltimetrie::setListFaces ( const TYTabLPPolygon list)
inline

Set/Get de la liste des faces.

Definition at line 122 of file TYAltimetrie.h.

Here is the call graph for this function:

◆ toString()

std::string TYAltimetrie::toString ( ) const
virtual

Retourne une chaine de caractere donnant des informations sur cet objet (utile pour le debugage).

Returns
Une chaine de caractere informative sur cet objet.

Reimplemented from TYElement.

Definition at line 133 of file TYAltimetrie.cpp.

◆ toXML()

DOM_Element TYAltimetrie::toXML ( DOM_Element domElement)
virtual

Construit une arborescence DOM a partir du noeud passe afin de sauvegarder les parametres au format XML.

Parameters
domElementLe noeud DOM parent a partir duquel l'arborescence doit etre creee.
Returns
Le noeud DOM nouvellement cree.

Reimplemented from TYElement.

Definition at line 138 of file TYAltimetrie.cpp.

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

◆ updateAltitude()

bool TYAltimetrie::updateAltitude ( OPoint3D pt) const

Modifie l'altitude d'un point donn�. Si le point est hors de la zone dans laquelle l'altim�trie est d�finie, la valeur z du point est mise a TYAltimetry::invalid_altitude.

Returns
false si l'altitude du point n'a pu etre determinee

Definition at line 630 of file TYAltimetrie.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ _bbox

OBox TYAltimetrie::_bbox
protected

Bounding Box 2D de l'altimetrie.

Definition at line 246 of file TYAltimetrie.h.

◆ _faces

std::deque<OTriangle> TYAltimetrie::_faces
protected

Definition at line 276 of file TYAltimetrie.h.

◆ _gridDX

double TYAltimetrie::_gridDX
protected

Step along each dimension of the accelerating grid.

Definition at line 271 of file TYAltimetrie.h.

◆ _gridDY

double TYAltimetrie::_gridDY
protected

Definition at line 272 of file TYAltimetrie.h.

◆ _gridSX

unsigned TYAltimetrie::_gridSX
protected

Size along each dimension of the accelerating grid.

Definition at line 267 of file TYAltimetrie.h.

◆ _gridSY

unsigned TYAltimetrie::_gridSY
protected

Definition at line 268 of file TYAltimetrie.h.

◆ _listFaces

TYTabLPPolygon TYAltimetrie::_listFaces
protected

Liste des polygones correspondant aux faces de cet altimetrie.

Definition at line 243 of file TYAltimetrie.h.

◆ _materials

std::deque<LPTYSol> TYAltimetrie::_materials
protected

Definition at line 277 of file TYAltimetrie.h.

◆ _pSortedFaces

TYTabLPPolygon** TYAltimetrie::_pSortedFaces
protected

Definition at line 264 of file TYAltimetrie.h.

◆ _vertices

std::deque<OPoint3D> TYAltimetrie::_vertices
protected

Definition at line 275 of file TYAltimetrie.h.

◆ invalid_altitude

const double TYAltimetrie::invalid_altitude = -1E5
static

Definition at line 42 of file TYAltimetrie.h.


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