]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter/pPlotter.cxx
*** empty log message ***
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / pPlotter / pPlotter.cxx
index 81726093f4c39d38fe68d4a972afa3b65c5ed63a..643743ca0d422b17f2598dc3f523bb40cffdf430 100644 (file)
@@ -717,5 +717,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);
+               }               
+       }
+}
+
+