2011-02-28 <guravage@petitdru.sen.cwi.nl>
* canvas.cpp (about): Correct citation text.
Resolves issue #4: http://code.google.com/p/virtualleaf/issues/detail?id=4.
2011-01-13 <guravage@petitdru.sen.cwi.nl>
* transporterdialog.cpp (TransporterDialog): Use wn to discern
which cell a wallitem belongs to.
* wallitem.cpp (WallItem): Add a comment explaining how
wallnumber(wn) can be used to tell which cell a wallitem belongs
to.
* VirtualLeaf-install-windows.nsi: Remove previous change that added icon directory.
* canvas.cpp: Instead of using a separate icon directory, compile
leaficon_small.xpm directly into canvas.cpp.
* VirtualLeaf-install-windows.nsi: Add new icons directory
* canvas.cpp (about): Added virtual leaf logo to About message box.
2011-01-12 <guravage@petitdru.sen.cwi.nl>
* transporterdialog.cpp (TransporterDialog): Add a proper title to
the dialog, and place the cell and wall pairs in a seperate labe.
2011-01-10 <guravage@petitdru.sen.cwi.nl>
* transporterdialog.cpp (TransporterDialog): Start numbering Transporter fields at zero.
Resolves issue #1: http://code.google.com/p/virtualleaf/issues/detail?id=1.
* wallitem.cpp (OnClick): Change dialog modality to Qt::WindowModal.
Resolves issue #2: http://code.google.com/p/virtualleaf/issues/detail?id=2.
* canvas.cpp (about): Add link to Plant Physiology paper.
Resolves issue #3: http://code.google.com/p/virtualleaf/issues/detail?id=3.
2010-11-30 <guravage@petitdru.sen.cwi.nl>
* canvas.cpp (snapshot): Preface each image format extension with
an asterisk so files with those extensions to appear in the file
dialogue.
(snapshot): Forgot to add asterisk before our own pdf format.
* VirtualLeaf-install-windows.nsi: Include imageformats folder
alongside executable.
* canvas.cpp (snapshot): PNG is the default image format.
2010-11-29 <guravage@petitdru.sen.cwi.nl>
* canvas.cpp (snapshot): Query and display supported snapshot file
formats.
* VirtualLeaf-install-windows.nsi: To facilitate debugging I added
the debug versions of all the windows DLLs.
2010-10-19 <guravage@caterpie.sen.cwi.nl>
* mainbase.cpp (Save): Use format specified in function prototype.
* VirtualLeaf.cpp (Plot): Render PNG instead of JPEG. Write image
and XML files dependent only on getTime().
2010-10-18 <guravage@caterpie.sen.cwi.nl>
* mainbase.cpp (Save): QDir::toNativeSeparators(fname). Invoke
save with format argument set to zero to force QImage to guess the
format by looking at fileName's suffix.
* VirtualLeaf-install.nsi: Put uninstaller in top directory.
* modelcatalogue.cpp (InstallModel): For all OS-es. Move from "bin" directory to root application folder.
* VirtualLeaf.pro: MAXOSX, look for gpl3.txt in the ../doc directory.
* Makefile (Makefile.libplugin): Removed -makefile qmake option.
* VirtualLeaf.cpp (TIMESTEP): Removed getIterations().
* mesh.h (Mesh): Removed {increment,get}Iterations().
* canvas.cpp (TimeStepWrap): Replaced getIterations() with getTime().
2010-10-15 <guravage@caterpie.sen.cwi.nl>
* mesh.h (Mesh): Added iterations. incrementIterations() and
getIterations().
* VirtualLeaf.cpp (Plot): Replaced local frame counter with
mesh.incrementIterations().
* canvas.cpp (TimeStepWrap): Replaced local counter with
2010-10-14 <guravage@caterpie.sen.cwi.nl>
* VirtualLeaf.pro: Turned debug off to make all profiles must be
consistant.
* VirtualLeaf-install.nsi: Tweaked paths to coincide with UNIX
distribution, i.e. VirtualLeaf.exe, its libraries, models, and the
uninstaller all go in the bin directory. And leaves directory
placed under data directory.
* canvas.cpp (exportCellData): Added a check to inquire before
overwritting an existing file.
2010-10-14 <merks@cwi.nl>
* mesh.cpp: In response to referees' comments, added new parameter
"yield_threshold" instead of fixed parameter '4' for yield
threshold.
* wallitem.cpp: when clicking a wall, both the wall type was
cycled and the transporterdialog popped up. Corrected this - for
wall type cycling, hold the Control button while left
clicking. TransporterDialog only pops up for left click. Also made
sure the wall is redrawn after changing the transporter values.
* cell.cpp (DivideWalls): accomodated for rename of Circumference -> WallCircumference
* hull.h: added an operator< to sort Points
* hull.cpp: added an operator< to sort Points
* cellbase.cpp (ExactCircumference): I added a new function
ExactCircumference, yielding the circumference of the cell along
its wall_elements
* VirtualLeaf.cpp: adjust info_string to accomodate for new name
of function CellBase::Circumference -> CellBase::WallCircumference
* mesh.cpp: corrected Mesh::Compactness, the boundary coordinates
need to be sorted in x,y order for the convex hull algorithm
(thanks Margriet!). I updated CSVExportCellData so it exports the
circumferences of hull and boundary_polygon.
* VirtualLeafpar.tmpl (export_fn_prefix): changed to 'cell.'
* canvas.cpp (TimeStepWrap): Removed TimeStamp(). Cell data
filename now incorporates iteration number.
* canvas.h (MainBase): Removed TimeStamp().
2010-10-08 <guravage@caterpie.sen.cwi.nl>
* pardialog.h:
* pardialog.cpp:
* parameter.h:
* parameter.cpp: Regenerated to include export_interval and export_fn_prefix.
* VirtualLeafpar.tmpl: Appended export_interval and export_fn_prefix.
* canvas.h (MainBase): Declared polymorphic exportCellData() functions.
* canvas.cpp:
(TimeStamp): New private TimeStamp() function.
(TimeStepWrap): Added invocation of exportCellData().
(exportCellData): Created two polymorphic functions: one with a
single QString argument, the other with no argument. The former is
called from TimeStepWrap() while the latter is called from the
"Export cell areas" item in the file menu.
2010-10-07 <guravage@caterpie.sen.cwi.nl>
* canvas.cpp (exportCellData): Added a Q3FileDialog to inquire
where to write the exportCellData.
2010-06-28 <guravage@caterpie.sen.cwi.nl>
* VirtualLeaf-install.nsi: Grab gpl3.txt from doc directory.
* canvas.cpp (gpl): gpl3.txt can be either in an ancestor doc
directory (Linux) or a decedent doc directory (Windows, via the
binary installer).
* VirtualLeaf-install.nsi: Add VirtualLeaf doc directory.
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.
@@ -857,388 +857,388 @@ int Main::readStateXML(const char *filen
} catch (const char *error_message) {
QMessageBox mb( "Read leaf from XML file",
QString(error_message),
QMessageBox::Critical,
QMessageBox::Ok | QMessageBox::Default,
Qt::NoButton,
Qt::NoButton);
mb.exec();
return 1;
}
void Main::readNextStateXML()
{
// if we have already read a file, read the next file
if (!currentFile.isEmpty() && working_dir) {
QString next_file;
QStringList xml_files = working_dir->entryList("*.xml");
QString currentFile_nopath = currentFile.section( '/', -1 );
QString currentFile_path = currentFile.section( '/', 0, -2 );
QList<QString>::iterator f = xml_files.find( currentFile_nopath );
if (f == xml_files.end()) {
return;
++f;
if (f==xml_files.end()) {
QMessageBox mb( "Read next leaf",
"No more files",
QMessageBox::Information,
QMessageBox::NoButton,
QMessageBox::NoButton);
next_file = *f;
next_file = currentFile_path+"/"+next_file;
readStateXML((const char*)next_file);
void Main::readLastStateXML()
next_file = xml_files.back();
void Main::readFirstStateXML()
next_file = xml_files.front();
QDir Main::GetLeafDir(void) {
QDir LeafDir(QApplication::applicationDirPath());
QStringList plugin_filters; // filter for plugins, i.e "*.dll", "*.dylib"
#if defined(Q_OS_WIN)
if (LeafDir.dirName().toLower() =="debug"
||LeafDir.dirName().toLower() =="release")
LeafDir.cdUp();
//plugin_filters << "*.dll";
#elif defined(Q_OS_MAC)
if (LeafDir.dirName() =="MacOS"){
#endif
// for all OS-es. Move from "bin" directory to root application folder.
if (LeafDir.dirName() == "bin") {
LeafDir.cd("data/leaves");
/* if (!LeafDir.cd("data/leaves")) {
QString status_message = QString("No directory data/leaves");
statusBar()->showMessage(status_message);
return LeafDir;
*/
void Main::readStateXML()
// extern Mesh mesh;
stopSimulation();
#ifdef QDEBUG
qDebug() << "Trying to open an OptionFileDialog" << endl;
OptionFileDialog *fd = new OptionFileDialog( this, "read dialog", TRUE );
fd->setMode( OptionFileDialog::ExistingFile );
fd->setFilter( "LeafML files (*.xml)");
if (working_dir) {
fd->setDir(*working_dir);
} else {
fd->setDir(par.datadir);
QString fileName;
if ( fd->exec() == QDialog::Accepted ) {
fileName = fd->selectedFile();
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.\
</p>\
<p>(c) 2005-2008, Roeland Merks <i>et al.</i>\
<a href=\"http://www.psb.vib-ugent.be\">VIB Department Plant Systems Biology</a>,\
Ghent, Belgium.\
<p>(c) 2008-2010,\
<a href=\"http://www.cwi.nl/~merks\">Roeland Merks <i>et al.</i></a>\
<a href=\"http://www.cwi.nl\">Centrum Wiskunde & Informatica (CWI)</a> and\
<a href=\"http://www.ncsb.nl\"> Netherlands Consortium for Systems Biology (NCSB)</a>,\
Amsterdam, the Netherlands.\
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.\
If you use this code for your projects, please cite our paper in\
<a href=\"http://www.plantphysiol.org\">Plant Physiology</a>, ‘\
Roeland M. H. Merks, Michael Guravage, Dirk Inze, and Gerrit T.S. Beemster,\
<a href=\"http://www.plantphysiol.org/cgi/content/short/pp.110.167619?keytype=ref&ijkey=YTmfxrHG5QCsa8k\">\
Roeland M. H. Merks, Michael Guravage, Dirk Inzé, and Gerrit T.S. Beemster,\
<a href=\"http://www.plantphysiol.org/cgi/reprint/155/2/656.pdf\">\
VirtualLeaf: an Open Source framework for cell-based modeling of plant tissue growth and development</a>,<br>\
Plant Physiology 2011: pp.110.167619v1-pp.110.167619.\
Plant Physiology 2011: 155:656-666.\
Please share your model plugins and extensions at\
<a href=\"http://virtualleaf.googlecode.com\">http://virtualleaf.googlecode.com</a>.\
</p>",
QMessageBox::Information, 1, 0, 0, this, 0, FALSE );
about->setButtonText( 1, "Dismiss" );
about->setIconPixmap(QPixmap( leaficon_small ));
about->show();
void Main::gpl()
static QMessageBox* gpl = new QMessageBox ( "GPL License", "",
QDir docDir(QApplication::applicationDirPath());
docDir.cd("../doc"); // Where Linux expects gpl3.txt
QString path = docDir.filePath("gpl3.txt");
if (!docDir.exists("gpl3.txt")){
docDir = QApplication::applicationDirPath();
docDir.cd("doc"); // Where Windows expects gpl3.txt
path = docDir.filePath("gpl3.txt");
// At this point path points either to the linux variant, which
// exists, or the windows variant, which may exist. Testing the
// ifstream object will determine whether we've found 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 © 2007 Free Software Foundation, Inc. "
"<<a href=\"http://fsf.org/\">http://fsf.org/</a>></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()
void Main::toggleShowApoplasts()
void Main::toggleShowNodes()
void Main::toggleNodeNumbers(void)
void Main::toggleCellNumbers(void)
void Main::toggleCellAxes(void)
void Main::toggleCellStrain(void)
void Main::toggleShowFluxes(void)
void Main::toggleShowBorderCells()
void Main::toggleHideCells(void)
editor->FullRedraw();
void Main::toggleMovieFrames(){}
void Main::toggleLeafBoundary(){}
void Main::toggleDynCells() {}
void Main::startSimulation(void)
timer->start( 0 );
statusBar()->message("Simulation started");
running = true;
void Main::stopSimulation(void)
timer->stop();
cerr << "Stopping simulation" << endl;
statusBar()->message("Simulation paused");
running = false;
void Main::togglePaused()
bool s = run->isItemChecked(paused_id);
if (s) {
cerr << "Calling start simulation" << endl;
startSimulation();
cerr << "Calling stop simulation" << endl;
void Main::setFluxArrowSize(int size)
flux_arrow_size = size/100.;
void Main::enlarge()
canvas.setSceneRect( QRectF( 0,0, canvas.width()*4./3., canvas.height()*4./3.) );
void Main::shrink()
canvas.setSceneRect( QRectF( 0,0, canvas.width()*3/4, canvas.height()*3/4) );
void Main::scale(double factor)
QMatrix m = editor->matrix();
m.scale(factor, factor);
editor->setMatrix( m );
void Main::zoomIn()
m.scale( 1.1, 1.1 );
void Main::zoomOut()
m.scale( 0.9, 0.9 );
void Main::print()
if ( !printer ) printer = new QPrinter;
Status change: