]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbmaracasvisuColorBar.cxx
1a2c08778633d9473e5f4cb733ce78f2fa13b86a
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuColorBar.cxx
1 #include "bbmaracasvisuColorBar.h"
2 #include "bbcreaMaracasVisuPackage.h"
3 namespace bbcreaMaracasVisu
4 {
5
6 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ColorBar)
7 BBTK_BLACK_BOX_IMPLEMENTATION(ColorBar,bbtk::WxBlackBox);
8
9 //--------------------------------------------------
10 void ColorBar::Process()
11 {
12 }
13
14 //--------------------------------------------------
15 void ColorBar::CreateWidget(wxWindow* parent)
16 {
17 //   bbSetOutputWidget( new wxStaticText ( bbGetWxParent() , -1 , _T("") ) );
18 //   Process();
19                 bbtkDebugMessageInc("Core",9,"ColorBar::CreateWidget()"<<std::endl);
20                 mwxwidget = new pColorBar( parent ,bbGetInputInW(), bbGetInputInH(), bbGetInputOrientation()==1); 
21                 mwxwidget -> setActiveStateTo( true );
22             mwxwidget -> setRepresentedValues(bbGetInputInMin(), bbGetInputInMax());
23                 mwxwidget -> setDeviceEndMargin(10);
24                 mwxwidget -> setDeviceBlitStart(10,10); 
25                 std::vector<int> vectRED = bbGetInputReds();    
26                 std::vector<int> vectGREEN = bbGetInputGreens();        
27                 std::vector<int> vectBLUE = bbGetInputBlues();  
28                 std::vector<int> vectVALUES = bbGetInputValues();       
29                 if(vectRED.size()==vectGREEN.size() && vectGREEN.size()==vectBLUE.size() && vectBLUE.size()==vectVALUES.size())
30                 {
31                         int i=0;
32                         while ( i< vectVALUES.size())
33                         {
34                                 mwxwidget -> addColorPoint ( (double)vectVALUES[i], wxColour(vectRED[i], vectGREEN[i], vectBLUE[i]));
35                                 i++;
36                         }
37                 }
38                 
39                     
40     bbtkDebugDecTab("Core",9);
41
42         bbSetOutputWidget( mwxwidget );
43 }
44
45 //--------------------------------------------------
46 void ColorBar::bbUserConstructor()
47 {
48                 mwxwidget = NULL;
49                 bbSetInputOrientation(1);
50                 bbSetInputInW(200);
51                 bbSetInputInH(80);
52                 bbSetInputInMax(1);
53                 bbSetInputInMin(1);     
54 }
55
56 //--------------------------------------------------
57 void ColorBar::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
58 {
59 }
60
61 //--------------------------------------------------
62 void ColorBar::bbUserDestructor()
63 {
64 }
65
66
67 }
68 // EO namespace bbcreaMaracasVisu
69
70