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
 

	
 
clean:
 
	make -f Makefile.libplugin clean
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
 
@@ -114,13 +114,13 @@ unix {
 
HEADERS += \
 
 apoplastitem.h \
 
 canvas.h \
 
 cellbase.h \
 
 cell.h \
 
 cellitem.h \
 
 forwardeuler.h \
 
# forwardeuler.h \
 
 infobar.h \
 
 mainbase.h \
 
 mainbase.h \
 
 matrix.h \
 
 mesh.h \
 
 miscq.h \
 
@@ -155,13 +155,13 @@ HEADERS += \
 
SOURCES += \
 
 apoplastitem.cpp \
 
 canvas.cpp \
 
 cellbase.cpp \
 
 cell.cpp \
 
 cellitem.cpp \
 
 forwardeuler.cpp \
 
# forwardeuler.cpp \
 
 mainbase.cpp \
 
 matrix.cpp \
 
 mesh.cpp \
 
 miscq.cpp \
 
 modelcatalogue.cpp \
 
 Neighbor.cpp \
src/VirtualLeafpar.tmpl
Show inline comments
 
@@ -5,13 +5,13 @@ arrowsize = 100 / double
 
textcolor = red / string
 
cellnumsize = 1 / int
 
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
 
lambda_length = 100. / double
 
lambda_celllength = 0. / double
 
target_length = 60. / 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
 
	make -f Makefile.plugin_leaf clean
 
	make -f Makefile.plugin_meinhardt clean
 
	make -f Makefile.plugin_test clean
src/build_models/auxingrowthplugin.cpp
Show inline comments
 
@@ -34,29 +34,29 @@
 
static const std::string _module_id("$Id$");
 

	
 
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.));
 
	
 
	
 
	/* for (list<Wall *>::const_iterator w=daughter2.walls.begin();
 
@@ -65,35 +65,35 @@ void AuxinGrowthPlugin::OnDivide(ParentI
 
		// reset transporter value
 
		(*w)->setTransporter(&daughter2, 1, 0.);
 
	}
 
	*/
 
}
 

	
 
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);
 
	}  
 
	
 

	
 
}
 

	
 
void AuxinGrowthPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
@@ -238,21 +238,21 @@ void AuxinGrowthPlugin::WallDynamics(Wal
 
    //dw1[2] = 0.; dw2[2] = 0.;
 
    
 
    dw1[1] = dPijdt1;
 
    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));
 
	
 
}
 

	
 
void AuxinGrowthPlugin::CellDynamics(CellBase *c, double *dchem) {
 
	// Note: Pi and Pij measured in numbers of molecules, not concentrations		
 
		double dPidt = 0.;
src/build_models/auxingrowthplugin.h
Show inline comments
 
@@ -34,30 +34,30 @@ class AuxinGrowthPlugin : public QObject
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
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);
 
    
 
	// 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);
 
	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
 
@@ -34,15 +34,15 @@
 

	
 
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);
 
  //daughter.chem[1]*=(daughter_area/tot_area);
 
	
 
  // For lack of detailed data, or a better rule, we assume that cells remain polarized
 
@@ -51,54 +51,54 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
  // So the PIN1 is redistributed according to the original polarization over the walls
 
  
 
  // parent_info contains info about the parent 
 
  // 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();
 
		//	 w!=daughter.walls.end();
 
		//	 w++) {
 
			
 
		//	(*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();
 
				 w!=walls.end();
 
				 w++) {
 
				
 
				(*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));
 
		  
 
		}
 
	}
 
	
 
	/*
 
	  // NB: Code commented out; not yet adapted to plugin format... RM 18/12/2009
 
@@ -109,18 +109,18 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
	
 
	// distribute wallPINs according to the circumference of the parent and daughter
 
	double circ = Circumference( );
 
	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();
 
		 w!=walls.end();
 
		 w++) {
 
		
 
@@ -140,36 +140,36 @@ void LeafPlugin::OnDivide(ParentInfo &pa
 
	//SetNewChem(1, Chemical(1));
 
	
 
	//cerr << "[ "  << sum_wall_Pi + Chemical(1) << "]";
 
	*/
 
}
 

	
 
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);
 
    } 
 
  }  
 
  
 
}
 

	
 
void LeafPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
@@ -356,21 +356,21 @@ void LeafPlugin::WallDynamics(Wall *w, d
 
    
 
  dw1[1] = dPijdt1;
 
  dw2[1] = dPijdt2;
 
  
 
}
 

	
 
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));
 
  
 
}
 

	
 

	
 
void LeafPlugin::CellDynamics(CellBase *c, double *dchem) { 
 

	
src/build_models/leafplugin.h
Show inline comments
 
@@ -34,31 +34,31 @@ class LeafPlugin : public QObject, SimPl
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
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);
 
    
 
	// 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);
 
	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);
 
	
 
};
 

	
 
#endif
src/build_models/meinhardtplugin.cpp
Show inline comments
 
@@ -18,65 +18,65 @@
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

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

	
 
#include "parameter.h"
 
#include "warning.h"
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "meinhardtplugin.h"
 

	
 
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.) );
 
		}
 
		
 
	}
 
}
 

	
 

	
 

	
 
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);
 
		}
 
	} 
 
    
 
}
 

	
 
void MeinhardtPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
src/build_models/meinhardtplugin.h
Show inline comments
 
@@ -23,38 +23,38 @@
 
#ifndef _MEINHARDTPLUGIN_H_
 
#define _MEINHARDTPLUGIN_H_
 

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

	
 

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

	
 
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);
 
    
 
	// 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);
 
	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; }
 
};
 

	
 
#endif
src/build_models/plugin_auxingrowth.pro
Show inline comments
 
@@ -21,12 +21,13 @@
 

	
 
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_DEBUG += -g3
 
@@ -34,21 +35,21 @@ QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 

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

	
 
unix {
 
 LIBS += -Llib -lvleaf
 
 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 += -Llib -lvleaf
 
 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_leaf.pro
Show inline comments
 
@@ -21,12 +21,13 @@
 

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

	
 
BINDIR = ../../bin
 
LIBDIR = ../../lib
 
DEFINES = QTGRAPHICS # VLEAFPLUGIN
 
DESTDIR = $${BINDIR}/models
 
TARGET = leaf
 
HEADERS = ../simplugin.h $${TARGET}plugin.h  
 
QMAKE_CXXFLAGS += -fexceptions -I..
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
@@ -34,21 +35,21 @@ QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 

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

	
 
unix {
 
 LIBS += -Llib -lvleaf
 
 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 += -Llib -lvleaf
 
 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
 
@@ -21,12 +21,13 @@
 

	
 
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_DEBUG += -g3
 
@@ -34,22 +35,22 @@ QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 

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

	
 
unix {
 
 LIBS += -Llib -lvleaf
 
 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 += -Llib -lvleaf
 
 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
 
@@ -21,12 +21,13 @@
 

	
 
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_DEBUG += -g3
 
@@ -34,22 +35,22 @@ QMAKE_CXXFLAGS_DEBUG += -DQDEBUG
 

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

	
 
unix {
 
 LIBS += -Llib -lvleaf
 
 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 += -Llib -lvleaf
 
 LIBS += -L$${LIBDIR} -Llib -lvleaf
 
 QMAKE_CXXFLAGS += -DLIBXML_STATIC
 
 QMAKE_CXXFLAGS += -I$${LIBXML2DIR}\include -I$${LIBICONVDIR}\include -I$${LIBZDIR}\include
 

	
 
}
 

	
 
# finis
src/build_models/simplugin.h
Show inline comments
 
deleted file
src/build_models/testplugin.cpp
Show inline comments
 
@@ -32,32 +32,32 @@
 

	
 
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();
 
	}
 
}
 

	
 
void TestPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {}
 
void TestPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {}
 
void TestPlugin::CellDynamics(CellBase *c, double *dchem) { }
src/build_models/testplugin.h
Show inline comments
 
@@ -32,28 +32,28 @@ class TestPlugin : public QObject, SimPl
 
	Q_INTERFACES(SimPluginInterface);
 

	
 
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);
 
    
 
	// 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);
 
	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
 
@@ -1091,13 +1091,13 @@ 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();
 
	
 
	daughter->div_counter=(++div_counter);
 
	
 
	
 
@@ -1658,13 +1658,13 @@ void Cell::Draw(QGraphicsScene *c, QStri
 
						  (int)((offset[1]+i->y)*factor) );
 
	}
 
	
 
	
 
	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));
 
	p->setBrush( cell_color );
 
	p->setZValue(1);
 
	
src/cellbase.h
Show inline comments
 
@@ -328,15 +328,15 @@ class CellBase :  public QObject, public
 
    //! The same, but now for the walls AND neighbors
 
    template<class P, class Op> P ReduceCellAndWalls(Op f) {
 
      P sum = 0;
 
      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;
 
    }
 
    
 
	/* template<class Op> void LoopWalls(Op f) {
 
		for (list<Wall *>::const_iterator w=walls.begin();
 
@@ -481,14 +481,14 @@ protected:
 
    bool marked;
 
    int div_counter;
 
};
 

	
 
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);
 
}
 

	
 

	
 
#endif
 

	
 

	
src/libplugin.pro
Show inline comments
 
@@ -26,13 +26,13 @@ CONFIG += staticlib
 
QMAKE_CXXFLAGS += -fexceptions
 
QMAKE_CXXFLAGS_DEBUG += -g3
 
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
 
TARGET = vleaf
 
TEMPLATE = lib
 

	
src/mesh.h
Show inline comments
 
@@ -235,13 +235,13 @@ public:
 
	
 
	void DoCellHouseKeeping(void) {
 
		vector<Cell *> current_cells = cells;
 
		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) {
 
				if ((*i)->division_axis) {
 
					(*i)->DivideOverAxis(*(*i)->division_axis);
 
					delete (*i)->division_axis;
src/modelcatalogue.cpp
Show inline comments
 
@@ -65,15 +65,19 @@ void ModelCatalogue::LoadPlugins() {
 
	foreach (QString fileName, pluginDir.entryList(QDir::Files)){ 
 
		QPluginLoader loader(pluginDir.absoluteFilePath(fileName)); 
 
		if (SimPluginInterface *plugin = 
 
			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) {
 

	
 
	
 
  QDir pluginDir(QApplication::applicationDirPath()); 
src/simplugin.h
Show inline comments
 
@@ -41,29 +41,29 @@ class SimPluginInterface {
 
public:
 
	virtual QString ModelID(void) = 0; 
 
	
 
	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;
 
	
 
	// 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 *dw)  = 0;
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	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;
 
	
 
	// For internal use; not to be redefined by end users
 
	virtual void SetParameters(Parameter *pass_pars);// { par = pass_pars; }
 
@@ -72,11 +72,11 @@ public:
 
protected:
 
	class Parameter *par;
 
	
 
};
 

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

	
 

	
 
#endif
 
\ No newline at end of file
0 comments (0 inline, 0 general)