X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FpPlotter%2FHistogramWidget.cxx;h=affe13c876cbe3c28c0a631115771bc2ce2acfc8;hb=096822cf3513065cfa25e378679339a5ae4684cf;hp=8466cdadf16b1e7d0f6b2c62c19b77e93e1761d1;hpb=3948b92b07a8992a6d04081c9649ba63e3e7d613;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx index 8466cda..affe13c 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/HistogramWidget.cxx @@ -145,6 +145,7 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint yValues[4]=0; pGraphicalFunction * tf = plotter ->getFunctionForVectors( xValues, 5, yValues, 5 ); + printf("EED %p HistogramWidget::drawTransferenceFunction %p\n", this , tf); // Including and drawing the created function in the plotter if (tf) { @@ -266,8 +267,12 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint */ bool HistogramWidget::addPointToTransferenceFunction(double x, double y) { + bool result=false; pGraphicalFunction* tf=plotter->getFunction(idTransferenceFunction); - return tf->AddPoint(x,y); +printf("EED %p HistogramWidget::addPointToTransferenceFunction tp%p x%f y%f %d\n",this, tf, x ,y, idTransferenceFunction); + if (tf!=NULL) { result=tf->AddPoint(x,y); } + + return result; } /* add a color point to the histogram @@ -294,15 +299,16 @@ HistogramWidget::HistogramWidget( wxWindow *parent, wxWindowID id, const wxPoint { // we have to erase the points pGraphicalFunction* tf=plotter->getFunction(idTransferenceFunction); - int numOfPoints=tf->getSizePoints(); - int i=numOfPoints-1;//-2; - while(i>=0) - { - tf->deletePointAt(i); - i--; - } - - } + if (tf!=NULL){ + int numOfPoints=tf->getSizePoints(); + int i=numOfPoints-1;//-2; + while(i>=0) + { + tf->deletePointAt(i); + i--; + } // while + } // if tf + } // if transferenceFunctionHasPoints //we set for actual the histogram //plotter->setActual()