/* * QGLViewerXML.cpp * $Id: QGLViewerXML.cpp,v 1.6 2002/11/13 14:09:28 gwetekam Exp $ * * Copyright (C) 2000, 2001 Michael Meissner * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * As a special exception to the GPL, the QGLViewer authors (Markus * Janich, Michael Meissner, Richard Guenther, Alexander Buck and Thomas * Woerner) give permission to link this program with Qt (non-)commercial * edition, and distribute the resulting executable, without including * the source code for the Qt (non-)commercial edition in the source * distribution. * */ /** documentation stuff @author Michael Meissner @version 0.0 //see cvs docu */ // QGLViewer ////////////// #include "QGLViewerXML.h" ///////////////////// // GENERIC HELPERS // ///////////////////// // Function : addNode // Purpose : Creates a new xml node with parent parent and member attribute as // specified in member (optional). The node is added to the parent node. // Comments : QDomElement QGLViewerXML::addNode(QDomElement& parent, const QString& member) /****************************************************************************/ { QDomElement domElem = parent.ownerDocument().createElement(QString()); if (!member.isNull()) domElem.setAttribute("member", member); parent.appendChild(domElem); return domElem; } // Function : queryNode // Purpose : Queries the node with member attribute as specified out of // the children of the parent node. // Comments : QDomElement QGLViewerXML::queryNode(const QDomElement& parent, const QString& member) /****************************************************************************/ { QDomNodeList domList = parent.childNodes(); for (int n=0; n