X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FpPlotter%2FpPlotter.cxx;h=97015de50c4af851b37f436bfddc0460d0dd52fd;hb=acaa3bc3e713898cad44e2a3a40dcd4269bcc3a2;hp=81726093f4c39d38fe68d4a972afa3b65c5ed63a;hpb=8e7ab74a199d1f05b01dccfb75da7f2c4754ddc5;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx index 8172609..97015de 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx @@ -100,7 +100,7 @@ END_EVENT_TABLE() { SetBackgroundColour(wxColour(255,255,255)); m_plot = new pPlotterWindow( this, -1, wxPoint(0,0), wxSize(nWidth,nHeight), wxSUNKEN_BORDER ); - + actualFunction =NULL; // Adding the axis layers to the plotter m_plot->AddLayer( new pPlotterScaleX() ); m_plot->AddLayer( new pPlotterScaleY() ); @@ -182,8 +182,9 @@ END_EVENT_TABLE() pPlotter :: ~pPlotter () - { - + { + + } //--------------------------------------------------------------------------------------------- @@ -717,5 +718,55 @@ void pPlotter :: sendTMessage(wxString theText) */ +/** +** Returns two vectors, the grey level of the point and its value, the value is between [0,1] +**/ +void pPlotter::GetValuesPointsFunction(std::vector& greylevel,std::vector& value, int histogramsize) +{ + if(actualFunction != NULL){ + double* xval = actualFunction->getX_RealValues(); + double* yval = actualFunction->getY_RealValues(); + + actualFunction->getScaleY(); + for(int i = 0; i < actualFunction->getSizePoints();i++){ + greylevel.push_back(xval[i]); + value.push_back(yval[i]/histogramsize); + } + } +} + +/** +** Returns two vectors, the grey level of the point and its value, the red, green +** and blue value is between [0,1] +**/ +void pPlotter::GetValuesColorPointsFunction(std::vector& greylevel, + std::vector& red, + std::vector& green, + std::vector& blue) +{ + + if(color_bar != NULL){ + + std::vector colors; + color_bar->getAddedColorsPointsList(colors); + + for(int i = 0; i < colors.size();i++){ + pColorPoint* pcolor = colors[i]; + + greylevel.push_back(pcolor->getRealX()); + wxColour colour = pcolor->getColor(); + + double _red = (double)(colour.Red())/255.0; + double _green = (double)(colour.Green())/255.0; + double _blue = (double)(colour.Blue())/255.0; + + red.push_back(_red); + green.push_back(_green); + blue.push_back(_blue); + } + } +} + +