]> Creatis software - creaMaracasVisu.git/commitdiff
Avoid message 'taking address of temporary'
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Fri, 13 Mar 2009 13:54:08 +0000 (13:54 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Fri, 13 Mar 2009 13:54:08 +0000 (13:54 +0000)
bbtk/src/bbmaracasvisuPlotterView.cxx
bbtk/src/bbmaracasvisuViewerNV.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 );
 }
 
 //---------------------------------------------------
index c31cbda1ca18d3aaa3be72edc3894801553819c7..8208643ef4abcfa735efbada1a4567b616eb1ec4 100644 (file)
@@ -86,10 +86,10 @@ void ViewerNV::Process()
 //-------------------------------------------------------------
 void ViewerNV::CreateWidget(wxWindow* parent)
 {
-    bbtkDebugMessageInc("Core",9,"ViewerNV::CreateWidget()"<<std::endl);
-       mwxwidget = new bbwxMaracas_N_ViewersWidget( this, parent , bbGetInputIn() , &(bbGetInputnTypeView())   );
-       bbtkDebugDecTab("Core",9);
-    bbSetOutputWidget( mwxwidget );
+   bbtkDebugMessageInc("Core",9,"ViewerNV::CreateWidget()"<<std::endl);
+   mwxwidget = new bbwxMaracas_N_ViewersWidget( this, parent , bbGetInputIn() , &(bbGetInputnTypeView())       );
+   bbtkDebugDecTab("Core",9);
+   bbSetOutputWidget( mwxwidget );
 }
 
 //-------------------------------------------------------------