]> Creatis software - creaMaracasVisu.git/commitdiff
v1.0.3 Feature 1408
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Tue, 5 Jun 2012 13:48:17 +0000 (13:48 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Tue, 5 Jun 2012 13:48:17 +0000 (13:48 +0000)
  - default axis X void, automatique generation of 0,1,2,3....N
    N= size of vector axis Y

bbtk/src/bbmaracasvisuPlotterView.cxx

index 98a59d0840e1fe799482370196c48daf4a65660d..9a0ee6c22a7c3235675fde1950367814e0fa1f5a 100644 (file)
@@ -25,9 +25,22 @@ void PlotterView::CreateWidget(wxWindow* parent)
    mwxwidget->AddLayer(new pPlotterScaleX());
    mwxwidget->AddLayer(new pPlotterScaleY());
    
+       std::vector<double> inX;
+       
    // avoid 'taking address of temporary '
    //pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx
-   std::vector<double> inX = bbGetInputInX();
+       if (bbGetInputInX().size()==0)
+       {
+               int i,size=bbGetInputInY().size();
+               for(i=0;i<size;i++)
+               {
+                       inX.push_back((double)i);
+               }
+       } else {
+               
+                inX = bbGetInputInX();
+       }
+       
    std::vector<double> inY = bbGetInputInY();
       
    pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &inX, &inY );