pPlotter Class Reference

#include <pPlotter.h>

Collaboration diagram for pPlotter:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 pPlotter (wxWindow *parent, int nWidth, int nHeight)
 ~pPlotter ()
void onChangeFunction (wxCommandEvent &event)
void onAddedPoint_Plotter (wxCommandEvent &event)
void onRemovedPoint_Plotter (wxCommandEvent &event)
void onMovePoint_Plotter (wxCommandEvent &event)
void onGuideLines (wxCommandEvent &event)
void onAdded_ColorPoint (wxCommandEvent &event)
void onRemoved_ColorPoint (wxCommandEvent &event)
void onMoved_ColorPoint (wxCommandEvent &event)
void onChanged_ColorPoint (wxCommandEvent &event)
void onColorBar (wxCommandEvent &event)
void onBarrange (wxCommandEvent &event)
void onActualChange_Bar (wxCommandEvent &event)
void onStartChange_Bar (wxCommandEvent &event)
void onEndChange_Bar (wxCommandEvent &event)
void onSelectionEnd (wxCommandEvent &event)
void onMovedBar (wxCommandEvent &event)
void sendTMessage (wxString theText)
wxWindow * initialize (wxWindow *parent)
void setTextMessage (wxString nMessage)
wxString getTextMessage ()
pGraphicalFunctiongetFunctionForVectors (double *vectorX, int sizeX, double *vectorY, int sizeY)
int addFunction (pGraphicalFunction *function)
void setType (int t)
pGraphicalFunctiongetFunction (int index)
void OnSize (wxSizeEvent &WXUNUSED(event))
void moveFunctions (float porcentageMinX, float porcentageMaxX)
int addFunctionToMove (pGraphicalFunction *function)
void setAll ()
int getColorPointsSize ()
void getBarColorDataAt (int index, double &x, int &red, int &green, int &blue)
bool addColorPoint (int x, int red, int green, int blue)
void eraseColorPoints ()
float getMaxShowedPorcentage ()
float getMinShowedPorcentage ()
float getActualShowedPorcentage ()
void setActual (pGraphicalFunction *nActual)
void update ()
void setPopUpMenu (bool startD, bool stopD, bool smooth, bool line, bool zoomIn, bool zoomOut, bool showPoints, bool noShowPoints, bool changeColor, bool addP, bool delPoint, bool load, bool save)
void GetValuesPointsFunction (std::vector< double > &greylevel, std::vector< double > &value, int histogramsize)
void GetValuesColorPointsFunction (std::vector< double > &greylevel, std::vector< double > &red, std::vector< double > &green, std::vector< double > &blue)

Private Attributes

pPlotterWindowm_plot
pColorBarcolor_bar
mBarRangebarrange
pGraphicalFunctionactualFunction
wxString text


Detailed Description

Definition at line 47 of file pPlotter.h.


Constructor & Destructor Documentation

pPlotter::pPlotter ( wxWindow *  parent,
int  nWidth,
int  nHeight 
)

Definition at line 98 of file pPlotter.cxx.

References mpWindow::getMaxScrX().

00099         :wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL)
00100         {
00101                 SetBackgroundColour(wxColour(255,255,255));
00102                 m_plot = new pPlotterWindow( this, -1, wxPoint(0,0), wxSize(nWidth,nHeight), wxSUNKEN_BORDER );
00103                 
00104                 // Adding the axis layers to the plotter
00105                 m_plot->AddLayer( new pPlotterScaleX() );
00106                 m_plot->AddLayer( new pPlotterScaleY() );  
00107 
00108                 // Creating the log window
00109         /*
00110            
00111                 m_log = new wxTextCtrl( panel, -1, wxT("This is the log window.\n"), wxPoint(0,0), wxSize(400,100), wxTE_MULTILINE );
00112                 // Sharing the log window of the application with the plotter widget    
00113                 m_plot->setmLog(m_log);
00114                 
00115                 */
00116 
00117 
00118                 // Creating a function for the plotter with given points x-vector and y-vector
00119 
00120                 /*
00121                 double vectX_F1 [] = { 0, 20, 50, 80, 100, 115, 120, 210, 220,250 };
00122 
00123                 
00124 //              double vectX_F1 [] = { 0, 20, 50, 80, 100, 115, 120, 210, 220,250 };
00125 
00126                 double vectY_F1 [] = { 0, 40, 70, 100, 200, 100, 40, 170, 0, 50  };
00127                 pGraphicalFunction * f1 = m_plot ->getFunctionForVectors( vectX_F1, 10, vectY_F1, 10 ); 
00128                 // Including and drawing the created function in the plotter
00129                 if (f1)
00130                 {
00131                         m_plot->addFunction( f1 );
00132                         m_plot->addFunctionToMove(f1);
00133                         //m_plot->addFunctionToMove(f1);
00134                         wxPen mypen1(*wxBLUE, 2, wxDOT_DASH );
00135                         mypen1.SetWidth(2);
00136                         f1->SetPen( mypen1 );
00137                 }
00138                 */
00139                 
00140                 //=================== lines to sychronyze the bars width with the drawed plotter--------------------------
00141 
00142                 mpWindow* mplotWindow = ((mpWindow*)m_plot);
00143                 float minReal_X = 0; //(float)mplotWindow->getMinScrX();
00144                 float maxReal_X =(float)mplotWindow->getMaxScrX();
00145                 //float scrX=(float)mplotWindow->GetScrX()-100; // JPRx
00146                 //double scaleX=(scrX/(maxReal_X))* (mplotWindow->getZoomFactor()); // JPRx
00147                         
00148                 // Creating the color bar with values according to the plotter added widget
00149                 color_bar = new pColorBar(this, (m_plot->GetSize()).GetWidth(),40, true);
00150                 color_bar -> setRepresentedValues ((int)minReal_X, (int)maxReal_X);
00151                 color_bar -> setDeviceBlitStart (70,0);
00152                 color_bar -> setVisibleRange ((int)minReal_X,(int) maxReal_X);
00153                 color_bar -> setDeviceEndMargin (50);
00154                 
00155                 
00156                 // Creating the min-max barrange bar with values according to the plotter added widget
00157                 barrange = new mBarRange(this, (m_plot->GetSize()).GetWidth(),30);
00158                 barrange -> setVisibleLabels (false);
00159                 barrange -> setRepresentedValues (minReal_X, maxReal_X);
00160                 barrange -> setDeviceBlitStart (70,0);
00161                 barrange -> setDeviceEndMargin (50);
00162 
00163                 // Adding the components to the sizer 
00164                 /*
00165                 if(m_plot->getActualFunction())
00166                         setAll();
00167                 */      
00168                 wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
00169                 sizer->Add( m_plot, 4, wxEXPAND);       
00170                 sizer->Add( color_bar,0, wxEXPAND );
00171                 sizer->Add( barrange, 0, wxEXPAND );
00172 
00173                 // sizer->Add( m_log, 0, wxEXPAND);
00174                 
00175                 // Stablishing the layout and sizer of the panel
00176                 /*panel->*/SetAutoLayout(true);
00177                 /*panel->*/SetSizer(sizer);
00178                 /*panel->*/Layout();
00179 
00180                 /*panel->*/Refresh();
00181         }

Here is the call graph for this function:

pPlotter::~pPlotter (  ) 

Definition at line 184 of file pPlotter.cxx.

00185         {
00186 
00187         }


Member Function Documentation

void pPlotter::onChangeFunction ( wxCommandEvent &  event  ) 

Definition at line 316 of file pPlotter.cxx.

References actualFunction, barrange, color_bar, pPlotterWindow::getActualFunction(), pGraphicalFunction::getMaxX(), pGraphicalFunction::getMaxXShowed(), pGraphicalFunction::getMinX(), pGraphicalFunction::getMinXShowed(), mBarRange::isActive(), m_plot, pColorBar::reinitiateColorBarTo(), sendTMessage(), mBarRange::SetEnd(), mBarRange::SetStart(), and text.

00317 {
00318         actualFunction = m_plot->getActualFunction();
00319         
00320         if (actualFunction != NULL)
00321         {
00322                 if( !barrange->isActive() )
00323                 {
00324                         barrange -> setActiveStateTo(true);
00325                         color_bar -> setActiveStateTo(true);
00326                 }
00327 
00328                 text.Clear();
00329                 text = _T("Last event was on plotter: function changed, minX=");
00330                 double realMin_X = actualFunction->getMinX();
00331                 text << realMin_X;      
00332                 text << _T(" maxX=");
00333                 double realMax_X = actualFunction->getMaxX();
00334                 text << realMax_X;
00335 
00336                 int minShowed = actualFunction->getMinXShowed();
00337                 int maxShowed = actualFunction->getMaxXShowed();
00338 
00339                 barrange -> setRepresentedValues (realMin_X, realMax_X);
00340                 barrange->SetStart( minShowed );
00341                 barrange->SetEnd( maxShowed );
00342                 
00343                 std::vector<pColorPoint *> actualColorPoints;
00344                 actualFunction -> getColorPoints(actualColorPoints);
00345                 if(actualColorPoints.empty())
00346                         color_bar ->reinitiateColorBar (realMin_X, realMax_X);
00347                 else
00348                         color_bar ->reinitiateColorBarTo(actualColorPoints);
00349 
00350                 color_bar -> setVisibleRange ((int)realMin_X, maxShowed);
00351                 
00352                 // Refresh
00353                 color_bar -> RefreshForce();
00354                 barrange -> RefreshForce();     
00355                 
00356                 sendTMessage(text);
00357         }
00358 }

Here is the call graph for this function:

void pPlotter::onAddedPoint_Plotter ( wxCommandEvent &  event  ) 

Definition at line 365 of file pPlotter.cxx.

References m_plot, sendTMessage(), text, and pPlotterWindow::writeInText().

00366 {
00367         text.Clear();
00368         m_plot->writeInText(text);
00369         sendTMessage(text);
00370 }

Here is the call graph for this function:

void pPlotter::onRemovedPoint_Plotter ( wxCommandEvent &  event  ) 

Definition at line 375 of file pPlotter.cxx.

References m_plot, sendTMessage(), text, and pPlotterWindow::writeInText().

00376 {
00377         text.Clear();
00378         m_plot->writeInText(text);
00379         sendTMessage(text);     
00380 }

Here is the call graph for this function:

void pPlotter::onMovePoint_Plotter ( wxCommandEvent &  event  ) 

Definition at line 385 of file pPlotter.cxx.

References m_plot, sendTMessage(), text, and pPlotterWindow::writeInText().

00386 {
00387         text.Clear();
00388         m_plot->writeInText(text);
00389         sendTMessage(text);
00390 }

Here is the call graph for this function:

void pPlotter::onGuideLines ( wxCommandEvent &  event  ) 

Definition at line 394 of file pPlotter.cxx.

00395 {
00396                 
00397 }

void pPlotter::onAdded_ColorPoint ( wxCommandEvent &  event  ) 

Definition at line 246 of file pPlotter.cxx.

References actualFunction, color_bar, pPlotterWindow::getActualFunction(), pColorBar::getAddedColorsPointsList(), m_plot, sendTMessage(), and text.

00247 {
00248         text.Clear();
00249         text = _T( "Last event was on color bar: Color point added, total#");
00250         
00251         actualFunction = m_plot->getActualFunction();
00252         if(actualFunction!=NULL)
00253         {               
00254                 std::vector<pColorPoint *> actualColorPoints;
00255                 color_bar ->getAddedColorsPointsList(actualColorPoints);
00256                 actualFunction -> setColorPoints(actualColorPoints);
00257                 text << actualColorPoints.size();
00258 
00259                 sendTMessage(text);
00260         }
00261 }

Here is the call graph for this function:

void pPlotter::onRemoved_ColorPoint ( wxCommandEvent &  event  ) 

Definition at line 262 of file pPlotter.cxx.

References actualFunction, color_bar, pPlotterWindow::getActualFunction(), pColorBar::getAddedColorsPointsList(), m_plot, sendTMessage(), and text.

00263 {       
00264         text.Clear();
00265         text = _T( "Last event on color bar: Color point removed total#");
00266 
00267         actualFunction = m_plot->getActualFunction();
00268         std::vector<pColorPoint *> actualColorPoints;
00269         color_bar ->getAddedColorsPointsList(actualColorPoints);
00270         actualFunction -> setColorPoints(actualColorPoints);
00271         text << actualColorPoints.size();
00272         
00273         sendTMessage(text);
00274 }

Here is the call graph for this function:

void pPlotter::onMoved_ColorPoint ( wxCommandEvent &  event  ) 

Definition at line 275 of file pPlotter.cxx.

References barrange, color_bar, pColorBar::getLastMovedColorPoint(), m_plot, sendTMessage(), mpWindow::setRealGuideX(), mBarRange::setRealX_vertical_line(), text, and mpWindow::UpdateAll().

00276 {
00277         text.Clear();
00278         text = _T( "Last event was on color bar: Color point moved to: ");
00279         int lastReal_X = (int)(color_bar->getLastMovedColorPoint())->getRealX();
00280         text << lastReal_X;
00281         
00282         barrange ->setRealX_vertical_line (lastReal_X);
00283         barrange -> RefreshForce();
00284         
00285         m_plot->setRealGuideX (lastReal_X);
00286         m_plot->UpdateAll();
00287         
00288         sendTMessage(text);
00289 }

Here is the call graph for this function:

void pPlotter::onChanged_ColorPoint ( wxCommandEvent &  event  ) 

Definition at line 290 of file pPlotter.cxx.

References sendTMessage(), and text.

00291 {
00292     text.Clear();
00293         sendTMessage(_T("Last event was on color bar: Color point changed color"));
00294 }

Here is the call graph for this function:

void pPlotter::onColorBar ( wxCommandEvent &  event  ) 

Definition at line 296 of file pPlotter.cxx.

References barrange, mBarRange::getRealX_vertical_line(), m_plot, mpWindow::setRealGuideX(), mBarRange::setRealX_vertical_line(), and mpWindow::UpdateAll().

00297 {
00298         if( (barrange->getRealX_vertical_line())!=-1)
00299         {
00300                 barrange ->setRealX_vertical_line (-1); 
00301                 m_plot->setRealGuideX (-1);
00302 
00303                 barrange -> RefreshForce();
00304                 m_plot->UpdateAll();
00305         }
00306 }

Here is the call graph for this function:

void pPlotter::onBarrange ( wxCommandEvent &  event  ) 

Definition at line 407 of file pPlotter.cxx.

00408 {
00409                 
00410 }

void pPlotter::onActualChange_Bar ( wxCommandEvent &  event  ) 

Definition at line 414 of file pPlotter.cxx.

References barrange, color_bar, mBarRange::GetActual(), m_plot, sendTMessage(), mpWindow::setRealGuideX(), pColorBar::setRealX_vertical_line(), text, and mpWindow::UpdateAll().

00415 {
00416         text.Clear();
00417         text = _T( "Last event was on min-max bar: Actual triangle moved to: " );
00418         int lastActual_X = barrange->GetActual();
00419 
00420         text << lastActual_X;
00421         
00422         color_bar ->setRealX_vertical_line (lastActual_X);
00423         m_plot->setRealGuideX (lastActual_X);
00424 
00425         color_bar -> RefreshForce();    
00426         m_plot->UpdateAll();
00427 
00428         sendTMessage(text);
00429 }

Here is the call graph for this function:

void pPlotter::onStartChange_Bar ( wxCommandEvent &  event  ) 

Definition at line 434 of file pPlotter.cxx.

References pPlotterWindow::actualizeViewRange(), barrange, color_bar, mBarRange::getEndShowPorcentage(), mpWindow::getMaxScrX(), mBarRange::GetStart(), mBarRange::getStartShowPorcentage(), m_plot, pPlotterWindow::moveFunctions(), sendTMessage(), and text.

00435 {
00436         text.Clear();
00437     
00438         text = _T( "Last event was on min-max bar: Start triangle moved to: ");
00439         int realMin_X = barrange->GetStart();
00440         text += wxString::Format(_T("%d"), realMin_X);  
00441         double realMax_X = m_plot->getMaxScrX();
00442         
00443         color_bar -> setVisibleRange (realMin_X, (int)realMax_X);
00444         
00445         m_plot->actualizeViewRange(realMin_X, (int)realMax_X);
00446         
00447         //setting the plotter for draw the functions that
00448         //it has to move.
00449         
00450         float startP=(float)barrange->getStartShowPorcentage();
00451         float endP=(float)barrange->getEndShowPorcentage();
00452         m_plot->moveFunctions(startP,endP);
00453         
00454         //Updating
00455         color_bar -> RefreshForce();
00456         m_plot -> UpdateAll();
00457         sendTMessage(text);
00458 }

Here is the call graph for this function:

void pPlotter::onEndChange_Bar ( wxCommandEvent &  event  ) 

Definition at line 460 of file pPlotter.cxx.

References pPlotterWindow::actualizeViewRange(), barrange, color_bar, mBarRange::GetEnd(), mBarRange::getEndShowPorcentage(), mpWindow::getMinScrX(), mBarRange::getStartShowPorcentage(), m_plot, pPlotterWindow::moveFunctions(), sendTMessage(), and text.

00461 {
00462         text.Clear();
00463         text += _T("Last event was on min-max bar: End  triangle moved to: ");
00464         int realMax_X = barrange->GetEnd();
00465         text += wxString::Format(_T("%d"),realMax_X);   
00466         double realMin_X = m_plot->getMinScrX();
00467         color_bar -> setVisibleRange ((int)realMin_X, realMax_X);
00468         m_plot->actualizeViewRange((int)realMin_X,realMax_X);
00469         
00470         float startP=(float)barrange->getStartShowPorcentage();
00471         float endP=(float)barrange->getEndShowPorcentage();
00472         m_plot->moveFunctions(startP,endP);
00473         
00474         color_bar -> RefreshForce();
00475         m_plot -> UpdateAll();
00476 
00477         sendTMessage(text);
00478 }

Here is the call graph for this function:

void pPlotter::onSelectionEnd ( wxCommandEvent &  event  ) 

Definition at line 480 of file pPlotter.cxx.

References color_bar, pColorBar::getRealX_vertical_line(), m_plot, mpWindow::setRealGuideX(), pColorBar::setRealX_vertical_line(), and mpWindow::UpdateAll().

00481 {
00482         if( (color_bar->getRealX_vertical_line())!=-1)
00483         {
00484                 color_bar ->setRealX_vertical_line (-1);        
00485                 m_plot->setRealGuideX (-1);
00486 
00487                 color_bar -> RefreshForce();
00488                 m_plot->UpdateAll();    
00489         }
00490 }

Here is the call graph for this function:

void pPlotter::onMovedBar ( wxCommandEvent &  event  ) 

Definition at line 491 of file pPlotter.cxx.

References barrange, color_bar, mBarRange::GetEnd(), mBarRange::getEndShowPorcentage(), mBarRange::GetStart(), mBarRange::getStartShowPorcentage(), m_plot, pPlotterWindow::moveFunctions(), sendTMessage(), and text.

00492 {
00493         text.Clear();
00494         text = _T( "Last event was on min-max bar: Moved bar to min:" );
00495         
00496         int realMin_X = barrange->GetStart();
00497         text +=  wxString::Format(_T("%d"),realMin_X);  
00498         text +=  _T(" max:");
00499 
00500         int realMax_X = barrange->GetEnd();
00501         text +=  wxString::Format(_T("%d"),realMax_X);
00502 
00503         color_bar -> setVisibleRange (realMin_X, realMax_X);
00504         
00505         float startP=(float)barrange->getStartShowPorcentage();
00506         float endP=(float)barrange->getEndShowPorcentage();
00507         m_plot->moveFunctions(startP,endP);
00508         
00509         color_bar -> RefreshForce();
00510         m_plot -> UpdateAll();
00511 
00512         sendTMessage(text);
00513 }

Here is the call graph for this function:

void pPlotter::sendTMessage ( wxString  theText  ) 

Definition at line 519 of file pPlotter.cxx.

Referenced by onActualChange_Bar(), onAdded_ColorPoint(), onAddedPoint_Plotter(), onChanged_ColorPoint(), onChangeFunction(), onEndChange_Bar(), onMoved_ColorPoint(), onMovedBar(), onMovePoint_Plotter(), onRemoved_ColorPoint(), onRemovedPoint_Plotter(), onStartChange_Bar(), and setAll().

00520 {
00521         //Creating a message event 
00522         wxCommandEvent puntualMSG_Event( wxEVT_NW_TEXT_MESAGGE, GetId() );
00523         puntualMSG_Event.SetEventObject(this);
00524         //Sending the event
00525         GetEventHandler()->ProcessEvent( puntualMSG_Event );
00526 }

Here is the caller graph for this function:

wxWindow* pPlotter::initialize ( wxWindow *  parent  ) 

void pPlotter::setTextMessage ( wxString  nMessage  ) 

Definition at line 532 of file pPlotter.cxx.

References text.

00533         {
00534                 text = nMessage;
00535         }

wxString pPlotter::getTextMessage (  ) 

Definition at line 541 of file pPlotter.cxx.

References text.

00542         {
00543                 return text;
00544         }

pGraphicalFunction * pPlotter::getFunctionForVectors ( double *  vectorX,
int  sizeX,
double *  vectorY,
int  sizeY 
)

Creates and returns a graphical funcion according to the indicated vectors.

Definition at line 556 of file pPlotter.cxx.

References pPlotterWindow::getFunctionForVectors(), and m_plot.

Referenced by HistogramWidget::drawHistogram(), and HistogramWidget::drawTransferenceFunction().

00557         {
00558                 return m_plot->getFunctionForVectors(vectorX,sizeX, vectorY, sizeY );
00559         }

Here is the call graph for this function:

Here is the caller graph for this function:

int pPlotter::addFunction ( pGraphicalFunction function  ) 

Add a function to the plotter when the function doesnt come from window

Definition at line 549 of file pPlotter.cxx.

References pPlotterWindow::addFunction(), and m_plot.

Referenced by HistogramWidget::drawHistogram(), and HistogramWidget::drawTransferenceFunction().

00550         {
00551                 return m_plot->addFunction(function);  
00552         }

Here is the call graph for this function:

Here is the caller graph for this function:

void pPlotter::setType ( int  t  ) 

Definition at line 563 of file pPlotter.cxx.

References m_plot, and mpWindow::setType().

Referenced by HistogramWidget::HistogramWidget().

00564         {
00565                 m_plot->setType(t);
00566         }

Here is the call graph for this function:

Here is the caller graph for this function:

pGraphicalFunction * pPlotter::getFunction ( int  index  ) 

Definition at line 570 of file pPlotter.cxx.

References pPlotterWindow::getFunction(), and m_plot.

Referenced by HistogramWidget::addPointToTransferenceFunction(), HistogramWidget::erasePointsTransferenceFunction(), HistogramWidget::getActualShowedPorcentage(), HistogramWidget::getMaxShowedPorcentage(), HistogramWidget::getMinShowedPorcentage(), HistogramWidget::getSizeTransferenceFunction(), HistogramWidget::getTransferenceFunctionPoint(), and HistogramWidget::OnSize().

00571         {
00572                 return m_plot->getFunction(index);
00573         }

Here is the call graph for this function:

Here is the caller graph for this function:

void pPlotter::OnSize ( wxSizeEvent &  WXUNUSED(event)  ) 

void pPlotter::moveFunctions ( float  porcentageMinX,
float  porcentageMaxX 
)

Definition at line 591 of file pPlotter.cxx.

References m_plot, and pPlotterWindow::moveFunctions().

00592         {
00593                 m_plot->moveFunctions(porcentageMinX,porcentageMaxX);
00594         }

Here is the call graph for this function:

int pPlotter::addFunctionToMove ( pGraphicalFunction function  ) 

Definition at line 577 of file pPlotter.cxx.

References pPlotterWindow::addFunctionToMove(), and m_plot.

Referenced by HistogramWidget::drawHistogram(), and HistogramWidget::drawTransferenceFunction().

00578         {
00579                 return m_plot->addFunctionToMove(function);
00580         }

Here is the call graph for this function:

Here is the caller graph for this function:

void pPlotter::setAll (  ) 

Definition at line 196 of file pPlotter.cxx.

References actualFunction, barrange, color_bar, pPlotterWindow::getActualFunction(), pGraphicalFunction::getMaxX(), pGraphicalFunction::getMaxXShowed(), pGraphicalFunction::getMinX(), pGraphicalFunction::getMinXShowed(), m_plot, pColorBar::reinitiateColorBarTo(), sendTMessage(), mBarRange::SetEnd(), mBarRange::SetStart(), and text.

00197 {
00198         actualFunction = m_plot->getActualFunction();
00199 
00200         if (actualFunction != NULL)
00201         {
00202                 barrange -> setActiveStateTo(true);
00203                 color_bar -> setActiveStateTo(true);
00204 
00205                 text.Clear();
00206                 text = _T("minX=");
00207                 double realMin_X = actualFunction->getMinX();
00208                 text = text + realMin_X;        
00209                 text = text + _T(" maxX=");
00210                 double realMax_X = actualFunction->getMaxX();
00211                 text = text + realMax_X;
00212 
00213                 int minShowed = actualFunction->getMinXShowed();
00214                 int maxShowed = actualFunction->getMaxXShowed();
00215 
00216                 barrange -> setRepresentedValues (realMin_X, realMax_X);
00217                 barrange->SetStart( minShowed );
00218                 barrange->SetEnd( maxShowed );
00219 
00220 
00221                 std::vector<pColorPoint *> actualColorPoints;
00222                 actualFunction -> getColorPoints(actualColorPoints);
00223                 if(actualColorPoints.empty())
00224                         color_bar ->reinitiateColorBar (realMin_X, realMax_X);
00225                 else
00226                         color_bar ->reinitiateColorBarTo(actualColorPoints);
00227 
00228                 color_bar -> setVisibleRange (minShowed, maxShowed);
00229                 
00230                 // Refresh
00231                 color_bar -> RefreshForce();
00232                 barrange -> RefreshForce();     
00233                 
00234                 sendTMessage(text);
00235         }
00236 }

Here is the call graph for this function:

int pPlotter::getColorPointsSize (  ) 

Returns the number of points that the bar color has

Definition at line 612 of file pPlotter.cxx.

References color_bar, and pColorBar::getColorPointsSize().

Referenced by HistogramWidget::getSizeBarColor().

00613         {
00614                 return color_bar->getColorPointsSize();
00615         }

Here is the call graph for this function:

Here is the caller graph for this function:

void pPlotter::getBarColorDataAt ( int  index,
double &  x,
int &  red,
int &  green,
int &  blue 
)

Definition at line 620 of file pPlotter.cxx.

References color_bar, and pColorBar::getDataAt().

Referenced by HistogramWidget::getDataBarColorPoint().

00621         {
00622                 color_bar->getDataAt(index,x,red,green,blue);
00623         }

Here is the call graph for this function:

Here is the caller graph for this function:

bool pPlotter::addColorPoint ( int  x,
int  red,
int  green,
int  blue 
)

Definition at line 629 of file pPlotter.cxx.

References pColorBar::addColorPoint(), and color_bar.

Referenced by HistogramWidget::addColorPoint().

00630         {
00631                 wxColour color= wxColour(red,green,blue);
00632                 return color_bar->addColorPoint((double)x, color);
00633         }

Here is the call graph for this function:

Here is the caller graph for this function:

void pPlotter::eraseColorPoints (  ) 

Definition at line 634 of file pPlotter.cxx.

References color_bar, pColorBar::getMaxValue(), pColorBar::getMinValue(), min, and pColorBar::reinitiateColorBar().

Referenced by HistogramWidget::eraseColorPoints().

00635         {
00636                 int min=(int)color_bar->getMinValue();
00637                 int max=(int)color_bar->getMaxValue();
00638                 color_bar->reinitiateColorBar(min,max);
00639         }

Here is the call graph for this function:

Here is the caller graph for this function:

float pPlotter::getMaxShowedPorcentage (  ) 

Definition at line 644 of file pPlotter.cxx.

References barrange, and mBarRange::getEndShowPorcentage().

Referenced by HistogramWidget::getMaxShowedPorcentage().

00645         {
00646                 return barrange->getEndShowPorcentage();
00647         }

Here is the call graph for this function:

Here is the caller graph for this function:

float pPlotter::getMinShowedPorcentage (  ) 

Definition at line 648 of file pPlotter.cxx.

References barrange, and mBarRange::getStartShowPorcentage().

Referenced by HistogramWidget::getActualShowedPorcentage(), and HistogramWidget::getMinShowedPorcentage().

00649         {
00650                 return barrange->getStartShowPorcentage();
00651         }

Here is the call graph for this function:

Here is the caller graph for this function:

float pPlotter::getActualShowedPorcentage (  ) 

Definition at line 652 of file pPlotter.cxx.

References barrange, and mBarRange::getActualShowPorcentage().

00653         {
00654                 return barrange->getActualShowPorcentage();
00655         }

Here is the call graph for this function:

void pPlotter::setActual ( pGraphicalFunction nActual  ) 

Definition at line 660 of file pPlotter.cxx.

References m_plot, and pPlotterWindow::setActualFunction().

00661         {
00662                 m_plot->setActualFunction(nActual);
00663         }

Here is the call graph for this function:

void pPlotter::update (  ) 

Definition at line 664 of file pPlotter.cxx.

References pGraphicalFunction::addSplinesPoints(), pGraphicalFunction::clearSplineVectors(), pPlotterWindow::getActualFunction(), pGraphicalFunction::getType(), mpWindow::getType(), pGraphicalFunction::initializeSplineVectors(), m_plot, and mpWindow::UpdateAll().

Referenced by HistogramWidget::updatePlotter().

00665         {
00666                 //if it is a plotter of histograms
00667                 if(m_plot->getType()==2)
00668                 {
00669                         pGraphicalFunction* tf= m_plot->getActualFunction();
00670                         if(tf->getType()==2)
00671                         {
00672                                 tf->clearSplineVectors();
00673                                 tf->addSplinesPoints();
00674                                 tf->initializeSplineVectors();
00675                         }
00676                 }
00677 
00678                 m_plot->UpdateAll();
00679         }

Here is the call graph for this function:

Here is the caller graph for this function:

void pPlotter::setPopUpMenu ( bool  startD,
bool  stopD,
bool  smooth,
bool  line,
bool  zoomIn,
bool  zoomOut,
bool  showPoints,
bool  noShowPoints,
bool  changeColor,
bool  addP,
bool  delPoint,
bool  load,
bool  save 
)

Definition at line 684 of file pPlotter.cxx.

References m_plot, and pPlotterWindow::setPopUpMenu().

Referenced by HistogramWidget::HistogramWidget().

00687         {
00688                 m_plot->setPopUpMenu(startD, stopD, smooth, line,  zoomIn,
00689                                            zoomOut, showPoints, noShowPoints, changeColor,  addP,
00690                                            delPoint, load, save);
00691         }

Here is the call graph for this function:

Here is the caller graph for this function:

void pPlotter::GetValuesPointsFunction ( std::vector< double > &  greylevel,
std::vector< double > &  value,
int  histogramsize 
)

Returns two vectors, the grey level of the point and its value, the value is between [0,1]

Definition at line 723 of file pPlotter.cxx.

References actualFunction, pGraphicalFunction::getScaleY(), pGraphicalFunction::getSizePoints(), pGraphicalFunction::getX_RealValues(), and pGraphicalFunction::getY_RealValues().

Referenced by HistogramWidget::GetValuesPointsFunction().

00724 {
00725         if(actualFunction != NULL){
00726                 double* xval = actualFunction->getX_RealValues();
00727                 double* yval = actualFunction->getY_RealValues();
00728 
00729                 actualFunction->getScaleY();
00730                 for(int i = 0; i < actualFunction->getSizePoints();i++){
00731                         greylevel.push_back(xval[i]);
00732                         value.push_back(yval[i]/histogramsize);
00733                 }
00734         }
00735 }

Here is the call graph for this function:

Here is the caller graph for this function:

void pPlotter::GetValuesColorPointsFunction ( std::vector< double > &  greylevel,
std::vector< double > &  red,
std::vector< double > &  green,
std::vector< double > &  blue 
)

Returns two vectors, the grey level of the point and its value, the red, green and blue value is between [0,1]

Definition at line 741 of file pPlotter.cxx.

References color_bar, pColorBar::getAddedColorsPointsList(), pColorPoint::getColor(), and pColorPoint::getRealX().

Referenced by HistogramWidget::GetValuesColorPointsFunction().

00745 {
00746 
00747         if(color_bar != NULL){
00748 
00749                 std::vector<pColorPoint*> colors;
00750         color_bar->getAddedColorsPointsList(colors);
00751 
00752                 for(int i = 0; i < colors.size();i++){
00753                         pColorPoint* pcolor = colors[i];
00754 
00755                         greylevel.push_back(pcolor->getRealX());
00756                         wxColour colour = pcolor->getColor();
00757                         
00758                         double _red = (double)(colour.Red())/255.0;
00759                         double _green = (double)(colour.Green())/255.0;
00760                         double _blue = (double)(colour.Blue())/255.0;
00761 
00762                         red.push_back(_red);
00763                         green.push_back(_green);
00764                         blue.push_back(_blue);
00765                 }               
00766         }
00767 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

pPlotterWindow* pPlotter::m_plot [private]

Definition at line 230 of file pPlotter.h.

Referenced by addFunction(), addFunctionToMove(), getFunction(), getFunctionForVectors(), moveFunctions(), onActualChange_Bar(), onAdded_ColorPoint(), onAddedPoint_Plotter(), onChangeFunction(), onColorBar(), onEndChange_Bar(), onMoved_ColorPoint(), onMovedBar(), onMovePoint_Plotter(), onRemoved_ColorPoint(), onRemovedPoint_Plotter(), onSelectionEnd(), onStartChange_Bar(), setActual(), setAll(), setPopUpMenu(), setType(), and update().

pColorBar* pPlotter::color_bar [private]

Definition at line 234 of file pPlotter.h.

Referenced by addColorPoint(), eraseColorPoints(), getBarColorDataAt(), getColorPointsSize(), GetValuesColorPointsFunction(), onActualChange_Bar(), onAdded_ColorPoint(), onChangeFunction(), onEndChange_Bar(), onMoved_ColorPoint(), onMovedBar(), onRemoved_ColorPoint(), onSelectionEnd(), onStartChange_Bar(), and setAll().

mBarRange* pPlotter::barrange [private]

Definition at line 238 of file pPlotter.h.

Referenced by getActualShowedPorcentage(), getMaxShowedPorcentage(), getMinShowedPorcentage(), onActualChange_Bar(), onChangeFunction(), onColorBar(), onEndChange_Bar(), onMoved_ColorPoint(), onMovedBar(), onStartChange_Bar(), and setAll().

pGraphicalFunction* pPlotter::actualFunction [private]

Definition at line 242 of file pPlotter.h.

Referenced by GetValuesPointsFunction(), onAdded_ColorPoint(), onChangeFunction(), onRemoved_ColorPoint(), and setAll().

wxString pPlotter::text [private]

Definition at line 247 of file pPlotter.h.

Referenced by getTextMessage(), onActualChange_Bar(), onAdded_ColorPoint(), onAddedPoint_Plotter(), onChanged_ColorPoint(), onChangeFunction(), onEndChange_Bar(), onMoved_ColorPoint(), onMovedBar(), onMovePoint_Plotter(), onRemoved_ColorPoint(), onRemovedPoint_Plotter(), onStartChange_Bar(), setAll(), and setTextMessage().


The documentation for this class was generated from the following files:
Generated on Wed Jul 29 16:36:07 2009 for creaMaracasVisu_lib by  doxygen 1.5.3