Changeset - 311dea91a9b6
[Not reviewed]
Merge default
1 23 19
Michael Guravage - 15 years ago 2010-06-04 16:05:21
michael.guravage@cwi.nl
Merged Roeland's latest changes with my project file changes (16:3f0977faba37).

--
user: Michael Guravage <michael.guravage@cwi.nl>
branch merge
branch 'default'
changed src/Makefile
changed src/TutorialCode/Tutorial0/mymodel.cpp
changed src/TutorialCode/Tutorial0/mymodel.h
changed src/TutorialCode/Tutorial0/mymodel.pro
changed src/TutorialCode/Tutorial1/mymodel.cpp
changed src/TutorialCode/Tutorial1/mymodel.h
changed src/TutorialCode/Tutorial1/mymodel.pro
changed src/TutorialCode/Tutorial2/mymodel.cpp
changed src/TutorialCode/Tutorial2/mymodel.h
changed src/TutorialCode/Tutorial2/mymodel.pro
changed src/TutorialCode/Tutorial3/mymodel.cpp
changed src/TutorialCode/Tutorial3/mymodel.h
changed src/TutorialCode/Tutorial3/mymodel.pro
changed src/TutorialCode/Tutorial4/mymodel.cpp
changed src/TutorialCode/Tutorial4/mymodel.h
changed src/TutorialCode/Tutorial4/mymodel.pro
changed src/TutorialCode/Tutorial5/mymodel.cpp
changed src/TutorialCode/Tutorial5/mymodel.h
changed src/TutorialCode/Tutorial5/mymodel.pro
changed src/VirtualLeaf.pro
changed src/VirtualLeafpar.tmpl
changed src/build_models/Makefile
changed src/build_models/auxingrowthplugin.cpp
changed src/build_models/auxingrowthplugin.h
changed src/build_models/leafplugin.cpp
changed src/build_models/leafplugin.h
changed src/build_models/meinhardtplugin.cpp
changed src/build_models/meinhardtplugin.h
changed src/build_models/plugin_auxingrowth.pro
changed src/build_models/plugin_leaf.pro
changed src/build_models/plugin_meinhardt.pro
changed src/build_models/plugin_test.pro
changed src/build_models/testplugin.cpp
changed src/build_models/testplugin.h
changed src/build_models/translate_plugin.pl
changed src/cell.cpp
changed src/cellbase.h
changed src/libplugin.pro
changed src/mesh.cpp
changed src/mesh.h
changed src/modelcatalogue.cpp
changed src/simplugin.h
removed src/build_models/simplugin.h
42 files changed with 1422 insertions and 207 deletions:
0 comments (0 inline, 0 general)
src/Makefile
Show inline comments
 
# $Id$
 

	
 
QMAKE = qmake
 

	
 
all: VirtualLeaf libplugin plugins
 

	
 
VirtualLeaf: Makefile.VirtualLeaf
 
	make -f Makefile.VirtualLeaf
 

	
 
Makefile.VirtualLeaf: VirtualLeaf.pro
 
	qmake -makefile -o $@ $< 
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
libplugin: Makefile.libplugin
 
	make -f Makefile.libplugin
 

	
 
Makefile.libplugin: libplugin.pro
 
	qmake -makefile -o $@ $< 
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
plugins:
 
	make -C build_models
src/TutorialCode/Tutorial0/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  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.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "My first model in VirtualLeaf" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 

	
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial0/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $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.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial0/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $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 = mymodel
 
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_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 = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial1/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  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.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Cell growth" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 

	
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial1/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $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.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial1/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $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 = mymodel
 
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_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 = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial2/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  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.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Cell growth and cell division" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 

	
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->Divide();
 
	}
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial2/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $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.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial2/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $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 = mymodel
 
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_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 = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial3/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  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.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Cell growth and cell division" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->DivideOverAxis(Vector(1,0,0));
 
	}
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial3/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $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.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial3/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $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 = mymodel
 
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_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 = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial4/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  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.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Growth, division, coloring" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 0; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 
	if (c->Area()/c->BaseArea()>1.8) { color->setNamedColor("blue"); }
 
	else { color->setNamedColor("green"); }
 

	
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->Divide();
 
	}
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
}
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial4/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $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.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial4/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $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 = mymodel
 
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_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 = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/TutorialCode/Tutorial5/mymodel.cpp
Show inline comments
 
new file 100644
 
/*
 
 *
 
 *  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.
 
 *
 
 */
 

	
 
#include <QObject>
 
#include <QtGui>
 

	
 
#include "simplugin.h"
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "mymodel.h"
 

	
 
static const std::string _module_id("$Id$");
 

	
 
QString MyModel::ModelID(void) {
 
  // specify the name of your model here
 
  return QString( "Growth hormones" );
 
}
 

	
 
// return the number of chemicals your model uses
 
int MyModel::NChem(void) { return 1; }
 

	
 
// To be executed after cell division
 
void MyModel::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
  // rules to be executed after cell division go here
 
  // (e.g., cell differentiation rules)
 
	
 
	// set one cell to source after first division
 
	if (CellBase::NCells()==2) {
 
		daughter1->SetCellType(1);
 
		daughter2->SetCellType(0);
 
	}
 
	
 
	// if a source cells has divided, one of the daughters becomes the new source
 
	if (daughter1->CellType()==1) {
 
		
 
		// if both cells are at the tissue perimeter, choose at random
 
		if (daughter1->AtBoundaryP() && daughter2->AtBoundaryP()) {
 
		
 
			if (qrand()%2){
 
				daughter1->SetCellType(1);
 
				daughter2->SetCellType(0);
 
			} else {
 
				daughter1->SetCellType(0);
 
				daughter2->SetCellType(1);
 
			}
 
		} else {
 
			// otherwise choose the one that is still at the perimeter
 
			if (daughter1->AtBoundaryP()) {
 
				daughter1->SetCellType(1);
 
				daughter2->SetCellType(0);
 
			} else {
 
				daughter1->SetCellType(0);
 
				daughter2->SetCellType(1);
 
			}
 
		}
 
	}
 
	
 
}
 

	
 
void MyModel::SetCellColor(CellBase *c, QColor *color) { 
 
  // add cell coloring rules here
 
	
 
	// white: high concentration of growth hormone, black low concentration
 
	double val = c->Chemical(0)/(1.+c->Chemical(0));
 
	color->setRgbF(val, val, val);
 
}
 

	
 
void MyModel::CellHouseKeeping(CellBase *c) {
 
  // add cell behavioral rules here
 
	if (CellBase::NCells()==1)
 
		// first cell expands unconditionally 
 
		c->EnlargeTargetArea(par->cell_expansion_rate);
 
	else 
 
		c->EnlargeTargetArea(c->Chemical(0)*par->cell_expansion_rate);
 
	
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea()) {
 
		c->Divide();
 
	}
 
}
 

	
 
void MyModel::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  // add biochemical transport rules here
 
	double phi = w->Length() * par->D[0] * ( w->C2()->Chemical(0) - w->C1()->Chemical(0) );
 
	dchem_c1[0]+=phi;
 
	dchem_c2[0]-=phi;
 
}
 

	
 
void MyModel::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  // add biochemical networks for reactions occuring at walls here
 
}
 
void MyModel::CellDynamics(CellBase *c, double *dchem) { 
 
  // add biochemical networks for intracellular reactions here
 
	if (c->CellType()==1) {
 
		dchem[0] = par->leaf_tip_source;
 
	}
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(mymodel, MyModel)
src/TutorialCode/Tutorial5/mymodel.h
Show inline comments
 
new file 100644
 
/*
 
 *  $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.
 
 *
 
 */
 

	
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 

	
 

	
 
class MyModel : public QObject, SimPluginInterface {
 
	Q_OBJECT
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial5/mymodel.pro
Show inline comments
 
new file 100644
 
#
 
# $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 = mymodel
 
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_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 = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finish
src/VirtualLeaf.pro
Show inline comments
 
@@ -117,7 +117,7 @@ HEADERS += \
 
 cellbase.h \
 
 cell.h \
 
 cellitem.h \
 
 forwardeuler.h \
 
# forwardeuler.h \
 
 infobar.h \
 
 mainbase.h \
 
 mainbase.h \
 
@@ -158,7 +158,7 @@ SOURCES += \
 
 cellbase.cpp \
 
 cell.cpp \
 
 cellitem.cpp \
 
 forwardeuler.cpp \
 
# forwardeuler.cpp \
 
 mainbase.cpp \
 
 matrix.cpp \
 
 mesh.cpp \
src/VirtualLeafpar.tmpl
Show inline comments
 
@@ -8,7 +8,7 @@ nodenumsize = 1 / int
 
node_mag = 1.0 / double 
 
outlinewidth = 1.0 / double
 
cell_outline_color = forestgreen / string
 
resize_stride = 10 / int
 
resize_stride = 0 / int
 
label = / label
 
label = <b>Cell mechanics</b> / label
 
T = 1.0 / double
src/build_models/Makefile
Show inline comments
 
# $Id$
 

	
 
QMAKE = qmake
 

	
 
all: plugin_auxingrowth plugin_leaf plugin_meinhardt plugin_test
 

	
 
plugin_auxingrowth: Makefile.plugin_auxingrowth
 
	make -f Makefile.plugin_auxingrowth
 

	
 
Makefile.plugin_auxingrowth: plugin_auxingrowth.pro
 
	qmake -makefile -o $@ $< 
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
plugin_leaf: Makefile.plugin_leaf
 
	make -f Makefile.plugin_leaf
 

	
 
Makefile.plugin_leaf: plugin_leaf.pro
 
	qmake -makefile -o $@ $< 
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
plugin_meinhardt: Makefile.plugin_meinhardt
 
	make -f Makefile.plugin_meinhardt
 

	
 
Makefile.plugin_meinhardt: plugin_meinhardt.pro
 
	qmake -makefile -o $@ $< 
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
plugin_test: Makefile.plugin_test
 
	make -f Makefile.plugin_test
 

	
 
Makefile.plugin_test: plugin_test.pro
 
	qmake -makefile -o $@ $< 
 
	$(QMAKE) -makefile -o $@ $< 
 

	
 
clean:
 
	make -f Makefile.plugin_auxingrowth clean
src/build_models/auxingrowthplugin.cpp
Show inline comments
 
@@ -37,23 +37,23 @@ bool batch = false;
 

	
 

	
 
// To be executed after cell division
 
void AuxinGrowthPlugin::OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2) {
 
void AuxinGrowthPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
	// Auxin distributes between parent and daughter according to area
 
	double area1 = daughter1.Area(), area2 = daughter2.Area();
 
	double area1 = daughter1->Area(), area2 = daughter2->Area();
 
	double tot_area = area1 + area2;
 
	
 
	daughter1.SetChemical(0,daughter1.Chemical(0)*(area1/tot_area));
 
	daughter2.SetChemical(0,daughter2.Chemical(0)*(area2/tot_area));
 
	daughter1->SetChemical(0,daughter1->Chemical(0)*(area1/tot_area));
 
	daughter2->SetChemical(0,daughter2->Chemical(0)*(area2/tot_area));
 
	
 
	// After divisions, parent and daughter cells get a standard stock of PINs.
 
	daughter1.SetChemical(1, par->initval[1]);
 
	daughter2.SetChemical(1, par->initval[1]);
 
	daughter1->SetChemical(1, par->initval[1]);
 
	daughter2->SetChemical(1, par->initval[1]);
 
	
 
	
 
	// Reset transporter values of parent and daughter
 
	QList<WallBase *> walls;
 
	foreach(WallBase *w, walls) { 
 
		w->setTransporter(&daughter1, 1, 0.);
 
		w->setTransporter(daughter1, 1, 0.);
 
	}
 
	
 
	//daughter1.LoopWalls(Wall::setTransporter(&daughter1, 1, 0.));
 
@@ -68,29 +68,29 @@ void AuxinGrowthPlugin::OnDivide(ParentI
 
	*/
 
}
 

	
 
void AuxinGrowthPlugin::SetCellColor(CellBase &c, QColor &color) { 
 
void AuxinGrowthPlugin::SetCellColor(CellBase *c, QColor *color) { 
 

	
 
	// Red: PIN1
 
	// Green: Auxin
 
	if (c.CellType()==1) color = QColor("Blue"); 
 
	else color.setRgb(c.Chemical(1)/(1+c.Chemical(1)) * 255.,(c.Chemical(0)/(1+c.Chemical(0)) * 255.),/* (chem[2]/(1+chem[2]) *255.) */ 0);
 
	if (c->CellType()==1) color->setNamedColor("Blue"); 
 
	else color->setRgb(c->Chemical(1)/(1+c->Chemical(1)) * 255.,(c->Chemical(0)/(1+c->Chemical(0)) * 255.),/* (chem[2]/(1+chem[2]) *255.) */ 0);
 
	
 
}
 

	
 

	
 

	
 
void AuxinGrowthPlugin::CellHouseKeeping(CellBase &c) {
 
void AuxinGrowthPlugin::CellHouseKeeping(CellBase *c) {
 

	
 
	if (c.Boundary()==CellBase::None) {
 
		if (c.Area() > par->rel_cell_div_threshold * c.BaseArea() ) {
 
			c.SetChemical(0,0);
 
			c.Divide();
 
	if (c->Boundary()==CellBase::None) {
 
		if (c->Area() > par->rel_cell_div_threshold * c->BaseArea() ) {
 
			c->SetChemical(0,0);
 
			c->Divide();
 
        }		
 
		if (c.Chemical(0)>0.6) {
 
			c.SetCellType(1);
 
		if (c->Chemical(0)>0.6) {
 
			c->SetCellType(1);
 
		} 
 
		// expand according to auxin concentration
 
   		c.EnlargeTargetArea(par->auxin_dependent_growth?(c.Chemical(0)/(1.+c.Chemical(0)))*par->cell_expansion_rate:par->cell_expansion_rate);
 
   		c->EnlargeTargetArea(par->auxin_dependent_growth?(c->Chemical(0)/(1.+c->Chemical(0)))*par->cell_expansion_rate:par->cell_expansion_rate);
 
	}  
 
	
 

	
 
@@ -241,15 +241,15 @@ void AuxinGrowthPlugin::WallDynamics(Wal
 
    dw2[1] = dPijdt2;
 
}
 

	
 
double AuxinGrowthPlugin::complex_PijAj(CellBase &here, CellBase &nb, Wall &w) { 
 
double AuxinGrowthPlugin::complex_PijAj(CellBase *here, CellBase *nb, Wall *w) { 
 
	
 
	// gives the amount of complex "auxinreceptor-Pin1"  at the wall (at QSS) 
 
	//return here.Chemical(1) * nb.Chemical(0) / ( par->km + here.Chemical(1));
 
	
 
	double nb_aux = (nb.BoundaryPolP() && w.AuxinSink()) ? par->sam_auxin : nb.Chemical(0);
 
	double nb_aux = (nb->BoundaryPolP() && w->AuxinSink()) ? par->sam_auxin : nb->Chemical(0);
 
	double receptor_level = nb_aux * par->r / (par->kr + nb_aux);
 
	
 
	return here.Chemical(1) * receptor_level / ( par->km + here.Chemical(1));
 
	return here->Chemical(1) * receptor_level / ( par->km + here->Chemical(1));
 
	
 
}
 

	
src/build_models/auxingrowthplugin.h
Show inline comments
 
@@ -37,7 +37,7 @@ public:
 
	virtual QString ModelID(void) { return QString( "Auxin accumulation and growth" ); }
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase &c);
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
@@ -49,15 +49,15 @@ public:
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2);
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase &c, QColor &color);	
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void) { return 2; }
 
	
 
private:
 
	double complex_PijAj(CellBase &here, CellBase &nb, Wall &w);
 
	double complex_PijAj(CellBase *here, CellBase *nb, Wall *w);
 
};
 

	
 
#endif
src/build_models/leafplugin.cpp
Show inline comments
 
@@ -37,9 +37,9 @@ static const std::string _module_id("$Id
 
bool batch = false;
 

	
 
// To be executed after cell division
 
void LeafPlugin::OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2) {
 
void LeafPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
		// PIN1 distributes between parent and daughter according to area
 
  double area = daughter1.Area(), daughter_area = daughter2.Area();
 
  double area = daughter1->Area(), daughter_area = daughter2->Area();
 
  double tot_area = area + daughter_area;
 
  
 
  //chem[1]*=(area/tot_area);
 
@@ -54,10 +54,10 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
  // redistribute the PIN in the endosome according to area
 
  
 
	// "Fudge" rule: if one of the cells is at the boundary, remove all AUX1 in the other cell
 
  if (daughter1.AtBoundaryP() && !daughter2.AtBoundaryP()) {
 
    //daughter2.new_chem[2]=daughter2.chem[2]=0.;
 
		daughter2.SetNewChem(2,0);
 
		daughter2.SetChemical(2,0);
 
  if (daughter1->AtBoundaryP() && !daughter2->AtBoundaryP()) {
 
    //daughter2->new_chem[2]=daughter2->chem[2]=0.;
 
		daughter2->SetNewChem(2,0);
 
		daughter2->SetChemical(2,0);
 
		//daughter.new_chem[0]=daughter.chem[0]=0.;
 
		//cerr << "Clearing daughter\n";
 
		//for (list<Wall *>::const_iterator w=daughter.walls.begin();
 
@@ -67,16 +67,16 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
		//	(*w)->setTransporter(&daughter, 1, 0.);
 
		
 
		//}
 
		//new_chem[2]=chem[2]=parent_info.PINendosome;
 
		daughter1.SetNewChem(2,parent_info.PINendosome);
 
		daughter1.SetChemical(2,parent_info.PINendosome);
 
		//new_chem[2]=chem[2]=parent_info->PINendosome;
 
		daughter1->SetNewChem(2,parent_info->PINendosome);
 
		daughter1->SetChemical(2,parent_info->PINendosome);
 
 
 
	} else {
 
		if (daughter2.AtBoundaryP() && !daughter1.AtBoundaryP()) {
 
		if (daughter2->AtBoundaryP() && !daughter1->AtBoundaryP()) {
 
		  
 
		  //new_chem[2]=chem[2]=0.;
 
		  daughter1.SetNewChem(2,0);
 
		  daughter1.SetChemical(2,0);
 
		  daughter1->SetNewChem(2,0);
 
		  daughter1->SetChemical(2,0);
 
		  
 
			/*new_chem[0]=chem[0]=0.;
 
			for (list<Wall *>::const_iterator w=walls.begin();
 
@@ -85,17 +85,17 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
				
 
				(*w)->setTransporter(this, 1, 0.);
 
			}*/
 
		  //daughter2.chem[2]=parent_info.PINendosome;
 
		  daughter2.SetChemical(2,parent_info.PINendosome);
 
		  //daughter2->chem[2]=parent_info->PINendosome;
 
		  daughter2->SetChemical(2,parent_info->PINendosome);
 
		  //cerr << "Clearing parent\n";
 
		  
 
		} else {
 
		  //daughter1.new_chem[2]=daughter1.chem[2] = parent_info.PINendosome*(area/tot_area);
 
		  daughter1.SetNewChem(2,parent_info.PINendosome*(area/tot_area));
 
		  daughter1.SetChemical(2, parent_info.PINendosome*(area/tot_area));
 
		  //daughter2.new_chem[2]=daughter2.chem[2] = parent_info.PINendosome*(daughter_area/tot_area);
 
		  daughter2.SetNewChem(2,parent_info.PINendosome*(daughter_area/tot_area));
 
		  daughter2.SetChemical(2,parent_info.PINendosome*(daughter_area/tot_area));
 
		  //daughter1->new_chem[2]=daughter1->chem[2] = parent_info->PINendosome*(area/tot_area);
 
		  daughter1->SetNewChem(2,parent_info->PINendosome*(area/tot_area));
 
		  daughter1->SetChemical(2, parent_info->PINendosome*(area/tot_area));
 
		  //daughter2->new_chem[2]=daughter2->chem[2] = parent_info->PINendosome*(daughter_area/tot_area);
 
		  daughter2->SetNewChem(2,parent_info->PINendosome*(daughter_area/tot_area));
 
		  daughter2->SetChemical(2,parent_info->PINendosome*(daughter_area/tot_area));
 
		  
 
		}
 
	}
 
@@ -112,12 +112,12 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
	double daughter_circ = daughter.Circumference();
 
	double tot_circ = circ + daughter_circ;
 
	
 
	double wallPINs = (circ / tot_circ) * parent_info.PINmembrane;
 
	double daughter_wallPINs = (daughter_circ / tot_circ) * parent_info.PINmembrane;
 
	double wallPINs = (circ / tot_circ) * parent_info->PINmembrane;
 
	double daughter_wallPINs = (daughter_circ / tot_circ) * parent_info->PINmembrane;
 
	
 
     	//cerr << "wallPINs = " << wallPINs <<  ", daughter_wallPINs =  " << daughter_wallPINs << "sum = " << wallPINs + daughter_wallPINs << ", PINmembrane = " << parent_info.PINmembrane << endl;
 
     	//cerr << "wallPINs = " << wallPINs <<  ", daughter_wallPINs =  " << daughter_wallPINs << "sum = " << wallPINs + daughter_wallPINs << ", PINmembrane = " << parent_info->PINmembrane << endl;
 
	// distrubute it according to the overall polarity
 
	Vector polarization = parent_info.polarization.Normalised().Perp2D();
 
	Vector polarization = parent_info->polarization.Normalised().Perp2D();
 
	
 
	double sum=0.;
 
	for (list<Wall *>::const_iterator w=walls.begin();
 
@@ -143,30 +143,30 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
	*/
 
}
 

	
 
void LeafPlugin::SetCellColor(CellBase &c, QColor &color) { 
 
void LeafPlugin::SetCellColor(CellBase *c, QColor *color) { 
 

	
 
	// Red: AUX1
 
	// Green: Auxin
 
	// Blue: van-3
 
  //  color.setRgb(chem[2]/(1+chem[2]) * 255.,(chem[0]/(1+chem[0]) * 255.),(chem[3]/(1+chem[3]) *255.) );
 
  color.setRgb(c.Chemical(2)/(1+c.Chemical(2)) * 255.,(c.Chemical(0)/(1+c.Chemical(0)) * 255.),(c.Chemical(3)/(1+c.Chemical(3)) *255.) );
 
  //  color->setRgb(chem[2]/(1+chem[2]) * 255.,(chem[0]/(1+chem[0]) * 255.),(chem[3]/(1+chem[3]) *255.) );
 
  color->setRgb(c->Chemical(2)/(1+c->Chemical(2)) * 255.,(c->Chemical(0)/(1+c->Chemical(0)) * 255.),(c->Chemical(3)/(1+c->Chemical(3)) *255.) );
 
  
 

	
 
}
 

	
 

	
 

	
 
void LeafPlugin::CellHouseKeeping(CellBase &c) {
 
void LeafPlugin::CellHouseKeeping(CellBase *c) {
 
	
 
  if (c.Boundary()==CellBase::None) {
 
    if (c.Area() > par->rel_cell_div_threshold * c.BaseArea() ) {
 
      //c.SetChemical(0,0);
 
      c.Divide();
 
  if (c->Boundary()==CellBase::None) {
 
    if (c->Area() > par->rel_cell_div_threshold * c->BaseArea() ) {
 
      //c->SetChemical(0,0);
 
      c->Divide();
 
    }		
 
    
 
    // expand if this is not a provascular cell
 
    if (c.Chemical(3) < 0.7 ) {
 
      c.EnlargeTargetArea(par->cell_expansion_rate);
 
    if (c->Chemical(3) < 0.7 ) {
 
      c->EnlargeTargetArea(par->cell_expansion_rate);
 
    } 
 
  }  
 
  
 
@@ -359,15 +359,15 @@ void LeafPlugin::WallDynamics(Wall *w, d
 
  
 
}
 

	
 
double LeafPlugin::complex_PijAj(CellBase &here, CellBase &nb, Wall &w) { 
 
double LeafPlugin::complex_PijAj(CellBase *here, CellBase *nb, Wall *w) { 
 

	
 
  // gives the amount of complex "auxinreceptor-Pin1"  at the wall (at QSS) 
 
  //return here.Chemical(1) * nb.Chemical(0) / ( par->km + here.Chemical(1));
 
  
 
  double nb_aux = (nb.BoundaryPolP() && w.AuxinSink()) ? par->sam_auxin : nb.Chemical(0);
 
  double nb_aux = (nb->BoundaryPolP() && w->AuxinSink()) ? par->sam_auxin : nb->Chemical(0);
 
  double receptor_level = nb_aux * par->r / (par->kr + nb_aux);
 

	
 
  return here.Chemical(1) * receptor_level / ( par->km + here.Chemical(1));
 
  return here->Chemical(1) * receptor_level / ( par->km + here->Chemical(1));
 
  
 
}
 

	
src/build_models/leafplugin.h
Show inline comments
 
@@ -37,7 +37,7 @@ public:
 
	virtual QString ModelID(void) { return QString( "Traveling wave model with influx carriers - Merks and Beemster, 2006-2008" ); }
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase &c);
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
@@ -49,15 +49,15 @@ public:
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2);
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase &c, QColor &color);	
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void) { return 4; }
 

	
 
 private:
 
	double complex_PijAj(CellBase &here, CellBase &nb, Wall &w);
 
	double complex_PijAj(CellBase *here, CellBase *nb, Wall *w);
 
	
 
};
 

	
src/build_models/meinhardtplugin.cpp
Show inline comments
 
@@ -21,7 +21,7 @@
 

	
 
#include <QObject>
 
#include <QtGui>
 
#include "simplugin.h"
 
#include "../simplugin.h"
 

	
 
#include "parameter.h"
 
#include "warning.h"
 
@@ -34,24 +34,24 @@ static const std::string _module_id("$Id
 
bool batch = false;
 

	
 
// To be executed after cell division
 
void MeinhardtPlugin::OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2) {
 
void MeinhardtPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
	
 
}
 

	
 
void MeinhardtPlugin::SetCellColor(CellBase &c, QColor &color) { 
 
void MeinhardtPlugin::SetCellColor(CellBase *c, QColor *color) { 
 

	
 
	if (fpclassify(c.Chemical(0))==FP_NAN) {
 
	if (fpclassify(c->Chemical(0))==FP_NAN) {
 
		// somehow the function isnan doesn't work properly on my system... SuSE Linux
 
		// 10.0 64-bits (isnan seems not be implemented using fpclassify).
 
		MyWarning::warning("Whoops! Numerical instability!!");
 
		color.setNamedColor("red");
 
		color->setNamedColor("red");
 
	} else {
 
		double range_min = 0.;//, range_max = 1.;
 
		if (c.Chemical(0)<range_min) {
 
		if (c->Chemical(0)<range_min) {
 
			MyWarning::warning("Whoops! Numerical instability!!");
 
			color.setNamedColor("blue");
 
			color->setNamedColor("blue");
 
		} else {
 
			color.setRgb(c.Chemical(1)/(1+c.Chemical(1)) * 255.,(c.Chemical(0)/(1+c.Chemical(0)) * 255.),(c.Chemical(3)/(1+c.Chemical(3)) *255.) );
 
			color->setRgb(c->Chemical(1)/(1+c->Chemical(1)) * 255.,(c->Chemical(0)/(1+c->Chemical(0)) * 255.),(c->Chemical(3)/(1+c->Chemical(3)) *255.) );
 
		}
 
		
 
	}
 
@@ -59,21 +59,21 @@ void MeinhardtPlugin::SetCellColor(CellB
 

	
 

	
 

	
 
void MeinhardtPlugin::CellHouseKeeping(CellBase &c) {
 
void MeinhardtPlugin::CellHouseKeeping(CellBase *c) {
 
	
 
	if (c.Area() > par->rel_cell_div_threshold * c.BaseArea() ) {
 
		c.Divide();
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea() ) {
 
		c->Divide();
 
	}
 
	
 
    // cell expansion is inhibited by substrate (chem 3)
 
	if (!par->constituous_expansion_limit || c.NCells()<par->constituous_expansion_limit) {
 
		c.EnlargeTargetArea(par->cell_expansion_rate );
 
	if (!par->constituous_expansion_limit || c->NCells()<par->constituous_expansion_limit) {
 
		c->EnlargeTargetArea(par->cell_expansion_rate );
 
	} else {
 
		if (c.Chemical(0)<0.5) {
 
		if (c->Chemical(0)<0.5) {
 
			double tmp;
 
			c.EnlargeTargetArea((tmp=(1.-par->vessel_inh_level*c.Chemical(3))*par->cell_expansion_rate /* + c.Chemical(4)*/)<0?0:tmp); 
 
			c->EnlargeTargetArea((tmp=(1.-par->vessel_inh_level*c->Chemical(3))*par->cell_expansion_rate /* + c->Chemical(4)*/)<0?0:tmp); 
 
		} else {
 
			c.EnlargeTargetArea(par->vessel_expansion_rate);
 
			c->EnlargeTargetArea(par->vessel_expansion_rate);
 
		}
 
	} 
 
    
src/build_models/meinhardtplugin.h
Show inline comments
 
@@ -26,7 +26,7 @@
 
#include <QObject>
 
#include <QtGui>
 
#include <QString>
 
#include "simplugin.h"
 
#include "../simplugin.h"
 

	
 

	
 
class MeinhardtPlugin : public QObject, SimPluginInterface {
 
@@ -37,7 +37,7 @@ public:
 
	virtual QString ModelID(void) { return QString( "Meinhardt 1976, with growth" ); }
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase &c);
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
@@ -49,10 +49,10 @@ public:
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2);
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase &c, QColor &color);	
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void) { return 4; }
 
};
src/build_models/plugin_auxingrowth.pro
Show inline comments
 
@@ -24,6 +24,7 @@ CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = ../../bin
 
LIBDIR = ../../lib
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
TARGET = auxingrowth
 
@@ -37,7 +38,7 @@ SOURCES = $${TARGET}plugin.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 
@@ -46,7 +47,7 @@ win32 {
 
 LIBXML2DIR = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -Llib -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 
}
src/build_models/plugin_leaf.pro
Show inline comments
 
@@ -24,6 +24,7 @@ CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = ../../bin
 
LIBDIR = ../../lib
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
TARGET = leaf
 
@@ -37,7 +38,7 @@ SOURCES = $${TARGET}plugin.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 
@@ -46,7 +47,7 @@ win32 {
 
 LIBXML2DIR = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -Llib -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 
}
src/build_models/plugin_meinhardt.pro
Show inline comments
 
@@ -24,6 +24,7 @@ CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = ../../bin
 
LIBDIR = ../../lib
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
TARGET = meinhardt
 
@@ -37,7 +38,7 @@ SOURCES = $${TARGET}plugin.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 
@@ -46,7 +47,7 @@ win32 {
 
 LIBXML2DIR = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -Llib -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 
}
src/build_models/plugin_test.pro
Show inline comments
 
@@ -24,6 +24,7 @@ CONFIG -= debug
 
CONFIG += plugin
 

	
 
BINDIR = ../../bin
 
LIBDIR = ../../lib
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
TARGET = test
 
@@ -37,7 +38,7 @@ SOURCES = $${TARGET}plugin.cpp
 
TEMPLATE = lib 
 

	
 
unix {
 
 LIBS += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -lvleaf
 
 QMAKE_CXXFLAGS += -fPIC -I/usr/include/libxml2
 
 QMAKE_LFLAGS += -fPIC
 
}
 
@@ -46,7 +47,7 @@ win32 {
 
 LIBXML2DIR = C:\libxml2
 
 LIBICONVDIR = C:\libiconv
 
 LIBZDIR = C:\libz
 
 LIBS += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -Llib -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
src/build_models/simplugin.h
Show inline comments
 
deleted file
src/build_models/testplugin.cpp
Show inline comments
 
@@ -35,26 +35,26 @@ static const std::string _module_id("$Id
 
bool batch = false;
 

	
 
// To be executed after cell division
 
void TestPlugin::OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2) {
 
void TestPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) {
 
	
 
}
 

	
 
void TestPlugin::SetCellColor(CellBase &c, QColor &color) { 
 
void TestPlugin::SetCellColor(CellBase *c, QColor *color) { 
 

	
 
	static QStringList colors;
 
	if (colors.size()==0) {
 
		colors << "red" << "green" << "blue";
 
	}
 
	color = colors[c.Index()%colors.size()];
 
	color->setNamedColor(colors[c->Index()%colors.size()]);
 
}
 

	
 

	
 

	
 
void TestPlugin::CellHouseKeeping(CellBase &c) {
 
void TestPlugin::CellHouseKeeping(CellBase *c) {
 
	
 
	c.EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c.Area() > par->rel_cell_div_threshold * c.BaseArea() ) {
 
		c.Divide();
 
	c->EnlargeTargetArea(par->cell_expansion_rate);
 
	if (c->Area() > par->rel_cell_div_threshold * c->BaseArea() ) {
 
		c->Divide();
 
	}
 
}
 

	
src/build_models/testplugin.h
Show inline comments
 
@@ -35,7 +35,7 @@ public:
 
	virtual QString ModelID(void) { return QString( "Test model" ); }
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase &c);
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
@@ -47,10 +47,10 @@ public:
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2);
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase &c, QColor &color);	
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void) { return 0; }
 
};
src/build_models/translate_plugin.pl
Show inline comments
 
new file 100755
 
#!/usr/bin/perl
 

	
 
$cfilename = shift(@ARGV) || die "Usage: translate_plugin.pl [cfile] [hfile] [profile]\n";
 
$hfilename = shift(@ARGV) || die "Usage: translate_plugin.pl [cfile] [hfile] [profile]\n";
 
$pfilename = shift(@ARGV) || die "Usage: translate_plugin.pl [cfile] [hfile] [profile]\n";
 

	
 
$ocfname = $cfilename; $ocfname =~ s/\.cpp/_tl.cpp/g;
 
$ohfname = $hfilename; $ohfname =~ s/\.h/_tl.h/g;
 
$opfname = $pfilename; $opfname =~ s/\.pro/_tl.pro/g;
 

	
 
print STDERR "Translating '$cfilename' to '$ocfname', '$hfilename' to '$ohfname', and '$pfilename' to '$opfname'\n";
 

	
 
open cfile,"<$cfilename";
 
open ocfile,">$ocfname";
 

	
 
while (<cfile>) {
 
	
 
	#s/$hfilename/$ohfname/g;
 
    
 
	# translate function definitions
 
	if (/[a-zA-Z0-9 ]*::OnDivide/) {
 
		s/ParentInfo &parent_info/ParentInfo *parent_info/g;
 
		s/CellBase &daughter1/CellBase *daughter1/g;
 
		s/CellBase &daughter2/CellBase *daughter2/g;
 
	}
 
	
 
	if (/[a-zA-Z0-9 ]*::SetCellColor/) {
 
		s/CellBase &c/CellBase *c/g;
 
		s/QColor &color/QColor *color/g;
 
	}
 
	
 
	if (/[a-zA-Z0-9 ]*::CellHouseKeeping/) {
 
		s/CellBase &c/CellBase *c/g;
 
	}
 
	
 
	# translate member function calls
 
	s/\bparent_info\b\./parent_info->/g;
 
	s/\bdaughter1\b\./daughter1->/g;
 
	s/\bdaughter2\b\./daughter2->/g;
 
	s/\bc\b\./c->/g;
 
	s/\bcolor\b\./color->/g;
 
	print ocfile;
 
	
 
}
 

	
 
open hfile,"<$hfilename";
 
open ohfile,">$ohfname";
 

	
 
while (<hfile>) {
 
	if (/[ \t]*virtual[ \t]+void[ \t]+CellHouseKeeping/) {
 
		s/CellBase &c/CellBase *c/g;
 
	}
 
	if (/[ \t]*virtual[ \t]+void[ \t]+OnDivide/) {
 
		s/ParentInfo &parent_info/ParentInfo *parent_info/g;
 
		s/CellBase &daughter1/CellBase *daughter1/g;
 
		s/CellBase &daughter2/CellBase *daughter2/g;
 
	}
 
	if (/[ \t]*virtual[ \t]+void[ \t]+SetCellColor/) {
 
		s/CellBase &c/CellBase *c/g;
 
		s/QColor &color/QColor *color/g;
 
	}
 
	
 
	
 
	print ohfile;
 
	
 
}
 

	
 
open pfile,"<$pfilename";
 
open opfile,">$opfname";
 

	
 
while (<pfile>) {
 
	
 
	s/\bplugin\b\.h/plugin_tl\.h/g;
 
	s/\bplugin\b\.cpp/plugin_tl\.cpp/g;
 
	
 
	print opfile;
 
	
 
}
 
\ No newline at end of file
src/cell.cpp
Show inline comments
 
@@ -1094,7 +1094,7 @@ void Cell::DivideWalls(ItList new_node_l
 
	ConstructNeighborList();
 
	daughter->ConstructNeighborList();
 
	
 
	m->plugin->OnDivide(parent_info,*daughter, *this);
 
	m->plugin->OnDivide(&parent_info, daughter, this);
 
	// wall->OnWallInsert();
 
	//daughter->OnDivide();
 
	
 
@@ -1661,7 +1661,7 @@ void Cell::Draw(QGraphicsScene *c, QStri
 
	
 
	QColor cell_color;
 
	
 
	m->plugin->SetCellColor(*this,cell_color);
 
	m->plugin->SetCellColor(this,&cell_color);
 
	
 
	p->setPolygon(pa);
 
	p->setPen(par.outlinewidth>=0?QPen( QColor(par.cell_outline_color),par.outlinewidth):QPen(Qt::NoPen));
src/cellbase.h
Show inline comments
 
@@ -331,9 +331,9 @@ class CellBase :  public QObject, public
 
      for (list<Wall *>::const_iterator w=walls.begin();
 
	   w!=walls.end();
 
	   w++) {
 
	sum += (*w)->c1 == this ? 
 
	  f( *((*w)->c1), *((*w)->c2), **w ) :  
 
	  f( *((*w)->c2), *((*w)->c1), **w );
 
	sum += ((*w)->c1 == this) ? 
 
	  f( ((*w)->c1), ((*w)->c2), *w ) :  
 
	  f( ((*w)->c2), ((*w)->c1), *w );
 
      }
 
      return sum;
 
    }
 
@@ -484,8 +484,8 @@ protected:
 

	
 
ostream &operator<<(ostream &os, const CellBase &v);
 

	
 
inline Vector PINdir(CellBase &here, CellBase &nb, Wall &w) {
 
	return w.getTransporter( &here, 1)  *  w.getInfluxVector(&here);
 
inline Vector PINdir(CellBase *here, CellBase *nb, Wall *w) {
 
	return w->getTransporter( here, 1)  *  w->getInfluxVector(here);
 
}
 

	
 

	
src/libplugin.pro
Show inline comments
 
@@ -29,7 +29,7 @@ QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 
QMAKE_CXXFLAGS_DEBUG -= -finstrument-functions
 

	
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = build_models/lib 
 
DESTDIR = ../lib 
 
PERLDIR = ./perl
 
PARTMPL = VirtualLeafpar.tmpl
 
QT += qt3support
src/mesh.h
Show inline comments
 
@@ -238,7 +238,7 @@ public:
 
		for (vector<Cell *>::iterator i = current_cells.begin();
 
			 i != current_cells.end();
 
			 i ++) {
 
			plugin->CellHouseKeeping(**i);
 
			plugin->CellHouseKeeping(*i);
 
			
 
			// Call functions of Cell that cannot be called from CellBase, including Division
 
			if ((*i)->flag_for_divide) {
src/modelcatalogue.cpp
Show inline comments
 
@@ -68,9 +68,13 @@ void ModelCatalogue::LoadPlugins() {
 
			qobject_cast<SimPluginInterface *>(loader.instance())) {
 
			models.append(plugin); 
 
		} else {
 
			MyWarning::warning("Could not load plugin %s",fileName.toStdString().c_str());
 
			cerr << loader.errorString().toStdString().c_str() << endl;
 
			MyWarning::warning("Could not load model %s: %s",fileName.toStdString().c_str(), loader.errorString().toStdString().c_str());
 
		}
 
	}
 
	if (models.size()==0) {
 
		MyWarning::error("No models could be loaded.");
 
	}
 
}
 

	
 
void ModelCatalogue::LoadPlugin(const char *model) {
src/simplugin.h
Show inline comments
 
@@ -44,7 +44,7 @@ public:
 
	virtual ~SimPluginInterface() { }
 

	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping(CellBase &c) = 0;
 
	virtual void CellHouseKeeping(CellBase *c) = 0;
 
	
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *, double *dchem_c1, double *dchem_c2) = 0;
 
@@ -57,10 +57,10 @@ public:
 
	virtual void CellDynamics(CellBase *c, double *dchem) = 0;
 

	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo &parent_info, CellBase &daughter1, CellBase &daughter2) = 0;
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2) = 0;
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase &c, QColor &color) = 0;
 
	virtual void SetCellColor(CellBase *c, QColor *color) = 0;
 
	
 
	// Number of chemicals
 
	virtual int NChem(void) = 0;
 
@@ -75,7 +75,7 @@ protected:
 
};
 

	
 
Q_DECLARE_INTERFACE(SimPluginInterface, 
 
                    "nl.cwi.VirtualLeaf.SimPluginInterface/1.1") 
 
                    "nl.cwi.VirtualLeaf.SimPluginInterface/1.2") 
 
Q_DECLARE_METATYPE(SimPluginInterface *)
 

	
 

	
0 comments (0 inline, 0 general)