18 #include "Tympan/core/config.h"
61 if (TYMaillage::operator!=(other))
100 return "TYLinearMaillage";
111 for (
unsigned int i = 0; i <
_ptsCalcul.size(); i++)
113 _ptsCalcul[i]->getSpectre()->toXML(domNewElem);
123 bool densiteOk =
false;
124 bool bOldDatas =
false;
131 QDomNodeList childs = domElement.childNodes();
132 for (
unsigned int i = 0; i < childs.length(); i++)
134 elemCur = childs.item(i).toElement();
143 compatibilityVector->push_back(pSpectre);
148 if (bOldDatas ==
true)
154 delete compatibilityVector;
166 QString fileName = QString(sFilePath.c_str());
167 int i = fileName.lastIndexOf(
'/');
168 QDir fileDirectory = QDir(fileName.mid(0, i));
169 if (!fileDirectory.exists())
171 fileDirectory.mkdir(fileName.mid(0, i));
174 if (!fileName.isEmpty())
176 if (!fileName.endsWith(
".xml"))
188 xmlManager.
createDoc(TY_PRODUCT_XMLTAG_, TY_PRODUCT_VERSION_);
191 if (xmlManager.
save(fileName) == 0)
202 QString fileName = QString(sFilePath.c_str());
204 if (fileName.isEmpty())
211 if (xmlManager.
load(fileName, elements))
213 if (elements.size() == 1)
216 if (strcmp(elt->
getClassName(),
"TYLinearMaillage") == 0)
232 xmlManager.
createDoc(TY_PRODUCT_XMLTAG_, TY_PRODUCT_VERSION_);
237 return retString.toStdString();
246 if (xmlManager.
loadFromString(QString(sXMLString.c_str()), elements))
248 if (elements.size() == 1)
251 if (strcmp(elt->
getClassName(),
"TYLinearMaillage") == 0)
282 int nbPts = (int)(densite * vec.
norme());
285 vec = vec * (1.0 / (double)nbPts);
291 for (
int i = 0; i < nbPts; i++)
std::vector< LPTYSpectre > TYTabLPSpectre
Collection de TYSpectre.
std::vector< LPTYElement > LPTYElementArray
Representation graphique d'un maillage lineaire (fichier header)
TY_EXTENSION_INST(TYLinearMaillage)
TY_EXT_GRAPHIC_INST(TYLinearMaillage)
virtual const char * getClassName() const
OPoint3D _ptA
Point A of the segment.
OPoint3D _ptB
Point B of the segment.
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)
Classe de definition d'un maillage lineaire.
bool operator!=(const TYLinearMaillage &other) const
Operateur !=.
virtual void clearResult()
LPTYSegment _pSeg
Le segment associe a ce maillage.
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
TYLinearMaillage & operator=(const TYLinearMaillage &other)
Operateur =.
virtual void make(LPTYSegment pSeg, double densite=TY_MAILLAGE_DEFAULT_DENSITE)
Rempli la structure de points de calcul a partir d'un segment et d'une densite de points.
virtual DOM_Element toXML(DOM_Element &domElement)
bool fromXMLString(const std::string &sXMLString)
double _densite
La densite de points de calcul.
virtual ~TYLinearMaillage()
Destructeur. Destructeur de la classe TYLinearMaillage.
bool operator==(const TYLinearMaillage &other) const
Operateur ==.
TYLinearMaillage()
Constructeur. Constructeur de la classe TYLinearMaillage.
virtual std::string toString() const
std::string toXMLString()
virtual int fromXML(DOM_Element domElement)
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)
TYTabLPPointCalcul _ptsCalcul
Liste des points de calcul.
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...
virtual bool deepCopy(const TYElement *pOther, bool copyId=true, bool pUseCopyTag=false)
virtual DOM_Element toXML(DOM_Element &domElement)
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)