X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbmaracasvisuPlotterView.cxx;h=51f36eba9a6e543f0b1921a6226b8faa307d56c1;hb=21c2226cf3dcad1daf3fb04818583b559694fa81;hp=b760826ae1b330f8022d94cb0c3892236a37645a;hpb=de5cb63cdc23317a114c77f7b6184126d7988508;p=creaMaracasVisu.git diff --git a/bbtk/src/bbmaracasvisuPlotterView.cxx b/bbtk/src/bbmaracasvisuPlotterView.cxx index b760826..51f36eb 100644 --- a/bbtk/src/bbmaracasvisuPlotterView.cxx +++ b/bbtk/src/bbmaracasvisuPlotterView.cxx @@ -19,20 +19,27 @@ void PlotterView::Process() //--------------------------------------------------- void PlotterView::CreateWidget(wxWindow* parent) { - bbtkDebugMessageInc("Core",9,"PlotterView::CreateWxWindow()"<AddLayer(new pPlotterScaleX()); - mwxwidget->AddLayer(new pPlotterScaleY()); - pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx - - mwxwidget->addFunction(pGF); - bbtkDebugDecTab("Core",9); - bbSetOutputWidget( mwxwidget ); + bbtkDebugMessageInc("Core",9,"PlotterView::CreateWxWindow()"<AddLayer(new pPlotterScaleX()); + mwxwidget->AddLayer(new pPlotterScaleY()); + + // avoid 'taking address of temporary ' + //pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx + std::vector inX = bbGetInputInX(); + std::vector inY = bbGetInputInY(); + + pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &inX, &inY ); + mwxwidget->addFunction(pGF); + bbtkDebugDecTab("Core",9); + bbSetOutputWidget( mwxwidget ); } //--------------------------------------------------- void PlotterView::bbUserConstructor() { + mwxwidget = NULL; } //---------------------------------------------------