//---------------------------------------------------
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 );
}
//---------------------------------------------------
//-------------------------------------------------------------
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 );
}
//-------------------------------------------------------------