]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuPlotterView.cxx
.
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuPlotterView.cxx
1 #include "bbmaracasvisuPlotterView.h"
2 #include "bbcreaMaracasVisuPackage.h"
3
4 #include "pPlotterScaleX.h"
5 #include "pPlotterScaleY.h"
6
7
8 namespace bbcreaMaracasVisu
9 {
10
11 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,PlotterView)
12 BBTK_BLACK_BOX_IMPLEMENTATION(PlotterView,bbtk::WxBlackBox);
13
14 //---------------------------------------------------
15 void PlotterView::Process()
16 {
17 }
18
19 //---------------------------------------------------
20 void PlotterView::CreateWidget(wxWindow* parent)
21 {
22    bbtkDebugMessageInc("Core",9,"PlotterView::CreateWxWindow()"<<std::endl);
23     
24    mwxwidget = new pPlotterWindow( parent , -1,wxDefaultPosition,  wxDefaultSize,  0 );
25    mwxwidget->AddLayer(new pPlotterScaleX());
26    mwxwidget->AddLayer(new pPlotterScaleY());
27    
28    // avoid 'taking address of temporary '
29    //pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &(bbGetInputInX()), &(bbGetInputInY()) ); // taking address of temporary ! JPRx
30    std::vector<double> inX = bbGetInputInX();
31    std::vector<double> inY = bbGetInputInY();
32       
33    pGraphicalFunction *pGF = mwxwidget->getFunctionForVectors( &inX, &inY ); 
34    mwxwidget->addFunction(pGF);
35    bbtkDebugDecTab("Core",9);
36    bbSetOutputWidget( mwxwidget );
37 }
38
39 //---------------------------------------------------
40 void PlotterView::bbUserSetDefaultValues()
41 {
42         mwxwidget = NULL;
43 }
44         
45         //-----------------------------------------------------------------     
46         void PlotterView::bbUserInitializeProcessing()
47         {
48         }
49         
50         //-----------------------------------------------------------------     
51         void PlotterView::bbUserFinalizeProcessing()
52         {
53         }
54         
55         //-----------------------------------------------------------------     
56
57 }
58 // EO namespace bbcreaMaracasVisu
59
60