Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYRectangularMaillage.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
16 /*
17  *
18  *
19  *
20  *
21  */
22 
23 #ifndef __TY_RECTANGULAR_MAILLAGE__
24 #define __TY_RECTANGULAR_MAILLAGE__
25 
27 #include "TYMaillage.h"
28 
39 {
43 
44  // Methodes
45 public:
52 
59 
65  virtual ~TYRectangularMaillage();
66 
69 
71  bool operator==(const TYRectangularMaillage& other) const;
72 
74  bool operator!=(const TYRectangularMaillage& other) const;
75 
84  virtual bool deepCopy(const TYElement* pOther, bool copyId = true, bool pUseCopyTag = false);
85 
86  virtual std::string toString() const;
87 
88  virtual DOM_Element toXML(DOM_Element& domElement);
89  virtual int fromXML(DOM_Element domElement);
90 
91  bool toXML(const std::string& sFilePath);
92 
93  bool fromXML(const std::string& sFilePath);
94 
95  std::string toXMLString();
96 
97  bool fromXMLString(const std::string& sXMLString);
98 
102  virtual void clearResult();
103 
111  virtual void make(LPTYRectangle pRect, double densiteX = TY_MAILLAGE_DEFAULT_DENSITE,
112  double densiteY = TY_MAILLAGE_DEFAULT_DENSITE);
113 
120  {
121  return _pRect;
122  }
123 
129  double getDensiteX() const
130  {
131  return _densiteX;
132  }
133 
139  double getDensiteY() const
140  {
141  return _densiteY;
142  }
143 
148  void setDensiteX(double densiteX)
149  {
150  _densiteX = densiteX;
151  if (densiteX != 0.0)
152  {
153  _distancePointsCalculX = std::round(100.0f / _densiteX) / 100.0f;
154  }
155  }
156 
161  void setDensiteY(double densiteY)
162  {
163  _densiteY = densiteY;
164  if (densiteY != 0.0)
165  {
166  _distancePointsCalculY = std::round(100.0f / _densiteY) / 100.0f;
167  }
168  }
169 
175  double getDistanceX() const
176  {
177  return _distancePointsCalculX;
178  }
179 
185  double getDistanceY() const
186  {
187  return _distancePointsCalculY;
188  }
189 
194  void getDimensionsAndSteps(unsigned long& x, unsigned long& y, OVector3D& stepx, OVector3D& stepy) const;
195 
202  {
203  return &_posLabel;
204  }
205 
212  virtual int getIndexPtCalcul(int x, int y) const;
213 
219  virtual void getDimensions(int& x, int& y) const;
220 
221  // Membres
222 protected:
224 
227 
229  double _densiteX;
230 
232  double _densiteY;
233 
236 
239 
241  double _nbPointsX;
242 };
243 
246 
249 
252 
254 typedef std::vector<LPTYRectangularMaillageGeoNode> TYTabRectangularMaillageGeoNode;
255 
256 #endif // __TY_RECTANGULAR_MAILLAGE__
QDomElement DOM_Element
Definition: QT2DOM.h:30
#define TY_EXT_GRAPHIC_DECL_ONLY(classname)
Definition: TYElement.h:430
#define OPROTODECL(classname)
Definition: TYElement.h:64
#define TY_EXTENSION_DECL_ONLY(classname)
Definition: TYElement.h:385
std::vector< LPTYRectangularMaillageGeoNode > TYTabRectangularMaillageGeoNode
Collection de noeuds geometriques de type TYRectangularMaillage.
SmartPtr< TYRectangularMaillageGeoNode > LPTYRectangularMaillageGeoNode
Smart Pointer sur TYRectangularMaillageGeoNode.
SmartPtr< TYRectangularMaillage > LPTYRectangularMaillage
Smart Pointer sur TYRectangularMaillage.
TYGeometryNode TYRectangularMaillageGeoNode
Noeud geometrique de type TYRectangularMaillage.
The 3D vector class.
Definition: 3d.h:298
Classe de definition d'un maillage.
Definition: TYMaillage.h:51
Classe de definition d'un maillage rectangulaire.
double _distancePointsCalculX
La distance entre 2 points de calcul consécutifs en X.
virtual DOM_Element toXML(DOM_Element &domElement)
bool fromXMLString(const std::string &sXMLString)
virtual int fromXML(DOM_Element domElement)
virtual ~TYRectangularMaillage()
Destructeur. Le destructeur de la classe TYRectangularMaillage.
double _distancePointsCalculY
La distance entre 2 points de calcul consécutifs en Y.
double getDensiteY() const
Retourne la densite de points de calcul en Y.
bool operator==(const TYRectangularMaillage &other) const
Operateur ==.
virtual void getDimensions(int &x, int &y) const
Return the dimensions in x and y.
LPTYRectangle getRectangle() const
Retourne le rectangle associe a ce maillage.
void getDimensionsAndSteps(unsigned long &x, unsigned long &y, OVector3D &stepx, OVector3D &stepy) const
Renvoie le nombre de lignes et de colonnes du maillage.En fonction de ses dimensions en 3D et de la d...
double getDistanceX() const
Retourne la distance en X entre 2 points de calcul.
double _nbPointsX
Numbers of point in row.
virtual std::string toString() const
TYPoint * getPosLabel()
Renvoie la position sur la maillage permettant l'affichage du label et de la legende.
void setDensiteY(double densiteY)
Fixe la densite de points de calcul en Y.
LPTYRectangle _pRect
Le rectangle associe a ce maillage.
bool operator!=(const TYRectangularMaillage &other) const
Operateur !=.
virtual int getIndexPtCalcul(int x, int y) const
Return the index.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
double getDensiteX() const
Retourne la densite de points de calcul en X.
TYRectangularMaillage & operator=(const TYRectangularMaillage &other)
Operateur =.
void setDensiteX(double densiteX)
Fixe la densite de points de calcul en X.
double _densiteX
La densite de points de calcul en X.
double _densiteY
La densite de points de calcul en Y.
virtual void make(LPTYRectangle pRect, double densiteX=TY_MAILLAGE_DEFAULT_DENSITE, double densiteY=TY_MAILLAGE_DEFAULT_DENSITE)
Rempli la structure de points de calcul a partir d'un rectangle et de densites de points.
TYRectangularMaillage()
Constructeur. Le constructeur de la classe TYRectangularMaillage.
double getDistanceY() const
Retourne la distance en Y entre 2 points de calcul.