diff --git a/src/Makefile b/src/Makefile new file mode 100644 --- /dev/null +++ b/src/Makefile @@ -0,0 +1,27 @@ +# $Id: Makefile,v 3f0977faba37 2010/06/03 15:54:37 michael $ + +QMAKE = qmake + +all: VirtualLeaf libplugin plugins + +VirtualLeaf: Makefile.VirtualLeaf + make -f Makefile.VirtualLeaf + +Makefile.VirtualLeaf: VirtualLeaf.pro + $(QMAKE) -makefile -o $@ $< + +libplugin: Makefile.libplugin + make -f Makefile.libplugin + +Makefile.libplugin: libplugin.pro + $(QMAKE) -makefile -o $@ $< + +plugins: + make -C build_models + +clean: + make -f Makefile.libplugin clean + make -f Makefile.VirtualLeaf clean + make -C build_models clean + +#finis diff --git a/src/VirtualLeaf.pro b/src/VirtualLeaf.pro --- a/src/VirtualLeaf.pro +++ b/src/VirtualLeaf.pro @@ -113,7 +113,7 @@ HEADERS += \ cellbase.h \ cell.h \ cellitem.h \ - forwardeuler.h \ +# forwardeuler.h \ infobar.h \ mainbase.h \ mainbase.h \ @@ -154,7 +154,7 @@ SOURCES += \ cellbase.cpp \ cell.cpp \ cellitem.cpp \ - forwardeuler.cpp \ +# forwardeuler.cpp \ mainbase.cpp \ matrix.cpp \ mesh.cpp \ diff --git a/src/build_models/Makefile b/src/build_models/Makefile new file mode 100644 --- /dev/null +++ b/src/build_models/Makefile @@ -0,0 +1,37 @@ +# $Id: Makefile,v 3f0977faba37 2010/06/03 15:54:37 michael $ + +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 $@ $< + +plugin_leaf: Makefile.plugin_leaf + make -f Makefile.plugin_leaf + +Makefile.plugin_leaf: plugin_leaf.pro + $(QMAKE) -makefile -o $@ $< + +plugin_meinhardt: Makefile.plugin_meinhardt + make -f Makefile.plugin_meinhardt + +Makefile.plugin_meinhardt: plugin_meinhardt.pro + $(QMAKE) -makefile -o $@ $< + +plugin_test: Makefile.plugin_test + make -f Makefile.plugin_test + +Makefile.plugin_test: plugin_test.pro + $(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 + +#finis diff --git a/src/build_models/leafplugin.cpp b/src/build_models/leafplugin.cpp --- a/src/build_models/leafplugin.cpp +++ b/src/build_models/leafplugin.cpp @@ -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::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::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::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)); } diff --git a/src/build_models/leafplugin.h b/src/build_models/leafplugin.h --- a/src/build_models/leafplugin.h +++ b/src/build_models/leafplugin.h @@ -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); }; diff --git a/src/build_models/simplugin.h b/src/build_models/simplugin.h deleted file mode 100644 --- a/src/build_models/simplugin.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * $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 . - * - * Copyright 2010 Roeland Merks. - * - */ - -#ifndef _SIMPLUGIN_H_ -#define _SIMPLUGIN_H_ - -#include -#include -#include "cellbase.h" -#include "wallbase.h" - -class Parameter; - -#include -#include - - -class SimPluginInterface { - -public: - virtual QString ModelID(void) = 0; - - virtual ~SimPluginInterface() { } - - // Executed after the cellular mechanics steps have equillibrized - 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; - - // to be executed for coloring a cell - 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; } - virtual void SetCellsStaticDatamembers (CellsStaticDatamembers *cells_static_data_members_of_main); - -protected: - class Parameter *par; - -}; - -Q_DECLARE_INTERFACE(SimPluginInterface, - "nl.cwi.VirtualLeaf.SimPluginInterface/1.1") -Q_DECLARE_METATYPE(SimPluginInterface *) - - -#endif \ No newline at end of file diff --git a/src/build_models/testplugin.cpp b/src/build_models/testplugin.cpp --- a/src/build_models/testplugin.cpp +++ b/src/build_models/testplugin.cpp @@ -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(); } } diff --git a/src/build_models/testplugin.h b/src/build_models/testplugin.h --- a/src/build_models/testplugin.h +++ b/src/build_models/testplugin.h @@ -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; } };