2 // C++ : La clase principale de Hexa
4 // Copyright (C) 2009-2012 CEA/DEN, EDF R&D
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 #include "HexDocument.hxx"
29 // ======================================================== Constructeur
32 setlocale (LC_NUMERIC, "C");
34 // ======================================================== Destructeur
38 int nbre = liste_documents.size();
39 for (int nd=0 ; nd<nbre ; nd++)
40 delete liste_documents [nd];
43 // ======================================================== countDocument
44 int Hex::countDocument ()
46 return liste_documents.size();
48 // ======================================================== getDocument
49 Document* Hex::getDocument (int nro)
51 if (nro<0 || nro>=(int)liste_documents.size())
54 return liste_documents [nro];
56 // ======================================================== removeDocument
57 void Hex::removeDocument (Document* doc)
59 int nbre = liste_documents.size();
60 for (int nd=0 ; nd<nbre ; nd++)
62 if (doc == liste_documents [nd])
64 liste_documents.erase (liste_documents.begin()+nd);
69 // Pas trouve dans la liste. On detruit quand meme
72 // ======================================================== addDocument
73 Document* Hex::addDocument (cpchar nomdoc)
75 Document* doc = new Document (nomdoc);
76 liste_documents.push_back (doc);
79 // ======================================================== loadDocument
80 Document* Hex::loadDocument (const char* filename)
82 Document* doc = addDocument ("xxxx");
83 doc->loadXml (filename);