18 #include "Tympan/core/config.h"
67 if (TYMaillage::operator!=(other))
112 return "TYRectangularMaillage";
131 bool densiteXOk =
false;
132 bool densiteYOk =
false;
133 bool bOldDatas =
false;
140 QDomNodeList childs = domElement.childNodes();
141 for (
unsigned int i = 0; i < childs.length(); i++)
143 elemCur = childs.item(i).toElement();
154 compatibilityVector->push_back(pSpectre);
159 if (bOldDatas ==
true)
165 delete compatibilityVector;
177 QString fileName = QString(sFilePath.c_str());
178 int i = fileName.lastIndexOf(
'/');
179 QDir fileDirectory = QDir(fileName.mid(0, i));
180 if (!fileDirectory.exists())
182 fileDirectory.mkdir(fileName.mid(0, i));
185 if (!fileName.isEmpty())
187 if (!fileName.endsWith(
".xml"))
199 xmlManager.
createDoc(TY_PRODUCT_XMLTAG_, TY_PRODUCT_VERSION_);
202 if (xmlManager.
save(fileName) == 0)
213 QString fileName = QString(sFilePath.c_str());
215 if (fileName.isEmpty())
222 if (xmlManager.
load(fileName, elements))
224 if (elements.size() == 1)
227 if (strcmp(elt->
getClassName(),
"TYRectangularMaillage") == 0)
244 xmlManager.
createDoc(TY_PRODUCT_XMLTAG_, TY_PRODUCT_VERSION_);
249 return retString.toStdString();
258 if (xmlManager.
loadFromString(QString(sXMLString.c_str()), elements))
260 if (elements.size() == 1)
263 if (strcmp(elt->
getClassName(),
"TYRectangularMaillage") == 0)
285 unsigned long nbPtsX = 0, nbPtsY = 0;
306 for (
unsigned int iY = 0; iY < nbPtsY; iY++)
309 for (
unsigned int iX = 0; iX < nbPtsX; iX++)
312 OPoint3D pos = startPt + (vecX * iX) + (vecY * iY);
341 nbPtsX ? nbPtsX : nbPtsX++;
342 nbPtsY ? nbPtsY : nbPtsY++;
349 stepx = vecX * (1.0 / (double)nbPtsX);
350 stepy = vecY * (1.0 / (double)nbPtsY);
360 unsigned long longx = 0, longy = 0;
std::vector< LPTYSpectre > TYTabLPSpectre
Collection de TYSpectre.
std::vector< LPTYElement > LPTYElementArray
Representation graphique d'un maillage rectangulaire (fichier header)
TY_EXT_GRAPHIC_INST(TYRectangularMaillage)
TY_EXTENSION_INST(TYRectangularMaillage)
virtual const char * getClassName() const
double norme() const
Computes the length of this vector.
QString _name
Nom courant de l'element.
bool callFromXMLIfEqual(DOM_Element &domElement, int *pRetVal=NULL)
void setAllUses(void *allUses)
virtual void setIsGeometryModified(bool isModified)
virtual void clearResult()
bool addPointCalcul(LPTYPointCalcul pPtCalcul)
Ajoute un nouveau point de calcul.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual int fromXML(DOM_Element domElement)
TYMaillage & operator=(const TYMaillage &other)
Operateur =.
void remAllPointCalcul()
Suppression de tous les elements.
virtual DOM_Element toXML(DOM_Element &domElement)
QString generateName(const char *classname)
Retourne le nom de la classe associe a un nombre.
static TYNameManager * get()
Retourne l'instance singleton.
Classe de definition d'un point de calcul.C'est une classe derivee a TYPoint avec en plus un spectrep...
void setSpectre(const LPTYSpectre spectre)
Set du spectre resultat d'un calcul donne.
virtual DOM_Element toXML(DOM_Element &domElement)
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual double surface() const
Classe de definition d'un maillage rectangulaire.
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.
bool operator==(const TYRectangularMaillage &other) const
Operateur ==.
virtual void getDimensions(int &x, int &y) const
Return the dimensions in x and y.
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...
std::string toXMLString()
virtual void clearResult()
double _nbPointsX
Numbers of point in row.
virtual std::string toString() const
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)
TYRectangularMaillage & operator=(const TYRectangularMaillage &other)
Operateur =.
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.
int save(QString fileName)
int load(const QString &fileName, LPTYElementArray &eltCollection)
void createDoc(QString docName, QString version)
int addElement(TYElement *pElt)
int loadFromString(const QString &xmlString, LPTYElementArray &eltCollection)