Code_TYMPAN
4.2.0
Industrial site acoustic simulation
|
#include <TYPolygon.h>
Public Member Functions | |
TYPolygon () | |
TYPolygon (const TYPolygon &other) | |
TYPolygon (const TYTabPoint &pts) | |
virtual | ~TYPolygon () |
TYPolygon & | operator= (const TYPolygon &other) |
Operateur =. More... | |
bool | operator== (const TYPolygon &other) const |
Operateur ==. More... | |
bool | operator!= (const TYPolygon &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) |
virtual double | surface () const |
virtual OVector3D | normal () const |
virtual OPlan | plan () const |
virtual TYTabPoint | getContour (int n=-1) const |
virtual TYTabPoint3D | getOContour (int n=-1) const |
virtual int | intersects (const TYSurfaceInterface *pSurf, OSegment3D &seg) const |
virtual int | intersects (const OSegment3D &seg, OPoint3D &pt) const |
virtual int | intersects (const OSegment3D &seg, OPoint3D &pt, bool insideTest) const |
virtual int | intersects (const OPoint3D &pt) const |
void | purge () |
size_t | getNbPts () const |
void | setPoints (const TYTabPoint &pts) |
bool | checkCoplanar () const |
const TYTabPoint & | getPoints () const |
TYTabPoint & | getPoints () |
OPoint3D | getPoint (size_t index) const |
void | transform (const OMatrix &matrix) |
void | setConvex (bool bConvex) |
bool | isConvex () const |
bool | isInBox (const OPoint3D &pt) const |
bool | isInBox2D (const OPoint3D &pt) const |
OPoint3D | getCenter () const |
bool | isValid () const |
ORepere3D | getORepere3D () const |
TYRectangle | getBoundingRect () const |
virtual const OPlan & | getPlan () const |
void | updateNormal () |
void | updateBox () |
virtual void | inverseNormale () |
virtual const OBox & | getBox () const |
void | exportMesh (std::deque< OPoint3D > &points, std::deque< OTriangle > &triangles, const TYGeometryNode &geonode) const |
Export the surface as a triangular mesh. 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 TYSurfaceInterface | |
TYSurfaceInterface () | |
virtual | ~TYSurfaceInterface () |
virtual int | intersectsPlan (const OPlan &plan, OSegment3D &seg) const |
Private Member Functions | |
int | isInpolyXY (const TYTabPoint &poly, int npoints, double xt, double yt) const |
int | isInpolyXZ (const TYTabPoint &poly, int npoints, double xt, double yt) const |
int | isInpolyYZ (const TYTabPoint &poly, int npoints, double xt, double yt) const |
Private Attributes | |
TYTabPoint | _pts |
Sommets. More... | |
OPlan | _plan |
OBox | _box |
bool | _bConvex |
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 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) |
Protected Member Functions inherited from OPrototype | |
OPrototype () | |
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... | |
Classe de definition d'un polygone.
Definition at line 30 of file TYPolygon.h.
TYPolygon::TYPolygon | ( | ) |
Constructeur par defaut.
Definition at line 41 of file TYPolygon.cpp.
TYPolygon::TYPolygon | ( | const TYPolygon & | other | ) |
Constructeur par copie.
Definition at line 48 of file TYPolygon.cpp.
TYPolygon::TYPolygon | ( | const TYTabPoint & | pts | ) |
Constructeur a partir d'un tableau de points.
Definition at line 53 of file TYPolygon.cpp.
|
virtual |
Destructeur.
Definition at line 61 of file TYPolygon.cpp.
bool TYPolygon::checkCoplanar | ( | ) | const |
Return true if the all the points of the polygon are coplanar.
Definition at line 384 of file TYPolygon.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 98 of file TYPolygon.cpp.
|
virtual |
Export the surface as a triangular mesh.
NB : This function expect empty deques and will clear the deque passed.
points | output argument filled with the vertices of the triangulation |
triangles | output argument filled with the faces of the triangulation |
Reimplemented from TYSurfaceInterface.
Definition at line 728 of file TYPolygon.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 142 of file TYPolygon.cpp.
TYRectangle TYPolygon::getBoundingRect | ( | ) | const |
Calcul le rectangle englobant ce polygone.
Definition at line 442 of file TYPolygon.cpp.
|
inlinevirtual |
Definition at line 173 of file TYPolygon.h.
|
inline |
Definition at line 133 of file TYPolygon.h.
|
virtual |
Retourne un tableau de points correspondant au contour de cette surface.
n | Le nombre de portion pour le decoupage. Si n=-1, n sera calcule a partir de la precision de distance definie par defaut. Pour certaine surface, le nombre de portion demande ne sera pas forcement le nombre de points obtenus. |
Implements TYSurfaceInterface.
Definition at line 236 of file TYPolygon.cpp.
|
inline |
Retourne le nombre de points composants ce polygone.
Definition at line 92 of file TYPolygon.h.
|
virtual |
Implements TYSurfaceInterface.
Definition at line 241 of file TYPolygon.cpp.
ORepere3D TYPolygon::getORepere3D | ( | ) | const |
Calcule le repere local a ce polygone par rapport au repere global.
Definition at line 418 of file TYPolygon.cpp.
|
inlinevirtual |
retourne le plan associe a cette surface
Definition at line 167 of file TYPolygon.h.
|
inline |
Get d'un point dans collection de point
Definition at line 110 of file TYPolygon.h.
|
inline |
Set/Get de la collection de points.
Definition at line 105 of file TYPolygon.h.
|
inline |
Definition at line 106 of file TYPolygon.h.
|
virtual |
Calcule le segment d'intersection avec une autre surface.
pSurf | La surface dont on cherche l'intersection. |
seg | Le segment resultant de l'intersection. |
Reimplemented from TYSurfaceInterface.
Definition at line 255 of file TYPolygon.cpp.
|
virtual |
Calcule le point d'intersection avec un segment.
seg | Le segment dont on cherche l'intersection. |
pt | Le point resultant de l'intersection. |
Implements TYSurfaceInterface.
Definition at line 260 of file TYPolygon.cpp.
|
virtual |
|
virtual |
Test si le point se trouve a l'interieur de la surface, sur le meme plan.
pt | Le point pour lequel on effectue le test. |
Implements TYSurfaceInterface.
Definition at line 288 of file TYPolygon.cpp.
|
virtual |
Inverse la normale a la surface
Reimplemented from TYSurfaceInterface.
Definition at line 714 of file TYPolygon.cpp.
|
inline |
Get de l'attribut de convexite.
Definition at line 122 of file TYPolygon.h.
|
inline |
Teste si le point se trouve dans la boite du polygone.
Definition at line 126 of file TYPolygon.h.
|
inline |
Teste si, vu de dessus, le point se trouve dans la boite du polygone.
Definition at line 131 of file TYPolygon.h.
|
private |
|
private |
|
private |
bool TYPolygon::isValid | ( | ) | const |
Test si ce polygone est valide. Les points de ce polygone doivent appartenir au meme plan.
true
si le polygon est valide; false
sinon. Definition at line 412 of file TYPolygon.cpp.
|
virtual |
Calcule la normale a cette surface.
Implements TYSurfaceInterface.
Definition at line 226 of file TYPolygon.cpp.
bool TYPolygon::operator!= | ( | const TYPolygon & | other | ) | const |
Operateur !=.
Definition at line 93 of file TYPolygon.cpp.
bool TYPolygon::operator== | ( | const TYPolygon & | other | ) | const |
Operateur ==.
Definition at line 80 of file TYPolygon.cpp.
|
virtual |
Calcule le plan dans lequel cette surface est inscrit.
Implements TYSurfaceInterface.
Definition at line 231 of file TYPolygon.cpp.
|
inline |
Vide le tableau de points.
Definition at line 87 of file TYPolygon.h.
|
inline |
Set de l'attribut de convexite.
Definition at line 118 of file TYPolygon.h.
void TYPolygon::setPoints | ( | const TYTabPoint & | pts | ) |
Set/Get de la collection de points.
Definition at line 374 of file TYPolygon.cpp.
|
virtual |
Calcule l'aire de la surface totale.
Implements TYSurfaceInterface.
Definition at line 169 of file TYPolygon.cpp.
|
virtual |
Retourne une chaine de caractere donnant des informations sur cet objet (utile pour le debugage).
Reimplemented from TYElement.
Definition at line 120 of file TYPolygon.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 TYPolygon.cpp.
void TYPolygon::transform | ( | const OMatrix & | matrix | ) |
Transforme les points du polygone avec la matrice passee en parametre.
Definition at line 402 of file TYPolygon.cpp.
void TYPolygon::updateBox | ( | ) |
Definition at line 534 of file TYPolygon.cpp.
void TYPolygon::updateNormal | ( | ) |
Definition at line 509 of file TYPolygon.cpp.
|
private |
Definition at line 199 of file TYPolygon.h.
|
private |
Definition at line 197 of file TYPolygon.h.
|
private |
Definition at line 195 of file TYPolygon.h.
|
private |
Sommets.
Definition at line 193 of file TYPolygon.h.