Changeset - 121f7720db62
[Not reviewed]
default
1 4 0
Michael Guravage - 15 years ago 2010-06-15 14:17:41
michael.guravage@cwi.nl
Removed references to XMLWriteLeafSourceCode and XMLWriteReactionsCode.

--
user: Michael Guravage <michael.guravage@cwi.nl>
branch 'default'

changed src/ChangeLog
changed src/VirtualLeaf.pro
changed src/xmlwrite.cpp
changed src/xmlwrite.h
removed src/xmlwritecode.cpp
5 files changed with 5 insertions and 41 deletions:
0 comments (0 inline, 0 general)
src/ChangeLog
Show inline comments
 
2010-06-15    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* VirtualLeaf.pro: Removed xmlwritecode.cpp from SOURCES list.
 

	
 
	* xmlwrite.cpp (XMLSave): Removed references to XMLWriteLeafSourceCode and XMLWriteReactionsCode.
 
	* xmlwrite.h (XMLIO): Ditto!
 

	
 
	* mesh.cpp (findNextBoundaryNode): Initialize Node *next_boundary_node = NULL;
 

	
 
	* xmlwrite.cpp (XMLReadSimtime): Removed unused variable cur
 
	(XMLReadWalls): viz_flux need not be declared twice; default value of 0.0.
 
	(XMLReadCells): Removed unused count variable.
 
	(XMLReadSimtime): Removed unused cur variable.
 
	(XMLRead): Removed unused v_str variable.
 

	
 
	* simitembase.cpp (userMove): Use assignment merely to obviate compilation warning.
 
	(SimItemBase) Ditto.
 

	
 
	* qcanvasarrow.h (QGraphicsLineItem): Use assignment merely to obviate compilation warning.
 

	
 
	* output.cpp (OpenWriteFile): Removed unused par variable.
 

	
 
	* nodeitem.cpp (paint): Use assignment merely to obviate compilation warning.
 

	
 
	* forwardeuler.cpp (odeint): Use assignment merely to obviate compilation warning.
 

	
 
	* cell.cpp (DivideOverGivenLine): Use assignment merely to obviate compilation warning.
 

	
 
	* canvas.cpp (FigureEditor): Use assignments merely to obviate compilation errors.
 
	(mousePressEvent): Removed unused item variable.
 

	
src/VirtualLeaf.pro
Show inline comments
 
@@ -142,49 +142,48 @@ SOURCES += \
 
 mainbase.cpp \
 
 matrix.cpp \
 
 mesh.cpp \
 
 miscq.cpp \
 
 modelcatalogue.cpp \
 
 Neighbor.cpp \
 
 node.cpp \
 
 nodeitem.cpp \
 
 nodeset.cpp \
 
 OptionFileDialog.cpp \
 
 output.cpp \
 
 parameter.cpp \
 
 pardialog.cpp \
 
 parse.cpp \
 
 random.cpp \
 
 rungekutta.cpp \
 
 simitembase.cpp \
 
 transporterdialog.cpp \
 
 UniqueMessage.cpp \
 
 vector.cpp \
 
 wallbase.cpp \
 
 wall.cpp \
 
 wallitem.cpp \
 
 warning.cpp \
 
 xmlwritecode.cpp \
 
 xmlwrite.cpp \
 
 $$MAINSRC
 

	
 
contains( TARGET, leaf_fleming ) {
 
 DEFINES += FLEMING	
 
}
 

	
 
contains(GRAPHICS, qwt) {
 
 #macx:LIBS += -L$$QWTDIR/lib -lqwt
 
 #win32:LIBS += -L$$QWTDIR/lib -lqwt5
 
 #LIBS += -L$$QWTDIR/lib -lqwt
 
 INCLUDEPATH += $$QWTDIR/include
 
 DEFINES += HAVE_QWT
 
 HEADERS += data_plot.h
 
 SOURCES += data_plot.cpp
 
}
 

	
 
contains( GRAPHICS, qt ) {
 
 message( "Building Qt executable" )
 
 QMAKE_CXXFLAGS += -DQTGRAPHICS # -fpermissive
 
}
 

	
 
contains( GRAPHICS, xfig ) {
 
 message("Building Xfig executable (background runnable).")
src/xmlwrite.cpp
Show inline comments
 
@@ -750,50 +750,48 @@ void Mesh::XMLSave(const char *docname, 
 
	 * It returns xmlAttrPtr, which isn't used here.
 
	 */
 
	xmlNewProp(root_node, BAD_CAST "name", BAD_CAST docname);
 
	
 
	time_t t;
 
	std::time(&t);
 
	// asctime_r(localtime(&t),tstring); //Doesn't work for MinGW
 
	char *tstring = strdup(asctime(localtime(&t))); // but this does
 
	// replace "end of line character by '\0'
 
	char *eol=strchr(tstring,'\n');
 
	if (eol!=NULL)
 
		*eol='\0';
 
	
 
	xmlNewProp(root_node, BAD_CAST "date", BAD_CAST tstring);
 
	free(tstring);
 
	
 
	
 
	QString simtime = QString("%1").arg(time);
 
	xmlNewProp(root_node, BAD_CAST "simtime", BAD_CAST simtime.toStdString().c_str()); 
 
	/*
 
	 * Creates a DTD declaration. Isn't mandatory. 
 
	 */
 
	//dtd = xmlCreateIntSubset(doc, BAD_CAST "root", NULL, BAD_CAST "tree2.dtd");
 
	par.XMLAdd(root_node);
 
	XMLIO::XMLWriteLeafSourceCode(root_node);
 
	XMLIO::XMLWriteReactionsCode(root_node);
 
	
 
	xmlNodePtr xmlnodes = xmlNewChild(root_node, NULL, BAD_CAST "nodes",NULL);
 
	{ ostringstream text;
 
		text << NNodes();
 
		xmlNewProp(xmlnodes, BAD_CAST "n", BAD_CAST text.str().c_str());
 
	}
 
	
 
	{ ostringstream text;
 
		text << Node::target_length;
 
		xmlNewProp(xmlnodes, BAD_CAST "target_length", BAD_CAST text.str().c_str());
 
	}
 
	
 
	
 
	
 
	for (vector<Node *>::const_iterator i=nodes.begin();
 
		 i!=nodes.end();
 
		 i++) {
 
		(*i)->XMLAdd(xmlnodes) ;
 
	}
 
	
 
	
 
	/* 
 
	 * xmlNewChild() creates a new node, which is "attached" as child node
 
	 * of root_node node. 
src/xmlwrite.h
Show inline comments
 
@@ -11,50 +11,48 @@
 
 *
 
 *  The Virtual Leaf 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 the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 

	
 
#ifndef _XML_WRITE_H_
 
#define _XML_WRITE_H_
 

	
 
#include <vector>
 
#include <libxml/tree.h>
 
#include <cstring>
 

	
 
namespace XMLIO {
 

	
 
	std::vector <double> XMLReadValArray(xmlNode *cur);
 
  void XMLWriteLeafSourceCode(xmlNode *parent);
 
  void XMLWriteReactionsCode(xmlNode *parent);
 
  template<class For, class E> long list_index (For beg, For end, E *elem) {
 
    
 
    long n = 0;
 
    for (For i=beg;
 
	 i!=end;
 
	 i++) {
 
      if (*i == elem) {
 
	return n;
 
      }
 
      n++;
 
    }
 
    return -1;
 
  }
 
 	
 
}
 

	
 

	
 
static const char * bool_names[2] = {"true","false"};
 

	
 
inline const char *bool_name(bool q) { return q ? bool_names[0] : bool_names[1]; }
 

	
 
inline bool strtobool(const char *str) { 
 
  if (!strcmp(str, "true")) {
 
    return true;
src/xmlwritecode.cpp
Show inline comments
 
deleted file
0 comments (0 inline, 0 general)