]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx
size of upper panel
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pPlotter.cxx
index 81726093f4c39d38fe68d4a972afa3b65c5ed63a..97015de50c4af851b37f436bfddc0460d0dd52fd 100644 (file)
@@ -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<double>& greylevel,std::vector<double>& 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<double>& greylevel,
+                                                               std::vector<double>& red,
+                                                               std::vector<double>& green,
+                                                               std::vector<double>& blue)
+{
+
+       if(color_bar != NULL){
+
+               std::vector<pColorPoint*> 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);
+               }               
+       }
+}
+
+