Changeset - caa535c40937
[Not reviewed]
default
1 34 4
Michael Guravage - 15 years ago 2010-06-25 16:50:35
michael.guravage@cwi.nl
Made changes to conform to the version submitted with the Plant Physiology paper. See the individual ChangeLogs for details.

--
user: Michael Guravage <michael.guravage@cwi.nl>
branch 'default'
added lib/libiconv/bin/iconv.exe
added lib/libiconv/bin/libcharset-1.dll
added lib/libiconv/bin/libiconv-2.dll
added src/gpl3.txt
changed INSTALL
changed src/ChangeLog
changed src/TutorialCode/Tutorial0/ChangeLog
changed src/TutorialCode/Tutorial0/tutorial0.pro
changed src/TutorialCode/Tutorial1A/ChangeLog
changed src/TutorialCode/Tutorial1A/tutorial1A.pro
changed src/TutorialCode/Tutorial1B/ChangeLog
changed src/TutorialCode/Tutorial1B/tutorial1B.pro
changed src/TutorialCode/Tutorial1C/ChangeLog
changed src/TutorialCode/Tutorial1C/tutorial1C.pro
changed src/TutorialCode/Tutorial1D/ChangeLog
changed src/TutorialCode/Tutorial1D/tutorial1D.pro
changed src/TutorialCode/Tutorial2/ChangeLog
changed src/TutorialCode/Tutorial2/tutorial2.pro
changed src/TutorialCode/Tutorial3/ChangeLog
changed src/TutorialCode/Tutorial3/tutorial3.pro
changed src/TutorialCode/Tutorial4/ChangeLog
changed src/TutorialCode/Tutorial4/tutorial4.pro
changed src/TutorialCode/Tutorial5/ChangeLog
changed src/TutorialCode/Tutorial5/tutorial5.pro
changed src/VirtualLeaf-install.nsi
changed src/VirtualLeaf.pro
changed src/build_models/ChangeLog
changed src/build_models/plugin_auxingrowth.pro
changed src/build_models/plugin_meinhardt.pro
changed src/build_models/plugin_test.pro
changed src/canvas.cpp
changed src/libplugin.pro
changed src/output.cpp
changed src/output.h
changed src/parameter.cpp
changed src/parameter.h
changed src/perl/ChangeLog
changed src/perl/make_parameter_source.pl
removed doc/gpl3.txt
38 files changed with 181 insertions and 92 deletions:
0 comments (0 inline, 0 general)
INSTALL
Show inline comments
 
Basic Installation
 
==================
 

	
 
Linux::
 

	
 
 qmake -makefile libplugin.pro
 
 rm -f make.out
 
 make clean all 2>&1 | tee make.out
 
 cd build_models
 
 rm -f make.out
 
 for i in *.pro; do echo $i; qmake -makefile $i; make clean all 2>&1 | tee -a make.out; done
 
 cd -
 
 qmake -makefile VirtualLeaf.pro 
 
 make clean all 2>&1 | tee -a make.out
 

	
 
MacOSX::
 

	
 
 tbw
 

	
 
Windows::
 

	
 
 tbw
 

	
 
You will find platform specific instructions how to compile and
 
install the VirtualLeaf in installation.pdf in the doc directory.
lib/libiconv/bin/iconv.exe
Show inline comments
 
new file 100755
 
binary diff not shown
lib/libiconv/bin/libcharset-1.dll
Show inline comments
 
new file 100755
 
binary diff not shown
lib/libiconv/bin/libiconv-2.dll
Show inline comments
 
new file 100755
 
binary diff not shown
src/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* gpl3.txt: Moved gpl3.txt from doc to src directory.
 

	
 
	* VirtualLeaf.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
	* libplugin.pro: Ditto.
 

	
 
	* parameter.cpp: Result of adding datadir changes to make_parameter_source.pl.
 
	* parameter.h: Ditto.
 

	
 
	* output.h: Declared new function (AppendHomeDirIfPathRelative).
 

	
 
	* output.cpp (AppendHomeDirIfPathRelative): Added new function.
 

	
 
	* canvas.cpp (gpl): Moving gpl3.txt from doc to src obviates the need to docDir.cd("../doc").
 

	
 
	* VirtualLeaf-install.nsi: Add missing libiconv/bin directory.
 
	Copy libiconv-2.dll, libxml2.dll and zlib1.dll from relative paths.
 

	
 
	* VirtualLeaf.pro: copy gpl3.txt as part of QMAKE_POST_LINK.
 

	
 
2010-06-24    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* libplugin.pro: Use correct library path.
 
	* VirtualLeaf.pro: Ditto.
 

	
 
	* VirtualLeaf.cpp (DrawCell): Iterate over NChem to construct info_string.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* simitembase.cpp: Removed NULL assignments to unused variables.
 
	* VirtualLeaf.cpp: Ditto.
 
	* apoplastitem.cpp: Ditto.
 
	* canvas.cpp: Ditto.
 
	* cell.cpp: Ditto.
 
	* cellbase.h: Ditto.
 
	* forwardeuler.cpp: Ditto.
 
	* mainbase.h: Ditto.
 
	* nodeitem.cpp: Ditto.
 
	* qcanvasarrow.h: Ditto.
 
	* simitembase.cpp: Ditto.
 

	
 

	
 
	* Makefile (clean): Add -f Makefile argument to each make invocation.
 

	
 
	* VirtualLeaf-install.nsi: New gpl license text.
 

	
 
	* VirtualLeaf.pro: Disabled console mode.
 

	
 
	* mesh.cpp (Clear): Added parentheses to qDebug statments.
 
	(TestIllegalWalls): Replaced qDebug().
 

	
 
	* canvas.cpp (mouseReleaseEvent): Replaced qDebug() with cerr since qDebug complains about *node_set.
 

	
 
	* wall.cpp (CorrectWall): Rplaced gDebug() with cerr in transform call and when printing *this.
 

	
 
2010-06-22    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* Makefile (tutorials): Add tutorials target.
 

	
 
2010-06-21    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* parameter.cpp: Added particular reassignment of datadir.
 

	
 
	* canvas.cpp (gpl): Added GPL3 License text. Display detail text only if the source text file exists.
 

	
 
2010-06-18    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* canvas.cpp (gpl): Added gpl slot to display GPL license.
src/TutorialCode/Tutorial0/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial0.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial0.pro: Corrected windows library paths.
 

	
src/TutorialCode/Tutorial0/tutorial0.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial0
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial1A/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial1A.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial1A.pro: corrected windows library path.
 

	
src/TutorialCode/Tutorial1A/tutorial1A.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial1A
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial1B/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial1B.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial1B.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial1B/tutorial1B.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial1B
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial1C/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial1C.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial1C.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial1C/tutorial1C.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial1C
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial1D/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial1D.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial1D.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial1D/tutorial1D.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial1D
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial2/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial2.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial2.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial2/tutorial2.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial2
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial3/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial3.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial3.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial3/tutorial3.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial3
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial4/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial4.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial4.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial4/tutorial4.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial4
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial5/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial5.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial5.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial5/tutorial5.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 

	
 
TARGET = tutorial5
 
VLEAFHOME = ../../..
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = $${VLEAFHOME}/bin
 
LIBDIR = $${VLEAFHOME}/lib
 
INCDIR = $${VLEAFHOME}/src
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
HEADERS = $${TARGET}.h 
 
INCLUDEPATH += $${INCDIR}	
 

	
 
QMAKE_CXXFLAGS += -fexceptions #-I$${INCDIR}
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QT += qt3support
 
SOURCES = $${TARGET}.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/VirtualLeaf-install.nsi
Show inline comments
 
@@ -79,93 +79,94 @@
 

	
 
# License page
 
!insertmacro MUI_PAGE_LICENSE "..\doc\gpl3.txt"
 

	
 
# Components page
 
!insertmacro MUI_PAGE_COMPONENTS
 

	
 
# Directory page
 
!insertmacro MUI_PAGE_DIRECTORY
 

	
 
# Instfiles page
 
!insertmacro MUI_PAGE_INSTFILES
 

	
 
# Finish page
 
!insertmacro MUI_PAGE_FINISH
 

	
 
# Uninstaller pages
 
!insertmacro MUI_UNPAGE_CONFIRM
 
!insertmacro MUI_UNPAGE_INSTFILES
 
!insertmacro MUI_UNPAGE_FINISH
 

	
 
# Language files
 
!insertmacro MUI_LANGUAGE "English"
 

	
 
# MUI end ------
 

	
 
# set the name of the installer
 
outfile "VirtualLeaf-install.exe"
 
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
 
ShowInstDetails show
 
ShowUnInstDetails show
 
 
 
# define the directory to install to
 
installDir C:\VirtualLeaf
 

	
 
# Request application privileges
 
RequestExecutionLevel user
 

	
 
section "Virtual Leaf executable"
 
  #sectionIn RO
 
  # define the output path for the Virtual Leaf executable
 
  setOutPath $INSTDIR
 
  writeUninstaller $INSTDIR\uninstaller.exe
 
  file ..\bin\VirtualLeaf.exe
 

	
 
  # Required DLLs
 
  setOutPath $INSTDIR\bin
 

	
 
  file C:\libiconv\bin\libiconv-2.dll
 
  file C:\libxml2\lib\libxml2.dll
 
  file C:\libz\bin\zlib1.dll
 
  file ..\lib\libiconv\bin\libiconv-2.dll
 
  file ..\lib\libxml2\lib\libxml2.dll
 
  file ..\lib\libz\bin\zlib1.dll
 

	
 
  # Is the pegging of these DLLs to a specific QT version a problem?
 
  file C:\Qt\2010.02.1\mingw\bin\mingwm10.dll
 
  file C:\Qt\2010.02.1\mingw\bin\libgcc_s_dw2-1.dll
 

	
 
  file C:\Qt\2010.02.1\qt\bin\Qt3Support4.dll
 
  file C:\Qt\2010.02.1\qt\bin\QtCore4.dll
 
  file C:\Qt\2010.02.1\qt\bin\QtGui4.dll
 
  file C:\Qt\2010.02.1\qt\bin\QtNetwork4.dll
 
  file C:\Qt\2010.02.1\qt\bin\QtSql4.dll
 
  file C:\Qt\2010.02.1\qt\bin\QtXml4.dll
 

	
 
  # Prepend the Virtual Leaf bin directory to the installers PATH
 
  ${EnvVarUpdate} $0 "PATH" "P" "HKCU" "$INSTDIR\bin"  
 
sectionEnd
 
 
 
section "Virtual Leaf plugins"
 
  # define the output path for the Virtual Leaf models
 
  setOutPath $INSTDIR\models
 
  file ..\bin\models\*
 
sectionEnd
 

	
 
section "Virtual Leaf data"
 
  # define the output path for the Virtual Leaf models
 
  setOutPath $INSTDIR\leaves
 
  file ..\data\leaves\*
 
sectionEnd
 

	
 
# create a section to define what the uninstaller does.
 
# the section will always be named "Uninstall"
 
section "Uninstall"
 

	
 
  # Always delete uninstaller first
 
  delete $INSTDIR\uninstaller.exe
 
 
 
  # Now delete installed file
 
  !insertmacro RemoveFilesAndSubDirs "$INSTDIR"
 

	
 
  # Last but not least - delete the path  
 
  ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\bin"
 
sectionEnd
 

	
 
# finis
src/VirtualLeaf.pro
Show inline comments
 
#
 
#  $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += qt
 

	
 
QMAKE_CXXFLAGS += -fexceptions
 
QMAKE_CXXFLAGS += -Wall
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 

	
 
#REACTIONS = reactions_auxin_growth.h 
 
#REACTIONS = reactions_meinhardt.h
 
#REACTIONS = reactions_pce_growth.h
 
DEFINES += QTGRAPHICS
 
DEFINES += REACTIONS_HEADER=$${REACTIONS}
 
DEFINES += REACTIONS_HEADER_STRING=\"$${REACTIONS}\"
 
DEFINES += FLEMING
 

	
 
BINDIR = ../bin
 
LIBDIR = ../lib
 
DESTDIR = $$BINDIR
 
TARGET = VirtualLeaf
 
TEMPLATE = app
 
PARTMPL = $${TARGET}par.tmpl
 
MAINSRC = $${TARGET}.cpp
 
QT -= network sql xml
 
QT += qt3support
 

	
 
!win32 {
 
 GRAPHICS = qt #qwt
 
}
 

	
 
win32 {
 
 CONFIG -= console
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 GRAPHICS = qt 
 
 RC_FILE = VirtualLeaf.rc
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 
 LIBS += -L$${LIBXML2DIR}\lib -lxml2 -L$${LIBICONVDIR}\lib -L$${LIBZDIR}\lib  -lz -lm -lwsock32 -liconv
 
}
 

	
 

	
 
macx:release {
 
 LIBS+= -dead_strip
 
}
 

	
 
unix {
 
 CC = /usr/bin/gcc 
 
 QWTDIR = /ufs/guravage/opt/qwt-5.2.1-svn
 
 QMAKE_LIBDIR += $$QWTDIR/lib 
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
@@ -154,67 +156,68 @@ SOURCES += \
 

	
 
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).")
 
 QMAKE_CXXFLAGS += -DXFIGGRAPHICS
 
}
 

	
 
contains( GRAPHICS, x11 ) {
 
 !unix {
 
  error("X11 graphics only available on Unix systems.")
 
 }
 
 message("Building X11 executable")
 
 SOURCES += x11graph.cpp
 
 HEADERS += x11graph.h
 
 QMAKE_CXXFLAGS += -DX11GRAPHICS
 
 CONFIG -= qt
 
 CONFIG += x11
 
 unix:LIBS += -lpng
 
}
 

	
 
#contains( GRAPHICS, qwt ) {
 
# 	QMAKE_POST_LINK = "install_name_tool -change libqwt.5.dylib $$QWTDIR/lib/libqwt.dylib $${TARGET}.app/Contents/MacOS/$${TARGET}; \
 
#}
 

	
 
# MACOSX packaging
 
macx {
 
ICON = leaficon.icns
 
QMAKE_POST_LINK = "\
 
	#install_name_tool -change libqwt.5.dylib $$QWTDIR/lib/libqwt.dylib $${TARGET}.app/Contents/MacOS/$${TARGET}; \
 
	cp leaficon.icns $${DESTDIR}/$${TARGET}.app; \
 
	cp gpl3.txt $${DESTDIR}/$${TARGET}.app/Contents/MacOS/.                                    ; \
 
	mkdir $${DESTDIR}/$${TARGET}.app/Contents/Frameworks; \
 
	cp -R /Library/Frameworks/QtCore.framework $${DESTDIR}/$${TARGET}.app/Contents/Frameworks; \
 
	cp -R /Library/Frameworks/QtGui.framework $${DESTDIR}/$${TARGET}.app/Contents/Frameworks; \
 
	cp -R /Library/Frameworks/Qt3Support.framework $${DESTDIR}/$${TARGET}.app/Contents/Frameworks; \
 
	#cp /usr/local/qwt/lib/libqwt.dylib $${DESTDIR}/$${TARGET}.app/Contents/Frameworks; \
 
	#install_name_tool -id @executable_path/../Frameworks/libqwt.dylib $${DESTDIR}/$${TARGET}.app/Contents/Frameworks/libqwt.dylib; \
 
	install_name_tool -change /usr/local/qwt/lib/libqwt.dylib @executable_path/../Frameworks/libqwt.dylib $${DESTDIR}/$${TARGET}.app/Contents/MacOS/$${TARGET};\
 
	install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/Current/QtCore $${DESTDIR}/$${TARGET}.app/Contents/Frameworks/QtCore.framework/Versions/4.0/QtCore; \
 
	install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/Current/QtGui $${DESTDIR}/$${TARGET}.app/Contents/Frameworks/QtGui.framework/Versions/4.0/QtGui; \
 
	install_name_tool -id @executable_path/../Frameworks/Qt3Support.framework/Versions/Current/Qt3Support $${DESTDIR}/$${TARGET}.app/Contents/Frameworks/Qt3Support.framework/Versions/4.0/Qt3Support; \
 
	install_name_tool -change Frameworks/QtCore.framework/Versions/Current/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore $${DESTDIR}/$${TARGET}.app/Contents/MacOS/$${TARGET}; \
 
	install_name_tool -change Frameworks/QtGui.framework/Versions/Current/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui $${DESTDIR}/$${TARGET}.app/Contents/MacOS/$${TARGET}; \
 
	install_name_tool -change Frameworks/Qt3Support.framework/Versions/Current/Qt3Support @executable_path/../Frameworks/Qt3Support.framework/Versions/4.0/Qt3Support $${DESTDIR}/$${TARGET}.app/Contents/MacOS/$${TARGET}; \
 
	install_name_tool -change Frameworks/QtCore.framework/Versions/Current/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore $${DESTDIR}/$${TARGET}.app/Contents/Frameworks/Qt3Support.framework/Versions/4.0/Qt3Support; \
 
	install_name_tool -change Frameworks/QtGui.framework/Versions/Current/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/4.0/QtGui $${DESTDIR}/$${TARGET}.app/Contents/Frameworks/Qt3Support.framework/Versions/4.0/Qt3Support; \
 
	install_name_tool -change Frameworks/QtCore.framework/Versions/Current/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore $${DESTDIR}/$${TARGET}.app/Contents/Frameworks/Qt3Support.framework/Versions/4.0/Qt3Support; "
 
}
 

	
 
# finis
src/build_models/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* plugin_auxingrowth.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 
	* plugin_test.pro: Ditto.
 
	* plugin_meinhardt.pro: Ditto.
 

	
 

	
 
2010-06-24    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* plugin_auxingrowth.pro: Use correct library path.
 
	* plugin_meinhardt.pro: Ditto.
 
	* plugin_test.pro: Ditto.
 

	
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* auxingrowthplugin.cpp: Removed NULL assignments to unused variables.
 
	* meinhardtplugin.cpp: Ditto.
 
	* testplugin.cpp: Ditto.
 

	
 

	
 
2010-06-22    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* Makefile (clean): Add windows equivalent of UNIX touch.
 

	
 

	
 
2010-06-18    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* plugin_auxingrowth.pro: Changed default LIBXML2DIR, LIBICONVDIR and LIBZDIR to corresponding distribution lib directories.
 
	* plugin_meinhardt.pro: Ditto.
 
	* plugin_test.pro: Ditto.
 

	
 
	* Makefile (clean): add if stmt not to `touch` on windows.
 

	
 

	
 
2010-06-15    <guravage@caterpie.sen.cwi.nl>
 

	
 

	
 
	* testplugin.cpp (CelltoCellTransport) Use NULL assignment merely to obviate compilation warnings.
 
	(WallDynamics): Ditto.
 
	(CellDynamics): Ditto.
 
	(OnDivide): Ditto.
 

	
 
	* meinhardtplugin.cpp (OnDivide): Use NULL assignment merely to obviate compilation warnings.
 
	* (WallDynamics): Ditto.
 

	
 
	* auxingrowthplugin.cpp (OnDivide): Use NULL assignment merely to obviate compilation warnings.
 

	
 
2010-06-03    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* Makefile: Added top-level Makefile.
 

	
 
2010-05-10    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* plugin_test.pro: Added -fPIC option to QMAKE_CXXFLAGS.
src/build_models/plugin_auxingrowth.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = ../../bin
 
LIBDIR = ../../lib
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
TARGET = auxingrowth
 
HEADERS = ../simplugin.h $${TARGET}plugin.h  
 
QMAKE_CXXFLAGS += -fexceptions -I..
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 

	
 
QT += qt3support
 
SOURCES = $${TARGET}plugin.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -Llib -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 
}
 

	
 
# finis
src/build_models/plugin_meinhardt.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = ../../bin
 
LIBDIR = ../../lib
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
TARGET = meinhardt
 
HEADERS = ../simplugin.h $${TARGET}plugin.h  
 
QMAKE_CXXFLAGS += -fexceptions -I..
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 

	
 
QT += qt3support
 
SOURCES = $${TARGET}plugin.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -Llib -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 
}
 

	
 
# finis
 

	
src/build_models/plugin_test.pro
Show inline comments
 
#
 
# $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = ../../bin
 
LIBDIR = ../../lib
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
TARGET = test
 
HEADERS = ../simplugin.h $${TARGET}plugin.h  
 
QMAKE_CXXFLAGS += -fexceptions -I..
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 

	
 
QT += qt3support
 
SOURCES = $${TARGET}plugin.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
 
 LIBZDIR = $${LIBDIR}\libz
 
 LIBS += -L$${LIBDIR} -Llib -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finis
src/canvas.cpp
Show inline comments
 
@@ -909,97 +909,96 @@ void Main::readStateXML()
 
  QString fileName;
 
  if ( fd->exec() == QDialog::Accepted ) {
 

	
 
    fileName = fd->selectedFile();
 
    if (working_dir) {
 
      delete working_dir;
 
    }
 
    working_dir = fd->dir();
 

	
 
    if (readStateXML((const char *)fileName,fd->readGeometryP(), fd->readParametersP()) )
 
      return readStateXML(); // user can try again
 
  }
 
}
 

	
 

	
 
void Main::clear()
 
{
 
  editor->clear();
 
}
 

	
 
void Main::about()
 
{
 
  static QMessageBox* about = new QMessageBox
 
    ( "VirtualLeaf V1.0",
 
      "<h3>VirtualLeaf V1.0</h3>"
 
      "<p>"
 
      "An Open Source framework for cell-based modeling of plant tissue growth and development <br>"
 
      "(c) 2005-2008, Roeland Merks <i>et al.</i><br>"
 
      "    <a href=\"http://www.psb.vib-ugent.be\">VIB Department Plant Systems Biology</a>, "
 
      "Ghent, Belgium <br>"
 
      "(c) 2008-2010, <a href=\"http://www.cwi.nl/~merks\">Roeland Merks <i>et al.</i></a> <br>"
 
      "    <a href=\"http://www.cwi.nl\">Centrum Wiskunde & Informatica</a> and <a href=\"http://www.ncsb.nl\">Netherlands Consortium for Systems Biology</a>, Amsterdam, Netherlands <br>"
 
"<br>VirtualLeaf 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 3 of the License, or (at your option) any later version.<br>"
 
      "<br>If you use this code for your projects, please cite our paper:"
 
"<br>Merks, Guravage, Inze, and Beemster. An Open Source framework for cell-based modeling of plant tissue growth and development. <i>Plant Physiology,</i> submitted.<br> . <br>"
 
      "<br>Please share your model plugins and extensions at <a href=\"http://virtualleaf.googlecode.com\">http://virtualleaf.googlecode.com</a>.", 
 
      QMessageBox::Information, 1, 0, 0, this, 0, FALSE );
 
  about->setButtonText( 1, "Dismiss" );
 
  about->show();
 
}
 

	
 

	
 
void Main::gpl()
 
{
 
  static QMessageBox* gpl = new QMessageBox ( "GPL License", "", 
 
      QMessageBox::Information, 1, 0, 0, this, 0, FALSE );
 

	
 
  QDir docDir(QApplication::applicationDirPath());
 
  docDir.cd("../doc");
 
  QString path = docDir.filePath("gpl3.txt");
 

	
 
  std::ifstream file(path.toStdString().c_str());
 
  std::string str;
 

	
 
  if (file) {
 
    file.seekg(0, std::ios::end);   
 
    str.reserve(file.tellg());
 
    file.seekg(0, std::ios::beg);
 

	
 
    str.assign((std::istreambuf_iterator<char>(file)),
 
	       std::istreambuf_iterator<char>());
 

	
 
    gpl->setDetailedText(QString(str.c_str()));
 
  }
 

	
 
  gpl->setText(QString( "<h3>GNU GENERAL PUBLIC LICENSE</h3>"
 
			"<p>Version 3, 29 June 2007</p>"
 
			"<p>Copyright &copy; 2007 Free Software Foundation, Inc. "
 
			"&lt;<a href=\"http://fsf.org/\">http://fsf.org/</a>&gt;</p><p>"
 
			"Everyone is permitted to copy and distribute verbatim copies "
 
			"of this license document, but changing it is not allowed.</p>"
 
			"<h2>GNU GENERAL PUBLIC LICENSE</h2>"));
 

	
 
  gpl->setButtonText( 1, "Dismiss" );
 
  gpl->show();
 
}
 

	
 
void Main::aboutQt(){
 
  QMessageBox::aboutQt( this, "Virtual Leaf" );
 
}
 

	
 
void Main::toggleShowCellCenters()
 
{
 
  Plot();
 
}
 

	
 
void Main::toggleShowWalls()
 
{
 
  Plot();
 
}
 

	
 
void Main::toggleShowApoplasts()
 
{
 
  Plot();
 
}
 

	
 
void Main::toggleShowNodes()
src/gpl3.txt
Show inline comments
 
file renamed from doc/gpl3.txt to src/gpl3.txt
src/libplugin.pro
Show inline comments
 
#
 
#  $Id$
 
#
 
#  This file is part of the Virtual Leaf.
 
#
 
#  The Virtual Leaf 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 3 of the License, or
 
#  (at your option) any later version.
 
#
 
#  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.
 
#
 

	
 
CONFIG += release
 
CONFIG -= debug
 
CONFIG += staticlib
 

	
 
QMAKE_CXXFLAGS += -fexceptions
 
QMAKE_CXXFLAGS += -Wall
 
QMAKE_CXXFLAGS += -Wno-write-strings
 
QMAKE_CXXFLAGS += -Wno-unused-parameter
 
win32:QMAKE_CXXFLAGS -= O2
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QMAKE_CXXFLAGS_DEBUG -= -finstrument-functions
 

	
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = ../lib
 
LIBDIR = ../lib
 
PARTMPL = VirtualLeafpar.tmpl
 
QT += qt3support
 
TARGET = vleaf
 
TEMPLATE = lib
 

	
 
HEADERS = \
 
 cellbase.h \
 
 matrix.h \
 
 output.h \
 
 parameter.h \
 
 parse.h \
 
 random.h \
 
 simplugin.h \
 
 UniqueMessage.h \
 
 vector.h \
 
 wallbase.h \
 
 warning.h
 

	
 
SOURCES = \
 
 cellbase.cpp \
 
 matrix.cpp \
 
 output.cpp \
 
 parameter.cpp \
 
 parse.cpp \
 
 random.cpp \
 
 simplugin.cpp \
 
 UniqueMessage.cpp \
 
 vector.cpp \
 
 wallbase.cpp \
 
 warning.cpp
 

	
 
unix {
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
 LIBS += -lxml2 -lz -lm 
 
}
 

	
 
win32 {
 
 LIBXML2DIR = $${LIBDIR}\libxml2
 
 LIBICONVDIR = $${LIBDIR}\libiconv
src/output.cpp
Show inline comments
 
@@ -274,49 +274,61 @@ void MakeDir(const char *dirname) {
 
 
 
#else
 
 
  int status;
 
  char message[MESS_BUF_SIZE];
 
 
  status=mkdir(dirname, S_IRWXU); // S_IRWXU: Read, Write, Execute by Owner 
 
 
  if (status<0) { // error occurred
 
 
    //check for existance
 
 
    if (errno==EEXIST) {
 
 
      // Check whether it is a directory 
 
      struct stat buf;
 
      stat(dirname, &buf);
 
      if (S_ISDIR(buf.st_mode)) {
 
	// OK 
 
	extern  Parameter par;
 
	if (false /* && par.interactive*/) {
 
	  fprintf(stderr,"Using existing directory %s for data storage.\n",dirname);
 
	  if (!YesNoP("OK?")) {
 
	    // User doesn't agree. Exit
 
	    exit(1);
 
	  }
 
	} else {
 
	  fprintf(stderr,"Using existing directory %s for data storage.\n",dirname);
 
	}
 
      } else {
 
	snprintf(message, MESS_BUF_SIZE, "%s is not a directory", dirname);
 
	perror(message);
 
	exit(1);
 
      }
 
    } else {
 
      // a different error occurred. Print error and quit 
 
 
      snprintf(message,MESS_BUF_SIZE,"Error in making directory %s",dirname);
 
      perror(message);
 
      exit(1);
 
    }
 
  }
 
 
#endif
 
}
 
 
 
char* AppendHomeDirIfPathRelative(char *datadir) {
 
  QDir dataDir(datadir);
 
  if (dataDir.isRelative()){
 
    if (datadir) { 
 
      free(datadir); 
 
    }
 
    QStringList path;
 
    path << QDir::homePath() << dataDir.dirName();
 
    return strdup((char *) path.join("/").toStdString().c_str());
 
  } else return datadir;
 
}
 
 
/* finis */
src/output.h
Show inline comments
 
/*
 
 *
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf 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 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf 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 _OUTPUT_H_
 
#define _OUTPUT_H_
 

	
 
#ifdef __cplusplus
 
extern "C" {
 
#endif
 

	
 
  int OpenFileAndCheckExistance(FILE **fp,const char *fname,char *ftype);
 
  int YesNoP(const char *message);
 
  FILE *OpenWriteFile(const char *filename);
 
  FILE *OpenGZippedWriteFile(const char *filename);
 
  FILE *OpenReadFile(const char *filename);
 
  char *ReadLine(FILE *fp);
 
  void CheckFile(FILE *fp);
 
  int FileExistsP(const char *fname);
 
  char *Chext(char *filename);
 
  void MakeDir(const char *dirname);
 
  char *AppendHomeDirIfPathRelative(char *datadir);
 
  bool CanWeWriteP(char *filename);
 

	
 
#ifdef __cplusplus
 
}
 
#endif
 

	
 

	
 
#define MESS_BUF_SIZE 160
 
#ifndef FALSE
 
#define FALSE 0
 
#define TRUE 1
 
#endif
 

	
 
#endif
 

	
 
/* finis */
src/parameter.cpp
Show inline comments
 
@@ -87,153 +87,147 @@ Parameter::Parameter() {
 
  initval = new double[15];
 
  initval[0] = 0.;
 
  initval[1] = 0.;
 
  initval[2] = 0.;
 
  initval[3] = 0.;
 
  initval[4] = 0.;
 
  initval[5] = 0.;
 
  initval[6] = 0.;
 
  initval[7] = 0.;
 
  initval[8] = 0.;
 
  initval[9] = 0.;
 
  initval[10] = 0.;
 
  initval[11] = 0.;
 
  initval[12] = 0.;
 
  initval[13] = 0.;
 
  initval[14] = 0.;
 
  k1 = 1.;
 
  k2 = 0.3;
 
  r = 1.;
 
  kr = 1.;
 
  km = 1.;
 
  Pi_tot = 1.;
 
  transport = 0.036;
 
  ka = 1;
 
  pin_prod = 0.001;
 
  pin_prod_in_epidermis = 0.1;
 
  pin_breakdown = 0.001;
 
  pin_breakdown_internal = 0.001;
 
  aux1prod = 0.001;
 
  aux1prodmeso = 0.;
 
  aux1decay = 0.001;
 
  aux1decaymeso = 0.1;
 
  aux1transport = 0.036;
 
  aux_cons = 0.;
 
  aux_breakdown = 0.;
 
  kaux1 = 1;
 
  kap = 1;
 
  leaf_tip_source = 0.001;
 
  sam_efflux = 0.0001;
 
  sam_auxin = 10.;
 
  sam_auxin_breakdown = 0;
 
  van3prod = 0.002;
 
  van3autokat = 0.1;
 
  van3sat = 10;
 
  k2van3 = 0.3;
 
  dt = 0.1;
 
  rd_dt = 1.0;
 
  datadir = strdup(".");
 
  datadir = AppendHomeDirIfPathRelative(datadir);
 
  movie = false;
 
  nit = 100000;
 
  maxt = 1000.;
 
  storage_stride = 10;
 
  xml_storage_stride = 500;
 
  rseed = -1;
 
  constituous_expansion_limit = 16;
 
  vessel_inh_level = 1;
 
  vessel_expansion_rate = 0.25;
 
  d = 0.;
 
  e = 0.;
 
  f = 0.;
 
  c = 0.;
 
  mu = 0.;
 
  nu = 0.;
 
  rho0 = 0.;
 
  rho1 = 0.;
 
  c0 = 0.;
 
  gamma = 0.;
 
  eps = 0.;
 
  k = new double[15];
 
  k[0] = 0.;
 
  k[1] = 0.0;
 
  k[2] = 0.0;
 
  k[3] = 0.;
 
  k[4] = 0.;
 
  k[5] = 0.;
 
  k[6] = 0.;
 
  k[7] = 0.;
 
  k[8] = 0.;
 
  k[9] = 0.;
 
  k[10] = 0.;
 
  k[11] = 0.;
 
  k[12] = 0.;
 
  k[13] = 0.;
 
  k[14] = 0.;
 
  i1 = 0;
 
  i2 = 0;
 
  i3 = 0;
 
  i4 = 0;
 
  i5 = 0;
 
  s1 = strdup("");
 
  s2 = strdup("");
 
  s3 = strdup("");
 
  b1 = false;
 
  b2 = false;
 
  b3 = false;
 
  b4 = false;
 
  dir1 = strdup(".");
 
  dir2 = strdup(".");
 
  // reassign datadir outside the loop
 
  QDir dataDir(datadir);
 
  if (dataDir.isRelative()){
 
    QStringList path;
 
    path << QDir::homePath() << dataDir.dirName();
 
    datadir = strdup((char *) path.join("/").toStdString().c_str());
 
  }
 
}
 

	
 
Parameter::~Parameter() {
 
    
 
  // destruct parameter object
 
  // free string parameter
 
  CleanUp();
 
}
 

	
 
void Parameter::CleanUp(void) {
 
  if (arrowcolor) 
 
    free(arrowcolor);
 
  if (textcolor) 
 
    free(textcolor);
 
  if (cell_outline_color) 
 
    free(cell_outline_color);
 
  if (D) 
 
    free(D);
 
  if (initval) 
 
    free(initval);
 
  if (datadir) 
 
    free(datadir);
 
  if (k) 
 
    free(k);
 
  if (s1) 
 
    free(s1);
 
  if (s2) 
 
    free(s2);
 
  if (s3) 
 
    free(s3);
 
  if (dir1) 
 
    free(dir1);
 
  if (dir2) 
 
    free(dir2);
 

	
 
}
 

	
 
void Parameter::Read(const char *filename) {
 
    
 
  static bool ReadP=false;
 

	
 
  if (ReadP) {
 

	
 
    //throw "Run Time Error in parameter.cpp: Please Read parameter file only once!!";
 
    CleanUp();
 
	
 
  } else
 
    ReadP=true;
 
@@ -259,96 +253,97 @@ void Parameter::Read(const char *filenam
 
  auxin_dependent_growth = bgetpar(fp, "auxin_dependent_growth", true, true);
 
  ode_accuracy = fgetpar(fp, "ode_accuracy", 1e-4, true);
 
  mc_stepsize = fgetpar(fp, "mc_stepsize", 0.4, true);
 
  mc_cell_stepsize = fgetpar(fp, "mc_cell_stepsize", 0.2, true);
 
  energy_threshold = fgetpar(fp, "energy_threshold", 1000., true);
 
  bend_lambda = fgetpar(fp, "bend_lambda", 0., true);
 
  alignment_lambda = fgetpar(fp, "alignment_lambda", 0., true);
 
  rel_cell_div_threshold = fgetpar(fp, "rel_cell_div_threshold", 2., true);
 
  rel_perimeter_stiffness = fgetpar(fp, "rel_perimeter_stiffness", 2, true);
 
  collapse_node_threshold = fgetpar(fp, "collapse_node_threshold", 0.05, true);
 
  morphogen_div_threshold = fgetpar(fp, "morphogen_div_threshold", 0.2, true);
 
  morphogen_expansion_threshold = fgetpar(fp, "morphogen_expansion_threshold", 0.01, true);
 
  copy_wall = bgetpar(fp, "copy_wall", true, true);
 
  source = fgetpar(fp, "source", 0., true);
 
  D = dgetparlist(fp, "D", 15, true);
 
  initval = dgetparlist(fp, "initval", 15, true);
 
  k1 = fgetpar(fp, "k1", 1., true);
 
  k2 = fgetpar(fp, "k2", 0.3, true);
 
  r = fgetpar(fp, "r", 1., true);
 
  kr = fgetpar(fp, "kr", 1., true);
 
  km = fgetpar(fp, "km", 1., true);
 
  Pi_tot = fgetpar(fp, "Pi_tot", 1., true);
 
  transport = fgetpar(fp, "transport", 0.036, true);
 
  ka = fgetpar(fp, "ka", 1, true);
 
  pin_prod = fgetpar(fp, "pin_prod", 0.001, true);
 
  pin_prod_in_epidermis = fgetpar(fp, "pin_prod_in_epidermis", 0.1, true);
 
  pin_breakdown = fgetpar(fp, "pin_breakdown", 0.001, true);
 
  pin_breakdown_internal = fgetpar(fp, "pin_breakdown_internal", 0.001, true);
 
  aux1prod = fgetpar(fp, "aux1prod", 0.001, true);
 
  aux1prodmeso = fgetpar(fp, "aux1prodmeso", 0., true);
 
  aux1decay = fgetpar(fp, "aux1decay", 0.001, true);
 
  aux1decaymeso = fgetpar(fp, "aux1decaymeso", 0.1, true);
 
  aux1transport = fgetpar(fp, "aux1transport", 0.036, true);
 
  aux_cons = fgetpar(fp, "aux_cons", 0., true);
 
  aux_breakdown = fgetpar(fp, "aux_breakdown", 0., true);
 
  kaux1 = fgetpar(fp, "kaux1", 1, true);
 
  kap = fgetpar(fp, "kap", 1, true);
 
  leaf_tip_source = fgetpar(fp, "leaf_tip_source", 0.001, true);
 
  sam_efflux = fgetpar(fp, "sam_efflux", 0.0001, true);
 
  sam_auxin = fgetpar(fp, "sam_auxin", 10., true);
 
  sam_auxin_breakdown = fgetpar(fp, "sam_auxin_breakdown", 0, true);
 
  van3prod = fgetpar(fp, "van3prod", 0.002, true);
 
  van3autokat = fgetpar(fp, "van3autokat", 0.1, true);
 
  van3sat = fgetpar(fp, "van3sat", 10, true);
 
  k2van3 = fgetpar(fp, "k2van3", 0.3, true);
 
  dt = fgetpar(fp, "dt", 0.1, true);
 
  rd_dt = fgetpar(fp, "rd_dt", 1.0, true);
 
  datadir = sgetpar(fp, "datadir", ".", true);
 
  datadir = AppendHomeDirIfPathRelative(datadir);
 
  if (strcmp(datadir, "."))
 
    MakeDir(datadir);
 
  movie = bgetpar(fp, "movie", false, true);
 
  nit = igetpar(fp, "nit", 100000, true);
 
  maxt = fgetpar(fp, "maxt", 1000., true);
 
  storage_stride = igetpar(fp, "storage_stride", 10, true);
 
  xml_storage_stride = igetpar(fp, "xml_storage_stride", 500, true);
 
  rseed = igetpar(fp, "rseed", -1, true);
 
  constituous_expansion_limit = igetpar(fp, "constituous_expansion_limit", 16, true);
 
  vessel_inh_level = fgetpar(fp, "vessel_inh_level", 1, true);
 
  vessel_expansion_rate = fgetpar(fp, "vessel_expansion_rate", 0.25, true);
 
  d = fgetpar(fp, "d", 0., true);
 
  e = fgetpar(fp, "e", 0., true);
 
  f = fgetpar(fp, "f", 0., true);
 
  c = fgetpar(fp, "c", 0., true);
 
  mu = fgetpar(fp, "mu", 0., true);
 
  nu = fgetpar(fp, "nu", 0., true);
 
  rho0 = fgetpar(fp, "rho0", 0., true);
 
  rho1 = fgetpar(fp, "rho1", 0., true);
 
  c0 = fgetpar(fp, "c0", 0., true);
 
  gamma = fgetpar(fp, "gamma", 0., true);
 
  eps = fgetpar(fp, "eps", 0., true);
 
  k = dgetparlist(fp, "k", 15, true);
 
  i1 = igetpar(fp, "i1", 0, true);
 
  i2 = igetpar(fp, "i2", 0, true);
 
  i3 = igetpar(fp, "i3", 0, true);
 
  i4 = igetpar(fp, "i4", 0, true);
 
  i5 = igetpar(fp, "i5", 0, true);
 
  s1 = sgetpar(fp, "s1", "", true);
 
  s2 = sgetpar(fp, "s2", "", true);
 
  s3 = sgetpar(fp, "s3", "", true);
 
  b1 = bgetpar(fp, "b1", false, true);
 
  b2 = bgetpar(fp, "b2", false, true);
 
  b3 = bgetpar(fp, "b3", false, true);
 
  b4 = bgetpar(fp, "b4", false, true);
 
  dir1 = sgetpar(fp, "dir1", ".", true);
 
  if (strcmp(dir1, "."))
 
    MakeDir(dir1);
 
  dir2 = sgetpar(fp, "dir2", ".", true);
 
  if (strcmp(dir2, "."))
 
    MakeDir(dir2);
 
}
 

	
 
const char *sbool(const bool &p) {
 

	
 
  const char *true_str="true";
 
  const char *false_str="false";
 
  if (p)
 
@@ -382,99 +377,103 @@ void Parameter::Write(ostream &os) const
 
  os << " cell_div_expansion_rate = " << cell_div_expansion_rate << endl;
 
  os << " auxin_dependent_growth = " << sbool(auxin_dependent_growth) << endl;
 
  os << " ode_accuracy = " << ode_accuracy << endl;
 
  os << " mc_stepsize = " << mc_stepsize << endl;
 
  os << " mc_cell_stepsize = " << mc_cell_stepsize << endl;
 
  os << " energy_threshold = " << energy_threshold << endl;
 
  os << " bend_lambda = " << bend_lambda << endl;
 
  os << " alignment_lambda = " << alignment_lambda << endl;
 
  os << " rel_cell_div_threshold = " << rel_cell_div_threshold << endl;
 
  os << " rel_perimeter_stiffness = " << rel_perimeter_stiffness << endl;
 
  os << " collapse_node_threshold = " << collapse_node_threshold << endl;
 
  os << " morphogen_div_threshold = " << morphogen_div_threshold << endl;
 
  os << " morphogen_expansion_threshold = " << morphogen_expansion_threshold << endl;
 
  os << " copy_wall = " << sbool(copy_wall) << endl;
 
  os << " source = " << source << endl;
 
  os << " D = "<< D[0] << ", " << D[1] << ", " << D[2] << ", " << D[3] << ", " << D[4] << ", " << D[5] << ", " << D[6] << ", " << D[7] << ", " << D[8] << ", " << D[9] << ", " << D[10] << ", " << D[11] << ", " << D[12] << ", " << D[13] << ", " << D[14] << endl;
 
  os << " initval = "<< initval[0] << ", " << initval[1] << ", " << initval[2] << ", " << initval[3] << ", " << initval[4] << ", " << initval[5] << ", " << initval[6] << ", " << initval[7] << ", " << initval[8] << ", " << initval[9] << ", " << initval[10] << ", " << initval[11] << ", " << initval[12] << ", " << initval[13] << ", " << initval[14] << endl;
 
  os << " k1 = " << k1 << endl;
 
  os << " k2 = " << k2 << endl;
 
  os << " r = " << r << endl;
 
  os << " kr = " << kr << endl;
 
  os << " km = " << km << endl;
 
  os << " Pi_tot = " << Pi_tot << endl;
 
  os << " transport = " << transport << endl;
 
  os << " ka = " << ka << endl;
 
  os << " pin_prod = " << pin_prod << endl;
 
  os << " pin_prod_in_epidermis = " << pin_prod_in_epidermis << endl;
 
  os << " pin_breakdown = " << pin_breakdown << endl;
 
  os << " pin_breakdown_internal = " << pin_breakdown_internal << endl;
 
  os << " aux1prod = " << aux1prod << endl;
 
  os << " aux1prodmeso = " << aux1prodmeso << endl;
 
  os << " aux1decay = " << aux1decay << endl;
 
  os << " aux1decaymeso = " << aux1decaymeso << endl;
 
  os << " aux1transport = " << aux1transport << endl;
 
  os << " aux_cons = " << aux_cons << endl;
 
  os << " aux_breakdown = " << aux_breakdown << endl;
 
  os << " kaux1 = " << kaux1 << endl;
 
  os << " kap = " << kap << endl;
 
  os << " leaf_tip_source = " << leaf_tip_source << endl;
 
  os << " sam_efflux = " << sam_efflux << endl;
 
  os << " sam_auxin = " << sam_auxin << endl;
 
  os << " sam_auxin_breakdown = " << sam_auxin_breakdown << endl;
 
  os << " van3prod = " << van3prod << endl;
 
  os << " van3autokat = " << van3autokat << endl;
 
  os << " van3sat = " << van3sat << endl;
 
  os << " k2van3 = " << k2van3 << endl;
 
  os << " dt = " << dt << endl;
 
  os << " rd_dt = " << rd_dt << endl;
 

	
 
  if (datadir) 
 
    os << " datadir = " << datadir << endl;
 
  if (datadir) {
 
    QDir dataDir = QDir::home().relativeFilePath(datadir);
 
    os << " datadir = " << dataDir.dirName().toStdString() << endl;
 
  }
 
  else {
 
    os << "datadir = ." << endl;
 
  }
 
  os << " movie = " << sbool(movie) << endl;
 
  os << " nit = " << nit << endl;
 
  os << " maxt = " << maxt << endl;
 
  os << " storage_stride = " << storage_stride << endl;
 
  os << " xml_storage_stride = " << xml_storage_stride << endl;
 
  os << " rseed = " << rseed << endl;
 
  os << " constituous_expansion_limit = " << constituous_expansion_limit << endl;
 
  os << " vessel_inh_level = " << vessel_inh_level << endl;
 
  os << " vessel_expansion_rate = " << vessel_expansion_rate << endl;
 
  os << " d = " << d << endl;
 
  os << " e = " << e << endl;
 
  os << " f = " << f << endl;
 
  os << " c = " << c << endl;
 
  os << " mu = " << mu << endl;
 
  os << " nu = " << nu << endl;
 
  os << " rho0 = " << rho0 << endl;
 
  os << " rho1 = " << rho1 << endl;
 
  os << " c0 = " << c0 << endl;
 
  os << " gamma = " << gamma << endl;
 
  os << " eps = " << eps << endl;
 
  os << " k = "<< k[0] << ", " << k[1] << ", " << k[2] << ", " << k[3] << ", " << k[4] << ", " << k[5] << ", " << k[6] << ", " << k[7] << ", " << k[8] << ", " << k[9] << ", " << k[10] << ", " << k[11] << ", " << k[12] << ", " << k[13] << ", " << k[14] << endl;
 
  os << " i1 = " << i1 << endl;
 
  os << " i2 = " << i2 << endl;
 
  os << " i3 = " << i3 << endl;
 
  os << " i4 = " << i4 << endl;
 
  os << " i5 = " << i5 << endl;
 

	
 
  if (s1) 
 
    os << " s1 = " << s1 << endl;
 

	
 
  if (s2) 
 
    os << " s2 = " << s2 << endl;
 

	
 
  if (s3) 
 
    os << " s3 = " << s3 << endl;
 
  os << " b1 = " << sbool(b1) << endl;
 
  os << " b2 = " << sbool(b2) << endl;
 
  os << " b3 = " << sbool(b3) << endl;
 
  os << " b4 = " << sbool(b4) << endl;
 

	
 
  if (dir1) 
 
    os << " dir1 = " << dir1 << endl;
 

	
 
  if (dir2) 
 
    os << " dir2 = " << dir2 << endl;
 
}
 

	
 
void Parameter::XMLAdd(xmlNode *root) const {
 
@@ -1055,98 +1054,100 @@ void Parameter::XMLAdd(xmlNode *root) co
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "van3prod" );
 
    ostringstream text;
 
    text << van3prod;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "van3autokat" );
 
    ostringstream text;
 
    text << van3autokat;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "van3sat" );
 
    ostringstream text;
 
    text << van3sat;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "k2van3" );
 
    ostringstream text;
 
    text << k2van3;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "dt" );
 
    ostringstream text;
 
    text << dt;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "rd_dt" );
 
    ostringstream text;
 
    text << rd_dt;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "datadir" );
 
    ostringstream text;
 

	
 
    if (datadir) 
 
      text << datadir;
 
    if (datadir) {
 
      QDir dataDir = QDir::home().relativeFilePath(datadir);
 
      text << dataDir.dirName().toStdString();
 
    }
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "movie" );
 
    ostringstream text;
 
    text << sbool(movie);
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "nit" );
 
    ostringstream text;
 
    text << nit;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "maxt" );
 
    ostringstream text;
 
    text << maxt;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "storage_stride" );
 
    ostringstream text;
 
    text << storage_stride;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "xml_storage_stride" );
 
    ostringstream text;
 
    text << xml_storage_stride;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "rseed" );
 
    ostringstream text;
 
    text << rseed;
 
    xmlNewProp(xmlpar, BAD_CAST "val", BAD_CAST text.str().c_str());
 
  }
 
  {
 
    xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST "par", NULL);
 
    xmlNewProp(xmlpar, BAD_CAST "name", BAD_CAST "constituous_expansion_limit" );
 
    ostringstream text;
 
@@ -1647,96 +1648,97 @@ void Parameter::AssignValToPar(const cha
 
  }
 
  if (!strcmp(namec, "kap")) {
 
    kap = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'kap' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "leaf_tip_source")) {
 
    leaf_tip_source = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'leaf_tip_source' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "sam_efflux")) {
 
    sam_efflux = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'sam_efflux' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "sam_auxin")) {
 
    sam_auxin = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'sam_auxin' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "sam_auxin_breakdown")) {
 
    sam_auxin_breakdown = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'sam_auxin_breakdown' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "van3prod")) {
 
    van3prod = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'van3prod' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "van3autokat")) {
 
    van3autokat = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'van3autokat' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "van3sat")) {
 
    van3sat = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'van3sat' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "k2van3")) {
 
    k2van3 = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'k2van3' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "dt")) {
 
    dt = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'dt' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "rd_dt")) {
 
    rd_dt = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'rd_dt' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "datadir")) {
 
    if (datadir) { free(datadir); }
 
    datadir=strdup(valc);
 
    datadir = AppendHomeDirIfPathRelative(datadir);
 
  }
 
  if (!strcmp(namec, "movie")) {
 
    movie = strtobool(valc);
 
  }
 
  if (!strcmp(namec, "nit")) {
 
    nit = standardlocale.toInt(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to integer while reading parameter 'nit' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "maxt")) {
 
    maxt = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'maxt' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "storage_stride")) {
 
    storage_stride = standardlocale.toInt(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to integer while reading parameter 'storage_stride' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "xml_storage_stride")) {
 
    xml_storage_stride = standardlocale.toInt(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to integer while reading parameter 'xml_storage_stride' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "rseed")) {
 
    rseed = standardlocale.toInt(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to integer while reading parameter 'rseed' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "constituous_expansion_limit")) {
 
    constituous_expansion_limit = standardlocale.toInt(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to integer while reading parameter 'constituous_expansion_limit' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "vessel_inh_level")) {
 
    vessel_inh_level = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'vessel_inh_level' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "vessel_expansion_rate")) {
 
    vessel_expansion_rate = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'vessel_expansion_rate' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "d")) {
 
    d = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'd' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "e")) {
 
    e = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'e' from XML file.",valc); }
 
  }
 
  if (!strcmp(namec, "f")) {
 
    f = standardlocale.toDouble(valc, &ok);
 
    if (!ok) { MyWarning::error("Read error: cannot convert string \"%s\" to double while reading parameter 'f' from XML file.",valc); }
 
  }
 
@@ -1802,66 +1804,56 @@ void Parameter::AssignValToPar(const cha
 
  }
 
  if (!strcmp(namec, "s3")) {
 
    if (s3) { free(s3); }
 
    s3=strdup(valc);
 
  }
 
  if (!strcmp(namec, "b1")) {
 
    b1 = strtobool(valc);
 
  }
 
  if (!strcmp(namec, "b2")) {
 
    b2 = strtobool(valc);
 
  }
 
  if (!strcmp(namec, "b3")) {
 
    b3 = strtobool(valc);
 
  }
 
  if (!strcmp(namec, "b4")) {
 
    b4 = strtobool(valc);
 
  }
 
  if (!strcmp(namec, "dir1")) {
 
    if (dir1) { free(dir1); }
 
    dir1=strdup(valc);
 
  }
 
  if (!strcmp(namec, "dir2")) {
 
    if (dir2) { free(dir2); }
 
    dir2=strdup(valc);
 
  }
 
}
 
void Parameter::AssignValArrayToPar(const char *namec, vector<double> valarray) {
 
  if (!strcmp(namec, "D")) {
 
    int i=0;
 
    vector<double>::const_iterator v=valarray.begin();
 
    while (v!=valarray.end() && i <= 14 ) {
 
      D[i++]=*(v++);
 
    }
 
  }
 
  if (!strcmp(namec, "initval")) {
 
    int i=0;
 
    vector<double>::const_iterator v=valarray.begin();
 
    while (v!=valarray.end() && i <= 14 ) {
 
      initval[i++]=*(v++);
 
    }
 
  }
 
  if (!strcmp(namec, "k")) {
 
    int i=0;
 
    vector<double>::const_iterator v=valarray.begin();
 
    while (v!=valarray.end() && i <= 14 ) {
 
      k[i++]=*(v++);
 
    }
 
  }
 
  // reassign datadir outside the loop
 
  if (!strcmp(namec, "datadir")) {
 
    if (datadir) { free(datadir); }
 
    QDir dataDir(datadir);
 
    if (dataDir.isRelative()){
 
      QStringList path;
 
      path << QDir::homePath() << dataDir.dirName();
 
      datadir = strdup((char *) path.join("/").toStdString().c_str());
 
    }
 
  }
 
}
 

	
 
ostream &operator<<(ostream &os, Parameter &p) {
 
  p.Write(os);
 
  return os;
 
}
 

	
 
/* finis */
src/parameter.h
Show inline comments
 
/*
 
 *
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf 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 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf 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 _PARAMETER_H_
 
#define _PARAMETER_H_
 
#include "vector.h"
 
#include <vector>
 

	
 
#include <libxml/parser.h>
 
#include <libxml/tree.h>
 

	
 
class Parameter {
 
 class Parameter {
 
		
 
 public: 
 
  Parameter();
 
  ~Parameter();
 
  void CleanUp(void);
 
  void Read(const char *filename);
 
  void Write(ostream &os) const;
 
  void XMLAdd(xmlNode *root) const;
 
  void XMLRead(xmlNode *root);
 
  void AssignValToPar(const char *namec, const char *valc);
 
  void AssignValArrayToPar(const char *namec, vector<double> valarray);
 
   Parameter();
 
   ~Parameter();
 
   void CleanUp(void);
 
   void Read(const char *filename);
 
   void Write(ostream &os) const;
 
   void XMLAdd(xmlNode *root) const;
 
   void XMLRead(xmlNode *root);
 
   void AssignValToPar(const char *namec, const char *valc);
 
   void AssignValArrayToPar(const char *namec, vector<double> valarray);
 
  char * arrowcolor;
 
  double arrowsize;
 
  char * textcolor;
 
  int cellnumsize;
 
  int nodenumsize;
 
  double node_mag;
 
  double outlinewidth;
 
  char * cell_outline_color;
 
  int resize_stride;
 
  double T;
 
  double lambda_length;
 
  double lambda_celllength;
 
  double target_length;
 
  double cell_expansion_rate;
 
  double cell_div_expansion_rate;
 
  bool auxin_dependent_growth;
 
  double ode_accuracy;
 
  double mc_stepsize;
 
  double mc_cell_stepsize;
 
  double energy_threshold;
 
  double bend_lambda;
 
  double alignment_lambda;
 
  double rel_cell_div_threshold;
 
  double rel_perimeter_stiffness;
 
  double collapse_node_threshold;
 
  double morphogen_div_threshold;
 
  double morphogen_expansion_threshold;
 
  bool copy_wall;
 
  double source;
 
  double * D;
 
  double * initval;
 
  double k1;
 
  double k2;
 
  double r;
 
  double kr;
 
  double km;
 
  double Pi_tot;
 
  double transport;
 
  double ka;
 
  double pin_prod;
 
  double pin_prod_in_epidermis;
 
  double pin_breakdown;
 
  double pin_breakdown_internal;
 
  double aux1prod;
 
  double aux1prodmeso;
 
  double aux1decay;
 
  double aux1decaymeso;
 
  double aux1transport;
 
@@ -95,56 +95,57 @@ class Parameter {
 
  double kap;
 
  double leaf_tip_source;
 
  double sam_efflux;
 
  double sam_auxin;
 
  double sam_auxin_breakdown;
 
  double van3prod;
 
  double van3autokat;
 
  double van3sat;
 
  double k2van3;
 
  double dt;
 
  double rd_dt;
 
  char * datadir;
 
  bool movie;
 
  int nit;
 
  double maxt;
 
  int storage_stride;
 
  int xml_storage_stride;
 
  int rseed;
 
  int constituous_expansion_limit;
 
  double vessel_inh_level;
 
  double vessel_expansion_rate;
 
  double d;
 
  double e;
 
  double f;
 
  double c;
 
  double mu;
 
  double nu;
 
  double rho0;
 
  double rho1;
 
  double c0;
 
  double gamma;
 
  double eps;
 
  double * k;
 
  int i1;
 
  int i2;
 
  int i3;
 
  int i4;
 
  int i5;
 
  char * s1;
 
  char * s2;
 
  char * s3;
 
  bool b1;
 
  bool b2;
 
  bool b3;
 
  bool b4;
 
  char * dir1;
 
  char * dir2;
 
 private:
 
};
 
 };
 

	
 
ostream &operator<<(ostream &os, Parameter &p);
 
const char *sbool(const bool &p);
 
 ostream &operator<<(ostream &os, Parameter &p);
 
 const char *sbool(const bool &p);
 

	
 

	
 
#endif
 

	
 
/* finis */
src/perl/ChangeLog
Show inline comments
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* make_parameter_source.pl: Added datadir changes.
 

	
 
2010-06-21    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* make_pardialog_source.pl: Reformatted. If datadir is relative append it to the user's home directory.
 
	* make_parameter_source.pl: Ditto.
 
	* make_xmlwritecode.pl: Ditto.
 

	
src/perl/make_parameter_source.pl
Show inline comments
 
@@ -43,359 +43,364 @@
 
    "int" => "int",
 
    "bool" => "bool",
 
    "char *" => "char *",
 
    "string" => "char *",
 
    "directory" => "char *",
 
    "doublelist" => "double *",
 
    "label" => "label",
 
    "title" => "title",
 
    );
 

	
 
open parfile,"<$ARGV[0]";
 
open cppfile,">parameter.cpp";
 
$i=0;
 
while (<parfile>) {
 
#ignore comments
 
    if (/^#/) {
 
	next;
 
	}
 
    @line=split(/=/);
 
#ignore empty lines
 
    if ($#line<1) {
 
	next;
 
    }
 
    $param[$i]=$line[0];
 
    $value_type=$line[1];
 

	
 
    @typel=split(/ \/ /,$value_type);
 
    $value[$i] = $typel[0];
 
    $type[$i] = $typel[1];
 
    
 
#get rid of spaces
 
    $param[$i] =~ s/ //g;
 
    $value[$i] =~ s/ //g;
 
    $type[$i] =~ s/ //g;
 
    $type[$i] =~s/\n//g;
 
    $convtype[$i]=$typetrans{$type[$i]};
 

	
 
    if ($convtype[$i] eq "char *") {
 
	$value[$i] = "\"$value[$i]\"";
 
    }
 
    #print cppfile "param = $param, value = $value, type = $type\n";
 

	
 
    $i++;
 
}
 

	
 
$lines=$i;
 

	
 
print cppfile <<END_HEADER;
 
// WARNING: This file is automatically generated by make_parameter_source.pl. Do not edit.
 
    // All edits will be discarded.
 
// WARNING: This file is automatically generated by make_parameter_source.pl.
 
// Do not edit. All edits will be discarded.
 

	
 
#include "parameter.h"
 
#include <cstdio>
 
#include <cstring>
 
#include <cstdlib>
 
#include <cerrno>
 
#include <iostream>
 
#include <sstream>
 
#include "output.h"
 
#include "parse.h"
 
#include "xmlwrite.h"
 
#include "warning.h"
 
#include <QLocale>
 
#include <QDir>
 
#include <QStringList>
 

	
 
using namespace std;
 

	
 
Parameter::Parameter() {
 
END_HEADER
 

	
 
for ($i=0;$i<$lines;$i++) {
 
    if ($convtype[$i] ne "label" && $convtype[$i] ne "title") {
 
	if ($convtype[$i] eq "char *") {
 
	    print cppfile "  $param[$i] = strdup($value[$i]);\n";
 
	    if ($param[$i] eq "datadir") {
 
		print cppfile "  datadir = AppendHomeDirIfPathRelative(datadir);\n";
 
	    }
 
	} else {
 
	    if ($convtype[$i] eq "double *") {
 
                #comma separated list expected
 
		@paramlist = split(/,/, $value[$i]);
 
		$length = $#paramlist+1;
 
		print cppfile "  $param[$i] = new double\[$length\];\n";
 
		for ($j=0;$j<=$#paramlist;$j++) {
 
		    print cppfile "  $param[$i]\[$j\] = $paramlist[$j];\n";
 
		}
 
	    } else {
 
		print cppfile "  $param[$i] = $value[$i];\n";
 
	    }
 
	}
 
    }
 
}
 

	
 

	
 
print cppfile <<END_HEADER3;
 
  // reassign datadir outside the loop
 
  QDir dataDir(datadir);
 
  if (dataDir.isRelative()){
 
    QStringList path;
 
    path << QDir::homePath() << dataDir.dirName();
 
    datadir = strdup((char *) path.join("/").toStdString().c_str());
 
  }
 
}
 

	
 
Parameter::~Parameter() {
 
    
 
// destruct parameter object
 
// free string parameter
 
CleanUp();
 
}
 

	
 
void Parameter::CleanUp(void) {
 
END_HEADER3
 

	
 
for ($i=0;$i<$lines;$i++) {
 
    if ($convtype[$i] eq "char *" || $convtype[$i] eq "double *") {
 
	print cppfile "  if ($param[$i]) \n";
 
	print cppfile "     free($param[$i]);\n";
 
    }
 
}
 
print cppfile <<END_HEADER4;
 

	
 
}
 

	
 
void Parameter::Read(const char *filename) {
 
    
 
  static bool ReadP=false;
 

	
 
  if (ReadP) {
 

	
 
    //throw "Run Time Error in parameter.cpp: Please Read parameter file only once!!";
 
    CleanUp();
 
	
 
  } else
 
    ReadP=true;
 

	
 
  FILE *fp=OpenReadFile(filename);
 

	
 

	
 
END_HEADER4
 

	
 
for ($i=0;$i<$lines;$i++) {
 

	
 
    if ($convtype[$i] eq "label" || $convtype[$i] eq "title") {
 
	next;
 
    }
 
    if ($convtype[$i] eq "double *") {
 
	@paramlist = split(/,/,$value[$i]);
 
	$length = $#paramlist+1;
 
	print cppfile "  $param[$i] = $funname{$convtype[$i]}(fp, \"$param[$i]\", $length, true);\n";
 
    } else {
 
	print cppfile "  $param[$i] = $funname{$convtype[$i]}(fp, \"$param[$i]\", $value[$i], true);\n";
 
	if ($param[$i] eq "datadir") {
 
	    print cppfile "  datadir = AppendHomeDirIfPathRelative(datadir);\n";
 
	}
 
    }
 
    if ($type[$i] eq "directory") {
 
	print cppfile "  if (strcmp($param[$i], \".\"))\n";
 
	print cppfile "    MakeDir($param[$i]);\n";
 
    }
 
}
 

	
 
  print cppfile <<END_MIDPART;
 
}
 

	
 
const char *sbool(const bool &p) {
 

	
 
  const char *true_str="true";
 
  const char *false_str="false";
 
  if (p)
 
    return true_str;
 
  else
 
    return false_str;
 
}
 

	
 
void Parameter::Write(ostream &os) const {
 

	
 
END_MIDPART
 

	
 
for ($i=0;$i<$lines;$i++) {
 
	    
 
    if ($convtype[$i] eq "label"  || $convtype[$i] eq "title") {
 
	next;
 
    }
 
    if ($convtype[$i] eq "double *") {
 
	print cppfile "  os << \" $param[$i] = \"";
 
	@paramlist = split(/,/,$value[$i]);
 
	for ($j=0;$j<$#paramlist;$j++) {
 
	    print cppfile "<< $param[$i]\[$j\] << \", \" ";
 
	}
 
	print cppfile "<< $param[$i]\[$#paramlist\] << endl;\n";
 
    } else {
 
	if ($convtype[$i] eq "bool") {
 
	    print cppfile "  os << \" $param[$i] = \" << sbool($param[$i]) << endl;\n";
 
	} else {
 
	    if ($convtype[$i] eq "char *") {
 
		print cppfile "\n  if ($param[$i]) \n";
 
		print cppfile "  ";
 

	
 
	    if (($convtype[$i] eq "char *") and ($param[$i] eq "datadir")) {
 
                print cppfile "  if (datadir) {
 
                                     QDir dataDir = QDir::home().relativeFilePath(datadir);
 
                                     os << \" datadir = \" << dataDir.dirName().toStdString() << endl;
 
                                 }
 
                                 else {
 
                                     os << \"datadir = .\" << endl;
 
                                 }\n";
 
	    } else {
 
		if ($convtype[$i] eq "char *") {
 
		    print cppfile "\n  if ($param[$i]) \n";
 
		}
 
		print cppfile "  os << \" $param[$i] = \" << $param[$i] << endl;\n";
 
	    }
 
	    print cppfile "  os << \" $param[$i] = \" << $param[$i] << endl;\n";
 
	}
 
    }
 
}
 

	
 
print cppfile "}\n";
 

	
 
print cppfile <<END_TRAIL2;
 

	
 
void Parameter::XMLAdd(xmlNode *root) const {
 
    xmlNode *xmlparameter = xmlNewChild(root, NULL, BAD_CAST "parameter", NULL);
 
END_TRAIL2
 

	
 
for ($i=0;$i<$lines;$i++) {
 
    if ($convtype[$i] eq "label" || $convtype[$i] eq "title") {
 
	next;
 
    }
 
    print cppfile "{\n";
 
    print cppfile "  xmlNode *xmlpar = xmlNewChild(xmlparameter, NULL, BAD_CAST \"par\", NULL);\n";
 
    print cppfile "  xmlNewProp(xmlpar, BAD_CAST \"name\", BAD_CAST \"$param[$i]\" );\n";
 
    if ($convtype[$i] eq "double *") {
 
	@paramlist = split(/,/,$value[$i]);
 
	print cppfile "  xmlNode *xmlvalarray = xmlNewChild(xmlpar, NULL, BAD_CAST \"valarray\", NULL);\n";
 
	for ($j=0;$j<=$#paramlist;$j++) {
 
	    print cppfile "  {\n";
 
	    print cppfile "    ostringstream text;\n";
 
	    print cppfile "    text << $param[$i]\[$j\];\n";
 
	    print cppfile "    xmlNode *xmlval = xmlNewChild(xmlvalarray, NULL, BAD_CAST \"val\", NULL);\n";
 
	    print cppfile "    xmlNewProp(xmlval, BAD_CAST \"v\", BAD_CAST text.str().c_str());\n";
 
	    print cppfile "  }\n";
 
	}
 
	print cppfile "}\n";
 
	next;
 
    } else {
 
	print cppfile "  ostringstream text;\n";
 
	if ($convtype[$i] eq "bool") {
 
	    print cppfile "text << sbool($param[$i]);\n";
 
	} else {
 
	    if ($convtype[$i] eq "char *") {
 
		print cppfile "\n  if ($param[$i]) \n";
 
		print cppfile "  ";
 
	    if (($convtype[$i] eq "char *") and ($param[$i] eq "datadir")) {
 
                print cppfile "\n  if ($param[$i]) {
 
                                     QDir dataDir = QDir::home().relativeFilePath(datadir);
 
                                     text << dataDir.dirName().toStdString();
 
                                   }\n";
 
	    } else {
 
		if ($convtype[$i] eq "char *") {
 
		    print cppfile "\n  if ($param[$i]) \n";
 
		}
 
		print cppfile "    text << $param[$i];\n";
 
	    }
 
	    print cppfile "  text << $param[$i];\n";
 
	}
 
    }
 
    print cppfile "xmlNewProp(xmlpar, BAD_CAST \"val\", BAD_CAST text.str().c_str());\n";
 
    print cppfile "}\n";
 
}
 

	
 
print cppfile "}\n";
 
    
 
print cppfile "void Parameter::AssignValToPar(const char *namec, const char *valc) {\n";
 
print cppfile;
 
print cppfile "  QLocale standardlocale(QLocale::C);\n";
 
print cppfile "  bool ok;\n";
 
for ($i=0;$i<$lines;$i++) {
 

	
 
    if ($convtype[$i] eq "label" || $convtype[$i] eq "title") {
 
	next;
 
    }
 
    if ($convtype[$i] eq "double *") {
 
	next;
 
    } else {
 
	print cppfile "if (!strcmp(namec, \"$param[$i]\")) {\n";
 
	if ($convtype[$i] eq "bool") {
 
	    print cppfile "$param[$i] = strtobool(valc);\n";
 
	} else {
 
	    if ($convtype[$i] eq "char *") {
 
		print cppfile "  if ($param[$i]) { free($param[$i]); }\n";
 
		print cppfile "  $param[$i]=strdup(valc);\n";
 
		if ($param[$i] eq "datadir") {
 
		    print cppfile "  datadir = AppendHomeDirIfPathRelative(datadir);\n";
 
		}
 
	    } else {
 
		if ($convtype[$i] eq "int") {
 
		    print cppfile "  $param[$i] = standardlocale.toInt(valc, &ok);\n";
 
		    print cppfile "  if (!ok) { MyWarning::error(\"Read error: cannot convert string \\\"%s\\\" to integer while reading parameter '$param[$i]' from XML file.\",valc); }\n";
 
		    # print cppfile "  $param[$i] = (int)strtol(valc, 0, 10);\n";
 
		} else {
 
		    # print cppfile "  $param[$i] = strtod(valc, 0);\n";
 
		    print cppfile "  $param[$i] = standardlocale.toDouble(valc, &ok);\n";
 
		    print cppfile "  if (!ok) { MyWarning::error(\"Read error: cannot convert string \\\"%s\\\" to double while reading parameter '$param[$i]' from XML file.\",valc); }\n";
 
		}
 
	    }
 
	}
 
    }
 
    print cppfile "}\n";
 
}
 
print cppfile "}\n";
 

	
 
print cppfile "void Parameter::AssignValArrayToPar(const char *namec, vector<double> valarray) {\n";
 
print cppfile;
 

	
 
for ($i=0;$i<$lines;$i++) {
 

	
 
    if ($convtype[$i] eq "double *") {
 
	@paramlist = split(/,/,$value[$i]);
 
	print cppfile "if (!strcmp(namec, \"$param[$i]\")) {\n";
 
	print cppfile "  int i=0;\n";
 
	print cppfile "  vector<double>::const_iterator v=valarray.begin();\n";
 
	print cppfile "  while (v!=valarray.end() && i <= $#paramlist ) {\n";
 
	print cppfile "     $param[$i]\[i++\]=*(v++);\n";
 
	print cppfile "  }\n";
 
	print cppfile "}\n";
 
    }
 
}
 

	
 
print cppfile <<END_DATADIR;
 
// reassign datadir outside the loop
 
if (!strcmp(namec, "datadir")) {
 
  if (datadir) { free(datadir); }
 
  QDir dataDir(datadir);
 
  if (dataDir.isRelative()){
 
    QStringList path;
 
    path << QDir::homePath() << dataDir.dirName();
 
    datadir = strdup((char *) path.join("/").toStdString().c_str());
 
  }
 
 }
 
END_DATADIR
 

	
 
print cppfile "}\n";
 

	
 
print cppfile <<END_TRAILER;
 

	
 
ostream &operator<<(ostream &os, Parameter &p) {
 
    p.Write(os);
 
    return os;
 
}
 

	
 
END_TRAILER
 

	
 

	
 

	
 
# parameter.h
 

	
 
open hfile, ">parameter.h";
 
print hfile <<END_HEADER2;
 
// WARNING: This file is automatically generated by make_parameter_source.pl. Do not edit.
 
// All edits will be discarded.
 

	
 
#ifndef _PARAMETER_H_
 
#define _PARAMETER_H_
 
#include "vector.h"
 
#include <vector>
 

	
 
#include <libxml/parser.h>
 
#include <libxml/tree.h>
 

	
 
 class Parameter {
 
		
 
 public: 
 
   Parameter();
 
   ~Parameter();
 
   void CleanUp(void);
 
   void Read(const char *filename);
 
   void Write(ostream &os) const;
 
   void XMLAdd(xmlNode *root) const;
 
   void XMLRead(xmlNode *root);
 
   void AssignValToPar(const char *namec, const char *valc);
 
   void AssignValArrayToPar(const char *namec, vector<double> valarray);
 
END_HEADER2
 

	
 
   for ($i=0;$i<$lines;$i++) {
 
     if ($convtype[$i] ne "label" && $convtype[$i] ne "title") {
 
       print hfile "  $convtype[$i] $param[$i];\n";
 
     }
 
   }
 

	
0 comments (0 inline, 0 general)