Changeset - c32457e84c7f
[Not reviewed]
Merge default
0 14 0
Roeland Merks - 15 years ago 2010-10-14 11:56:01
roeland.merks@cwi.nl
Commit changes

user: Roeland Merks <roeland.merks@cwi.nl>
branch merge
branch 'default'
changed src/ChangeLog
changed src/TutorialCode/Tutorial3/ChangeLog
changed src/TutorialCode/Tutorial3/tutorial3.h
changed src/TutorialCode/Tutorial4/ChangeLog
changed src/TutorialCode/Tutorial4/tutorial4.h
changed src/TutorialCode/Tutorial5/ChangeLog
changed src/TutorialCode/Tutorial5/tutorial5.h
changed src/VirtualLeafpar.tmpl
changed src/canvas.cpp
changed src/canvas.h
changed src/parameter.cpp
changed src/parameter.h
changed src/pardialog.cpp
changed src/pardialog.h
13 files changed with 39 insertions and 27 deletions:
0 comments (0 inline, 0 general)
src/TutorialCode/Tutorial3/ChangeLog
Show inline comments
 
2010-10-14    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial3.h (SimPluginInterface): Added default LeafML file.
 

	
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial3.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial3.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial3/tutorial3.h
Show inline comments
 
@@ -32,29 +32,32 @@ class Tutorial3 : public QObject, SimPlu
 
	Q_INTERFACES(SimPluginInterface);
 

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

	
 
	// default LeafML file
 
	virtual QString DefaultLeafML(void) { return QString("tutorial3_init.xml"); }
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial4/ChangeLog
Show inline comments
 
2010-10-14    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial4.h (SimPluginInterface): Added default LeafML file.
 

	
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial4.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial4.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial4/tutorial4.h
Show inline comments
 
@@ -34,29 +34,32 @@ class Tutorial4 : public QObject, SimPlu
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
	
 
	virtual double PINflux(CellBase *this_cell, CellBase *adjacent_cell, Wall *w); 
 

	
 
	// default LeafML file
 
	virtual QString DefaultLeafML(void) { return QString("tutorial4_init.xml"); }
 
};
 

	
 

	
 

	
 

	
src/TutorialCode/Tutorial5/ChangeLog
Show inline comments
 
2010-10-14    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial5.h (SimPluginInterface): Added default LeafML file.
 

	
 
2010-06-25    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial5.pro: Added -Wno-write-strings and -Wno-unused-parameter to QMAKE_CXXFLAGS.
 

	
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* tutorial5.pro: Corrected windows library path.
 

	
src/TutorialCode/Tutorial5/tutorial5.h
Show inline comments
 
@@ -34,29 +34,32 @@ class Tutorial5 : public QObject, SimPlu
 
public:
 
	virtual QString ModelID(void);
 
	
 
	// Executed after the cellular mechanics steps have equillibrized
 
	virtual void CellHouseKeeping (CellBase *c);
 
	// Differential equations describing transport of chemicals from cell to cell
 
	virtual void CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2);
 
    
 
	// Differential equations describing chemical reactions taking place at or near the cell walls
 
	// (e.g. PIN accumulation)
 
	virtual void WallDynamics(Wall *w, double *dw1, double *dw2);
 
	
 
	// Differential equations describing chemical reactions inside the cells
 
	virtual void CellDynamics(CellBase *c, double *dchem);
 
	
 
	// to be executed after a cell division
 
	virtual void OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2);
 
	
 
	// to be executed for coloring a cell
 
	virtual void SetCellColor(CellBase *c, QColor *color);	
 
	// return number of chemicals
 
	virtual int NChem(void);
 
	
 
	virtual double PINflux(CellBase *this_cell, CellBase *adjacent_cell, Wall *w); 
 

	
 
	// default LeafML file
 
	virtual QString DefaultLeafML(void) { return QString("tutorial5_init.xml"); }
 
};
 

	
 

	
 

	
 

	
src/VirtualLeafpar.tmpl
Show inline comments
 
@@ -104,25 +104,25 @@ mu = 0. / double
 
nu = 0. / double
 
rho0 = 0. / double
 
rho1 = 0. / double
 
c0 = 0. / double
 
gamma = 0. / double
 
eps = 0. / double
 
label = / label
 
label = <b>User-defined parameters</b> / label
 
k = 0., 0.0, 0.0, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. / doublelist
 
i1 = 0 / int
 
i2 = 0 / int
 
i3 = 0 / int
 
i4 = 0 / int
 
i5 = 0 / int
 
s1 =  / string
 
s2 =  / string
 
s3 =  / string
 
b1 = false / bool
 
b2 = false / bool
 
b3 = false / bool
 
b4 = false / bool
 
dir1 = . / directory
 
dir2 = . / directory
 
export_interval = 0 / int
 
export_fn_prefix = CellData_ / string
 
export_fn_prefix = cell. / string
src/canvas.cpp
Show inline comments
 
@@ -69,48 +69,49 @@
 
#include "nodeitem.h"
 
#include "cellitem.h"
 
#include "wallitem.h"
 
#include "mesh.h"
 
#include "xmlwrite.h"
 
#include "miscq.h"
 
#include "OptionFileDialog.h"
 
#include <cstdlib>
 
#include <cstdio>
 
#include "modelcatalogue.h"
 

	
 
#include <algorithm>
 

	
 
// Include VIB and PSB logos
 
#include "psb.xpm"
 
#include "cwi.xpm"
 

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

	
 
using namespace std;
 

	
 
// We use a global variable to save memory - all the brushes and pens in
 
// the mesh are shared.
 

	
 
#define FNAMESIZE 100
 
#define QUOTE_ME(s) QUOTE_ME_2NDLEV(s)
 
#define QUOTE_ME_2NDLEV(s) #s
 

	
 
static QColor dark_red("darkRed");
 

	
 

	
 
static const int imageRTTI = 984376;
 
extern Parameter par;
 
const QString Main::caption("Virtual leaf");
 
const QString Main::caption_with_file("Virtual leaf: %1");
 

	
 
FigureEditor::FigureEditor(
 
			   QGraphicsScene& c, Mesh &m, QWidget* parent,
 
			   const char* name, Qt::WindowFlags f) :
 
  QGraphicsView(&c,parent), mesh(m)
 
{
 
  intersection_line = 0;
 
  //angle_line = 0;
 
  setInteractive(true);
 
  moving = 0;  
 
  rotation_mode = false;
 
}
 

	
 

	
 
@@ -459,49 +460,49 @@ Main::Main(QGraphicsScene& c, Mesh &m, Q
 
  mesh(m)
 
{
 
  editor = new FigureEditor(canvas,mesh, this);
 

	
 
#ifdef QDEBUG
 
  qDebug() << "Interactive = " << editor->isEnabled();
 
#endif
 

	
 
  working_dir = 0;
 
  QObject::connect( editor, SIGNAL(MousePressed()), this, SLOT(PauseIfRunning()));
 
  QObject::connect( editor, SIGNAL(MouseReleased()), this, SLOT(ContIfRunning()));
 
  QMenuBar* menu = menuBar();
 

	
 
  Q3PopupMenu* file = new Q3PopupMenu( menu );
 

	
 
  file->insertItem("&Read leaf", this, SLOT(readStateXML()));
 
  file->insertItem("&Save leaf", this, SLOT(saveStateXML()));
 
  file->insertItem("Snapshot", this, SLOT(snapshot()), Qt::CTRL+Qt::SHIFT+Qt::Key_S);
 

	
 
  file->insertSeparator();
 
  file->insertItem("Read next leaf", this, SLOT(readNextStateXML()), Qt::Key_PageDown);
 
  file->insertItem("Read previous leaf", this, SLOT(readPrevStateXML()), Qt::Key_PageUp);
 
  file->insertItem("Read last leaf", this, SLOT(readLastStateXML()), Qt::Key_End);
 
  file->insertItem("Read first leaf", this, SLOT(readFirstStateXML()), Qt::Key_Home);
 
  file->insertItem("Export cell areas", this, SLOT(exportCellData()));
 
  file->insertItem("Export cell data", this, SLOT(exportCellData()));
 

	
 
  file->insertSeparator();
 
  file->insertItem("&Print...", this, SLOT(print()), Qt::CTRL+Qt::Key_P);
 
  file->insertSeparator();
 
  file->insertItem("E&xit", qApp, SLOT(quit()), Qt::CTRL+Qt::Key_Q);
 
  menu->insertItem("&File", file);
 

	
 
  Q3PopupMenu* edit = new Q3PopupMenu( menu );
 
  edit->insertItem("Reset Chemicals and Transporters", this, SLOT( CleanMesh()), Qt::CTRL+Qt::Key_R );
 
  edit->insertItem("Reset Chemicals", this, SLOT( CleanMeshChemicals()) );
 
  edit->insertItem("Reset Transporters", this, SLOT( CleanMeshTransporters()) );
 
  edit->insertItem("Randomize PIN1 Transporters", this, SLOT( RandomizeMesh()) );
 
  edit->insertItem("Cut away SAM", this, SLOT( CutSAM() ));
 
  menu->insertItem("&Edit", edit);
 

	
 
  run = new Q3PopupMenu( menu );
 
  running = false;
 
  paused_id = run->insertItem("&Simulation paused", this, SLOT(togglePaused()), Qt::Key_S);
 
  run->setItemChecked(paused_id, FALSE);
 

	
 
  menu->insertItem("&Run", run);
 

	
 
  view = new Q3PopupMenu( menu );
 
  view->insertItem("&Zoom in", this, SLOT(zoomIn()), Qt::CTRL+Qt::Key_Equal);
 
@@ -1144,74 +1145,68 @@ void Main::print()
 
#endif
 
    double cw = (bbur.x - bbll.x);
 
    double ch = (bbur.y - bbll.y);
 
    QPainter pp(printer);
 
    QRect vp=pp.viewport();
 
#ifdef QDEBUG
 
    qDebug() << "Paper width = " << vp.width() << " x " << vp.height() << endl;
 
#endif
 

	
 
    // Note that Cell is also translated...
 
    pp.translate(-bbur.x,-bbur.y);
 
    if (cw>ch) {
 
      pp.scale(vp.width()/(2*cw*Cell::Magnification()), vp.width()/(2*cw*Cell::Magnification()));
 
    } else {
 
      pp.scale(vp.height()/(2*ch*Cell::Magnification()), vp.height()/(2*ch*Cell::Magnification()));
 
    }
 
    canvas.render(&pp, QRectF(), QRectF(0.,0.,canvas.width(),canvas.height()));
 
  }
 
}
 

	
 

	
 
void Main::TimeStepWrap(void)
 
{
 
  static int t=0;
 
  stringstream fname;
 

	
 
  TimeStep();
 
  t++;
 

	
 
  if ((par.export_interval > 0) && ((t % par.export_interval) == 0)){
 
    this->exportCellData(QString(par.datadir) + QString('/') + QString(par.export_fn_prefix) + this->TimeStamp());
 
    fname << par.datadir << "/" << par.export_fn_prefix;
 
    fname.fill('0');
 
    fname.width(6);
 
    fname << t << ".csv";
 
    this->exportCellData(QString(fname.str().c_str()));
 
  }
 

	
 
  // check number of timesteps
 
  if (t==par.nit) {
 
    emit SimulationDone();
 
  }
 
}
 

	
 

	
 
QString Main::TimeStamp(){
 
  time_t rawtime;
 
  struct tm * timeinfo;
 
  char buffer [15];
 

	
 
  time ( &rawtime );
 
  timeinfo = localtime ( &rawtime );
 
  strftime (buffer,15,"%Y%m%d%H%M%S",timeinfo);
 
  return QString(buffer);
 
}
 

	
 

	
 
void Main::RestartSim(void)
 
{
 

	
 
  stopSimulation();
 
  if ( QMessageBox::question(
 
			     this,
 
			     tr("Restart simulation?"),
 
			     tr("Restart simulation.\n"
 
				"Are you sure?"),
 
			     QMessageBox::Yes | QMessageBox::No, QMessageBox::NoButton ) == QMessageBox::Yes ) {
 

	
 
    cerr << "Restarting simulation" << endl;
 
    //    extern Mesh mesh;
 
    mesh.Clear();
 
    Init();
 
    Plot();
 
    editor->FullRedraw();
 
  } 
 
  //startSimulation();
 
}
 

	
 

	
 
void Main::FitCanvasToWindow(void)
 
{
src/canvas.h
Show inline comments
 
@@ -206,50 +206,48 @@ class Main : public Q3MainWindow, public
 
  void readPrevStateXML();
 
  void readFirstStateXML();
 
  void readLastStateXML();
 
  void exportCellData();
 
  void exportCellData(QString);
 
  void saveStateXML();
 
  void snapshot();
 
  void savePars();
 
  void readPars();
 
  void clear();
 
  void init();
 
  virtual void CutSAM() { MainBase::CutSAM(); Refresh();}
 

	
 
  void enlarge();
 
  void shrink();
 
  void zoomIn();
 
  void zoomOut();
 

	
 
  void CleanMesh();
 
  void CleanMeshChemicals(void);
 
  void CleanMeshTransporters(void);
 

	
 
  void RandomizeMesh();
 

	
 
  QString TimeStamp();
 

	
 
 signals:
 
  void SimulationDone(void);
 
  void ParsChanged(void);
 

	
 
 protected:
 
  Mesh &mesh;
 

	
 
 private:
 
  NodeSet *node_set;
 
  FigureEditor *editor;
 
  Q3PopupMenu* options;
 
  Q3PopupMenu *view;
 
  Q3PopupMenu *run;
 
  QMenu *modelmenu;
 
  Q3PopupMenu *helpmenu;
 

	
 
  QPrinter* printer;
 
  const QDir *working_dir;
 
  QString currentFile;
 
  //  toggle item states 
 
  int dbf_id; // options->Double Buffer
 
  int com_id; // view->Show centers
 
  int mesh_id; // view->Show mesh
 
  int node_number_id; // view->Show Node numbers
src/parameter.cpp
Show inline comments
 
/*
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
// WARNING: This file is automatically generated by make_parameter_source.pl.
 
// Do not edit. All edits will be discarded.
 

	
 

	
 
#include "parameter.h"
 
#include <cstdio>
 
#include <cstring>
 
#include <cstdlib>
 
#include <cerrno>
 
#include <iostream>
 
#include <sstream>
 
#include "output.h"
 
#include "parse.h"
 
#include "xmlwrite.h"
 
#include "warning.h"
 
#include <QLocale>
 
#include <QDir>
 
#include <QStringList>
 

	
 
using namespace std;
 

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

	
 
Parameter::Parameter() {
 
  arrowcolor = strdup("white");
 
  arrowsize = 100;
 
  textcolor = strdup("red");
 
  cellnumsize = 1;
 
@@ -165,50 +165,50 @@ Parameter::Parameter() {
 
  k[5] = 0.;
 
  k[6] = 0.;
 
  k[7] = 0.;
 
  k[8] = 0.;
 
  k[9] = 0.;
 
  k[10] = 0.;
 
  k[11] = 0.;
 
  k[12] = 0.;
 
  k[13] = 0.;
 
  k[14] = 0.;
 
  i1 = 0;
 
  i2 = 0;
 
  i3 = 0;
 
  i4 = 0;
 
  i5 = 0;
 
  s1 = strdup("");
 
  s2 = strdup("");
 
  s3 = strdup("");
 
  b1 = false;
 
  b2 = false;
 
  b3 = false;
 
  b4 = false;
 
  dir1 = strdup(".");
 
  dir2 = strdup(".");
 
  export_interval = 100;
 
  export_fn_prefix = strdup("CELLDATA");
 
  export_interval = 0;
 
  export_fn_prefix = strdup("cell.");
 
}
 

	
 
Parameter::~Parameter() {
 
    
 
// destruct parameter object
 
// free string parameter
 
CleanUp();
 
}
 

	
 
void Parameter::CleanUp(void) {
 
  if (arrowcolor) 
 
     free(arrowcolor);
 
  if (textcolor) 
 
     free(textcolor);
 
  if (cell_outline_color) 
 
     free(cell_outline_color);
 
  if (D) 
 
     free(D);
 
  if (initval) 
 
     free(initval);
 
  if (datadir) 
 
     free(datadir);
 
  if (k) 
 
     free(k);
 
@@ -326,50 +326,50 @@ void Parameter::Read(const char *filenam
 
  rho0 = fgetpar(fp, "rho0", 0., true);
 
  rho1 = fgetpar(fp, "rho1", 0., true);
 
  c0 = fgetpar(fp, "c0", 0., true);
 
  gamma = fgetpar(fp, "gamma", 0., true);
 
  eps = fgetpar(fp, "eps", 0., true);
 
  k = dgetparlist(fp, "k", 15, true);
 
  i1 = igetpar(fp, "i1", 0, true);
 
  i2 = igetpar(fp, "i2", 0, true);
 
  i3 = igetpar(fp, "i3", 0, true);
 
  i4 = igetpar(fp, "i4", 0, true);
 
  i5 = igetpar(fp, "i5", 0, true);
 
  s1 = sgetpar(fp, "s1", "", true);
 
  s2 = sgetpar(fp, "s2", "", true);
 
  s3 = sgetpar(fp, "s3", "", true);
 
  b1 = bgetpar(fp, "b1", false, true);
 
  b2 = bgetpar(fp, "b2", false, true);
 
  b3 = bgetpar(fp, "b3", false, true);
 
  b4 = bgetpar(fp, "b4", false, true);
 
  dir1 = sgetpar(fp, "dir1", ".", true);
 
  if (strcmp(dir1, "."))
 
    MakeDir(dir1);
 
  dir2 = sgetpar(fp, "dir2", ".", true);
 
  if (strcmp(dir2, "."))
 
    MakeDir(dir2);
 
  export_interval = igetpar(fp, "export_interval", 100, true);
 
  export_fn_prefix = sgetpar(fp, "export_fn_prefix", "CELLDATA", true);
 
  export_interval = igetpar(fp, "export_interval", 0, true);
 
  export_fn_prefix = sgetpar(fp, "export_fn_prefix", "cell.", true);
 
}
 

	
 
const char *sbool(const bool &p) {
 

	
 
  const char *true_str="true";
 
  const char *false_str="false";
 
  if (p)
 
    return true_str;
 
  else
 
    return false_str;
 
}
 

	
 
void Parameter::Write(ostream &os) const {
 

	
 

	
 
  if (arrowcolor) 
 
  os << " arrowcolor = " << arrowcolor << endl;
 
  os << " arrowsize = " << arrowsize << endl;
 

	
 
  if (textcolor) 
 
  os << " textcolor = " << textcolor << endl;
 
  os << " cellnumsize = " << cellnumsize << endl;
 
  os << " nodenumsize = " << nodenumsize << endl;
 
  os << " node_mag = " << node_mag << endl;
 
@@ -1872,25 +1872,24 @@ if (!strcmp(namec, "D")) {
 
     D[i++]=*(v++);
 
  }
 
}
 
if (!strcmp(namec, "initval")) {
 
  int i=0;
 
  vector<double>::const_iterator v=valarray.begin();
 
  while (v!=valarray.end() && i <= 14 ) {
 
     initval[i++]=*(v++);
 
  }
 
}
 
if (!strcmp(namec, "k")) {
 
  int i=0;
 
  vector<double>::const_iterator v=valarray.begin();
 
  while (v!=valarray.end() && i <= 14 ) {
 
     k[i++]=*(v++);
 
  }
 
}
 
}
 

	
 
ostream &operator<<(ostream &os, Parameter &p) {
 
    p.Write(os);
 
    return os;
 
}
 

	
 
/* finis */
src/parameter.h
Show inline comments
 
/*
 
 *
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
// WARNING: This file is automatically generated by make_parameter_source.pl. Do not edit.
 
// All edits will be discarded.
 
// Do not edit. All edits will be discarded.
 

	
 
#ifndef _PARAMETER_H_
 
#define _PARAMETER_H_
 
#include "vector.h"
 
#include <vector>
 

	
 
#include <libxml/parser.h>
 
#include <libxml/tree.h>
 

	
 
 class Parameter {
 
		
 
 public: 
 
   Parameter();
 
   ~Parameter();
 
   void CleanUp(void);
 
   void Read(const char *filename);
 
   void Write(ostream &os) const;
 
   void XMLAdd(xmlNode *root) const;
 
   void XMLRead(xmlNode *root);
 
   void AssignValToPar(const char *namec, const char *valc);
 
   void AssignValArrayToPar(const char *namec, vector<double> valarray);
 
  char * arrowcolor;
 
  double arrowsize;
 
  char * textcolor;
src/pardialog.cpp
Show inline comments
 
/*
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
// WARNING: This file is automatically generated by make_parameter_source.pl. Do not edit.
 
// Do not edit. All edits will be discarded.
 

	
 
#include "pardialog.h"
 
#include "parameter.h"
 
#include <cstring>
 
#include <qdialog.h>
 
#include <qlabel.h>
 
#include <qlineedit.h>
 
#include <qmessagebox.h>
 

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

	
 
ParameterDialog::ParameterDialog(QWidget *parent, const char *name, Qt::WindowFlags f) : QDialog(parent,name,false,f) {
 
    extern Parameter par;
 
  arrowcolor_edit = new QLineEdit( QString("%1").arg(par.arrowcolor), this, "arrowcolor_edit" );
 
  arrowsize_edit = new QLineEdit( QString("%1").arg(par.arrowsize), this, "arrowsize_edit" );
 
  textcolor_edit = new QLineEdit( QString("%1").arg(par.textcolor), this, "textcolor_edit" );
 
  cellnumsize_edit = new QLineEdit( QString("%1").arg(par.cellnumsize), this, "cellnumsize_edit" );
 
  nodenumsize_edit = new QLineEdit( QString("%1").arg(par.nodenumsize), this, "nodenumsize_edit" );
 
  node_mag_edit = new QLineEdit( QString("%1").arg(par.node_mag), this, "node_mag_edit" );
 
  outlinewidth_edit = new QLineEdit( QString("%1").arg(par.outlinewidth), this, "outlinewidth_edit" );
 
  cell_outline_color_edit = new QLineEdit( QString("%1").arg(par.cell_outline_color), this, "cell_outline_color_edit" );
 
  resize_stride_edit = new QLineEdit( QString("%1").arg(par.resize_stride), this, "resize_stride_edit" );
 
  T_edit = new QLineEdit( QString("%1").arg(par.T), this, "T_edit" );
 
@@ -797,25 +798,24 @@ void ParameterDialog::Reset(void) {
 
  c0_edit->setText( QString("%1").arg(par.c0) );
 
  gamma_edit->setText( QString("%1").arg(par.gamma) );
 
  eps_edit->setText( QString("%1").arg(par.eps) );
 
  QString k_string("%1,%2,%3,%4,%5,%6,%7,%8,%9,%10,%11,%12,%13,%14,%15");
 
  k_string = k_string.arg(par.k[0]).arg(par.k[1]).arg(par.k[2]).arg(par.k[3]).arg(par.k[4]).arg(par.k[5]).arg(par.k[6]).arg(par.k[7]).arg(par.k[8]).arg(par.k[9]).arg(par.k[10]).arg(par.k[11]).arg(par.k[12]).arg(par.k[13]).arg(par.k[14]);
 
  k_edit->setText( k_string );
 
  i1_edit->setText( QString("%1").arg(par.i1) );
 
  i2_edit->setText( QString("%1").arg(par.i2) );
 
  i3_edit->setText( QString("%1").arg(par.i3) );
 
  i4_edit->setText( QString("%1").arg(par.i4) );
 
  i5_edit->setText( QString("%1").arg(par.i5) );
 
  s1_edit->setText( QString("%1").arg(par.s1) );
 
  s2_edit->setText( QString("%1").arg(par.s2) );
 
  s3_edit->setText( QString("%1").arg(par.s3) );
 
  b1_edit->setText( QString("%1").arg(sbool(par.b1)));
 
  b2_edit->setText( QString("%1").arg(sbool(par.b2)));
 
  b3_edit->setText( QString("%1").arg(sbool(par.b3)));
 
  b4_edit->setText( QString("%1").arg(sbool(par.b4)));
 
  dir1_edit->setText( QString("%1").arg(par.dir1) );
 
  dir2_edit->setText( QString("%1").arg(par.dir2) );
 
  export_interval_edit->setText( QString("%1").arg(par.export_interval) );
 
  export_fn_prefix_edit->setText( QString("%1").arg(par.export_fn_prefix) );
 
}
 

	
 
/* finis */
src/pardialog.h
Show inline comments
 
/*
 
 *
 
 *  $Id$
 
 *
 
 *  This file is part of the Virtual Leaf.
 
 *
 
 *  VirtualLeaf is free software: you can redistribute it and/or modify
 
 *  it under the terms of the GNU General Public License as published by
 
 *  the Free Software Foundation, either version 3 of the License, or
 
 *  (at your option) any later version.
 
 *
 
 *  VirtualLeaf is distributed in the hope that it will be useful,
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 *  GNU General Public License for more details.
 
 *
 
 *  You should have received a copy of the GNU General Public License
 
 *  along with the Virtual Leaf.  If not, see <http://www.gnu.org/licenses/>.
 
 *
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
// WARNING: This file is automatically generated by make_parameter_source.pl. Do not edit.
 
// All edits will be discarded.
 
// Do not edit. All edits will be discarded.
 

	
 
#ifndef PARAMETER_DIALOG_H
 
#define PARAMETER_DIALOG_H
 
#include <qdialog.h>
 
#include <qspinbox.h>
 
#include <qlineedit.h>
 
#include <qlayout.h>
 
#include <qpushbutton.h>
 
#include <iostream>
 

	
 
class ParameterDialog : public QDialog {
 
    Q_OBJECT
 
	
 
      public:
 
	ParameterDialog(QWidget *parent=0, const char *name = 0, Qt::WindowFlags f = 0);
 
    virtual ~ParameterDialog(void);
 
    public slots:
 
    void Reset(void);
 

	
 
    private slots:
 
    void write(void);
 

	
 
  private:
 
  QLineEdit *arrowcolor_edit;
 
@@ -127,25 +127,24 @@ class ParameterDialog : public QDialog {
 
  QLineEdit *rho0_edit;
 
  QLineEdit *rho1_edit;
 
  QLineEdit *c0_edit;
 
  QLineEdit *gamma_edit;
 
  QLineEdit *eps_edit;
 
  QLineEdit *k_edit;
 
  QLineEdit *i1_edit;
 
  QLineEdit *i2_edit;
 
  QLineEdit *i3_edit;
 
  QLineEdit *i4_edit;
 
  QLineEdit *i5_edit;
 
  QLineEdit *s1_edit;
 
  QLineEdit *s2_edit;
 
  QLineEdit *s3_edit;
 
  QLineEdit *b1_edit;
 
  QLineEdit *b2_edit;
 
  QLineEdit *b3_edit;
 
  QLineEdit *b4_edit;
 
  QLineEdit *dir1_edit;
 
  QLineEdit *dir2_edit;
 
  QLineEdit *export_interval_edit;
 
  QLineEdit *export_fn_prefix_edit;
 
};
 
#endif
 

	
0 comments (0 inline, 0 general)