From: Eduardo Davila Date: Mon, 9 Jul 2012 13:08:50 +0000 (+0000) Subject: 1495 PlotterViewer , Refresh data X-Git-Tag: v1.0.4~13 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c68f4e0d9298fe538f87a974947cce470148c60b;p=creaMaracasVisu.git 1495 PlotterViewer , Refresh data --- diff --git a/bbtk/src/bbmaracasvisuPlotterView.cxx b/bbtk/src/bbmaracasvisuPlotterView.cxx index 9a0ee6c..c6fcb82 100644 --- a/bbtk/src/bbmaracasvisuPlotterView.cxx +++ b/bbtk/src/bbmaracasvisuPlotterView.cxx @@ -14,8 +14,55 @@ BBTK_BLACK_BOX_IMPLEMENTATION(PlotterView,bbtk::WxBlackBox); //--------------------------------------------------- void PlotterView::Process() { + + if (firsttime==true) + { + firsttime=false; + std::vector inX; + + // avoid 'taking address of temporary ' + //pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx + if (bbGetInputInX().size()==0) + { + int i,size=bbGetInputInY().size(); + for(i=0;i inY = bbGetInputInY(); + pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &inX, &inY ); + mwxwidget->addFunction(pGF); + } + + + + pGraphicalFunction *pGF = mwxwidget->getFunction(0); + int i,sizePoints = pGF->getSizePoints(); + for (i=0; ideletePointAt(i); + } + + double px; + sizePoints=bbGetInputInY().size(); + for (i=0; iAddNewPoint( px, bbGetInputInY()[i] ); + printf ("EED PlotterView::Process %f %f\n", px, bbGetInputInY()[i]); + } } + //--------------------------------------------------- void PlotterView::CreateWidget(wxWindow* parent) { @@ -25,27 +72,7 @@ void PlotterView::CreateWidget(wxWindow* parent) mwxwidget->AddLayer(new pPlotterScaleX()); mwxwidget->AddLayer(new pPlotterScaleY()); - std::vector inX; - - // avoid 'taking address of temporary ' - //pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx - if (bbGetInputInX().size()==0) - { - int i,size=bbGetInputInY().size(); - for(i=0;i inY = bbGetInputInY(); - - pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &inX, &inY ); - mwxwidget->addFunction(pGF); - bbtkDebugDecTab("Core",9); + bbtkDebugDecTab("Core",9); bbSetOutputWidget( mwxwidget ); } @@ -53,6 +80,7 @@ void PlotterView::CreateWidget(wxWindow* parent) void PlotterView::bbUserSetDefaultValues() { mwxwidget = NULL; + firsttime=true; } //----------------------------------------------------------------- diff --git a/bbtk/src/bbmaracasvisuPlotterView.h b/bbtk/src/bbmaracasvisuPlotterView.h index d3d0dfe..65e800a 100644 --- a/bbtk/src/bbmaracasvisuPlotterView.h +++ b/bbtk/src/bbmaracasvisuPlotterView.h @@ -22,6 +22,7 @@ class /*BBTK_EXPORT*/ PlotterView private: pPlotterWindow *mwxwidget; + bool firsttime; };