Changeset - 782330072e62
[Not reviewed]
default
! ! !
Michael Guravage - 15 years ago 2010-06-17 18:13:46
michael.guravage@cwi.nl
Reformatted the source files and generally straighten up the code.

--
user: Michael Guravage <michael.guravage@cwi.nl>
branch 'default'

changed src/Neighbor.cpp
changed src/Neighbor.h
changed src/OptionFileDialog.cpp
changed src/OptionFileDialog.h
changed src/UniqueMessage.cpp
changed src/UniqueMessage.h
changed src/VirtualLeaf.cpp
changed src/apoplastitem.cpp
changed src/apoplastitem.h
changed src/build_models/auxingrowthplugin.cpp
changed src/build_models/auxingrowthplugin.h
changed src/build_models/meinhardtplugin.cpp
changed src/build_models/meinhardtplugin.h
changed src/build_models/testplugin.cpp
changed src/build_models/testplugin.h
changed src/build_models/translate_plugin.pl
changed src/canvas.cpp
changed src/canvas.h
changed src/cell.cpp
changed src/cell.h
changed src/cellbase.cpp
changed src/cellbase.h
changed src/cellitem.cpp
changed src/cellitem.h
changed src/curvecolors.h
changed src/data_plot.cpp
changed src/data_plot.h
changed src/far_mem_5.h
changed src/flux_function.h
changed src/forwardeuler.cpp
changed src/forwardeuler.h
changed src/infobar.h
changed src/mainbase.cpp
changed src/mainbase.h
changed src/matrix.cpp
changed src/matrix.h
changed src/maxmin.h
changed src/mesh.cpp
changed src/mesh.h
changed src/miscq.cpp
changed src/miscq.h
changed src/modelcatalogue.cpp
changed src/modelcatalogue.h
changed src/modelelement.h
changed src/node.cpp
changed src/node.h
changed src/nodeitem.cpp
changed src/nodeitem.h
changed src/nodeset.cpp
changed src/nodeset.h
changed src/output.cpp
changed src/output.h
changed src/parameter.cpp
changed src/parameter.h
changed src/pardialog.cpp
changed src/pardialog.h
changed src/parse.cpp
changed src/parse.h
changed src/perl/deployapp.pl
changed src/perl/histogram.pl
changed src/perl/make_parameter_source.pl
changed src/perl/make_pardialog_source.pl
changed src/perl/make_xmlwritecode.pl
changed src/pi.h
changed src/qcanvasarrow.h
changed src/random.cpp
changed src/random.h
changed src/rseed.cpp
changed src/rungekutta.cpp
changed src/rungekutta.h
changed src/simitembase.cpp
changed src/simitembase.h
changed src/simplugin.cpp
changed src/simplugin.h
changed src/sqr.h
changed src/tiny.h
changed src/transporterdialog.cpp
changed src/transporterdialog.h
changed src/vector.cpp
changed src/vector.h
changed src/vleafmodel.h
changed src/wall.cpp
changed src/wall.h
changed src/wallbase.cpp
changed src/wallbase.h
changed src/wallitem.cpp
changed src/wallitem.h
changed src/warning.cpp
changed src/warning.h
changed src/xmlwrite.cpp
changed src/xmlwrite.h
87 files changed with 601 insertions and 792 deletions:
src/cell.cpp
62
118
src/node.h
19
32
0 comments (0 inline, 0 general)
src/Neighbor.cpp
Show inline comments
 
@@ -43,4 +43,5 @@ bool neighbor_cell_eq(const Neighbor &n1
 
  return (n1.getCell())->Index() == (n2.getCell())->Index(); // Compare cell indices not pointers.
 
}
 
  
 
// finis
 
/* finis */
 

	
src/Neighbor.h
Show inline comments
 
@@ -68,4 +68,5 @@ bool neighbor_cell_eq(const Neighbor &n1
 

	
 
#endif
 

	
 
// finis
 
/* finis */
 

	
src/OptionFileDialog.cpp
Show inline comments
 
@@ -27,8 +27,8 @@ using namespace  std;
 

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

	
 
OptionFileDialog::OptionFileDialog(QWidget *parent, const char *name, bool modal) : Q3FileDialog(parent, name, modal) {
 

	
 
OptionFileDialog::OptionFileDialog(QWidget *parent, const char *name, bool modal) : Q3FileDialog(parent, name, modal)
 
{
 
	//cerr << "This is an OptionFileDialog\n";
 
	geometrycheck = new QCheckBox("geometry",this);
 
	geometrycheck -> setCheckState(Qt::Checked);
 
@@ -38,12 +38,13 @@ OptionFileDialog::OptionFileDialog(QWidg
 
	
 
	addToolButton(geometrycheck);
 
	addToolButton(parcheck);
 

	
 
};
 

	
 
OptionFileDialog::OptionFileDialog ( const QString & dirName, const QString & filter , QWidget * parent, const char * name , bool modal  ) :
 
OptionFileDialog::OptionFileDialog ( const QString & dirName, const QString & filter , 
 
				     QWidget * parent, const char * name , bool modal  ) :
 
		Q3FileDialog(dirName, filter, parent, name, modal) {
 
		
 
			cerr << "This is an OptionFileDialog\n";
 
};
 
					
 
	};
 
/* finis */
src/OptionFileDialog.h
Show inline comments
 
@@ -30,7 +30,8 @@ class OptionFileDialog : public Q3FileDi
 
	Q_OBJECT
 
public:
 
	OptionFileDialog(QWidget *parent = 0, const char *name = 0, bool modal = false);
 
	OptionFileDialog ( const QString & dirName, const QString & filter = QString(), QWidget * parent = 0, const char * name = 0, bool modal = false );
 
  OptionFileDialog ( const QString & dirName, const QString & filter = QString(), 
 
		     QWidget * parent = 0, const char * name = 0, bool modal = false );
 
	
 
	bool readGeometryP(void) const { return geometrycheck->checkState()==Qt::Checked; }
 
	bool readParametersP(void) const { return parcheck->checkState()==Qt::Checked; }
 
@@ -41,3 +42,5 @@ private:
 
};
 

	
 
#endif
 

	
 
/* finis */
src/UniqueMessage.cpp
Show inline comments
 
@@ -68,7 +68,6 @@ UniqueMessageBox::~UniqueMessageBox(void
 
	if (show_again->checkState() == Qt::Checked ) {
 
		cerr << "Message won't be shown again\n";
 
		issued_messages << boxtext;
 

	
 
	}
 
}
 
int UniqueMessageBox::exec(void)  {
 
@@ -78,8 +77,8 @@ int UniqueMessageBox::exec(void)  {
 
	else {
 
		return 1;
 
	}
 

	
 
}
 
					   
 
QStringList UniqueMessageBox::issued_messages;
 
					   
 
/* finis */
src/UniqueMessage.h
Show inline comments
 
@@ -52,3 +52,5 @@ private:
 
};
 

	
 
#endif
 

	
 
/* finis */
src/VirtualLeaf.cpp
Show inline comments
 
@@ -138,7 +138,8 @@ public:
 
Mesh mesh;
 
bool batch=false;
 

	
 
void MainBase::Plot(int resize_stride) {
 
void MainBase::Plot(int resize_stride)
 
{
 
	
 
  clear();
 
	
 
@@ -261,30 +262,22 @@ TIMESTEP {
 
				
 
      // Reaction diffusion	
 
      mesh.ReactDiffuse(par.rd_dt);
 
				
 
      t++;
 
				
 
      Plot(par.resize_stride);
 
		
 
    }
 
		
 
  } else {
 
			
 
    mesh.ReactDiffuse(par.rd_dt);
 
		
 
    Plot(par.resize_stride);
 
			
 
  }
 
		
 
  i++;
 
  return mesh.getTime();
 
		
 
}
 
		
 
		
 
				
 
/* Called if a cell is clicked */
 
void Cell::OnClick(QMouseEvent *e) {
 
void Cell::OnClick(QMouseEvent *e)
 
{
 
  e = NULL; // use assignment merely to obviate compilation warning
 
}
 
				
 
@@ -318,11 +311,7 @@ Parameter par;
 
int main(int argc,char **argv) {
 
					
 
  try {
 
						
 

	
 
    int c;
 

	
 
						
 
    char *leaffile=0;
 
    char *modelfile=0;
 
						
 
@@ -417,11 +406,8 @@ int main(int argc,char **argv) {
 
      }
 
    } else {
 
      main_window=new MainBase(canvas, mesh);
 

	
 
    }
 

	
 
    
 
	  
 
    canvas.setSceneRect(QRectF());
 
    if (!batch) {
 
      QObject::connect( qApp, SIGNAL(lastWindowClosed()), qApp, SLOT(quit()) );
 
@@ -433,7 +419,6 @@ int main(int argc,char **argv) {
 
      model_catalogue.PopulateModelMenu();
 
    model_catalogue.InstallFirstModel();
 
    
 

	
 
    if (leaffile) 
 
      main_window->Init(leaffile);
 
	  
 
@@ -449,11 +434,9 @@ int main(int argc,char **argv) {
 
      do {
 
	t = main_window->TimeStep();
 
      } while (t < par.maxt);
 
							
 
    } else
 
      return app.exec();
 
	  
 
						
 
  } catch (const char *message) {
 
    if (batch) { 
 
      cerr << "Exception caught:" << endl;
 
@@ -477,3 +460,5 @@ int main(int argc,char **argv) {
 
    }
 
  }
 
}
 

	
 
/* finis */
src/apoplastitem.cpp
Show inline comments
 
@@ -66,10 +66,10 @@ void ApoplastItem::setColor(void) {
 

	
 
	diffcolor.setRgb( 0,0,(int)( ( val / (1 + val) )*255.));
 
	setPen (QPen(diffcolor, 20) );
 

	
 
}
 

	
 
void ApoplastItem::OnClick(QMouseEvent *e) {
 
  e = NULL; // merely to obviate compilation warnings
 
}
 

	
 
/* finis*/
src/apoplastitem.h
Show inline comments
 
@@ -23,6 +23,7 @@
 

	
 
#ifndef _APOPLASTITEM_H_
 
#define _APOPLASTITEM_H_
 

	
 
#include <QGraphicsScene>
 
#include <QGraphicsLineItem>
 
#include <QPainter>
 
@@ -46,3 +47,5 @@ private:
 
};
 

	
 
#endif
 

	
 
/* finis*/
src/build_models/auxingrowthplugin.cpp
Show inline comments
 
@@ -37,7 +37,8 @@ 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)
 
{
 
  parent_info = NULL; // merely to obviate compile time error
 

	
 
	// Auxin distributes between parent and daughter according to area
 
@@ -57,22 +58,23 @@ void AuxinGrowthPlugin::OnDivide(ParentI
 
	foreach(WallBase *w, walls) { 
 
		w->setTransporter(daughter1, 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->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);
 
	
 
  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.), 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);
 
@@ -84,11 +86,10 @@ void AuxinGrowthPlugin::CellHouseKeeping
 
		// 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);
 
	}  
 
	
 

	
 
}
 

	
 
void AuxinGrowthPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
void AuxinGrowthPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2)
 
{
 

	
 
	// leaf edge is const source of auxin
 
    // (Neumann boundary condition: we specify the influx)
 
@@ -102,7 +103,6 @@ void AuxinGrowthPlugin::CelltoCellTransp
 
		}
 
	}
 
	
 
	
 
	if (w->C1()->BoundaryPolP()) {
 
		
 
		if (w->AuxinSource()) {
 
@@ -146,10 +146,8 @@ void AuxinGrowthPlugin::CelltoCellTransp
 
	
 
}
 

	
 
void AuxinGrowthPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {
 

	
 
	
 
	
 
void AuxinGrowthPlugin::WallDynamics(Wall *w, double *dw1, double *dw2)
 
{
 
    // Cells polarize available PIN1 to Shoot Apical Meristem
 
    if (w->C2()->BoundaryPolP()) {
 
		if (w->AuxinSink()) {
 
@@ -227,8 +225,9 @@ void AuxinGrowthPlugin::WallDynamics(Wal
 
    dw2[1] = dPijdt2;
 
}
 

	
 
double AuxinGrowthPlugin::complex_PijAj(CellBase *here, CellBase *nb, Wall *w) { 
 
	
 
double AuxinGrowthPlugin::complex_PijAj(CellBase *here, CellBase *nb, Wall *w)
 
{ 
 
	// gives the amount of complex "auxinreceptor-Pin1"  at the wall (at QSS) 
 
	//return here.Chemical(1) * nb.Chemical(0) / ( par->km + here.Chemical(1));
 
	
 
@@ -239,7 +238,9 @@ double AuxinGrowthPlugin::complex_PijAj(
 
	
 
}
 

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

	
 
void AuxinGrowthPlugin::CellDynamics(CellBase *c, double *dchem)
 
{
 
	// Note: Pi and Pij measured in numbers of molecules, not concentrations		
 
		double dPidt = 0.;
 
		
 
@@ -260,15 +261,11 @@ void AuxinGrowthPlugin::CellDynamics(Cel
 
		
 
		dchem[1] = dPidt;
 
		
 
		
 
		// source of auxin
 
		dchem[0] = par->aux_cons - par->aux_breakdown * c->Chemical(0);
 
		>
 
  }
 
	}
 
	
 
	
 
Q_EXPORT_PLUGIN2(auxingrowthplugin, AuxinGrowthPlugin)
 
	
 
}
 

	
 

	
 
Q_EXPORT_PLUGIN2(auxingrowthplugin, AuxinGrowthPlugin)
 
/* finis */
src/build_models/auxingrowthplugin.h
Show inline comments
 
@@ -61,3 +61,5 @@ private:
 
};
 

	
 
#endif
 

	
 
/* finis */
src/build_models/meinhardtplugin.cpp
Show inline comments
 
@@ -54,7 +54,6 @@ void MeinhardtPlugin::SetCellColor(CellB
 
		} 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.) );
 
		}
 
		
 
	}
 
}
 

	
 
@@ -77,7 +76,6 @@ void MeinhardtPlugin::CellHouseKeeping(C
 
			c->EnlargeTargetArea(par->vessel_expansion_rate);
 
		}
 
	} 
 
    
 
}
 

	
 
void MeinhardtPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
@@ -100,8 +98,6 @@ void MeinhardtPlugin::CelltoCellTranspor
 
		dchem_c1[c] += phi; 
 
		dchem_c2[c] -= phi;
 
	}
 
   
 

	
 
}
 

	
 
void MeinhardtPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
@@ -118,8 +114,6 @@ void MeinhardtPlugin::CellDynamics(CellB
 
	double H = c->Chemical(2);
 
	double S = c->Chemical(3);
 

	
 
	
 
	
 
    dchem[0] = ( par->d * A - par->e * Y + Y*Y/(1 + par->f * Y*Y ) );
 
	dchem[1] = ( par->c * A*A*S/H - par->mu * A + par->rho0*Y );
 
	dchem[2] = ( par->c * A*A*S - par->nu*H + par->rho1*Y );
 
@@ -128,3 +122,5 @@ void MeinhardtPlugin::CellDynamics(CellB
 

	
 

	
 
Q_EXPORT_PLUGIN2(meinhardtplugin, MeinhardtPlugin)
 

	
 
/* finis */
src/build_models/meinhardtplugin.h
Show inline comments
 
@@ -58,3 +58,5 @@ public:
 
};
 

	
 
#endif
 

	
 
/* finis */
src/build_models/testplugin.cpp
Show inline comments
 
@@ -75,3 +75,5 @@ void TestPlugin::CellDynamics(CellBase *
 
}
 

	
 
Q_EXPORT_PLUGIN2(testplugin, TestPlugin)
 

	
 
/* finis */
src/build_models/testplugin.h
Show inline comments
 
@@ -58,3 +58,5 @@ public:
 
};
 

	
 
#endif
 

	
 
/* finis */
src/build_models/translate_plugin.pl
Show inline comments
 
@@ -75,4 +75,6 @@ while (<pfile>) {
 
	
 
	print opfile;
 
	
 
}
 
\ No newline at end of file
 
}
 

	
 
#finis
src/canvas.cpp
Show inline comments
 
@@ -19,8 +19,6 @@
 
 *
 
 */
 

	
 
#include <QDebug>
 

	
 
#include <string>
 
#include <QGraphicsScene>
 
#include <QGraphicsView>
 
@@ -134,7 +132,8 @@ void FigureEditor::scaleView (qreal scal
 
  scale (scaleFactor, scaleFactor);
 
}
 

	
 
void FigureEditor::Save(const char *fname, const char *format, int sizex, int sizey) {
 
void FigureEditor::Save(const char *fname, const char *format, int sizex, int sizey)
 
{
 
  
 
    QImage *image = new QImage(sizex, sizey, QImage::Format_RGB32);
 
    image->fill(QColor(Qt::white).rgb());
 
@@ -147,7 +146,6 @@ void FigureEditor::Save(const char *fnam
 
    delete image;
 
}
 

	
 
//void FigureEditor::contentsMousePressEvent(QMouseEvent* e)
 
void FigureEditor::mousePressEvent(QMouseEvent* e)
 
{
 
  static QList<Node*> selected;
 
@@ -210,7 +208,6 @@ void FigureEditor::mousePressEvent(QMous
 
  moving = 0;
 
}
 
  
 
//void FigureEditor::contentsMouseMoveEvent(QMouseEvent* e)
 
void FigureEditor::mouseMoveEvent(QMouseEvent* e)
 
{
 

	
 
@@ -392,8 +389,8 @@ void FigureEditor::mouseReleaseEvent(QMo
 

	
 

	
 
// returns a vector of pointer to cells colliding with intersection line
 
vector <CellItem *> FigureEditor::getIntersectedCells(void) { 
 
  
 
vector <CellItem *> FigureEditor::getIntersectedCells(void)
 
{ 
 
  vector <CellItem *> colliding_cells;
 
  
 
  QList<QGraphicsItem *> l = intersection_line->collidingItems( );
 
@@ -416,10 +413,10 @@ vector <CellItem *> FigureEditor::getInt
 
  delete intersection_line;
 
  intersection_line = 0;
 
  return colliding_cells;
 
    
 
}
 

	
 
void FigureEditor::FullRedraw(void) {
 
void FigureEditor::FullRedraw(void)
 
{
 
	QList<QRectF> rl;
 
	rl << sceneRect();
 
	updateScene(rl);   
 
@@ -585,18 +582,17 @@ Main::Main(QGraphicsScene& c, Mesh &m, Q
 
	
 
	infobar = new InfoBar();
 
	addDockWindow(infobar);
 

	
 
}
 

	
 
void Main::RefreshInfoBar(void) {
 
void Main::RefreshInfoBar(void)
 
{
 
	infobar->SetText(mesh.ModelID());
 
}
 

	
 

	
 
void Main::UserMessage(QString message, int timeout) {
 

	
 
void Main::UserMessage(QString message, int timeout)
 
{
 
  statusBar()->showMessage(message, timeout);
 

	
 
}
 

	
 

	
 
@@ -608,8 +604,6 @@ void Main::init()
 
  srand(++r);
 
  
 
  mainCount++;
 
  
 
  
 
}
 

	
 
Main::~Main()
 
@@ -630,7 +624,8 @@ void Main::newView()
 
}
 

	
 

	
 
void Main::EditParameters() {
 
void Main::EditParameters()
 
{
 
  
 
  ParameterDialog *pardial = new ParameterDialog(this, "stridediag");
 

	
 
@@ -638,10 +633,10 @@ void Main::EditParameters() {
 
  // each method changing the parameters (reading XML or PAR files) should
 
  // emit this signal
 
  QObject::connect(   this, SIGNAL( ParsChanged() ), pardial, SLOT( Reset() ) );
 

	
 
}
 

	
 
void Main::savePars() {
 
void Main::savePars()
 
{
 
  
 
  stopSimulation();
 
  
 
@@ -657,10 +652,10 @@ void Main::savePars() {
 
  }
 

	
 
  startSimulation();
 

	
 
}
 

	
 
void Main::readPars() {
 
void Main::readPars()
 
{
 
  
 
  stopSimulation();
 
  
 
@@ -677,11 +672,11 @@ void Main::readPars() {
 
  emit ParsChanged();
 
  /* if (timer_active)
 
     timer->start( 0 );*/
 
  
 
}
 

	
 

	
 
void Main::saveStateXML() {
 
void Main::saveStateXML()
 
{
 
  
 
  stopSimulation();
 
  Q3FileDialog *fd = new Q3FileDialog( this, "file dialog", TRUE );
 
@@ -708,12 +703,12 @@ void Main::saveStateXML() {
 
    
 
    }
 
  }
 

	
 
}
 

	
 

	
 

	
 
void Main::snapshot() {
 
void Main::snapshot()
 
{
 
  
 
   
 
  stopSimulation();
 
@@ -744,12 +739,12 @@ void Main::snapshot() {
 
		Save((const char *)fileName, extension, 1024, 768);
 
    }
 
  }
 

	
 
}
 

	
 
 
 

	
 
void Main::readPrevStateXML() {
 
void Main::readPrevStateXML()
 
{
 
  
 
  // if we have already read a file, read the next file
 
  if (!currentFile.isEmpty() && working_dir) {
 
@@ -783,7 +778,8 @@ void Main::readPrevStateXML() {
 
  }
 
}
 

	
 
int Main::readStateXML(const char *filename, bool geometry, bool pars, bool simtime) {
 
int Main::readStateXML(const char *filename, bool geometry, bool pars, bool simtime)
 
{
 
 
 
  try {
 
    xmlNode *settings;
 
@@ -820,11 +816,11 @@ int Main::readStateXML(const char *filen
 
    mb.exec();
 
    return 1;
 
  }
 
  
 
}
 

	
 

	
 
void Main::readNextStateXML() {
 
void Main::readNextStateXML()
 
{
 
  
 
  // if we have already read a file, read the next file
 
  if (!currentFile.isEmpty() && working_dir) {
 
@@ -857,11 +853,10 @@ void Main::readNextStateXML() {
 

	
 
    readStateXML((const char*)next_file);
 
  }
 
  
 
  
 
}
 

	
 
void Main::readLastStateXML() {
 
void Main::readLastStateXML()
 
{
 
  
 
  // if we have already read a file, read the next file
 
  if (!currentFile.isEmpty() && working_dir) {
 
@@ -878,12 +873,11 @@ void Main::readLastStateXML() {
 

	
 
    readStateXML((const char*)next_file);
 
  }
 
  
 
  
 
}
 

	
 

	
 
void Main::readFirstStateXML() {
 
void Main::readFirstStateXML()
 
{
 
  
 
  // if we have already read a file, read the next file
 
  if (!currentFile.isEmpty() && working_dir) {
 
@@ -900,11 +894,10 @@ void Main::readFirstStateXML() {
 

	
 
    readStateXML((const char*)next_file);
 
  }
 
  
 
  
 
}
 

	
 
void Main::readStateXML() {
 
void Main::readStateXML()
 
{
 

	
 
  //  extern Mesh mesh;
 

	
 
@@ -956,8 +949,7 @@ void Main::help()
 
  about->show();
 
}
 

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

	
 
@@ -970,56 +962,68 @@ void Main::help()
 
  {
 
    Plot();
 
  }
 

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

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

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

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

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

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

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

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

	
 
void Main::toggleHideCells(void) {
 
void Main::toggleHideCells(void)
 
{
 
	Plot();
 
	editor->FullRedraw();
 
}
 

	
 
  void Main::toggleMovieFrames(){}
 

	
 
  void Main::toggleLeafBoundary(){}
 

	
 
  void Main::toggleDynCells() {}
 
  
 
  void Main::startSimulation(void) {
 
void Main::startSimulation(void)
 
{
 
    timer->start( 0 );
 
    statusBar()->message("Simulation started");
 
    running = true;
 
  }
 

	
 
  void Main::stopSimulation(void) {
 
void Main::stopSimulation(void)
 
{
 
    timer->stop();
 
    cerr << "Stopping simulation" << endl;
 
    statusBar()->message("Simulation paused");
 
@@ -1038,8 +1042,8 @@ void Main::toggleHideCells(void) {
 
    }
 
  }
 

	
 
  void Main::setFluxArrowSize(int size) {
 
  
 
void Main::setFluxArrowSize(int size)
 
{
 
    flux_arrow_size = size/100.;
 
  }
 

	
 
@@ -1055,7 +1059,8 @@ void Main::toggleHideCells(void) {
 
  }
 

	
 

	
 
  void Main::scale(double factor) {
 
void Main::scale(double factor)
 
{
 
    QMatrix m = editor->matrix();
 
    m.scale(factor, factor);
 
    editor->setMatrix( m );
 
@@ -1110,8 +1115,8 @@ void Main::toggleHideCells(void) {
 
  }
 

	
 

	
 
  void Main::TimeStepWrap(void) {
 
  
 
void Main::TimeStepWrap(void)
 
{
 
    static int t=0;
 
    TimeStep();
 
    t++;
 
@@ -1122,7 +1127,8 @@ void Main::toggleHideCells(void) {
 
  }
 

	
 

	
 
  void Main::RestartSim(void) {
 
void Main::RestartSim(void)
 
{
 

	
 
    stopSimulation();
 
    if ( QMessageBox::question(
 
@@ -1143,7 +1149,8 @@ void Main::toggleHideCells(void) {
 
  }
 

	
 

	
 
void Main::FitCanvasToWindow(void) {
 
void Main::FitCanvasToWindow(void)
 
{
 
  
 
  double scale_factor_x = (double)editor->width()/(double)canvas.width();
 
  double scale_factor_y = (double)editor->height()/(double)canvas.height();
 
@@ -1163,19 +1170,22 @@ void Main::FitCanvasToWindow(void) {
 
  editor->show();
 
}
 

	
 
  void Main::PauseIfRunning(void) {
 
void Main::PauseIfRunning(void)
 
{
 
    if (running) {
 
      timer->stop();
 
    }
 
  }
 

	
 
  void Main::ContIfRunning(void) {
 
void Main::ContIfRunning(void)
 
{
 
    if (running) {
 
      timer->start( 0 );
 
    }
 
  }
 

	
 
void Main::FitLeafToCanvas(void) {
 
void Main::FitLeafToCanvas(void) 
 
{
 

	
 
  Vector ll,ur;
 
  mesh.BoundingBox(ll, ur);
 
@@ -1192,7 +1202,8 @@ void Main::FitLeafToCanvas(void) {
 
  editor->fitInView(bb, Qt::KeepAspectRatio);
 
}
 

	
 
void Main::CleanMesh(void) {
 
void Main::CleanMesh(void) 
 
{
 
	vector<double> clean_chem(Cell::NChem());
 
	vector<double> clean_transporters(Cell::NChem());
 

	
 
@@ -1210,7 +1221,8 @@ void Main::CleanMesh(void) {
 
	editor->FullRedraw();
 
}
 

	
 
void Main::CleanMeshChemicals(void) {
 
void Main::CleanMeshChemicals(void) 
 
{
 
	
 
	vector<double> clean_chem(Cell::NChem());
 

	
 
@@ -1225,7 +1237,8 @@ void Main::CleanMeshChemicals(void) {
 
	editor->FullRedraw();
 
}
 

	
 
void Main::CleanMeshTransporters(void) {
 
void Main::CleanMeshTransporters(void) 
 
{
 
	vector<double> clean_transporters(Cell::NChem());
 
	for (int i=0;i<Cell::NChem();i++) {
 
		clean_transporters[i]=0.;
 
@@ -1239,7 +1252,8 @@ void Main::CleanMeshTransporters(void) {
 
	editor->FullRedraw();
 
}
 

	
 
void Main::RandomizeMesh(void) {
 
void Main::RandomizeMesh(void) 
 
{
 
  
 
  vector<double> max_chem(Cell::NChem());
 
  vector<double> max_transporters(Cell::NChem());
 
@@ -1257,7 +1271,8 @@ void Main::RandomizeMesh(void) {
 
  Plot();
 
}
 

	
 
void Main::XMLReadSettings(xmlNode *settings) {
 
void Main::XMLReadSettings(xmlNode *settings) 
 
{
 
  
 
  MainBase::XMLReadSettings(settings);
 

	
 
@@ -1277,7 +1292,8 @@ void Main::XMLReadSettings(xmlNode *sett
 
	view->setItemChecked( apoplasts_id, showapoplastsp);
 
}
 

	
 
xmlNode *Main::XMLSettingsTree(void) {
 
xmlNode *Main::XMLSettingsTree(void) 
 
{
 

	
 
  showcentersp = view->isItemChecked(com_id);
 
  showmeshp = view->isItemChecked(mesh_id);
 
@@ -1298,4 +1314,3 @@ xmlNode *Main::XMLSettingsTree(void) {
 
}
 

	
 
/* finis */
 

	
src/canvas.h
Show inline comments
 
@@ -128,7 +128,8 @@ class Main : public Q3MainWindow, public
 
  virtual bool ShowToolTipsP(void) { return helpmenu->isItemChecked(tooltips_id); }
 
  virtual bool HideCellsP(void) { return view->isItemChecked(hide_cells_id); }
 
  void scale(double factor); 
 
  virtual double getFluxArrowsize(void) {
 
  virtual double getFluxArrowsize(void)
 
  {
 
    return flux_arrow_size;
 
  }
 
    
 
@@ -162,7 +163,8 @@ class Main : public Q3MainWindow, public
 
  void stopSimulation(void);
 
  void RefreshInfoBar(void);
 

	
 
  void EnterRotationMode(void) {
 
  void EnterRotationMode(void)
 
  {
 

	
 
    UserMessage("Rotation mode. Click mouse to exit.");
 
    if (editor) {
 
@@ -173,7 +175,8 @@ class Main : public Q3MainWindow, public
 
    }
 
  
 
  }
 
  void ExitRotationMode(void) { 
 
  void ExitRotationMode(void)
 
  { 
 
    UserMessage("Exited rotation mode.",2000);
 

	
 
    options->setItemChecked(rotation_mode_id, false); 
 
@@ -263,9 +266,8 @@ class Main : public Q3MainWindow, public
 
  static const QString caption;
 
  static const QString caption_with_file;
 
	InfoBar *infobar;
 

	
 
};
 

	
 

	
 
#endif
 

	
 
#endif
 
/* finis*/
src/cell.cpp
Show inline comments
 
@@ -40,35 +40,34 @@ extern Parameter par;
 
double Cell::factor=1.;
 
double Cell::offset[3]={0,0,0};
 

	
 
Cell::Cell(void) : CellBase() {
 

	
 
Cell::Cell(void) : CellBase()
 
{
 
	m=0;
 

	
 
}
 

	
 
Cell::Cell(double x, double y, double z) : CellBase(x,y,z) {
 

	
 
Cell::Cell(double x, double y, double z) : CellBase(x,y,z)
 
{
 
	m=0;
 
	
 
}
 

	
 
Cell::Cell(const Cell &src) :  CellBase(src) {
 
	
 
Cell::Cell(const Cell &src) :  CellBase(src)
 
{
 
	m=src.m;
 
}
 

	
 
bool Cell::Cmp(Cell *c) const { return this->Index() < c->Index(); }
 
bool Cell::Eq(Cell *c) const { return this->Index() == c->Index(); }
 

	
 
Cell Cell::operator=(const Cell &src) {
 
Cell Cell::operator=(const Cell &src) 
 
{
 
	CellBase::operator=(src);
 
	m=src.m;
 
	return *this;
 
}
 
//Cell(void) : CellBase() {}
 

	
 
void Cell::DivideOverAxis(Vector axis) {
 
	
 
void Cell::DivideOverAxis(Vector axis) 
 
{
 
	// Build a wall
 
	// ->  find the position of the wall
 
	
 
@@ -99,15 +98,16 @@ void Cell::DivideOverAxis(Vector axis) {
 
	}
 
	
 
	DivideWalls(new_node_locations, centroid, centroid+axis);
 
}
 
	
 
}
 
double Cell::MeanArea(void) {
 
double Cell::MeanArea(void)
 
{
 
	return m->MeanArea();
 
}
 

	
 

	
 
void Cell::Apoptose(void) {
 
	
 
void Cell::Apoptose(void)
 
{
 
	// First kill walls
 
        #ifdef QDEBUG
 
        qDebug() << "This is cell " << Index() << endl;
 
@@ -168,7 +168,6 @@ void Cell::Apoptose(void) {
 
				 << (*w)->c1->Index() << ", c2 = " << (*w)->c2->Index() << endl;
 
                        #endif
 
		}
 
		
 
	}
 
	walls.remove(0);
 
	
 
@@ -215,14 +214,12 @@ void Cell::Apoptose(void) {
 
		}
 
	}
 
	
 
	
 
	
 
	// mark cell as dead
 
	MarkDead();
 
}
 

	
 
void Cell::ConstructConnections(void) {
 
	
 
void Cell::ConstructConnections(void)
 
{
 
    // Tie up the nodes of this cell, assuming they are correctly ordered
 
	
 
    //cerr << "Constructing connections of cell " << index << endl;
 
@@ -261,34 +258,14 @@ void Cell::ConstructConnections(void) {
 
		} else {
 
			next=*next_iterator;
 
		}
 
		
 
		//cerr << "[" << *i << "]";
 
		//if (*i==10 || *i==11) {
 
		//cerr << "previous = " << previous << ", next = " << next << endl;
 
		//}
 
		//if (*i!=10 && *i!=11)
 
		//cerr << "Node " << *i << endl << " = " << *(*i) << endl;
 
		(*i)->owners.push_back( Neighbor( this, previous, next ) );
 
		// if (*i==50 || *i==51) {
 
		//cerr << "Node " << *i << ".size() = " << (*i)->owners.size() << endl;
 
		// }
 
    }
 
}
 

	
 

	
 
/*! \brief Divide the cell over the line v1-v2.
 
 
 
 \param v1: First vertex of line.
 
 \param v2: Second vertex of line.
 
 \param fixed_wall: If true: wall will be set to "fixed" (i.e. not motile)
 
 \return: true if the cell divided, false if not (i.e. no intersection between v1 and v2, and the cell)
 
 */
 
bool Cell::DivideOverGivenLine(const Vector v1, const Vector v2, bool fix_cellwall, NodeSet *node_set ) {
 
	
 
bool Cell::DivideOverGivenLine(const Vector v1, const Vector v2, bool fix_cellwall, NodeSet *node_set )
 
{
 
	if (dead) return false;
 
	
 
	
 
	
 
	// check each edge for intersection with the line
 
	ItList new_node_locations;
 
	
 
@@ -353,11 +330,11 @@ bool Cell::DivideOverGivenLine(const Vec
 
	DivideWalls(new_node_locations, v1, v2, fix_cellwall, node_set);
 
	
 
	return true;
 
	
 
}
 

	
 
// Core division procedure
 
void Cell::DivideWalls(ItList new_node_locations, const Vector from, const Vector to, bool fix_cellwall, NodeSet *node_set) {
 
void Cell::DivideWalls(ItList new_node_locations, const Vector from, const Vector to, bool fix_cellwall, NodeSet *node_set)
 
{
 
	
 
	if (dead) return;
 
	
 
@@ -387,7 +364,6 @@ void Cell::DivideWalls(ItList new_node_l
 
		daughter->new_chem[i]=new_chem[i];
 
	}
 
	
 
	
 
	daughter->boundary=boundary;
 
	daughter->m=m;
 
	
 
@@ -396,7 +372,6 @@ void Cell::DivideWalls(ItList new_node_l
 
	target_area/=2;
 
	daughter->cellvec=cellvec;
 
	
 
	
 
	// Division currently only works for convex cells: i.e. if the division line
 
	// intersects the cells at two points only.
 
	if (new_node_locations.size()!=2) {
 
@@ -426,7 +401,6 @@ void Cell::DivideWalls(ItList new_node_l
 
		return;
 
	}
 
	
 
	
 
	// We can be sure we only need two positions here because divisions
 
	// of non-convex cells are rejected above.
 
	Vector new_node[2];
 
@@ -629,7 +603,9 @@ void Cell::DivideWalls(ItList new_node_l
 
			list<Neighbor> unique_owners;
 
			copy(owners.begin(), owners.end(), back_inserter(unique_owners));
 
			unique_owners.unique( mem_fun_ref( &Neighbor::Eq ) );
 
			qDebug() << "The dividing edge nodes: " << div_edges[i].first->Index() << " and " << div_edges[i].second->Index() << " are owned by cells: ";
 
      qDebug() << "The dividing edge nodes: " << div_edges[i].first->Index() 
 
	       << " and " << div_edges[i].second->Index() << " are owned by cells: ";
 

	
 
			// spit out each owners' cell index
 
			foreach(Neighbor neighbor, unique_owners){
 
			  qDebug() << neighbor.cell->Index() << "  ";
 
@@ -657,7 +633,8 @@ void Cell::DivideWalls(ItList new_node_l
 
			if (edge_owners.size() > 1){
 
			  // Remove the boundary polygon - if its there
 
			  list<Neighbor>::iterator it;
 
			  if ((it = find_if (edge_owners.begin(), edge_owners.end(), bind2nd(mem_fun_ref(&Neighbor::CellEquals), -1))) != edge_owners.end()) {
 
	if ((it = find_if (edge_owners.begin(), edge_owners.end(), bind2nd(mem_fun_ref(&Neighbor::CellEquals), -1)))
 
	    != edge_owners.end()) {
 
                            #ifdef QDEBUG
 
			    qDebug() << "deleating: " << it->cell->Index() << " from the list of edge owners." << endl;
 
                            #endif
 
@@ -845,6 +822,7 @@ void Cell::DivideWalls(ItList new_node_l
 
					(*i)->owners.end(),
 
				bind2nd(mem_fun_ref( &Neighbor::CellEquals ),this->Index() )  );
 
			if (neighb_with_this_cell==(*i)->owners.end()) {
 

	
 
			        #ifdef QDEBUG
 
			  qDebug() << "not found" << endl;
 
                                #endif
 
@@ -981,8 +959,6 @@ void Cell::DivideWalls(ItList new_node_l
 
	// its daughter
 
	broken_neighbors.push_back(daughter);
 
	
 
	
 
	
 
	// Recalculate area of parent and daughter
 
	area = CalcArea();
 
	daughter->area = daughter->CalcArea();
 
@@ -990,8 +966,6 @@ void Cell::DivideWalls(ItList new_node_l
 
	SetIntegrals();
 
	daughter->SetIntegrals();
 
	
 
    
 
	
 
	// Add a "Cell Wall" for diffusion algorithms
 
	Wall *wall = new Wall( new_node_ind[0], new_node_ind[1], this, daughter );
 
	
 
@@ -1016,8 +990,6 @@ void Cell::DivideWalls(ItList new_node_l
 
		
 
	}
 
	
 
	
 
	
 
	// Correct tranporterconcentrations of divided walls
 
	for (int i=0;i<4;i++) {
 
		if (div_wall[i]) {
 
@@ -1035,15 +1007,12 @@ void Cell::DivideWalls(ItList new_node_l
 
		((Cell *)(*i))->ConstructNeighborList();
 
	}
 
	
 
	
 
	ConstructNeighborList();
 
	daughter->ConstructNeighborList();
 
	
 
	m->plugin->OnDivide(&parent_info, daughter, this);
 
	
 
	daughter->div_counter=(++div_counter);
 
	
 
	
 
}
 

	
 
// Move the whole cell
 
@@ -1056,7 +1025,8 @@ void Cell::Move(const Vector T) {
 
    }
 
}
 

	
 
double Cell::Displace(double dx, double dy, double dh) {
 
double Cell::Displace(double dx, double dy, double dh)
 
{
 
	
 
	// Displace whole cell, add resulting energy to dh,
 
	// and accept displacement if energetically favorable
 
@@ -1158,13 +1128,14 @@ double Cell::Displace(double dx, double 
 
}
 

	
 

	
 
void Cell::Displace (void) {
 
void Cell::Displace (void)
 
{
 
	Displace(par.mc_cell_stepsize*(RANDOM()-0.5),par.mc_cell_stepsize*(RANDOM()-0.5),0);
 
}
 

	
 
// Get energy level of whole cell (excluding length constraint?)
 
double Cell::Energy(void) const {
 
	
 
double Cell::Energy(void) const
 
{
 
	double energy = 0.;
 
	double length_contribution = 0.;
 
	
 
@@ -1193,11 +1164,8 @@ double Cell::Energy(void) const {
 
	energy += DSQR(CalcArea() - target_area);
 
	
 
	// cell length constraint
 
	
 
	
 
	energy += lambda_celllength * DSQR(Length() - target_length);
 
	
 
	
 
	return energy;
 
}
 

	
 
@@ -1205,8 +1173,8 @@ double Cell::Energy(void) const {
 

	
 

	
 

	
 
bool Cell::SelfIntersect(void) {
 
	
 
bool Cell::SelfIntersect(void)
 
{
 
    // The (obvious) O(N*N) algorithm
 
	
 
    // Compare each edge against each other edge
 
@@ -1265,7 +1233,8 @@ bool Cell::SelfIntersect(void) {
 
}
 

	
 

	
 
bool Cell::MoveSelfIntersectsP(Node *moving_node_ind, Vector new_pos) {
 
bool Cell::MoveSelfIntersectsP(Node *moving_node_ind, Vector new_pos)
 
{
 
	
 
	// Check whether the polygon will self-intersect if moving_node_ind 
 
	// were displaced to new_pos
 
@@ -1332,27 +1301,19 @@ bool Cell::MoveSelfIntersectsP(Node *mov
 
			}
 
		}
 
	}
 
	
 
	return false;
 
}
 

	
 
/*! \brief Test if this cell intersects with the given line.
 
 
 
 */
 
bool Cell::IntersectsWithLineP(const Vector v1, const Vector v2) {
 
	
 
	
 
bool Cell::IntersectsWithLineP(const Vector v1, const Vector v2)
 
{
 
	// Compare the line against each edge
 
	
 
	// method used: http://astronomy.swin.edu.au/~pbourke/geometry/lineline2d/
 
	
 
	
 
	
 
	for (list<Node *>::const_iterator i=nodes.begin();
 
		 i!=nodes.end();
 
		 i++) 
 
  for (list<Node *>::const_iterator i=nodes.begin(); i!=nodes.end(); i++) 
 
    {
 
		
 
		Vector v3 = *(*i);
 
		list<Node *>::const_iterator nb=i;
 
		nb++;
 
@@ -1373,10 +1334,7 @@ bool Cell::IntersectsWithLineP(const Vec
 
			return true;
 
		}
 
    }
 
	
 
	return false;
 
	
 
	
 
}
 
/*! \brief Constructs Walls, but only one per cell boundary.
 
 
 
@@ -1386,8 +1344,8 @@ bool Cell::IntersectsWithLineP(const Vec
 
 We can remove this? Well, let's leave it in the code in case we need it for something else. E.g. for importing leaf architectures in different formats than our own... :-)
 
 
 
 */
 
void Cell::ConstructWalls(void) {
 
	
 
void Cell::ConstructWalls(void)
 
{
 
	return;
 
	if (dead) return;
 
	
 
@@ -1406,7 +1364,6 @@ void Cell::ConstructWalls(void) {
 
			// push onto list
 
			corner_points.push_back(*i);
 
		}
 
		
 
	}
 
	
 
	// Construct Walls between corner points
 
@@ -1459,7 +1416,6 @@ void Cell::ConstructWalls(void) {
 
			else {
 
				return;
 
			}
 
			
 
		}
 
		
 
		
 
@@ -1478,15 +1434,14 @@ void Cell::ConstructWalls(void) {
 
			}
 
		}
 
	}
 
	
 
}
 

	
 

	
 
void BoundaryPolygon::Draw(QGraphicsScene *c, QString tooltip) {
 
void BoundaryPolygon::Draw(QGraphicsScene *c, QString tooltip)
 
{
 
	
 
	// Draw the BoundaryPolygon on a QCanvas object
 
	
 
	
 
	CellItem* p = new CellItem(this, c);
 
	
 
	QPolygonF pa(nodes.size());
 
@@ -1501,7 +1456,6 @@ void BoundaryPolygon::Draw(QGraphicsScen
 
						  (int)((Offset().y+i->y)*Factor()) );
 
	}
 
	
 
	
 
	p->setPolygon(pa);
 
	p->setPen(par.outlinewidth>=0?QPen( QColor(par.cell_outline_color),par.outlinewidth):QPen(Qt::NoPen));
 
	p->setBrush( Qt::NoBrush );
 
@@ -1511,12 +1465,10 @@ void BoundaryPolygon::Draw(QGraphicsScen
 
		p->setToolTip(tooltip);
 
	
 
	p->show();
 
	
 
}
 

	
 
void Cell::Flux(double *flux, double *D)  {
 
	
 
	
 
void Cell::Flux(double *flux, double *D)
 
{
 
	// loop over cell edges
 
	
 
	for (int c=0;c<NChem();c++) flux[c]=0.;
 
@@ -1543,7 +1495,6 @@ void Cell::Flux(double *flux, double *D)
 
			flux[c] += phi;
 
		}    
 
	}
 
	
 
}
 

	
 

	
 
@@ -1552,7 +1503,8 @@ void Cell::Flux(double *flux, double *D)
 

	
 
#include "canvas.h"
 

	
 
void Cell::Draw(QGraphicsScene *c, QString tooltip) {
 
void Cell::Draw(QGraphicsScene *c, QString tooltip)
 
{
 
	
 
	// Draw the cell on a QCanvas object
 
	
 
@@ -1591,7 +1543,6 @@ void Cell::Draw(QGraphicsScene *c, QStri
 
		p->setToolTip(tooltip);
 
	
 
	p->show();
 
	
 
}
 

	
 

	
 
@@ -1624,7 +1575,6 @@ void Cell::DrawNodes(QGraphicsScene *c) 
 
		item ->setPos(((offset[0]+i->x)*factor),
 
					  ((offset[1]+i->y)*factor) );
 
	}
 
	
 
}
 

	
 
void Cell::DrawIndex(QGraphicsScene *c) const {
 
@@ -1643,7 +1593,6 @@ void Cell::DrawText(QGraphicsScene *c, c
 
	ctext->show();
 
	ctext ->setPos(((offset[0]+centroid.x)*factor),
 
				   ((offset[1]+centroid.y)*factor) );
 
	
 
}
 

	
 

	
 
@@ -1673,7 +1622,6 @@ void Cell::DrawAxis(QGraphicsScene *c) c
 
				  ( (offset[1]+to.y)*factor ) );
 
	line->setZValue(10);
 
	line->show();
 
	
 
}
 

	
 
void Cell::DrawStrain(QGraphicsScene *c) const {
 
@@ -1682,7 +1630,8 @@ void Cell::DrawStrain(QGraphicsScene *c)
 
}
 

	
 

	
 
void Cell::DrawFluxes(QGraphicsScene *c, double arrowsize)  {
 
void Cell::DrawFluxes(QGraphicsScene *c, double arrowsize)
 
{
 
	
 
	// get the mean flux through this cell
 
	Vector vec_flux = ReduceCellAndWalls<Vector>( PINdir );
 
@@ -1707,7 +1656,6 @@ void Cell::DrawFluxes(QGraphicsScene *c,
 
				   ( (offset[1]+to.y)*factor ) );
 
	arrow->setZValue(10);
 
	arrow->show();
 
	
 
}
 

	
 

	
 
@@ -1723,17 +1671,17 @@ void Cell::DrawWalls(QGraphicsScene *c) 
 
void Cell::DrawValence(QGraphicsScene *c) const {
 
	
 
	DrawText(c, QString("%1").arg(walls.size()) );
 
	
 
}
 

	
 
#endif
 
#endif // QTGRAPHICS !
 

	
 
/*! \brief Recalculate the lengths of the cell's Walls.
 
 
 
 Call this function after the Monte Carlo updates, and before doing the reaction-diffusion iterations.
 
 
 
 */
 
void Cell::SetWallLengths(void) {
 
void Cell::SetWallLengths(void)
 
{
 
	
 
	for (list<Wall *>::iterator de=walls.begin();
 
		 de!=walls.end();
 
@@ -1779,7 +1727,8 @@ void Cell::SetWallLengths(void) {
 

	
 

	
 
//! Add Wall w to the list of Walls
 
void Cell::AddWall( Wall *w ) {
 
void Cell::AddWall( Wall *w )
 
{
 
	
 
	// if necessary, we could try later inserting it at the correct position
 
        #ifdef QDEBUG
 
@@ -1799,11 +1748,11 @@ void Cell::AddWall( Wall *w ) {
 
		== m->walls.end() ) {
 
		m->walls.push_back(w);
 
	}
 
	
 
}
 

	
 
//! Remove Wall w from the list of Walls
 
list<Wall *>::iterator Cell::RemoveWall( Wall *w ) {
 
list<Wall *>::iterator Cell::RemoveWall( Wall *w )
 
{
 
	
 
	// remove wall from Mesh's list
 
	m->walls.erase(
 
@@ -1813,20 +1762,15 @@ list<Wall *>::iterator Cell::RemoveWall(
 
				   );
 
	
 
	// remove wall from Cell's list
 
	return 
 
	walls.erase (
 
				 find( 
 
					  walls.begin(), walls.end(),
 
					  w )
 
				 );
 
	
 
  return walls.erase (find( walls.begin(), walls.end(), w ));
 
}
 

	
 

	
 

	
 
void Cell::EmitValues(double t) {
 
void Cell::EmitValues(double t)
 
{
 
	
 
	//  cerr << "Attempting to emit " << t << ", " << chem[0] << ", " << chem[1] << endl;
 
	emit ChemMonValue(t, chem);
 
}
 
	
 
}
 
/* finis */
src/cell.h
Show inline comments
 
@@ -92,14 +92,15 @@ public:
 
    }
 
    
 
    void DivideOverAxis(Vector axis); // divide cell over axis
 
    bool DivideOverGivenLine(const Vector v1, const Vector v2, bool wall_fixed = false, NodeSet *node_set = 0); // divide over the line (if line and cell intersect)
 

	
 
  // divide over the line (if line and cell intersect)
 
  bool DivideOverGivenLine(const Vector v1, const Vector v2, bool wall_fixed = false, NodeSet *node_set = 0);
 
	
 
    void Divide(void) { // Divide cell over short axis
 
		
 
		Vector long_axis; 
 
		Length(&long_axis); 
 
		DivideOverAxis(long_axis.Perp2D()); 
 
		
 
    }
 
	
 
	//void CheckForGFDrivenDivision(void);
 
@@ -122,11 +123,6 @@ public:
 
	void ConstructWalls(void);
 
	void Flux(double *flux, double *D);
 
	
 
	/*! \brief Method called if a cell is clicked. 
 
	 
 
	 Define this in the end-user code (e.g. meinhardt.cpp).
 
	 
 
	 */
 
    void OnClick(QMouseEvent *e);
 
    inline Mesh& getMesh(void) const { return *m; }
 
	double MeanArea(void);
 
@@ -153,7 +149,6 @@ public:
 
signals:
 
    void ChemMonValue(double t, double *x);
 
	
 
	
 
protected:
 
	void XMLAddCore(xmlNodePtr xmlcell) const;
 
    int XMLRead(xmlNode *cur);
 
@@ -167,7 +162,6 @@ private:
 
	Mesh *m;
 
	void ConstructConnections(void);
 
	void SetWallLengths(void);
 

	
 
};
 

	
 

	
 
@@ -196,10 +190,8 @@ public:
 
	virtual void XMLAdd(xmlNodePtr parent_node) const;
 
	
 
	virtual bool BoundaryPolP(void) const { return true; } 
 

	
 

	
 
};
 

	
 

	
 
#endif
 

	
 
#endif
 
/* finis */
src/cellbase.cpp
Show inline comments
 
@@ -134,7 +134,6 @@ CellBase::CellBase(double x,double y,dou
 
	cell_type = 0;
 
	flag_for_divide = false;
 
	division_axis = 0;
 

	
 
}
 

	
 
CellBase::CellBase(const CellBase &src) :  Vector(src), QObject()
 
@@ -178,7 +177,8 @@ CellBase::CellBase(const CellBase &src) 
 
}
 

	
 

	
 
CellBase CellBase::operator=(const CellBase &src) {
 
CellBase CellBase::operator=(const CellBase &src)
 
{
 
	Vector::operator=(src);
 

	
 
	for (int i=0;i<NChem();i++) {
 
@@ -217,7 +217,8 @@ CellBase CellBase::operator=(const CellB
 
	return *this;
 
}
 

	
 
void CellBase::SetChemical(int c, double conc) {
 
void CellBase::SetChemical(int c, double conc)
 
{
 
	if (c>=NChem()) {
 
		stringstream error;
 
		error << "SetChemical: value c = " << c << " is out of range\n";
 
@@ -226,7 +227,8 @@ void CellBase::SetChemical(int c, double
 
	chem[c]=conc;
 
}
 

	
 
void CellBase::SetTransporters(int ch, double conc) {
 
void CellBase::SetTransporters(int ch, double conc)
 
{
 
	if (ch>=NChem()) {
 
		stringstream error;
 
		error << "SetChemical: value ch = " << ch << " is out of range\n";
 
@@ -239,7 +241,8 @@ void CellBase::SetTransporters(int ch, d
 
	}
 
}
 

	
 
ostream &CellBase::print(ostream &os) const {
 
ostream &CellBase::print(ostream &os) const
 
{
 
	
 
	
 
	os << "[ index = " << index << " {" << x << ", " << y << ", " << z << "}: {";
 
@@ -276,16 +279,17 @@ ostream &CellBase::print(ostream &os) co
 
	os << "cell_type = " << cell_type << endl;
 
	os << endl;
 
	return os;
 
	
 
}
 

	
 
ostream &operator<<(ostream &os, const CellBase &c) {
 
ostream &operator<<(ostream &os, const CellBase &c)
 
{
 
	c.print(os);
 
	return os;
 
}
 

	
 

	
 
double CellBase::CalcArea(void) const {
 
double CellBase::CalcArea(void) const
 
{
 
	
 
	double loc_area=0.;
 
	
 
@@ -302,11 +306,11 @@ double CellBase::CalcArea(void) const {
 
	}
 

	
 
	// http://technology.niagarac.on.ca/courses/ctec1335/docs/arrays2.pdf	
 
	//return loc_area/2.0; 
 
	return fabs(loc_area)/2.0; 
 
} 
 

	
 
Vector CellBase::Centroid(void) const {
 
Vector CellBase::Centroid(void) const
 
{
 
	
 
	double area=0.;
 
	double integral_x_dxdy=0.,integral_y_dxdy=0.;
 
@@ -332,7 +336,6 @@ Vector CellBase::Centroid(void) const {
 
			 (*i_plus_1)->x*(*i)->y);
 
	}
 
    
 
	//area/=2.0;
 
	area = fabs(area)/2.0;
 
	
 
	integral_x_dxdy/=6.;
 
@@ -345,7 +348,8 @@ Vector CellBase::Centroid(void) const {
 

	
 

	
 

	
 
void CellBase::SetIntegrals(void) const {
 
void CellBase::SetIntegrals(void) const
 
{
 
	
 
	// Set the initial values for the integrals over x^2,
 
	// xy, yy, x, and y
 
@@ -392,13 +396,11 @@ void CellBase::SetIntegrals(void) const 
 
			((*i)->x*(*nb)->y-
 
			 (*nb)->x*(*i)->y);
 
	}
 
	
 

	
 
	area = fabs(area)/2.0;
 
	
 
}
 

	
 
double CellBase::Length(Vector *long_axis, double *width)  const {
 
double CellBase::Length(Vector *long_axis, double *width)  const
 
{
 
	
 
	// Calculate length and axes of CellBase
 
    
 
@@ -434,12 +436,10 @@ double CellBase::Length(Vector *long_axi
 
	}
 
	
 
	return 4*sqrt(lambda_b/area);
 
    
 
	
 
	
 
}
 

	
 
double CellBase::CalcLength(Vector *long_axis, double *width)  const {
 
double CellBase::CalcLength(Vector *long_axis, double *width)  const
 
{
 
	
 
	// Calculate length and axes of CellBase, without touching cells raw moments
 
    
 
@@ -515,14 +515,11 @@ double CellBase::CalcLength(Vector *long
 
	}
 
	
 
	return 4*sqrt(lambda_b/my_area);
 
    
 
	
 
	
 
}
 

	
 

	
 

	
 
void CellBase::ConstructNeighborList(void) {
 
void CellBase::ConstructNeighborList(void)
 
{
 
	
 
	neighbors.clear();
 
	for (//list<Wall *>::const_reverse_iterator wit=walls.rbegin();
 
@@ -561,11 +558,11 @@ void CellBase::ConstructNeighborList(voi
 
			break;
 
		}
 
  } while(1);
 
	
 
}
 
	
 
	// Save the cell to a stream so we can reconstruct its state later
 
	void CellBase::Dump(ostream &os) const {
 
void CellBase::Dump(ostream &os) const
 
{
 
		
 
		
 
		os << index << " " << nodes.size() << endl;
 
@@ -583,16 +580,10 @@ void CellBase::ConstructNeighborList(voi
 
		for (list<CellBase *>::const_iterator i=neighbors.begin();i!=neighbors.end();i++) {
 
			os << *i << " ";
 
		}
 
		os << endl;
 
		
 
		os << walls.size() << endl;
 
		/*for (list<Wall *>::const_iterator i=walls.begin();i!=walls.end(); i++) {
 
			(*i)->Dump(os);
 
		}*/
 
  os << endl << walls.size() << endl << endl;
 
  os << NChem() << " ";
 
		
 
		os << endl;
 
		
 
		os << NChem() << " ";
 
		for (int i=0;i<NChem();i++) {
 
			os << chem[i] << " ";
 
		}
 
@@ -604,7 +595,9 @@ void CellBase::ConstructNeighborList(voi
 
		}
 
		os << endl;
 
		
 
		os << boundary << " " << area << " " << target_area << " " << target_length << " " << fixed << " " << intgrl_xx << " " << intgrl_xy << " " << intgrl_yy << " " << intgrl_x << " " << intgrl_y << " " << source << " ";
 
  os << boundary << " " << area << " " << target_area << " " << target_length 
 
     << " " << fixed << " " << intgrl_xx << " " << intgrl_xy << " " << intgrl_yy 
 
     << " " << intgrl_x << " " << intgrl_y << " " << source << " ";
 
		
 
		cellvec.Dump(os);
 
		
 
@@ -614,8 +607,8 @@ void CellBase::ConstructNeighborList(voi
 
	}
 
	
 
	
 
	
 
	void CellBase::UnfixNodes(void) {
 
void CellBase::UnfixNodes(void)
 
{
 
		
 
		for (list<Node *>::const_iterator i=nodes.begin();
 
			 i!=nodes.end();
 
@@ -625,7 +618,9 @@ void CellBase::ConstructNeighborList(voi
 
		
 
	}
 
	
 
	void CellBase::FixNodes(void) {
 

	
 
void CellBase::FixNodes(void)
 
{
 
		
 
		for (list<Node *>::const_iterator i=nodes.begin();
 
			 i!=nodes.end();
 
@@ -636,18 +631,14 @@ void CellBase::ConstructNeighborList(voi
 
	}
 
	
 
	// returns true if cell is at border
 
	bool CellBase::AtBoundaryP(void) const {
 
		
 
bool CellBase::AtBoundaryP(void) const
 
{
 
		return at_boundary;
 
	}
 
	
 

	
 

	
 

	
 

	
 

	
 

	
 
QString CellBase::printednodelist(void) {
 
QString CellBase::printednodelist(void)
 
{
 
	QString info_string = "Nodelist = { ";
 
	for (list<Node *>::const_iterator i =  nodes.begin(); i!=nodes.end(); i++) {
 
		info_string += QString("%1 ").arg((*i)->Index());
 
@@ -656,3 +647,4 @@ QString CellBase::printednodelist(void) 
 
	return info_string;
 
}
 

	
 
/* finis*/
src/cellbase.h
Show inline comments
 
@@ -51,7 +51,6 @@ struct ParentInfo {
 
	Vector polarization;
 
	double PINmembrane;
 
	double PINendosome;
 
	
 
};
 

	
 
// We need a little trick here, to make sure the plugin and the main application will see the same static datamembers
 
@@ -77,8 +76,6 @@ public:
 
	int ncells;
 
	int nchem;
 
	double base_area;
 

	
 

	
 
};
 

	
 
class CellBase :  public QObject, public Vector 
 
@@ -86,7 +83,6 @@ class CellBase :  public QObject, public
 

	
 
	Q_OBJECT
 

	
 

	
 
	friend class Mesh;
 
	friend class CellInfo;
 
	friend class Node;
 
@@ -112,14 +108,18 @@ class CellBase :  public QObject, public
 
    CellBase operator=(const Vector &src);
 
  
 
    void SetChemical(int chem, double conc);
 
    inline void SetNewChem(int chem, double conc) { 
 
  inline void SetNewChem(int chem, double conc)
 
  { 
 
      new_chem[chem] = conc;
 
    }
 
    void SetSource(int chem, double conc) {
 

	
 
  void SetSource(int chem, double conc)
 
  {
 
      source=true;
 
      source_chem = chem;
 
      source_conc = conc;
 
	}
 

	
 
	// set chem 1 to conc in all membranes of this cell
 
    void SetTransporters(int chem, double conc);
 
    void UnfixNodes(void);
 
@@ -154,26 +154,22 @@ class CellBase :  public QObject, public
 
    
 
    //void print_nblist(void) const;
 

	
 
    boundary_type SetBoundary(boundary_type bound) {
 
  boundary_type SetBoundary(boundary_type bound)
 
  {
 
      if (bound!=None) {
 
      }
 
      return boundary=bound;
 
    }
 
  
 
    boundary_type ResetBoundary(void) {
 
      return boundary=None;
 
    }
 
    boundary_type Boundary(void) const {
 
      return boundary;
 
    }
 
    static int &NChem(void) {
 
      return static_data_members->nchem;
 
    }
 
  boundary_type ResetBoundary(void) { return boundary=None; }
 

	
 
  boundary_type Boundary(void) const { return boundary; }
 

	
 
  static int &NChem(void) { return static_data_members->nchem; }
 
  
 
    double CalcArea(void) const;
 
    double RecalcArea(void) {
 
      return area = CalcArea();
 
    }
 

	
 
  double RecalcArea(void) { return area = CalcArea(); }
 
    
 
    Vector Centroid(void) const;
 
  
 
@@ -183,49 +179,33 @@ class CellBase :  public QObject, public
 
    double CalcLength(Vector *long_axis = 0, double *width = 0) const;
 
    
 

	
 
    inline int Index(void) const {
 
      return index;
 
    }
 
  inline int Index(void) const { return index; }
 
  
 

	
 
    void SetTargetArea(double tar_ar) {
 
      target_area=tar_ar;
 
    }
 
    inline void SetTargetLength(double tar_l) {
 
      target_length=tar_l;
 
    }
 
    inline void SetLambdaLength(double lambda_length) {
 
      lambda_celllength = lambda_length;
 
    }
 
    inline double TargetArea(void) {
 
      return target_area;
 
    }
 
  void SetTargetArea(double tar_ar) { target_area=tar_ar; }
 

	
 
  inline void SetTargetLength(double tar_l) { target_length=tar_l; }
 
  
 
    inline void SetStiffness(double stiff) {
 
      stiffness = stiff;
 
    }
 
  inline void SetLambdaLength(double lambda_length) { lambda_celllength = lambda_length; }
 

	
 
  inline double TargetArea(void) { return target_area; }
 

	
 
  inline void SetStiffness(double stiff) { stiffness = stiff; }
 

	
 
    inline double Stiffness(void) {
 
      return stiffness;
 
    }
 
    inline double EnlargeTargetArea(double da) {
 
      return target_area+=da;
 
    }
 
  inline double Stiffness(void) { return stiffness; }
 

	
 
  inline double EnlargeTargetArea(double da) { return target_area+=da; }
 
  
 
    inline double Area(void) const {
 
      return area;
 
    }
 
  inline double Area(void) const { return area; }
 
    
 
	inline void Divide(void) {
 
		flag_for_divide = true;
 
	}
 
  inline void Divide(void) { flag_for_divide = true; }
 
	
 
	inline void DivideOverAxis(const Vector &v) {
 
  inline void DivideOverAxis(const Vector &v)
 
  {
 
		division_axis = new Vector(v);
 
		flag_for_divide = true;
 
	}
 
	
 

	
 
    inline double Circumference(void) const {
 
      double sum=0.;
 
      for (list<Wall *>::const_iterator w=walls.begin();
 
@@ -251,18 +231,16 @@ class CellBase :  public QObject, public
 
   	
 
	QString printednodelist(void);
 
 
 

	
 
    
 
    inline bool DeadP(void) { return dead; }
 
    inline void MarkDead(void) { dead  = true; }
 
    
 
	static double &BaseArea(void) { 
 
  static double &BaseArea(void)
 
  { 
 
		return static_data_members->base_area;
 
	}
 
  
 
    void CheckForDivision(void);
 

	
 
	
 
    // write flux from neighboring cells into "flux"
 
    void Flux(double *flux, double *D); 
 
    inline bool FixedP(void) { return fixed; }
 
@@ -272,24 +250,28 @@ class CellBase :  public QObject, public
 
    
 
	bool AtBoundaryP(void) const;
 
    
 
    static inline int &NCells(void) {
 
  static inline int &NCells(void)
 
  {
 
      return static_data_members->ncells;
 
    }
 

	
 
 
 
   
 
    inline void Mark(void) {
 
  inline void Mark(void)
 
  {
 
      marked=true;
 
    }
 
    inline void Unmark(void) {
 

	
 
  inline void Unmark(void)
 
  {
 
      marked=false;
 
    }
 

	
 
    inline bool Marked(void) const {
 
      return marked;
 
    }
 

	
 
	//! Returns the sum of chemical "chem" of this CellBase's neighbors
 
    double SumChemicalsOfNeighbors(int chem) {
 
  double SumChemicalsOfNeighbors(int chem)
 
  {
 
      double sum=0.;
 
      for (list<Wall *>::const_iterator w=walls.begin();
 
	   w!=walls.end();
 
@@ -320,11 +302,9 @@ class CellBase :  public QObject, public
 
      return sum;
 
    }
 
	
 
	
 
    
 
    
 
    //! The same, but now for the walls AND neighbors
 
    template<class P, class Op> P ReduceCellAndWalls(Op f) {
 
  template<class P, class Op> P ReduceCellAndWalls(Op f)
 
  {
 
      P sum = 0;
 
      for (list<Wall *>::const_iterator w=walls.begin();
 
	   w!=walls.end();
 
@@ -338,7 +318,8 @@ class CellBase :  public QObject, public
 
    
 
	
 
    //! Sum transporters at this CellBase's side of the walls
 
    double SumTransporters(int ch) {
 
  double SumTransporters(int ch)
 
  {
 
      double sum=0.;
 
      for (list<Wall *>::const_iterator w=walls.begin();
 
	   w!=walls.end();
 
@@ -346,14 +327,14 @@ class CellBase :  public QObject, public
 
	sum += (*w)->getTransporter(this, ch);
 
      
 
      }
 
      
 
      return sum;
 
    }
 

	
 
    inline int NumberOfDivisions(void) { return div_counter; }
 
    
 
    //! Sum transporters at this CellBase's side of the walls
 
    double SumLengthTransporters(int ch) {
 
  double SumLengthTransporters(int ch)
 
  {
 
      double sum=0.;
 
      for (list<Wall *>::const_iterator w=walls.begin();
 
	   w!=walls.end();
 
@@ -361,13 +342,13 @@ class CellBase :  public QObject, public
 
	sum += (*w)->getTransporter(this, ch) * (*w)->Length();
 
      
 
      }
 
      
 
      return sum;
 
    }
 
    
 
	
 
    
 
    double SumLengthTransportersChemical(int trch, int ch) {
 
  double SumLengthTransportersChemical(int trch, int ch)
 
  {
 
      double sum=0.;
 
      for (list<Wall *>::const_iterator w=walls.begin();
 
	   w!=walls.end();
 
@@ -375,14 +356,14 @@ class CellBase :  public QObject, public
 
	sum += (*w)->getTransporter(this, trch) * ( (*w)->c1!=this ? (*w)->c1->Chemical(ch) : (*w)->c2->Chemical(ch) );
 
	
 
      }
 
      
 
      return sum;
 
    }
 
	inline int CellType(void) const { return cell_type; } 
 
	inline void SetCellType(int ct) { cell_type = ct; }
 

	
 
    
 
	static void SetNChem(int new_nchem) {
 
  static void SetNChem(int new_nchem)
 
  {
 
		if (NCells()) {
 
			MyWarning::error("CellBase::SetNChem says: not permitted, call SetNChem after deleting all cells.");
 
		} else {
 
@@ -400,12 +381,14 @@ protected:
 

	
 
    int index;
 

	
 
	inline void SetChemToNewchem(void) {
 
  inline void SetChemToNewchem(void)
 
  {
 
		for (int c=0;c<CellBase::NChem();c++) {
 
			chem[c]=new_chem[c];
 
		}
 
    }
 
    inline void SetNewChemToChem(void) {
 
  inline void SetNewChemToChem(void)
 
  {
 
		for (int c=0;c<CellBase::NChem();c++) {
 
			new_chem[c]=chem[c];
 
		}
 
@@ -446,10 +429,8 @@ protected:
 
	bool flag_for_divide;
 
	
 
	Vector *division_axis;
 
	
 
	int cell_type;
 
	
 
    
 
    // for length constraint
 
    mutable double intgrl_xx, intgrl_xy, intgrl_yy, intgrl_x, intgrl_y;
 
    
 
@@ -462,7 +443,8 @@ protected:
 
    int source_chem;
 
	
 
    // PRIVATE MEMBER FUNCTIONS
 
    inline static void ClearNCells(void) {
 
  inline static void ClearNCells(void)
 
  {
 
      NCells()=0;
 
    }
 
    
 
@@ -472,15 +454,12 @@ protected:
 

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

	
 
inline Vector PINdir(CellBase *here, CellBase *nb, Wall *w) {
 
inline Vector PINdir(CellBase *here, CellBase *nb, Wall *w)
 
{
 
	  nb = NULL; // assignment merely to obviate compilation warning
 
	  return w->getTransporter( here, 1)  *  w->getInfluxVector(here);
 
}
 

	
 

	
 
#endif
 

	
 

	
 

	
 

	
 

	
 
/* finis*/
src/cellitem.cpp
Show inline comments
 
@@ -29,7 +29,8 @@ CellItem::CellItem( Cell *c, QGraphicsSc
 
  : QGraphicsPolygonItem( 0, canvas ), SimItemBase( c, canvas){
 
}
 

	
 
void CellItem::userMove(double dx, double dy) {
 
void CellItem::userMove(double dx, double dy)
 
{
 
  QGraphicsPolygonItem::moveBy( dx, dy );
 

	
 
  // also move the cell itself
 
@@ -39,7 +40,8 @@ void CellItem::userMove(double dx, doubl
 
  class_cast<Cell*>(obj)->Move( (dx/Cell::Magnification()), (dy/Cell::Magnification()) );
 
}
 

	
 

	
 
QPainterPath CellItem::shape() const { return QGraphicsPolygonItem::shape(); }
 
QRectF CellItem::boundingRect() const { return QGraphicsPolygonItem::boundingRect(); }
 

	
 

	
 
/* finis */
src/cellitem.h
Show inline comments
 
@@ -43,7 +43,8 @@ public:
 
  QRectF boundingRect() const;
 

	
 
 private:
 

	
 
};
 

	
 
#endif
 

	
 
/* finis */
src/curvecolors.h
Show inline comments
 
@@ -175,3 +175,5 @@ class CurveColors {
 
  QStringList colors;
 
};
 
#endif
 

	
 
/* finis */
src/data_plot.cpp
Show inline comments
 
@@ -66,8 +66,6 @@ DataPlot::DataPlot(QWidget *parent, cons
 
  alignScales();
 
    
 
  //  Initialize data
 
  
 
  
 
  for (int i = 0; i< PLOT_SIZE; i++) {
 
    d_t[i] = 0.;     // time axis
 
  }
 
@@ -98,20 +96,19 @@ DataPlot::DataPlot(QWidget *parent, cons
 
    
 
  // Axis 
 
  setAxisTitle(QwtPlot::xBottom, "Time");
 

	
 
  setAxisTitle(QwtPlot::yLeft, "Level");
 
  setAxisScale(QwtPlot::yLeft, 0, 10);
 

	
 
  data_pos = 0;
 

	
 
}
 

	
 
DataPlot::~DataPlot(void) {
 
DataPlot::~DataPlot(void)
 
{
 
  delete[] d_t ;
 
  delete[] d_x[0];
 
  delete[] d_x;
 
  delete[] curves;
 
}
 

	
 
//
 
//  Set a plain canvas frame and align the scales to it
 
//
 
@@ -136,7 +133,6 @@ void DataPlot::alignScales()
 
    }
 
}
 

	
 

	
 
//  Generate new values 
 
void DataPlot::AddValue(double t,double *x)
 
{
 
@@ -154,7 +150,6 @@ void DataPlot::AddValue(double t,double 
 
	d_x[i][j] = d_x[i][j+1];
 
    }
 
    data_pos = PLOT_SIZE - 1;
 
    
 
  } 
 

	
 
  d_t[data_pos] = t;
 
@@ -165,29 +160,24 @@ void DataPlot::AddValue(double t,double 
 
  }
 
					       
 
  setAxisScale(QwtPlot::xBottom, d_t[0], t);
 
  data_pos++;
 
  
 
  data_pos++;
 
  // update the display
 
  replot();
 
  
 

	
 
}
 

	
 

	
 
PlotDialog::PlotDialog(QWidget *parent, const QString title, const QStringList curvenames):
 
  QDialog(parent) 
 
{
 
  
 
  plot = new DataPlot(this,title,curvenames);
 
  
 
  plot->resize(400,300);
 
  
 
  show();
 

	
 
}
 

	
 
PlotDialog::~PlotDialog(void) {
 
  
 
PlotDialog::~PlotDialog(void)
 
{
 
  delete plot;
 
}
 

	
 
/* finis */
src/data_plot.h
Show inline comments
 
@@ -63,7 +63,6 @@ private:
 
    // to write contents of DataPlot to a file
 
    QFile *datfile;
 
    QTextStream datstream;
 

	
 
};
 

	
 
class PlotDialog : public QDialog {
 
@@ -82,3 +81,5 @@ Q_OBJECT
 
};
 

	
 
#endif
 

	
 
/* finis */
src/far_mem_5.h
Show inline comments
 
@@ -21,7 +21,6 @@
 
 *
 
 */
 

	
 

	
 
#ifndef _FAR_MEM_5_h_
 
#define _FAR_MEM_5_h_
 

	
 
@@ -45,9 +44,12 @@ Type *m_ptyp;
 
Result (Type::*m_pmf)(Param1);
 
};
 

	
 
template <class Result, class Type, class Param1>far_1_arg_mem_fun_t<Result,Type,Param1> far_1_arg_mem_fun(Type &ir_typ, Result (Type::*i_pmf)(Param1) ) {
 
template <class Result, class Type, 
 
  class Param1>far_1_arg_mem_fun_t<Result,Type,Param1> far_1_arg_mem_fun(Type &ir_typ, Result (Type::*i_pmf)(Param1) )
 
{
 
	return far_1_arg_mem_fun_t<Result,Type,Param1>(ir_typ,i_pmf);
 
 }
 

	
 
template <class _Arg1, class _Arg2,  class _Result>
 
	struct my_2_function
 
	{
 
@@ -55,6 +57,7 @@ typedef _Arg1 argument_type1;
 
typedef _Arg2 argument_type2;
 
typedef _Result result_type;  ///<  result_type is the return type
 
};
 

	
 
template <class Result, class Type,  class Param1, class Param2>
 
class far_2_arg_mem_fun_t : public my_2_function<Param1, Param2, Result> {
 
public:
 
@@ -69,9 +72,11 @@ Type *m_ptyp;
 
Result (Type::*m_pmf)(Param1, Param2);
 
};
 

	
 
template <class Result, class Type, class Param1, class Param2>far_2_arg_mem_fun_t<Result,Type,Param1, Param2> far_2_arg_mem_fun(Type &ir_typ, Result (Type::*i_pmf)(Param1, Param2) ) {
 
template <class Result, class Type, class Param1, 
 
  class Param2>far_2_arg_mem_fun_t<Result,Type,Param1, Param2> far_2_arg_mem_fun(Type &ir_typ, Result (Type::*i_pmf)(Param1, Param2) ) {
 
	return far_2_arg_mem_fun_t<Result,Type,Param1, Param2>(ir_typ,i_pmf);
 
 }
 

	
 
template <class _Arg1, class _Arg2, class _Arg3,  class _Result>
 
	struct my_3_function
 
	{
 
@@ -80,6 +85,7 @@ typedef _Arg2 argument_type2;
 
typedef _Arg3 argument_type3;
 
typedef _Result result_type;  ///<  result_type is the return type
 
};
 

	
 
template <class Result, class Type,  class Param1, class Param2, class Param3>
 
class far_3_arg_mem_fun_t : public my_3_function<Param1, Param2, Param3, Result> {
 
public:
 
@@ -94,9 +100,11 @@ Type *m_ptyp;
 
Result (Type::*m_pmf)(Param1, Param2, Param3);
 
};
 

	
 
template <class Result, class Type, class Param1, class Param2, class Param3>far_3_arg_mem_fun_t<Result,Type,Param1, Param2, Param3> far_3_arg_mem_fun(Type &ir_typ, Result (Type::*i_pmf)(Param1, Param2, Param3) ) {
 
template <class Result, class Type, class Param1, class Param2, 
 
class Param3>far_3_arg_mem_fun_t<Result,Type,Param1, Param2, Param3> far_3_arg_mem_fun(Type &ir_typ, Result (Type::*i_pmf)(Param1, Param2, Param3) ) {
 
	return far_3_arg_mem_fun_t<Result,Type,Param1, Param2, Param3>(ir_typ,i_pmf);
 
 }
 

	
 
template <class _Arg1, class _Arg2, class _Arg3, class _Arg4,  class _Result>
 
	struct my_4_function
 
	{
 
@@ -106,6 +114,7 @@ typedef _Arg3 argument_type3;
 
typedef _Arg4 argument_type4;
 
typedef _Result result_type;  ///<  result_type is the return type
 
};
 

	
 
template <class Result, class Type,  class Param1, class Param2, class Param3, class Param4>
 
class far_4_arg_mem_fun_t : public my_4_function<Param1, Param2, Param3, Param4, Result> {
 
public:
 
@@ -123,6 +132,7 @@ Result (Type::*m_pmf)(Param1, Param2, Pa
 
template <class Result, class Type, class Param1, class Param2, class Param3, class Param4>far_4_arg_mem_fun_t<Result,Type,Param1, Param2, Param3, Param4> far_4_arg_mem_fun(Type &ir_typ, Result (Type::*i_pmf)(Param1, Param2, Param3, Param4) ) {
 
	return far_4_arg_mem_fun_t<Result,Type,Param1, Param2, Param3, Param4>(ir_typ,i_pmf);
 
 }
 

	
 
template <class _Arg1, class _Arg2, class _Arg3, class _Arg4, class _Arg5,  class _Result>
 
	struct my_5_function
 
	{
 
@@ -133,6 +143,7 @@ typedef _Arg4 argument_type4;
 
typedef _Arg5 argument_type5;
 
typedef _Result result_type;  ///<  result_type is the return type
 
};
 

	
 
template <class Result, class Type,  class Param1, class Param2, class Param3, class Param4, class Param5>
 
class far_5_arg_mem_fun_t : public my_5_function<Param1, Param2, Param3, Param4, Param5, Result> {
 
public:
 
@@ -152,3 +163,5 @@ template <class Result, class Type, clas
 
 }
 

	
 
#endif
 

	
 
/* finis */
src/flux_function.h
Show inline comments
 
@@ -39,3 +39,5 @@
 
(( _vleafcellp_->ReduceCellAndWalls<double>( far_3_arg_mem_fun( *this, &_flux_function_ ) ) ))
 

	
 
#endif
 

	
 
/* finis */
src/forwardeuler.cpp
Show inline comments
 
@@ -91,7 +91,6 @@ void ForwardEuler::odeint(double *ystart
 
      //xsav=x;
 
    }
 

	
 

	
 
    for (int i=0;i<nvar;i++) {
 
      y[i]=y[i] + h1 * dydx[i];
 
    }
 
@@ -101,8 +100,6 @@ void ForwardEuler::odeint(double *ystart
 
    if ((x-x2)*(x2-x1) >= 0.0) { //Are we done?
 
      goto done;
 
    }
 

	
 

	
 
  }
 

	
 
 done:
 
@@ -116,5 +113,6 @@ void ForwardEuler::odeint(double *ystart
 
  delete[] dydx;
 
  delete[] y;
 
  return; //Normal exit.
 
}
 

	
 
}
 
/* finis */
src/forwardeuler.h
Show inline comments
 
@@ -22,7 +22,6 @@
 
 *
 
 */
 

	
 

	
 
#ifndef _FORWARDEULER_H_
 
#define _FORWARDEULER_H_
 

	
 
@@ -55,7 +54,7 @@ class ForwardEuler  {
 
  static const double Errcon;
 
  static const double Maxstp;
 
  static const double Tiny;
 
  
 

	
 
};
 
#endif
 

	
 
/* finis */
src/infobar.h
Show inline comments
 
@@ -54,4 +54,6 @@ private:
 
	QLabel *virtleaf;
 
};
 

	
 
#endif
 
\ No newline at end of file
 
#endif
 

	
 
/* finis */
src/mainbase.cpp
Show inline comments
 
@@ -131,11 +131,11 @@ xmlNode *MainBase::XMLSettingsTree(void)
 
		text << bool_name(hidecellsp);
 
		xmlNewProp(xmloption, BAD_CAST "val", BAD_CAST text.str().c_str());
 
	}
 
	
 
	return xmlsettings;
 
}
 

	
 
void MainBase::XMLReadSettings(xmlNode *settings) {
 
void MainBase::XMLReadSettings(xmlNode *settings)
 
{
 
	
 
	// Many files have no settings section, so don't complain about it.
 
	// Defaults will be used instead.
 
@@ -196,15 +196,13 @@ void MainBase::XMLReadSettings(xmlNode *
 
			
 
			xmlFree(name);
 
			xmlFree(val);
 
			
 
			
 
		}
 
		cur=cur->next;
 
	}
 
	
 
}
 

	
 
void MainBase::Save(const char *fname, const char *format, int sizex, int sizey) {
 
void MainBase::Save(const char *fname, const char *format, int sizex, int sizey)
 
{
 
	
 
	Vector ll,ur;
 
	mesh.BoundingBox(ll, ur);
 
@@ -214,7 +212,6 @@ void MainBase::Save(const char *fname, c
 
		return;
 
	}
 
	
 
	
 
	ll*=Cell::Magnification(); ur*=Cell::Magnification();
 
	
 
	// give the leaf some space
 
@@ -242,8 +239,9 @@ void MainBase::Save(const char *fname, c
 
	}
 
}
 

	
 
void MainBase::CutSAM() {
 
	
 
void MainBase::CutSAM()
 
{
 
	mesh.CutAwaySAM();
 
}
 
	
 
}
 
/* finis */
src/mainbase.h
Show inline comments
 
@@ -132,3 +132,5 @@ class MainBase  {
 
#define INIT void MainBase::Init(char *leaffile)
 

	
 
#endif
 

	
 
/* finis */
src/matrix.cpp
Show inline comments
 
@@ -35,29 +35,26 @@ Matrix::Matrix(const Vector &c1, const V
 
  mat[0][0]=c1.x; mat[0][1]=c2.x; mat[0][2]=c3.x;
 
  mat[1][0]=c1.y; mat[1][1]=c2.y; mat[1][2]=c3.y;
 
  mat[2][0]=c1.z; mat[2][1]=c2.z; mat[2][2]=c3.z;
 

	
 
    
 
}
 

	
 
void Matrix::Alloc(void) {
 

	
 
void Matrix::Alloc(void)
 
{
 
  // constructor
 
  mat = new double*[3];
 
  mat[0] = new double[9];
 
  for (int i=1;i<3;i++)
 
    mat[i]=mat[i-1]+3;
 
  
 
}
 

	
 
Matrix::~Matrix() {
 
 
 
Matrix::~Matrix()
 
{
 
  // destructor
 
  delete[] mat[0];
 
  delete[] mat;
 
}
 

	
 
Matrix::Matrix(void) {
 
  
 
Matrix::Matrix(void)
 
{
 
  // constructor
 
  Alloc();
 

	
 
@@ -65,23 +62,21 @@ Matrix::Matrix(void) {
 
  for (int i=0;i<9;i++) {
 
    mat[0][i]=0.;
 
  }
 
 
 
}
 

	
 
Matrix::Matrix(const Matrix &source) {
 
 
 
Matrix::Matrix(const Matrix &source)
 
{
 
  // copy constructor
 
  Alloc();
 
  
 
  for (int i=0;i<9;i++) {
 
    mat[0][i]=source.mat[0][i];
 
  }
 
  
 
}
 

	
 

	
 
void Matrix::operator=(const Matrix &source) {
 
  
 
void Matrix::operator=(const Matrix &source)
 
{
 
  // assignment
 
  
 
  // don't assign to self
 
@@ -90,14 +85,14 @@ void Matrix::operator=(const Matrix &sou
 
  // copy 
 
  for (int i=0;i<9;i++)
 
    mat[0][i]=source.mat[0][i];
 
  
 
}
 

	
 

	
 
void Matrix::print(ostream *os) {
 
  
 
  *os << "{ { " << mat[0][0] << "," << mat[0][1] << "," << mat[0][2] << "},{" << mat[1][0] << "," << mat[1][1] << "," << mat[1][2] << "},{" << mat[2][0] << "," << mat[2][1] << "," << mat[2][2] << "} }";
 

	
 
void Matrix::print(ostream *os)
 
{
 
  *os << "{ { " << mat[0][0] << "," << mat[0][1] << "," << mat[0][2] 
 
      << "},{" << mat[1][0] << "," << mat[1][1] << "," << mat[1][2] 
 
      << "},{" << mat[2][0] << "," << mat[2][1] << "," << mat[2][2] << "} }";
 
}
 

	
 
ostream &operator<<(ostream &os, Matrix &v) {
 
@@ -106,8 +101,8 @@ ostream &operator<<(ostream &os, Matrix 
 
}
 

	
 

	
 
Vector Matrix::operator*(const Vector &v) const {
 
  
 
Vector Matrix::operator*(const Vector &v) const
 
{
 
  // matrix * vector
 
  Vector result;
 
  
 
@@ -116,23 +111,20 @@ Vector Matrix::operator*(const Vector &v
 
  result.z = mat[2][0]*v.x+mat[2][1]*v.y+mat[2][2]*v.z;
 
  
 
  return result;
 
  
 
  
 
}
 

	
 

	
 
bool Matrix::operator==(Matrix &m) const {
 
   
 
bool Matrix::operator==(Matrix &m) const
 
{
 
  for (int i=0;i<9;i++) {
 
    if ((mat[0][i]-m.mat[0][i])>TINY)
 
      return false;
 
  }
 
  return true;
 
  
 
}
 

	
 
double Matrix::Det(void) const {
 
  
 
double Matrix::Det(void) const
 
{
 
  return 
 
    - mat[0][2]*mat[0][4]*mat[0][6]
 
    + mat[0][1]*mat[0][5]*mat[0][6] 
 
@@ -140,10 +132,10 @@ double Matrix::Det(void) const {
 
    - mat[0][0]*mat[0][5]*mat[0][7]
 
    - mat[0][1]*mat[0][3]*mat[0][8]
 
    + mat[0][0]*mat[0][4]*mat[0][8];
 

	
 
}
 

	
 
Matrix Matrix::Inverse(void) const {
 
Matrix Matrix::Inverse(void) const
 
{
 
  
 
  // return the Inverse of this matrix
 
  double rd=1./Det(); // Reciproce Det;
 
@@ -158,17 +150,17 @@ Matrix Matrix::Inverse(void) const {
 
  inverse.mat[0][7]=rd*( mat[0][1]*mat[0][6]-mat[0][0]*mat[0][7]);
 
  inverse.mat[0][8]=rd*(-mat[0][1]*mat[0][3]+mat[0][0]*mat[0][4]);
 
  
 

	
 
  return inverse;
 
}
 

	
 
void Matrix::Rot2D(double theta) { 
 
  
 
void Matrix::Rot2D(double theta)
 
{ 
 
  // make this matrix a rotation matrix over theta
 
  // see http://mathworld.wolfram.com/RotationMatrix.html
 
 
 
  mat[0][0] = cos(theta); mat[0][1]=sin(theta);
 
  mat[1][0] = -sin(theta); mat[1][1]=cos(theta);
 
  mat[0][2] = mat[1][2] = mat[2][0] = mat[2][1] = mat[2][2] = 0.;
 
}
 

	
 
}
 
/* finis */
src/matrix.h
Show inline comments
 
@@ -55,3 +55,5 @@ private:
 
ostream &operator<<(ostream &os, Matrix &v);
 

	
 
#endif
 

	
 
/* finis */
src/maxmin.h
Show inline comments
 
@@ -33,3 +33,4 @@ inline double SIGN(double a, double b) {
 

	
 
#endif
 

	
 
/* finis */
src/mesh.cpp
Show inline comments
 
@@ -61,7 +61,6 @@ void Mesh::AddNodeToCell(Cell *c, Node *
 
  
 
  c->nodes.push_back( n );
 
  n->owners.push_back( Neighbor(c, nb1, nb2 ) );
 
  
 
}
 

	
 
void Mesh::PerturbChem(int chemnum, double range) {
 
@@ -72,7 +71,6 @@ void Mesh::PerturbChem(int chemnum, doub
 
    (*i)->chem[chemnum] += range*(RANDOM()-0.5);
 
    if ((*i)->chem[chemnum]<0.) (*i)->chem[chemnum]=0.;
 
  }
 
  
 
}
 

	
 
void Mesh::CellFiles(const Vector ll, const Vector ur) {
 
@@ -132,7 +130,6 @@ void Mesh::CellFiles(const Vector ll, co
 
  Node::target_length/=4.;
 
  
 
  SetBaseArea();
 

	
 
}
 

	
 
Cell *Mesh::RectangularCell(const Vector ll, const Vector ur, double rotation) {
 
@@ -281,8 +278,6 @@ Cell &Mesh::EllipticCell(double xc, doub
 
  c->at_boundary=true;
 
  
 
  return *c;
 

	
 
  
 
}
 

	
 
Cell &Mesh::LeafPrimordium(int nnodes, double pet_length) {
 
@@ -451,9 +446,6 @@ Cell &Mesh::LeafPrimordium(int nnodes, d
 
}
 

	
 
/*Cell &Mesh::Box() {
 
  
 
  
 
  
 
}*/
 

	
 

	
 
@@ -478,7 +470,6 @@ void Mesh::BoundingBox(Vector &LowerLeft
 
    if ((*c)->z > UpperRight.z)
 
      UpperRight.z = (*c)->z;
 
  }
 
  
 
}
 

	
 

	
 
@@ -1029,7 +1020,6 @@ double Mesh::DisplaceNodes(void) {
 
    }
 
    
 
    return sum_dh;
 
    
 
}
 
				   
 

	
 
@@ -1188,7 +1178,6 @@ void Mesh::InsertNode(Edge &e) {
 
    c++;
 
  }
 
  //  debug_stream.flush();
 

	
 
}
 

	
 

	
 
@@ -1238,7 +1227,6 @@ void Mesh::CircumCircle(double x1,double
 
  return;
 
  // Suggested
 
  // return((drsqr <= rsqr + EPSILON) ? TRUE : FALSE);
 

	
 
}
 
  
 
//
 
@@ -1254,7 +1242,6 @@ double Mesh::SumChemical(int ch) {
 
    sum+=(*i)->chem[ch];
 
  }
 
  return sum;
 

	
 
}
 

	
 

	
 
@@ -1439,7 +1426,6 @@ void Mesh::CleanUpCellNodeLists(void) {
 
  
 
  shuffled_cells.clear();
 
  shuffled_cells = cells;
 
 
 
}
 

	
 
void Mesh::CutAwayBelowLine( Vector startpoint, Vector endpoint) {
 
@@ -1472,7 +1458,6 @@ void Mesh::CutAwayBelowLine( Vector star
 
  TestIllegalWalls();
 
  
 
  CleanUpCellNodeLists();
 

	
 
}
 

	
 
void Mesh::CutAwaySAM(void) {
 
@@ -1490,8 +1475,6 @@ void Mesh::CutAwaySAM(void) {
 
  TestIllegalWalls();
 
  
 
  CleanUpCellNodeLists();
 

	
 

	
 
}
 
void Mesh::TestIllegalWalls(void) {
 

	
 
@@ -1504,7 +1487,6 @@ void Mesh::TestIllegalWalls(void) {
 
      #endif
 
    }
 
  }
 

	
 
}
 

	
 

	
 
@@ -1521,7 +1503,6 @@ public:
 
    else 
 
      return false;
 
  }
 
  
 
};
 

	
 

	
 
@@ -1652,7 +1633,6 @@ void Mesh::RepairBoundaryPolygon(void) {
 
  qDebug() << endl;
 
  #endif
 
#endif
 

	
 
}
 

	
 

	
 
@@ -1755,7 +1735,6 @@ void Mesh::Rotate(double angle, Vector c
 
void Mesh::PrintWallList( void ) {
 
  
 
   transform ( walls.begin(), walls.end(), ostream_iterator<Wall>(cerr, "\n"), deref_ptr<Wall> );
 

	
 
}
 

	
 
#include <QString>
 
@@ -1828,7 +1807,6 @@ void Mesh::ReactDiffuse(double delta_t) 
 
  
 
  setTime(getTime()+delta_t);
 
  setValues(getTime(),ystart);
 
  
 
}
 

	
 

	
 
@@ -1874,7 +1852,6 @@ void Mesh::DeleteLooseWalls(void) {
 
    }
 
    
 
  }
 
  
 
}
 

	
 
/*void Mesh::FitLeafToCanvas(double width, double height) {
 
@@ -1913,8 +1890,6 @@ void Mesh::CleanChemicals(const vector<d
 
		(*c)->SetNewChemToChem();
 
		
 
	}
 
	
 

	
 
}
 

	
 

	
 
@@ -1935,7 +1910,6 @@ void Mesh::CleanTransporters(const vecto
 
			(*w)->setTransporters2(i,clean_transporters[i]); (*w)->setNewTransporters2(i,clean_transporters[i]);
 
		}
 
	}
 
	
 
}
 

	
 

	
 
@@ -1966,7 +1940,6 @@ void Mesh::RandomizeChemicals(const vect
 
      (*w)->setTransporters2(i,max_transporters[i] * RANDOM()); (*w)->setNewTransporters2(i, (*w)->Transporters1(i) );
 
    }
 
  }
 
  
 
}
 

	
 
//!\brief Calculates a vector with derivatives of all variables, which
 
@@ -2024,8 +1997,6 @@ void Mesh::Derivatives(double *derivs) {
 
      //&(derivs[(*w)->c2->Index() * nchems] ) );
 
    i+=2*nchems;
 
  }
 
  
 
  
 
}
 

	
 
void Mesh::setValues(double x, double *y) {
 
@@ -2138,7 +2109,6 @@ void Mesh::DrawNodes(QGraphicsScene *c) 
 
    item ->setPos(((Cell::offset[0]+i->x)*Cell::factor),
 
		  ((Cell::offset[1]+i->y)*Cell::factor) );
 
  }
 

	
 
}
 

	
 
/*! Returns the sum of protein "ch" of a cycling protein in cells and walls */
 
@@ -2164,7 +2134,6 @@ double Mesh::CalcProtCellsWalls(int ch) 
 
  }
 
  
 
  return sum_prot;
 

	
 
}
 

	
 
void Mesh::SettoInitVals(void) {
 
@@ -2182,7 +2151,6 @@ void Mesh::SettoInitVals(void) {
 
  
 
	CleanChemicals(clean_chem);
 
	CleanTransporters(clean_transporters);
 

	
 
}
 

	
 
string Mesh::getTimeHours(void) const {
src/mesh.h
Show inline comments
 
@@ -165,7 +165,6 @@ public:
 
			 i++) {
 
			f(*shuffled_nodes[*i]);
 
		}
 
		
 
	}
 
	
 
	template<class Op> void RandomlyLoopCells(Op f) {
 
@@ -178,8 +177,6 @@ public:
 
			 i++) {
 
			f(*shuffled_cells[*i]);
 
		}
 
		
 
		
 
	}
 
	
 
	template<class Op1, class Op2> void LoopCells(Op1 f, Op2 &g) {
 
@@ -427,3 +424,5 @@ private:
 
					  double *xc,double *yc,double *r);
 
};
 
#endif
 

	
 
/* finis */
src/miscq.cpp
Show inline comments
 
@@ -26,12 +26,13 @@
 
static const std::string _module_id("$Id$");
 

	
 
// Returns the extension of a filename
 
QString getExtension(const QString fn) {
 
  
 
QString getExtension(const QString fn)
 
{
 
  // split on dots
 
  QStringList parts = fn.split(".");
 
  
 
  // return last part, this should be the extension
 
  return QString(parts.last());
 
}
 
  
 
}
 
/* finis */
src/miscq.h
Show inline comments
 
@@ -33,3 +33,4 @@ QString getExtension(const QString fn);
 

	
 
#endif
 

	
 
/* finis */
src/modelcatalogue.h
Show inline comments
 
@@ -55,6 +55,5 @@ private:
 
	QVector<SimPluginInterface *> models;
 
	Mesh *mesh;
 
	Main *mainwin;
 

	
 
};
 
#endif
src/node.cpp
Show inline comments
 
@@ -49,7 +49,6 @@ ostream &Neighbor::print(ostream &os) co
 
  
 
  os << " {" << cell->Index() << " " << nb1->Index() << " " << nb2->Index() << "}";
 
  return os;
 

	
 
}
 

	
 
ostream &operator<<(ostream &os, const Neighbor &n) {
 
@@ -58,8 +57,8 @@ ostream &operator<<(ostream &os, const N
 
}
 
 
 

	
 
Node::Node(void) : Vector() {
 

	
 
Node::Node(void) : Vector()
 
{
 
  index=(nnodes++);
 
  node_set =0;
 
  fixed=false;
 
@@ -68,7 +67,8 @@ Node::Node(void) : Vector() {
 
  dead=false;
 
}
 

	
 
Node::Node(int ind) : Vector() {
 
Node::Node(int ind) : Vector()
 
{
 
  node_set =0;
 
  index=ind;
 
  fixed=false;
 
@@ -77,8 +77,8 @@ Node::Node(int ind) : Vector() {
 
  dead=false;
 
}
 

	
 
Node::Node(const Vector &src) : Vector(src) {
 

	
 
Node::Node(const Vector &src) : Vector(src)
 
{
 
  node_set = 0;
 
  index=(nnodes++);
 
  fixed=false;
 
@@ -87,8 +87,8 @@ Node::Node(const Vector &src) : Vector(s
 
  dead = false;
 
}
 

	
 
Node::Node(double x,double y, double z) : Vector (x,y,z) {
 
  
 
Node::Node(double x,double y, double z) : Vector (x,y,z)
 
{
 
  node_set = 0;
 
  index=(nnodes++);
 
  fixed=false;
 
@@ -97,8 +97,8 @@ Node::Node(double x,double y, double z) 
 
  dead = false;
 
}
 

	
 
Node::Node(const Node &src) : Vector(src) {
 
  
 
Node::Node(const Node &src) : Vector(src)
 
{
 
  node_set=0;
 
  owners=src.owners;
 
  m=src.m;
 
@@ -110,7 +110,8 @@ Node::Node(const Node &src) : Vector(src
 
}
 

	
 

	
 
Cell &Node::getCell(const Neighbor &i) {
 
Cell &Node::getCell(const Neighbor &i)
 
{
 
  return *i.getCell(); // use accessor!
 
}
 

	
 
@@ -132,7 +133,6 @@ ostream &Node::print(ostream &os) const 
 
  os << " } " << endl;
 

	
 
  return os;
 

	
 
}
 

	
 

	
 
@@ -156,12 +156,8 @@ void Node::DrawIndex(QGraphicsScene *c) 
 
void Node::DrawOwners(QGraphicsScene *c) const {
 
  
 
  stringstream text;
 
  
 
  
 

	
 
  text << owners.size();
 
  
 
  
 
  QGraphicsSimpleTextItem *number = new QGraphicsSimpleTextItem ( QString (text.str().c_str()), 0, c );
 
  number->setFont( QFont( "Helvetica", par.nodenumsize, QFont::Bold) );
 
  number->setPen( QPen(par.textcolor) );
 
@@ -174,9 +170,8 @@ void Node::DrawOwners(QGraphicsScene *c)
 
}
 

	
 

	
 

	
 
QVector<qreal> Node::NeighbourAngles(void) {
 
	
 
QVector<qreal> Node::NeighbourAngles(void)
 
{
 
	QVector<qreal> angles;
 
	for (list<Neighbor>::iterator i=owners.begin();
 
		 i!=owners.end();
 
@@ -192,7 +187,8 @@ QVector<qreal> Node::NeighbourAngles(voi
 
		}
 
		angles.push_back(angle);
 
		
 
		//cerr << "Cell " << i->cell->Index() << ": " <<  v1 << " and " << v2 << ": angle = " << angles.back() << ", " << v1.Angle(v2) << endl;
 
    //cerr << "Cell " << i->cell->Index() << ": " <<  v1 << " and " << v2 
 
    //     << ": angle = " << angles.back() << ", " << v1.Angle(v2) << endl;
 
		
 
	}
 
	
 
@@ -212,12 +208,11 @@ QVector<qreal> Node::NeighbourAngles(voi
 
}
 

	
 

	
 

	
 
#endif
 

	
 

	
 
ostream &operator<<(ostream &os, const Node &n) {
 
  n.print(os);
 
  return os;
 
}
 

	
 
/* finis */
src/node.h
Show inline comments
 
@@ -78,7 +78,6 @@ public:
 
  // Output the Edge
 
  ostream &print(ostream &os) const;
 
    
 
  
 
  Node *first, *second;
 
};
 

	
 
@@ -138,45 +137,32 @@ public:
 
#endif
 
  
 
  // temporary function for easier debugging
 
  inline int CellsSize(void) const {
 
    return owners.size();
 
  }
 
  inline int CellsSize(void) const { return owners.size(); }
 

	
 
  inline int Value(void) const { return owners.size(); }
 

	
 
  inline int Value(void) const {
 
    return owners.size();
 
  }
 
  void Fix(void) { fixed=true; }
 

	
 
  inline bool Fixed(void) const { return fixed; }
 

	
 
  inline void Unfix(void) { fixed=false; }
 

	
 
  void Fix(void) {
 
    fixed=true;
 
  }
 
  inline bool Fixed(void) const {
 
    return fixed;
 
  }
 
  inline void Unfix(void) {
 
    fixed=false;
 
  }
 
  inline void MarkDead(void) {
 
    dead=true;
 
  }
 
  inline bool DeadP(void) {
 
    return dead;
 
  }
 
  inline void MarkDead(void) { dead=true; }
 

	
 
  inline bool DeadP(void) { return dead; }
 

	
 
  inline void Mark(void) {
 
    marked=true;
 
  }
 
  inline void Unmark(void) {
 
    marked=false;
 
  }
 
  inline bool Marked(void) const {
 
    return marked;
 
  }
 
  inline void Mark(void) { marked=true; }
 

	
 
  inline void Unmark(void) { marked=false; }
 

	
 
  inline bool Marked(void) const { return marked; }
 
  
 
  inline void setPos( Vector p ) { 
 
    x = p.x;
 
    y = p.y;
 
    z = p.z;
 
  }
 

	
 
  inline bool SamP(void) const { return sam; }
 

	
 
  //!\brief Calculate angles with neighboring vertices
 
@@ -210,5 +196,6 @@ inline ostream &operator<<(ostream &os, 
 
  return os;
 
}
 

	
 
#endif
 

	
 
#endif
 
/* finis */
src/nodeitem.cpp
Show inline comments
 
@@ -39,10 +39,10 @@ NodeItem::NodeItem( Node *n, QGraphicsSc
 
  
 
  const double mag = par.node_mag;
 
  ellipsesize=QRectF(-1*mag, -1*mag, 2*mag, 2*mag);
 

	
 
}
 

	
 
void NodeItem::userMove(double dx, double dy) {
 
void NodeItem::userMove(double dx, double dy)
 
{
 
  QGraphicsItem::moveBy( dx, dy );
 
  
 
  class_cast<Node *>(obj)->x += (dx/Cell::Magnification());
 
@@ -53,7 +53,6 @@ void NodeItem::userMove(double dx, doubl
 

	
 
void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
 
{
 

	
 
  option = NULL; // use assignment merely to obviate compilation warning
 
  
 
  painter->setBrush(brush);
 
@@ -77,25 +76,26 @@ QRectF NodeItem::boundingRect() const
 
}
 

	
 
// polymorphic OnClick functions
 
void NodeItem::OnClick(void) {
 
void NodeItem::OnClick(void)
 
{
 
  Node *n = &getNode();
 
  n->toggleBoundary();
 
  setColor();
 
  update();
 
}
 

	
 
void NodeItem::OnClick(const Qt::MouseButton &mb) {
 
void NodeItem::OnClick(const Qt::MouseButton &mb)
 
{
 
  if (mb == Qt::LeftButton) {
 
    Node *n = &getNode();
 
    n->toggleBoundary();
 
    setColor();
 
    update();
 

	
 
  }
 
}
 

	
 
void NodeItem::setColor(void) {
 

	
 
void NodeItem::setColor(void)
 
{
 
  static QColor indian_red("IndianRed");
 
  static QColor deep_sky_blue("DeepSkyBlue");
 
  static QColor purple("Purple");
 
@@ -113,3 +113,5 @@ void NodeItem::setColor(void) {
 
    }
 
  }
 
}
 

	
 
/* finis */
src/nodeitem.h
Show inline comments
 
@@ -56,3 +56,5 @@ private:
 
};
 

	
 
#endif
 

	
 
/* finis */
src/nodeset.cpp
Show inline comments
 
@@ -29,3 +29,5 @@ ostream &operator<<(ostream &os, const N
 
  ns.print(os);
 
  return os;
 
}
 

	
 
/* finis */
src/nodeset.h
Show inline comments
 
@@ -61,8 +61,7 @@ class NodeSet : public list<Node *> {
 
    // remove all non-unique elements
 
    // (unique moves all unique elements to the front and returns an iterator to the end of the unique elements;
 
    // so we simply erase all remaining elements.
 
    cellset.erase(::unique(cellset.begin(), cellset.end() ), 
 
		  cellset.end() );
 
    cellset.erase(::unique(cellset.begin(), cellset.end() ), cellset.end() );
 
    
 
    // remove boundary_polygon
 
    cellset.erase( find_if ( cellset.begin(), cellset.end(), mem_fun( &Cell::BoundaryPolP  ) ) );
 
@@ -111,7 +110,6 @@ class NodeSet : public list<Node *> {
 
      (*n)->x+=rx;
 
      (*n)->y+=ry;
 
      // (*n)->z += rz;
 
       
 
    }
 
    
 
    // 4. Recalculate the energy
 
@@ -151,8 +149,6 @@ class NodeSet : public list<Node *> {
 
	(*n)->x-=rx;
 
	(*n)->y-=ry;
 
	  }
 
      
 
      
 
    }
 
  }
 
  
 
@@ -164,3 +160,5 @@ class NodeSet : public list<Node *> {
 

	
 
ostream &operator<<(ostream &os, const NodeSet &ns);
 
#endif
 

	
 
/* finis */
src/output.cpp
Show inline comments
 
@@ -61,7 +61,6 @@ int FileExistsP(const char *fname) {
 
  
 
  fclose(fp);
 
  return TRUE;
 
 
}
 
		       
 
int YesNoP(const char *message) {
 
@@ -81,13 +80,11 @@ int YesNoP(const char *message) {
 
  if (!strcmp(answer,"y")) return TRUE;
 
  
 
  return FALSE;
 
    
 
}
 
 
 
FILE *OpenWriteFile(const char *filename) 
 
{
 
 
  char fname[FNAMESIZE];
 
 
  FILE *fp;
 
@@ -108,7 +105,6 @@ FILE *OpenWriteFile(const char *filename
 
      /* Rename old file */
 
      sprintf(fname, "%s~",filename);
 
      rename(filename, fname);
 
      
 
    }
 
  }
 
  
 
@@ -121,7 +117,6 @@ FILE *OpenWriteFile(const char *filename
 
    perror("");
 
    throw(message);
 
  }
 
	
 
  return fp;
 
}
 
 
@@ -170,7 +165,6 @@ char *ReadLine(FILE *fp)
 
  while ((character=getc(fp))!=EOF && /* read a character and check */
 
		 character!='\n') {
 
 
	
 
	tmpstring[pos]=(char)character;
 
	(pos)++;
 
 
@@ -178,25 +172,19 @@ char *ReadLine(FILE *fp)
 
	  /* line is longer than initial_bufsize, reallocate space */
 
	  bufsize+=INITIAL_BUFSIZE;
 
	  MEMORYCHECK(tmpstring=(char *)realloc(tmpstring,bufsize*sizeof(char)));
 
	  
 
	}
 
		   
 
  }
 
 
 
  if (character==EOF) {
 
	
 
	if (pos==0) {
 
	  /* EOF was reached, while no characters were read */
 
	  free(tmpstring);
 
	  return NULL;
 
 
	}
 
	if (ferror(fp)) {
 
	  error("I/O error in ReadLine(%ld): %s\n",fp, strerror(errno));
 
	}
 
	
 
 
  }
 
  
 
  /* Allocate enough memory for the line */
 
@@ -207,7 +195,6 @@ char *ReadLine(FILE *fp)
 
  
 
  line[pos-1]='\0';
 
  return line;
 
    
 
}
 
 
 
@@ -237,7 +224,6 @@ char *Chext(char *filename) {
 
  for (i=strlen(filename)-1;i>=0;i--) {
 
    if (filename[i]=='.') 
 
      break;
 
    
 
  }
 
  
 
  /* No . found */
 
@@ -251,8 +237,6 @@ char *Chext(char *filename) {
 
    strncpy(result, filename, i);
 
  }
 
  return result;
 
  
 
  
 
}
 
 
void MakeDir(const char *dirname) {
 
@@ -273,7 +257,6 @@ void MakeDir(const char *dirname) {
 
      cerr << message << endl;
 
      throw(message);
 
    }
 
    
 
  }
 
 
  // make directory
 
@@ -329,13 +312,11 @@ void MakeDir(const char *dirname) {
 
      snprintf(message,MESS_BUF_SIZE,"Error in making directory %s",dirname);
 
      perror(message);
 
      exit(1);
 
      
 
    }
 
  
 
 
 
  }
 
 
#endif
 
}
 
 
 
/* finis */
src/output.h
Show inline comments
 
@@ -53,3 +53,5 @@ bool CanWeWriteP(char *filename);
 
#endif
 

	
 
#endif
 

	
 
/* finis */
src/parameter.cpp
Show inline comments
 
@@ -189,7 +189,6 @@ Parameter::~Parameter() {
 
  // free string parameter
 

	
 
  CleanUp();
 

	
 
}
 

	
 
void Parameter::CleanUp(void) {
 
@@ -217,7 +216,6 @@ void Parameter::CleanUp(void) {
 
     free(dir1);
 
  if (dir2) 
 
     free(dir2);
 

	
 
}
 

	
 
void Parameter::Read(const char *filename) {
 
@@ -339,7 +337,6 @@ void Parameter::Read(const char *filenam
 
  dir2 = sgetpar(fp, "dir2", ".", true);
 
  if (strcmp(dir2, "."))
 
    MakeDir(dir2);
 

	
 
}
 

	
 
const char *sbool(const bool &p) {
 
@@ -1876,7 +1873,6 @@ if (!strcmp(namec, "k")) {
 
    }
 
    cur=cur->next;
 
  }
 
    
 
}*/
 

	
 
ostream &operator<<(ostream &os, Parameter &p) {
src/pardialog.cpp
Show inline comments
 
@@ -694,7 +694,6 @@ void ParameterDialog::write(void) {
 
  par.dir1 = strdup((const char *)dir1_edit->text());
 
  par.dir2 = strdup((const char *)dir2_edit->text());
 
  Reset();
 

	
 
}
 
void ParameterDialog::Reset(void) {
 
  extern Parameter par;
src/parse.cpp
Show inline comments
 
@@ -64,7 +64,6 @@ char *ParsePar(FILE *fp, char *parameter
 
  free(line);
 
  
 
  return value;
 
      
 
}
 
 
 
@@ -95,7 +94,6 @@ int igetpar(FILE *fp,char *parameter, in
 
  free(token);
 
 
  return value;
 
  
 
}
 
 
float fgetpar(FILE *fp,char *parameter, bool wrapflag) {
 
@@ -120,13 +118,9 @@ float fgetpar(FILE *fp, char *parameter,
 
 
  /* read it */
 
  sscanf(token,"%e",&value);
 
 
  fprintf(stderr,"%e]\n",value);
 
  
 
  free(token);
 
 
  return value;
 
  
 
}
 
 
 
@@ -180,7 +174,6 @@ double *dgetparlist(FILE *fp,char *param
 
  }
 
  
 
  return value;
 
  
 
}
 
 
char *sgetpar(FILE *fp,char *parameter, bool wrapflag) 
 
@@ -213,7 +206,6 @@ char *sgetpar(FILE *fp, char *parameter,
 
  fprintf(stderr,"%s]\n",value);
 
 
  return value;
 
  
 
}
 
 
char *bool_str(bool bool_var) {
 
@@ -229,7 +221,6 @@ char *bool_str(bool bool_var) {
 
  } else {
 
    return f;
 
  }
 
  
 
}
 
 
bool bgetpar(FILE *fp, char *parameter,  bool wrapflag) {
 
@@ -238,7 +229,6 @@ bool bgetpar(FILE *fp, char *parameter, 
 
  // default = false
 
 
  return bgetpar(fp, parameter, 0, wrapflag);
 
 
}
 
 
bool bgetpar(FILE *fp, char *parameter, int default_val, bool wrapflag) {
 
@@ -276,7 +266,6 @@ bool bgetpar(FILE *fp, char *parameter, 
 
  fprintf(stderr, "%s]\n",bool_str(value));
 
 
  return value;
 
 
}
 
 
 
@@ -344,9 +333,7 @@ char *SearchToken(FILE *fp, char *token,
 
	}
 
    }
 
    
 
 
    free(line);
 
    
 
  }
 
  free(tokenplusspace);
 
  return NULL; /* Token Not Found in the file */
 
@@ -367,7 +354,6 @@ void SkipLine(FILE *fp) {
 
  char *tmpstring;
 
  tmpstring=ReadLine(fp);
 
  free(tmpstring);
 
  
 
}
 
 
void SkipToken(FILE *fp,char *token, bool wrapflag)
 
@@ -386,6 +372,6 @@ void SkipToken(FILE *fp,char *token, boo
 
  }
 
 
  free(tmppointer);
 
      
 
}
 
 
/* finis */
src/parse.h
Show inline comments
 
@@ -44,3 +44,5 @@ void SkipLine(FILE *fp);
 
char *bool_str(bool bool_var);
 

	
 
#endif
 

	
 
/* finis */
src/perl/deployapp.pl
Show inline comments
 
@@ -112,3 +112,5 @@ for $lib (@additionallibs) {
 
    system "install_name_tool -change $fwfw/Versions/4/$liblib \@executable_path/../Frameworks/$fwfw/Versions/4.0/$liblib  $appdir/Contents/Frameworks/$lib";
 
  }
 
}
 

	
 
# finis
src/perl/histogram.pl
Show inline comments
 
@@ -45,3 +45,6 @@ for ($bin=0;$bin<=$#bins;$bin++) {
 
   $halfwaybin = $bin * $binsize + $binsize/2.;
 
   print $halfwaybin." ".$bins[$bin]."\n";
 
}
 

	
 
# finis
 

	
src/perl/make_parameter_source.pl
Show inline comments
 
@@ -440,3 +440,5 @@ for ($i=0;$i<$lines;$i++) {
 
    print parfile "  $param[$i] = $value[$i]\n";
 
  }
 
}
 

	
 
# finis
src/perl/make_pardialog_source.pl
Show inline comments
 
@@ -301,3 +301,4 @@ print hfile <<END_TRAILER2;
 
#endif
 
END_TRAILER2
 

	
 
# finis
src/perl/make_xmlwritecode.pl
Show inline comments
 
@@ -221,3 +221,4 @@ print xmlsrc "xmlChar *sourcecode = (xml
 

	
 
END_MARKER3
 

	
 
# finis
src/pi.h
Show inline comments
 
@@ -28,3 +28,5 @@
 
const double Pi=3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170676;
 

	
 
#endif
 

	
 
/* finis */
src/qcanvasarrow.h
Show inline comments
 
@@ -30,8 +30,7 @@
 
class QGraphicsArrowItem : public QGraphicsLineItem {
 

	
 
 public:
 
  QGraphicsArrowItem(QGraphicsItem *parent, QGraphicsScene *c) : QGraphicsLineItem(parent, c) {
 
  };
 
 QGraphicsArrowItem(QGraphicsItem *parent, QGraphicsScene *c) : QGraphicsLineItem(parent, c) {};
 
    
 
    void paint ( QPainter *p, const QStyleOptionGraphicsItem *option,
 
		 QWidget *widget ) {
 
@@ -74,3 +73,5 @@ class QGraphicsArrowItem : public QGraph
 
};
 

	
 
#endif
 

	
 
/* finis */
src/random.cpp
Show inline comments
 
@@ -147,3 +147,4 @@ int Randomize(void) {
 
  return seed;
 
}
 
 
/* finis */
src/random.h
Show inline comments
 
@@ -58,9 +58,6 @@ class MyUrand {
 
  long operator()(void) { return RandomNumber(n); }
 
};
 

	
 

	
 

	
 
#endif
 

	
 

	
 

	
 
#endif
 
/* finis */
src/rseed.cpp
Show inline comments
 
@@ -28,6 +28,7 @@ static const std::string _module_id("$Id
 
int main() {
 

	
 
   long rseed=Randomize();
 
   std::cout << rseed << "\n";
 
  std::cerr << rseed << std::endl;
 
}
 

	
 
}
 
/* finis */
src/rungekutta.cpp
Show inline comments
 
@@ -85,7 +85,6 @@ void RungeKutta::rkqs(double *y, double 
 
  for (i=0;i<n;i++) y[i]=ytemp[i];
 
  delete[] ytemp;
 
  delete[] yerr;
 

	
 
}
 

	
 

	
 
@@ -203,3 +202,5 @@ void RungeKutta::odeint(double *ystart, 
 
  }
 
  MyWarning::error("Too many steps in routine odeint");
 
}
 

	
 
/* finis */
src/rungekutta.h
Show inline comments
 
@@ -59,7 +59,7 @@ class RungeKutta  {
 
  static const double Errcon;
 
  static const double Maxstp;
 
  static const double Tiny;
 
  
 

	
 
};
 
#endif
 

	
 
/* finis */
src/simitembase.cpp
Show inline comments
 
@@ -25,7 +25,8 @@
 

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

	
 
SimItemBase::SimItemBase( void *v, QGraphicsScene *canvas ) {
 
SimItemBase::SimItemBase( void *v, QGraphicsScene *canvas )
 
{
 
  canvas = NULL; // use assignment merely to obviate compilation warning
 
    obj=v;
 
};
 
@@ -33,6 +34,9 @@ SimItemBase::SimItemBase( void *v, QGrap
 
SimItemBase::~SimItemBase(void) {};
 

	
 

	
 
void SimItemBase::userMove(double dx, double dy) {
 
void SimItemBase::userMove(double dx, double dy)
 
{
 
  dx = dy = 0.0; // use assignment merely to obviate compilation warning
 
};
 

	
 
/* finis */
src/simitembase.h
Show inline comments
 
@@ -65,3 +65,5 @@ public:
 
  };
 

	
 
#endif
 

	
 
/* finis */
src/simplugin.cpp
Show inline comments
 
@@ -24,7 +24,8 @@
 

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

	
 
void SimPluginInterface::SetParameters(Parameter *pass_pars) {
 
void SimPluginInterface::SetParameters(Parameter *pass_pars)
 
{
 
	par = pass_pars; 
 
}
 

	
 
@@ -33,3 +34,4 @@ void SimPluginInterface::SetCellsStaticD
 
	CellBase::static_data_members = cells_static_data_members_of_main;
 
}
 

	
 
/* finis */
src/simplugin.h
Show inline comments
 
@@ -71,12 +71,11 @@ public:
 

	
 
protected:
 
	class Parameter *par;
 
	
 
};
 

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

	
 
#endif
 

	
 
#endif
 
\ No newline at end of file
 
/* finis */
src/sqr.h
Show inline comments
 
@@ -40,7 +40,6 @@ inline double DSQR( double a ) {
 
  } else {
 
    return a*a;
 
  }
 

	
 
}
 

	
 
inline float SQR( float a ) {
 
@@ -50,4 +49,7 @@ inline float SQR( float a ) {
 
    return a*a;
 
  }
 
}
 

	
 
#endif
 

	
 
/* finis */
src/tiny.h
Show inline comments
 
@@ -28,3 +28,5 @@
 
#define TINY 1e-5
 

	
 
#endif
 

	
 
/* finis */
src/transporterdialog.cpp
Show inline comments
 
@@ -41,7 +41,8 @@ TransporterDialog::TransporterDialog(Wal
 

	
 
  // compose a label for the dialog box
 
  std::stringstream label_text; 
 
  label_text << "C("<< wall->C1()->Index() << "," << wall->C2()->Index() << "), N(" << wall->N1()->Index() << "," << wall->N2()->Index() << ")";
 
  label_text << "C("<< wall->C1()->Index() << "," << wall->C2()->Index() << "), N(" 
 
	     << wall->N1()->Index() << "," << wall->N2()->Index() << ")";
 
	
 
  // retrieve the current transporters
 
  QVector <double> transporters;  // transporter vector
 
@@ -86,8 +87,8 @@ TransporterDialog::TransporterDialog(Wal
 
  setWindowTitle(tr(label_text.str().c_str()));
 
}
 

	
 
void TransporterDialog::setTransporterValues(){
 

	
 
void TransporterDialog::setTransporterValues()
 
{
 
  // iterate over the editor widgets soliciting their values and setting the wall's transporters accordingly.
 
  for (int i=0; i<ntransporters; ++i){
 
    #ifdef QDEBUG  
 
@@ -102,5 +103,6 @@ void TransporterDialog::setTransporterVa
 
  close();
 
}
 

	
 
// finis
 
/* finis */
 

	
 

	
src/transporterdialog.h
Show inline comments
 
@@ -55,3 +55,5 @@ class TransporterDialog : public QDialog
 
};
 

	
 
#endif
 

	
 
/* finis */
src/vector.cpp
Show inline comments
 
@@ -43,18 +43,15 @@ void Vector::operator=(const Vector &sou
 
  x=source.x;
 
  y=source.y;
 
  z=source.z;
 
  
 
}
 

	
 

	
 

	
 

	
 

	
 
ostream &Vector::print(ostream &os) const {
 
  os << "(" << x << ", " << y << ", " << z << ")";
 
  return os;
 
}
 

	
 

	
 
ostream &operator<<(ostream &os, const Vector &v) {
 
  v.print(os);
 
  return os;
 
@@ -69,7 +66,6 @@ Vector Vector::operator+(const Vector &v
 
  result.z=z+v.z;
 
  
 
  return result;
 

	
 
}
 

	
 

	
 
@@ -80,7 +76,6 @@ Vector& Vector::operator-=(const Vector 
 
  z-=v.z;
 
  
 
  return *this;
 

	
 
}
 

	
 
Vector Vector::operator/(const double divisor) const {
 
@@ -93,8 +88,6 @@ Vector Vector::operator/(const double di
 
  result.z=z/divisor;
 

	
 
  return result;
 
  
 
  
 
}
 

	
 

	
 
@@ -107,8 +100,6 @@ Vector Vector::operator*(const double mu
 
  result.z=z*multiplier;
 

	
 
  return result;
 

	
 
  
 
}
 

	
 

	
 
@@ -121,7 +112,6 @@ Vector operator*(const double multiplier
 
  result.z=v.z*multiplier;
 

	
 
  return result;
 
  
 
}
 

	
 
Vector &Vector::operator/=(const double divisor) {
 
@@ -130,7 +120,6 @@ Vector &Vector::operator/=(const double 
 
  z/=divisor;
 
  
 
  return *this;
 

	
 
}
 

	
 
Vector &Vector::operator*=(const double multiplier) {
 
@@ -140,7 +129,6 @@ Vector &Vector::operator*=(const double 
 
  z*=multiplier;
 

	
 
  return *this;
 

	
 
}
 

	
 
Vector Vector::operator*(const Vector &v) const {
 
@@ -153,8 +141,6 @@ Vector Vector::operator*(const Vector &v
 
  result.z=x*v.y-y*v.x;
 
  
 
  return result;
 
  
 
  
 
}
 

	
 

	
 
@@ -164,7 +150,6 @@ double InnerProduct(const Vector &v1, co
 
  double result;
 
  result=v1.x*v2.x+v1.y*v2.y+v1.z*v2.z;
 
  return result;
 

	
 
}
 

	
 
double Vector::Angle(const Vector &v) const {
 
@@ -187,7 +172,6 @@ double Vector::Angle(const Vector &v) co
 
  double angle=acos(cos_angle);
 
  
 
  return angle;
 

	
 
}
 

	
 
double Vector::SignedAngle(const Vector &v) const {
 
@@ -211,7 +195,6 @@ double Vector::SignedAngle(const Vector 
 
  
 
  double sign = (InnerProduct ( Perp2D(), v ) )>0.?1.:-1.;
 
  return angle * sign;
 

	
 
}
 

	
 

	
 
@@ -222,7 +205,6 @@ bool Vector::operator==(const Vector &v)
 
    return true;
 
  else
 
    return false;
 
  
 
}
 

	
 
bool Vector::operator< (const Vector &v) const {
 
@@ -232,7 +214,6 @@ bool Vector::operator< (const Vector &v)
 
    return true;
 
  else 
 
    return false;
 
  
 
}
 

	
 

	
 
@@ -242,7 +223,6 @@ double Vector::SqrNorm(void) const {
 
  // added this function to avoid taking the square root and 
 
  // the square again if this value is needed
 
  return DSQR(x)+DSQR(y)+DSQR(z);
 

	
 
}
 

	
 
void Vector::Normalise(void) {
 
@@ -255,7 +235,6 @@ void Vector::Normalise(void) {
 
    
 
    (*this)/=norm;
 
  }
 
  
 
}
 

	
 
Vector Vector::Normalised(void) const {
 
@@ -269,7 +248,6 @@ Vector Vector::Normalised(void) const {
 
  } else {
 
    return *this;
 
  }
 
    
 
}
 

	
 
bool Vector::SameDirP(const Vector &v) {
 
@@ -282,7 +260,6 @@ bool Vector::SameDirP(const Vector &v) {
 
    return true;
 
  else
 
    return false;
 
 
 
}
 

	
 
double Vector::Max(void) {
 
@@ -334,8 +311,8 @@ void main() {
 
  d.Normalise();
 
  
 
//  cerr << d << "  " << d.Norm() << "\n";
 
  
 
  
 
}
 

	
 
#endif 
 

	
 
/* finis */
src/vector.h
Show inline comments
 
@@ -97,7 +97,6 @@ public:
 
    result.z=z-v.z;
 
    
 
    return result;
 
    
 
  }
 
  Vector &operator-=(const Vector &v);
 
  
 
@@ -108,7 +107,6 @@ public:
 
    z+=v.z;
 
    
 
    return *this;
 
    
 
  }
 
  
 
  Vector operator/(const double divisor) const; // division by a double
 
@@ -121,7 +119,6 @@ public:
 
  inline double Norm(void) const {
 
  
 
    return sqrt(DSQR(x)+DSQR(y)+DSQR(z));
 
    
 
  }
 

	
 
  // Quick and dirty Norm (i.e. Manhattan distance)
 
@@ -141,6 +138,7 @@ public:
 
  Vector Perp2D(void) const {
 
    return Vector(y,-x,0);
 
  }
 

	
 
  // data members
 
  double x,y,z;
 

	
 
@@ -151,7 +149,6 @@ public:
 
    is >> x >> y >> z;
 
  }
 
private:
 

	
 
};
 

	
 
ostream &operator<<(ostream &os, const Vector &v);
 
@@ -159,3 +156,5 @@ Vector operator*(const double multiplier
 
double InnerProduct(const Vector &v1, const Vector &v2);
 

	
 
#endif
 

	
 
/* finis */
src/vleafmodel.h
Show inline comments
 
@@ -37,3 +37,5 @@
 
#include "flux_function.h"
 

	
 
#endif
 

	
 
/* finis */
src/wall.cpp
Show inline comments
 
@@ -64,7 +64,6 @@ bool Wall::CorrectWall( void ) {
 
												   wall_owners.begin(), wall_owners.end(), 
 
												   mem_fun( &CellBase::BoundaryPolP )
 
												   );
 
		
 
		if (bpit!=wall_owners.end()) {
 
			
 
			// add a Wall with the boundary_polygon to each cell
 
@@ -89,9 +88,11 @@ bool Wall::CorrectWall( void ) {
 
		  transform(wall_owners.begin(), wall_owners.end(), ostream_iterator<int>(qDebug(), "  "), mem_fun (&CellBase::Index) );
 
		  qDebug() << endl;
 
		  qDebug() << "Owners node " << n1->Index() << ": ";
 

	
 
		  for (list<Neighbor>::iterator i = n1->owners.begin(); i!=n1->owners.end(); i++) {
 
		    qDebug() << i->getCell()->Index() << " ";
 
		  }
 

	
 
		  qDebug() << endl;
 
		  qDebug() << "Owners node " << n2->Index() << ": ";
 
			
 
@@ -102,7 +103,6 @@ bool Wall::CorrectWall( void ) {
 
                  #endif
 
		  std::exit(1);
 
		}
 
		
 
	}
 
	
 
	#ifdef QDEBUG
 
@@ -151,12 +151,7 @@ bool Wall::CorrectWall( void ) {
 
			}
 
		}
 
	}
 
	
 
	return true;
 
	
 
	
 
	
 
	
 
}
 

	
 
void Wall::Draw(QGraphicsScene *c) {
 
@@ -165,13 +160,11 @@ void Wall::Draw(QGraphicsScene *c) {
 
	WallItem *wi2 = new WallItem(this, 2, c);
 
	wi1->show();
 
	wi2->show();
 
	
 
}
 

	
 
void Wall::DrawApoplast(QGraphicsScene *c) {
 
	ApoplastItem *apo = new ApoplastItem(this, c);
 
	apo->show();
 
	
 
}
 

	
 
void Wall::ShowStructure(QGraphicsScene *c) {
 
@@ -208,7 +201,6 @@ void Wall::ShowStructure(QGraphicsScene 
 
	text1->setPen ( QColor(par.textcolor) );
 
	text2->setPen ( text1->pen() );
 
	text1->show(); text2->show();
 
	
 
}
 
string Wall::WallTypetoStr(const WallType &wt) const {
 
	
 
@@ -227,5 +219,4 @@ string Wall::WallTypetoStr(const WallTyp
 
	return string("");
 
}
 

	
 

	
 

	
 
/* finis */
src/wall.h
Show inline comments
 
@@ -54,10 +54,8 @@ public:
 

	
 
private:
 
	string WallTypetoStr(const WallType &wt) const;
 
	    
 
	
 
	
 
	
 
};
 

	
 
#endif
 

	
 
/* finis */
src/wallbase.cpp
Show inline comments
 
@@ -53,7 +53,8 @@ ostream &operator<<(ostream &os, const W
 
}
 

	
 

	
 
WallBase::WallBase(Node *sn1, Node *sn2, CellBase *sc1, CellBase *sc2) {
 
WallBase::WallBase(Node *sn1, Node *sn2, CellBase *sc1, CellBase *sc2)
 
{
 
	
 
        #ifdef QDEBUG
 
	if (sc1==sc2) { 
 
@@ -85,10 +86,10 @@ WallBase::WallBase(Node *sn1, Node *sn2,
 
	dead = false;
 
	wall_type = Normal;
 
	wall_index = nwalls++;
 
	
 
}
 

	
 
void WallBase::CopyWallContents(const WallBase &src) {
 
void WallBase::CopyWallContents(const WallBase &src)
 
{
 
	
 
	for (int i=0; i<CellBase::NChem(); i++) {
 
		if (transporters1) {
 
@@ -112,7 +113,8 @@ void WallBase::CopyWallContents(const Wa
 
	wall_type = src.wall_type;
 
}
 

	
 
void WallBase::SwapWallContents(WallBase *src) {
 
void WallBase::SwapWallContents(WallBase *src)
 
{
 
	
 
	for (int i=0; i<CellBase::NChem(); i++) {
 
		if (transporters1) {
 
@@ -158,22 +160,18 @@ void WallBase::SwapWallContents(WallBase
 
	tmp_wall_type = src->wall_type;
 
	src->wall_type = wall_type;
 
	wall_type = tmp_wall_type;
 
	
 
}
 

	
 
bool WallBase::SAM_P(void) { 
 
	
 
bool WallBase::SAM_P(void)
 
{ 
 
	return N1()->sam || N2()->sam; 
 
	
 
}  
 

	
 
#include <fstream>
 

	
 
void WallBase::SetLength(void) {
 
void WallBase::SetLength(void)
 
{
 
	
 
	//static bool show_nodes = true;
 
	
 
	//double old_length = length;
 
	// Step 1: find the path of nodes leading along the WallBase.
 
	// A WallBase often represents a curved cell wall: we want the total
 
	// length _along_ the wall here...
 
@@ -206,15 +204,13 @@ void WallBase::SetLength(void) {
 
		
 
		// Note that Node derives from a Vector, so we can do vector calculus as defined in vector.h 
 
		
 
		
 
		deb_str << "[ " << (*prev_n)->index << " to " << (*n)->index << "]";
 
		
 
		length += (*(*prev_n) - *(*n)).Norm(); 
 
		
 
	}
 
}
 

	
 
void WallBase::CorrectTransporters(double orig_length) {
 
void WallBase::CorrectTransporters(double orig_length)
 
{
 
	
 
	double length_factor = length / orig_length;
 

	
 
@@ -224,11 +220,11 @@ void WallBase::CorrectTransporters(doubl
 
		new_transporters1[ch] *= length_factor;
 
		new_transporters2[ch] *= length_factor;
 
	}
 
	
 
}
 

	
 

	
 
Vector WallBase::VizFlux(void) {
 
Vector WallBase::VizFlux(void)
 
{
 
	return viz_flux * ( (*n2) - (*n1) ).Normalised().Perp2D();    
 
}
 

	
 
@@ -241,15 +237,16 @@ void WallBase::SetTransToNewTrans( void 
 
}
 

	
 

	
 
Vector WallBase::getWallVector(CellBase *c) {
 
Vector WallBase::getWallVector(CellBase *c)
 
{
 
	if ( c == c1 ) {
 
		return ( Vector(*n2) - Vector(*n1) );
 
	} else {
 
		return ( Vector(*n1) - Vector(*n2) );
 
	}
 
	
 
}
 
Vector WallBase::getInfluxVector(CellBase *c) {
 
Vector WallBase::getInfluxVector(CellBase *c)
 
{
 
	if ( c == c1 ) {
 
		return ( Vector(*n2) - Vector(*n1) ).Normalised().Perp2D();
 
	} else {
 
@@ -258,7 +255,8 @@ Vector WallBase::getInfluxVector(CellBas
 
}
 

	
 
//! \brief Test if this wall intersects with division plane p1 -> p2 
 
bool WallBase::IntersectsWithDivisionPlaneP(const Vector &p1, const Vector &p2) {
 
bool WallBase::IntersectsWithDivisionPlaneP(const Vector &p1, const Vector &p2)
 
{
 
	
 
	// Algorithm of http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/
 
	double x1 = n1->x, y1 = n1->y;
 
@@ -271,6 +269,6 @@ bool WallBase::IntersectsWithDivisionPla
 
	// If ua is between 0 and 1, line p1 intersects the line segment
 
	if ( ua >=0. && ua <=1.) return true;
 
	else return false;
 
	
 
}
 

	
 
/* finis */
src/wallbase.h
Show inline comments
 
@@ -28,12 +28,8 @@
 

	
 
#include <list>
 
#include <iostream>
 

	
 

	
 

	
 
#include "vector.h"
 

	
 

	
 
class Node;
 
class CellBase;
 

	
 
@@ -156,7 +152,10 @@ public:
 
				}
 
	}
 
	// checked version. Use during debugging stage.
 
	inline double getTransporter(CellBase *c, int ch) const { return c1 == c ? transporters1[ch] : ( c2 == c ? transporters2[ch] : throw "WallBase::getTransporter called with wrong cell") ; } 
 
  inline double getTransporter(CellBase *c, int ch) const
 
  { 
 
    return c1 == c ? transporters1[ch] : ( c2 == c ? transporters2[ch] : throw "WallBase::getTransporter called with wrong cell") ; } 
 

	
 
	inline void setTransporter(CellBase *c, int ch, double val) { 
 
		if ( c1 == c ) {
 
			transporters1[ch]=val;
 
@@ -194,8 +193,9 @@ public:
 
	void SetTransToNewTrans( void );
 
	
 
private:
 
	
 
};
 

	
 
ostream &operator<<(ostream &os, const WallBase &w);
 
#endif
 

	
 
/* finis */
src/wallitem.cpp
Show inline comments
 
@@ -128,3 +128,5 @@ void WallItem::OnClick(QMouseEvent *e) {
 
		} 
 
	}
 
}
 

	
 
/* finis */
src/wallitem.h
Show inline comments
 
@@ -48,3 +48,5 @@ public:
 
};
 

	
 
#endif
 

	
 
/* finis */
src/warning.cpp
Show inline comments
 
@@ -81,7 +81,6 @@ void MyWarning::error(const char *fmt, .
 
    std::exit(1);
 
  }
 
  delete[] message;
 
  
 
}
 
#endif
 

	
 
@@ -131,7 +130,6 @@ void MyWarning::warning(const char *fmt,
 
	  msgBox.exec();
 
  }
 
  delete[] message;
 

	
 
}
 
#endif
 

	
 
@@ -177,3 +175,5 @@ main(int argc, char * argv[])
 
}
 

	
 
#endif
 

	
 
/* finis */
src/warning.h
Show inline comments
 
@@ -45,3 +45,5 @@ extern "C" {
 
#endif
 

	
 
#endif
 

	
 
/* finis */
src/xmlwrite.cpp
Show inline comments
 
@@ -56,14 +56,12 @@ void Cell::XMLAdd(xmlNodePtr cells_node)
 
  // Save the cell to a stream so we can reconstruct its state later
 
  xmlNodePtr xmlcell = xmlNewChild(cells_node, NULL, BAD_CAST "cell",NULL);
 
  XMLAddCore(xmlcell);
 

	
 
}
 

	
 
void BoundaryPolygon::XMLAdd(xmlNodePtr parent_node) const {
 
  
 
  xmlNodePtr xmlcell = xmlNewChild(parent_node, NULL, BAD_CAST "boundary_polygon",NULL);
 
  XMLAddCore(xmlcell);
 

	
 
}
 

	
 
void NodeSet::XMLAdd(xmlNode *root) const {
 
@@ -78,7 +76,6 @@ void NodeSet::XMLAdd(xmlNode *root) cons
 
      xmlNewProp(node_xml, BAD_CAST "n", BAD_CAST text.str().c_str());
 
    }
 
  }
 
  
 
}
 

	
 

	
 
@@ -208,12 +205,8 @@ void Cell::XMLAddCore(xmlNodePtr xmlcell
 
      ostringstream text;
 
      text << chem[i];
 
      xmlNewProp(chem_val_xml, BAD_CAST "v", BAD_CAST text.str().c_str());
 

	
 
    }
 
  }
 
  
 
  
 

	
 
}
 

	
 

	
 
@@ -223,8 +216,6 @@ void Node::XMLAdd(xmlNodePtr nodes_node)
 
  // Save the node to a stream so we can reconstruct its state later
 
  xmlNodePtr xmlnode = xmlNewChild(nodes_node, NULL, BAD_CAST "node",NULL);
 

	
 
  
 
  
 
  {
 
    ostringstream text;
 
    text << x;
 
@@ -260,8 +251,6 @@ void Node::XMLAdd(xmlNodePtr nodes_node)
 
    text << XMLIO::list_index(m->node_sets.begin(),m->node_sets.end(),node_set);
 
    xmlNewProp(xmlnode, BAD_CAST "nodeset", BAD_CAST text.str().c_str());    
 
  }
 
  
 

	
 
}
 

	
 
void Neighbor::XMLAdd(xmlNodePtr neighbors_node) const {
 
@@ -284,7 +273,6 @@ void Neighbor::XMLAdd(xmlNodePtr neighbo
 
    text << nb2->Index();
 
    xmlNewProp(xmlnode, BAD_CAST "nb2", BAD_CAST text.str().c_str());
 
  }
 

	
 
}
 

	
 

	
 
@@ -316,7 +304,8 @@ getnodeset (xmlDocPtr doc, xmlChar *xpat
 

	
 

	
 

	
 
int Cell::XMLRead(xmlNode *cur)  {
 
int Cell::XMLRead(xmlNode *cur)
 
{
 
  
 
  xmlNode *n = cur->xmlChildrenNode;
 
  QLocale standardlocale(QLocale::C);
 
@@ -554,10 +543,10 @@ int Cell::XMLRead(xmlNode *cur)  {
 
  // Recalculate moments and area
 
  SetIntegrals();
 
  return 0;
 

	
 
}
 
  
 
void NodeSet::XMLRead(xmlNode *root, Mesh *m) {
 
void NodeSet::XMLRead(xmlNode *root, Mesh *m)
 
{
 
  
 
  xmlNode *n = root->xmlChildrenNode;
 
  
 
@@ -579,7 +568,6 @@ void NodeSet::XMLRead(xmlNode *root, Mes
 
  for (int i=0;i<nnodes;i++) {
 
    AddNode( &(m->getNode(tmp_nodes[i])) );
 
  }
 
  
 
}
 

	
 

	
 
@@ -663,7 +651,6 @@ void Wall::XMLAdd(xmlNode *parent) const
 
	ostringstream text;
 
	text << transporters2[i];
 
	xmlNewProp(tr2_val_xml, BAD_CAST "v", BAD_CAST text.str().c_str());
 
      
 
      }
 
    }
 
  }
 
@@ -677,14 +664,14 @@ void Wall::XMLAdd(xmlNode *parent) const
 
	ostringstream text;
 
	text << transporters2[i];
 
	xmlNewProp(apo_val_xml, BAD_CAST "v", BAD_CAST text.str().c_str());
 
	
 
      }
 
    }
 
  } 
 
}
 

	
 

	
 
vector<double> XMLIO::XMLReadValArray(xmlNode *cur) {
 
vector<double> XMLIO::XMLReadValArray(xmlNode *cur)
 
{
 
  
 
  vector<double> result;
 
  QLocale standardlocale(QLocale::C);
 
@@ -763,8 +750,6 @@ void Mesh::XMLSave(const char *docname, 
 
		xmlNewProp(xmlnodes, BAD_CAST "target_length", BAD_CAST text.str().c_str());
 
	}
 
	
 
	
 
	
 
	for (vector<Node *>::const_iterator i=nodes.begin();
 
		 i!=nodes.end();
 
		 i++) {
 
@@ -842,13 +827,7 @@ void Mesh::XMLSave(const char *docname, 
 
		xmlNewProp(xmlnodesets, BAD_CAST "n", BAD_CAST text.str().c_str());
 
	}
 
	
 
	
 
	for_each( node_sets.begin(), node_sets.end(), 
 
			 bind2nd ( 
 
					  mem_fun( &NodeSet::XMLAdd ),
 
					  xmlnodesets
 
					  ) );
 
	
 
  for_each( node_sets.begin(), node_sets.end(), bind2nd ( mem_fun( &NodeSet::XMLAdd ), xmlnodesets ) );
 
	
 
	// Add option tree for interactive application
 
	if (options) {
 
@@ -856,8 +835,6 @@ void Mesh::XMLSave(const char *docname, 
 
	}
 
	
 
	
 
	
 
	
 
	/* 
 
	 * Dumping document to stdio or file
 
	 */
 
@@ -880,7 +857,8 @@ void Mesh::XMLSave(const char *docname, 
 

	
 

	
 

	
 
void Mesh::XMLReadSimtime(const xmlNode *a_node) {
 
void Mesh::XMLReadSimtime(const xmlNode *a_node)
 
{
 
	
 
  xmlNode *root_node;
 
  root_node = (xmlNode *)a_node;
 
@@ -906,7 +884,8 @@ void Mesh::XMLReadSimtime(const xmlNode 
 
	}	
 
}
 

	
 
void Mesh::XMLReadPars(const xmlNode * a_node) {
 
void Mesh::XMLReadPars(const xmlNode * a_node)
 
{
 
	xmlNode *root_node;
 
	root_node = (xmlNode *)a_node;
 
	par.XMLRead(root_node);
 
@@ -979,7 +958,6 @@ void Mesh::XMLReadGeometry(const xmlNode
 
			if (!ok) MyWarning::error("Could not convert \"%s\" to double in XMLRead.",(const char *)baseareac);
 
			xmlFree(baseareac);
 
			
 
			
 
			XMLReadCells(cur);
 
		}
 
		cur=cur->next;
 
@@ -1021,19 +999,18 @@ void Mesh::XMLReadGeometry(const xmlNode
 
	
 
	MyUrand r(shuffled_cells.size());
 
	random_shuffle(shuffled_cells.begin(),shuffled_cells.end(),r);
 
    
 
}
 

	
 
void Mesh::XMLParseTree(const xmlNode *root_node) {
 
	
 
void Mesh::XMLParseTree(const xmlNode *root_node)
 
{
 
	XMLReadSimtime(root_node);
 
	XMLReadPars(root_node);
 
	XMLReadGeometry(root_node);
 
	
 
}
 

	
 

	
 
void Mesh::XMLReadNodes(xmlNode *root) {
 
void Mesh::XMLReadNodes(xmlNode *root)
 
{
 
	
 
  QLocale standardlocale(QLocale::C);
 
  bool ok;
 
@@ -1054,7 +1031,6 @@ void Mesh::XMLReadNodes(xmlNode *root) {
 
	
 
  if (tlc != 0) {
 

	
 
	  
 
    Node::target_length = standardlocale.toDouble((const char *)tlc, &ok);
 
    if (!ok) MyWarning::error("Could not convert \"%s\" to double in XMLRead.",(const char *)tlc);
 
		
 
@@ -1115,8 +1091,6 @@ void Mesh::XMLReadNodes(xmlNode *root) {
 
      xmlFree(boundaryc);
 
      xmlFree(fixedc);
 
      xmlFree(samc);
 
			
 
			
 
    }
 
    cur=cur->next;
 
  }
 
@@ -1126,10 +1100,10 @@ void Mesh::XMLReadNodes(xmlNode *root) {
 
	
 
  MyUrand r(shuffled_nodes.size());
 
  random_shuffle(shuffled_nodes.begin(),shuffled_nodes.end(),r);
 
	
 
}
 

	
 
void Mesh::XMLReadWalls(xmlNode *root, vector<Wall *> *tmp_walls) {
 
void Mesh::XMLReadWalls(xmlNode *root, vector<Wall *> *tmp_walls)
 
{
 
	
 
  xmlNode *cur = root;
 
  cur = cur->xmlChildrenNode;
 
@@ -1240,7 +1214,6 @@ void Mesh::XMLReadWalls(xmlNode *root, v
 
	    dead = strtobool( (char *)v_str);
 
	    xmlFree(v_str);
 
	  }
 
					
 
	}
 
				
 
	Cell *cc1 = c1 != -1 ? cells[c1] : boundary_polygon;
 
@@ -1287,10 +1260,8 @@ void Mesh::XMLReadWalls(xmlNode *root, v
 
	      }
 
	      v_node = v_node->next; 
 
	    }
 
						
 
	  }
 
					
 
					
 
	  if ((!xmlStrcmp(w_node->name, (const xmlChar *)"transporters2"))) {
 
						
 
	    xmlNode *v_node = w_node->xmlChildrenNode;
 
@@ -1303,7 +1274,6 @@ void Mesh::XMLReadWalls(xmlNode *root, v
 
		    text << "Exception in Mesh::XMLRead: Too many transporter values given for wall(s). Ignoring remaining values.";
 
		    unique_warning(text.str().c_str());
 
		    break;
 

	
 
		  }
 
		}
 
								
 
@@ -1321,7 +1291,6 @@ void Mesh::XMLReadWalls(xmlNode *root, v
 
	      }
 
	      v_node = v_node->next; 
 
	    }
 
						
 
	  } 
 
					
 
	  if ((!xmlStrcmp(w_node->name, (const xmlChar *)"apoplast"))) {
 
@@ -1364,7 +1333,8 @@ void Mesh::XMLReadWalls(xmlNode *root, v
 
}
 

	
 

	
 
void Mesh::XMLReadWallsToCells(xmlNode *root, vector<Wall *> *tmp_walls) {
 
void Mesh::XMLReadWallsToCells(xmlNode *root, vector<Wall *> *tmp_walls)
 
{
 
	
 
	// Add the walls to the cells (do this after reading the walls; read walls after reading cells...)
 
	// 1. Read Nodes
 
@@ -1409,19 +1379,16 @@ void Mesh::XMLReadWallsToCells(xmlNode *
 
				for (int i=0;i<nwalls;i++) {
 
					cells[ci]->walls.push_back((*tmp_walls)[tmp_walls_ind[i]]);	
 
				}
 
				
 
				ci++;
 
			}
 
			
 
		} 
 
		cur=cur->next;
 
	}
 
	
 
	
 
}
 

	
 

	
 
void Mesh::XMLReadNodeSetsToNodes(xmlNode *root) {
 
void Mesh::XMLReadNodeSetsToNodes(xmlNode *root)
 
{
 
	
 
	xmlNode *cur = root->xmlChildrenNode;
 
	int ci=0; // cell index
 
@@ -1448,18 +1415,15 @@ void Mesh::XMLReadNodeSetsToNodes(xmlNod
 
				
 
				n = n->next;
 
			}
 
			
 
			ci++;
 
			
 
		} 
 
		cur=cur->next;
 
	}
 
	
 
	
 
}
 

	
 

	
 
void Mesh::XMLReadNodeSets(xmlNode *root) {
 
void Mesh::XMLReadNodeSets(xmlNode *root)
 
{
 
	
 
	for (vector<NodeSet *>::iterator i=node_sets.begin();
 
		 i!=node_sets.end();
 
@@ -1487,10 +1451,10 @@ void Mesh::XMLReadNodeSets(xmlNode *root
 
		new_nodeset->XMLRead(cur, this);
 
		cur=cur->next;
 
	}
 
	
 
}
 

	
 
void Mesh::XMLReadCells(xmlNode *root) {
 
void Mesh::XMLReadCells(xmlNode *root)
 
{
 
	
 
	for (vector<Cell *>::iterator i=cells.begin();
 
		 i!=cells.end();
 
@@ -1530,10 +1494,10 @@ void Mesh::XMLReadCells(xmlNode *root) {
 
		new_cell->XMLRead(cur);
 
		cur=cur->next;
 
	}
 
	
 
}
 

	
 
void Mesh::XMLRead(const char *docname, xmlNode **settings, bool geometry, bool pars, bool simtime) {
 
void Mesh::XMLRead(const char *docname, xmlNode **settings, bool geometry, bool pars, bool simtime)
 
{
 
	
 
	xmlDocPtr doc = xmlParseFile(docname);
 
	if (doc == NULL ) {
 
@@ -1584,11 +1548,11 @@ void Mesh::XMLRead(const char *docname, 
 
	
 
	// We're doing this so we can manually delete walls with by adding the 'delete="true"' property
 
	CleanUpCellNodeLists();
 
	
 
}
 

	
 

	
 
void Parameter::XMLRead(xmlNode *root) {
 
void Parameter::XMLRead(xmlNode *root)
 
{
 
	
 
	xmlNode *cur = root->xmlChildrenNode;
 
	while (cur!=NULL) {
 
@@ -1617,10 +1581,9 @@ void Parameter::XMLRead(xmlNode *root) {
 
				}	  
 
				par_node = par_node->next;
 
			}
 
			
 
		}
 
		cur=cur->next;
 
	}
 
    
 
}
 

	
 
/* finis */
src/xmlwrite.h
Show inline comments
 
@@ -45,7 +45,6 @@ namespace XMLIO {
 
    }
 
    return -1;
 
  }
 
 	
 
}
 

	
 

	
 
@@ -66,3 +65,5 @@ inline bool strtobool(const char *str) {
 
}
 

	
 
#endif
 

	
 
/* finis */
0 comments (0 inline, 0 general)