]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbmaracasvisuPlotterView.cxx
Avoid message 'taking address of temporary'
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuPlotterView.cxx
index cee80abbc03277a852ce4e810d114ceffa0199de..51f36eba9a6e543f0b1921a6226b8faa307d56c1 100644 (file)
@@ -19,15 +19,21 @@ void PlotterView::Process()
 //---------------------------------------------------
 void PlotterView::CreateWidget(wxWindow* parent)
 {
-    bbtkDebugMessageInc("Core",9,"PlotterView::CreateWxWindow()"<<std::endl);
-               mwxwidget = new pPlotterWindow( parent , -1,wxDefaultPosition,  wxDefaultSize,  0 );
-               mwxwidget->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()"<<std::endl);
+    
+   mwxwidget = new pPlotterWindow( parent , -1,wxDefaultPosition,  wxDefaultSize,  0 );
+   mwxwidget->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<double> inX = bbGetInputInX();
+   std::vector<double> inY = bbGetInputInY();
+      
+   pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &inX, &inY ); 
+   mwxwidget->addFunction(pGF);
+   bbtkDebugDecTab("Core",9);
+   bbSetOutputWidget( mwxwidget );
 }
 
 //---------------------------------------------------