Changeset - 59e38e5f05d2
[Not reviewed]
default
0 15 0
Michael Guravage - 15 years ago 2010-06-23 16:21:32
michael.guravage@cwi.nl
Reverted NULL assignments to obviate compilation warnings.

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

changed src/ChangeLog
changed src/VirtualLeaf.cpp
changed src/apoplastitem.cpp
changed src/build_models/ChangeLog
changed src/build_models/auxingrowthplugin.cpp
changed src/build_models/meinhardtplugin.cpp
changed src/build_models/testplugin.cpp
changed src/canvas.cpp
changed src/cell.cpp
changed src/cellbase.h
changed src/forwardeuler.cpp
changed src/mainbase.h
changed src/nodeitem.cpp
changed src/qcanvasarrow.h
changed src/simitembase.cpp
15 files changed with 29 insertions and 53 deletions:
0 comments (0 inline, 0 general)
src/ChangeLog
Show inline comments
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* simitembase.cpp: Removed NULL assignments to unused variables.
 
	* VirtualLeaf.cpp: Ditto.
 
	* apoplastitem.cpp: Ditto.
 
	* canvas.cpp: Ditto.
 
	* cell.cpp: Ditto.
 
	* cellbase.h: Ditto.
 
	* forwardeuler.cpp: Ditto.
 
	* mainbase.h: Ditto.
 
	* nodeitem.cpp: Ditto.
 
	* qcanvasarrow.h: Ditto.
 
	* simitembase.cpp: Ditto.
 

	
 

	
 
	* Makefile (clean): Add -f Makefile argument to each make invocation.
 

	
 
	* VirtualLeaf-install.nsi: New gpl license text.
 

	
 
	* VirtualLeaf.pro: Disabled console mode.
 

	
 
	* mesh.cpp (Clear): Added parentheses to qDebug statments.
 
	(TestIllegalWalls): Replaced qDebug().
 

	
 
	* canvas.cpp (mouseReleaseEvent): Replaced qDebug() with cerr since qDebug complains about *node_set.
 

	
 
	* wall.cpp (CorrectWall): Rplaced gDebug() with cerr in transform call and when printing *this.
src/VirtualLeaf.cpp
Show inline comments
 
@@ -266,28 +266,25 @@ TIMESTEP {
 
    }
 
  } 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)
 
{
 
  e = NULL; // use assignment merely to obviate compilation warning
 
}
 
void Cell::OnClick(QMouseEvent *e){}
 

	
 

	
 
/* Custom message handler - Default appends a newline character to the end of each line. */ 
 
void vlMessageOutput(QtMsgType type, const char *msg)
 
{
 
  switch (type) {
 
  case QtDebugMsg:
 
    //fprintf(stderr, "Debug: %s\n", msg);
 
    cerr << msg << flush;
 
    break;
 
  case QtWarningMsg:
 
    //fprintf(stderr, "Warning: %s\n", msg);
src/apoplastitem.cpp
Show inline comments
 
@@ -59,17 +59,15 @@ void ApoplastItem::setColor(void) {
 

	
 
  QColor diffcolor;
 
  static const QColor purple("Purple");
 
  static const QColor blue("blue");
 

	
 
  Wall *w=&getWall();
 
  double val = w->getApoplast(2);
 

	
 
  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
 
}
 
void ApoplastItem::OnClick(QMouseEvent *e) {}
 

	
 
/* finis*/
src/build_models/ChangeLog
Show inline comments
 
2010-06-23    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* auxingrowthplugin.cpp: Removed NULL assignments to unused variables.
 
	* meinhardtplugin.cpp: Ditto.
 
	* testplugin.cpp: Ditto.
 

	
 

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

	
 
	* Makefile (clean): Add windows equivalent of UNIX touch.
 

	
 

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

	
 
	* plugin_auxingrowth.pro: Changed default LIBXML2DIR, LIBICONVDIR and LIBZDIR to corresponding distribution lib directories.
 
	* plugin_meinhardt.pro: Ditto.
 
	* plugin_test.pro: Ditto.
 

	
 
	* Makefile (clean): add if stmt not to `touch` on windows.
src/build_models/auxingrowthplugin.cpp
Show inline comments
 
@@ -30,25 +30,24 @@
 
#include "auxingrowthplugin.h"
 

	
 
#include "far_mem_5.h"
 

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

	
 
bool batch = false;
 

	
 

	
 
// To be executed after cell division
 
void AuxinGrowthPlugin::OnDivide(ParentInfo *parent_info, CellBase *daughter1, CellBase *daughter2)
 
{
 
  parent_info = NULL; // merely to obviate compile time error
 

	
 
  // Auxin distributes between parent and daughter according to area
 
  double area1 = daughter1->Area(), area2 = daughter2->Area();
 
  double tot_area = area1 + area2;
 
	
 
  daughter1->SetChemical(0,daughter1->Chemical(0)*(area1/tot_area));
 
  daughter2->SetChemical(0,daughter2->Chemical(0)*(area2/tot_area));
 
	
 
  // After divisions, parent and daughter cells get a standard stock of PINs.
 
  daughter1->SetChemical(1, par->initval[1]);
 
  daughter2->SetChemical(1, par->initval[1]);
 
	
src/build_models/meinhardtplugin.cpp
Show inline comments
 
@@ -25,28 +25,25 @@
 

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

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

	
 
bool batch = false;
 

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

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

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

	
 
  // Passive fluxes (Fick's law)
 
  for (int c=0;c<NChem();c++) {
 
    double phi = w->Length() * ( par->D[c] ) * ( w->C2()->Chemical(c) - w->C1()->Chemical(c) );
 
    dchem_c1[c] += phi; 
 
    dchem_c2[c] -= phi;
 
  }
 
}
 

	
 
void MeinhardtPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  w = NULL;
 
  for (int c = 0;c<NChem();c++) {
 
    dw1[c] = 0.; dw2[c] = 0.;
 
  }
 
}
 

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

	
 
  double Y = c->Chemical(0);
 
  double A = c->Chemical(1);
 
  double H = c->Chemical(2);
 
  double S = c->Chemical(3);
 
	
src/build_models/testplugin.cpp
Show inline comments
 
@@ -26,54 +26,38 @@
 

	
 
#include "parameter.h"
 

	
 
#include "wallbase.h"
 
#include "cellbase.h"
 
#include "testplugin.h"
 

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

	
 
bool batch = false;
 

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

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

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

	
 

	
 

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

	
 
void TestPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {
 
  w = NULL;
 
  dchem_c1 = dchem_c2 = NULL;
 
}
 
void TestPlugin::CelltoCellTransport(Wall *w, double *dchem_c1, double *dchem_c2) {}
 

	
 
void TestPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {
 
  w = NULL;
 
  dw1 = dw2 = NULL;
 
}
 
void TestPlugin::WallDynamics(Wall *w, double *dw1, double *dw2) {}
 

	
 
void TestPlugin::CellDynamics(CellBase *c, double *dchem) {
 
  c = NULL;
 
  dchem=NULL;
 
}
 
void TestPlugin::CellDynamics(CellBase *c, double *dchem) {}
 

	
 
Q_EXPORT_PLUGIN2(testplugin, TestPlugin)
 

	
 
/* finis */
src/canvas.cpp
Show inline comments
 
@@ -94,27 +94,24 @@ 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)
 
{
 
  name = NULL; // use these two assignments merely to obviate compile time warnings
 
  f = Qt::Widget;
 

	
 
  intersection_line = 0;
 
  //angle_line = 0;
 
  setInteractive(true);
 
  moving = 0;  
 
  rotation_mode = false;
 
}
 

	
 

	
 
void FigureEditor::clear()
 
{
 
  QList<QGraphicsItem *> list = scene()->items();
 
  QList<QGraphicsItem *>::Iterator it = list.begin();
src/cell.cpp
Show inline comments
 
@@ -1543,25 +1543,24 @@ void Cell::DrawAxis(QGraphicsScene *c) c
 
  line->setPen( QPen(QColor(par.arrowcolor),2) );
 
  line->setZValue(2);
 

	
 
  line->setLine( ( (offset[0]+from.x)*factor ),
 
		 ( (offset[1]+from.y)*factor ), 
 
		 ( (offset[0]+to.x)*factor ),
 
		 ( (offset[1]+to.y)*factor ) );
 
  line->setZValue(10);
 
  line->show();
 
}
 

	
 
void Cell::DrawStrain(QGraphicsScene *c) const {
 
  c = NULL; // assignment merely to obviate compilation warning
 
  MyWarning::warning("Sorry, Cell::DrawStrain temporarily not implemented.");
 
}
 

	
 

	
 
void Cell::DrawFluxes(QGraphicsScene *c, double arrowsize)
 
{
 

	
 
  // get the mean flux through this cell
 
  Vector vec_flux = ReduceCellAndWalls<Vector>( PINdir );
 

	
 
  vec_flux.Normalise();
 

	
src/cellbase.h
Show inline comments
 
@@ -444,19 +444,18 @@ class CellBase :  public QObject, public
 
  {
 
    NCells()=0;
 
  }
 

	
 
  bool marked;
 
  int div_counter;
 
};
 

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

	
 
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/forwardeuler.cpp
Show inline comments
 
@@ -49,27 +49,24 @@ const double ForwardEuler::Tiny = 1.0e-3
 

	
 
void ForwardEuler::odeint(double *ystart, int nvar, double x1, double x2, double eps, double h1, double hmin, int *nok, int *nbad)
 
/* Runge-Kutta driver with adaptive stepsize control. Integrate starting values ystart[1..nvar]
 
   from x1 to x2 with accuracy eps, storing intermediate results in global variables. h1 should
 
   be set as a guessed first stepsize, hmin as the minimum allowed stepsize (can be zero). On
 
   output nok and nbad are the number of good and bad (but retried and fixed) steps taken, and
 
   ystart is replaced byv alues at the end of the integration interval. derivs is the user-supplied
 
   routine for calculating the right-hand side derivative, while rkqs is the name of the stepper
 
   routine to be used. */
 
{
 
  static bool warning_issued = false;
 

	
 
  eps = hmin = 0.0; // use assignment merely to obviate compilation warning
 
  nbad = nok = NULL;
 

	
 
  if (!warning_issued) {
 
    cerr << "Using inaccurate method ForwardEuler\n";
 
    warning_issued=true;
 
    //MyWarning::warning("Using inaccurate method ForwardEuler");
 
  }
 
  // N.B. Not for serious use and not fully usage compatible with RungeKutta
 
  // simply for testing API of integrator.
 

	
 
  double *y,*dydx;
 
  y=new double[nvar];
 
  dydx=new double[nvar];
 
  double x=x1;
src/mainbase.h
Show inline comments
 
@@ -93,27 +93,27 @@ class MainBase  {
 
  };
 
  virtual void XMLReadSettings(xmlNode *settings);
 
  virtual void XMLReadViewport(xmlNode *viewport);
 

	
 
  virtual double getFluxArrowsize(void) { return 10.;}
 

	
 
  void Save(const char *fname, const char *format, int sizex=640, int sizey=480);
 
  void CutSAM(void);
 

	
 
  void Plot(int resize_stride=10);
 

	
 
  virtual void UserMessage(QString message, int timeout = 0) {
 
    timeout = 0; // merely to obviate 'warning unused parameter' message
 
    cerr << message.toAscii().constData() << endl;
 
  }
 

	
 
  Mesh &mesh;
 
  QTransform viewport;
 

	
 
 protected:
 
  QGraphicsScene &canvas;
 
  virtual xmlNode *XMLSettingsTree(void) const;
 
  virtual xmlNode *XMLViewportTree(QTransform &transform) const;
 
  
 
 protected:
 
  bool showcentersp;
 
  bool showmeshp;
 
  bool showbordercellp;
src/nodeitem.cpp
Show inline comments
 
@@ -44,26 +44,24 @@ NodeItem::NodeItem( Node *n, QGraphicsSc
 
void NodeItem::userMove(double dx, double dy)
 
{
 
  QGraphicsItem::moveBy( dx, dy );
 

	
 
  class_cast<Node *>(obj)->x += (dx/Cell::Magnification());
 
  class_cast<Node *>(obj)->y += (dy/Cell::Magnification());
 
}
 

	
 

	
 

	
 
void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *)
 
{
 
  option = NULL; // use assignment merely to obviate compilation warning
 

	
 
  painter->setBrush(brush);
 
  painter->setPen(Qt::NoPen);
 
  painter->drawEllipse(ellipsesize);
 
}
 

	
 

	
 
QPainterPath NodeItem::shape() const
 
{
 
  QPainterPath path;
 
  path.addEllipse(ellipsesize);
 
  return path;
 
}
src/qcanvasarrow.h
Show inline comments
 
@@ -26,27 +26,24 @@
 
#define _QCANVASARROW_H_
 

	
 
#include <QGraphicsScene>
 

	
 
class QGraphicsArrowItem : public QGraphicsLineItem {
 

	
 
 public:
 
 QGraphicsArrowItem(QGraphicsItem *parent, QGraphicsScene *c) : QGraphicsLineItem(parent, c) {};
 

	
 
  void paint ( QPainter *p, const QStyleOptionGraphicsItem *option,
 
	       QWidget *widget ) {
 

	
 
    widget = NULL; //use assignment merely to obviate compilation warning
 
    option = NULL;
 

	
 
    // construct arrow head
 
    QPointF start=line().p1();
 
    QPointF end=line().p2();
 
    QPointF mid=start + (3./4.)*(end-start);
 

	
 
    double vx=end.x()-start.x();
 
    double vy=end.y()-start.y();
 

	
 
    double length = sqrt(vx*vx+vy*vy);
 
    if (length==0) return;
 

	
 
    // perpendicular vector
src/simitembase.cpp
Show inline comments
 
@@ -18,25 +18,20 @@
 
 *  Copyright 2010 Roeland Merks.
 
 *
 
 */
 

	
 
#include <string>
 
#include <QBrush>
 
#include "simitembase.h"
 

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

	
 
SimItemBase::SimItemBase( void *v, QGraphicsScene *canvas )
 
{
 
  canvas = NULL; // use assignment merely to obviate compilation warning
 
  obj=v;
 
};
 

	
 
SimItemBase::~SimItemBase(void) {};
 

	
 

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

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