2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbcreaMaracasVisuColorLayerImageView2.h"
5 #include "bbcreaMaracasVisuPackage.h"
6 namespace bbcreaMaracasVisu
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ColorLayerImageView2)
10 BBTK_BLACK_BOX_IMPLEMENTATION(ColorLayerImageView2,bbtk::AtomicBlackBox);
17 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
19 void ColorLayerImageView2::Process()
22 // THE MAIN PROCESSING METHOD BODY
23 // Here we simply set the input 'In' value to the output 'Out'
24 // And print out the output value
25 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
26 // void bbSet{Input|Output}NAME(const TYPE&)
27 // const TYPE& bbGet{Input|Output}NAME() const
29 // * NAME is the name of the input/output
30 // (the one provided in the attribute 'name' of the tag 'input')
31 // * TYPE is the C++ type of the input/output
32 // (the one provided in the attribute 'type' of the tag 'input')
33 // bbSetOutputOut( bbGetInputIn() );
34 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
37 if (bbGetInputActive()==true)
39 if (bbGetInputIn()!=NULL) {
40 if ( !( (bbGetInputWxVtkBaseView()==NULL) && (bbGetInputWxVtkBaseView1()==NULL) && (bbGetInputWxVtkBaseView2()==NULL)) )
42 // ColorLayerImageViewPanel_widgetBox *clivp = (ColorLayerImageViewPanel_widgetBox*)bbGetOutputWidget();
45 // if (firsttime==true)
48 // clivp->SetActive( bbGetInputActive() );
52 std::vector<double> range = bbGetInputlstRangeForColorBar();
53 std::vector<int> colorbarposition = bbGetInputColorBarPosition();
54 std::vector<double> base_color = bbGetInputlstBaseColor();
55 std::vector<double> grey_level_boundaries = bbGetInputlstGreyLevelBoundaries();
56 std::vector<double> transparence_level_boundaries = bbGetInputlstTransparenceBoundaries();
58 _colorLayerImageViewManager->SetwxVtkBaseView ( 0 , bbGetInputWxVtkBaseView() );
59 _colorLayerImageViewManager->SetwxVtkBaseView ( 1 , bbGetInputWxVtkBaseView1() );
60 _colorLayerImageViewManager->SetwxVtkBaseView ( 2 , bbGetInputWxVtkBaseView2() );
61 _colorLayerImageViewManager->SetRangeForColorBar ( range );
62 _colorLayerImageViewManager->SetColorBarPosition ( colorbarposition );
63 _colorLayerImageViewManager->SetBaseColors ( base_color );
64 _colorLayerImageViewManager->SetGreyLevelBoundaries ( grey_level_boundaries );
65 _colorLayerImageViewManager->SetBaseTransparence ( transparence_level_boundaries );
66 _colorLayerImageViewManager->SetPlainOrGradientColor ( bbGetInputPlainOrGradientColor() );
67 _colorLayerImageViewManager->onThresholdChangeOpacity ( bbGetInputOpacity() );
68 _colorLayerImageViewManager->SetActive ( bbGetInputActive() );
71 // CM Sets the fitting mode if an appropriate value is provided.
72 if (bbGetInputFittingMode() == -1 || bbGetInputFittingMode() == 1 || bbGetInputFittingMode() == 2 || bbGetInputFittingMode() == 3)
74 fitting_mode = bbGetInputFittingMode();
76 //Otherwise, an exception should be thrown (value 0 is fine, it corresponds to an empty field i.e. the default value is kept).
77 else if (bbGetInputFittingMode() != 0) {
78 std::cout << "CM ERROR!!! The fitting mode provided has an inappropriate value. It should be an int between -1 ; 1 ; 2 ; 3, but its value is :" << bbGetInputFittingMode() << ". The default value will be set instead, i.e. Pixel transformation (3)." << std::endl;
83 // clivp->SetFittingMode( bbGetInputFittingMode() );
84 // clivp->SetImage( bbGetInputIn() );
85 _colorLayerImageViewManager->SetFittingMode( fitting_mode );
86 _colorLayerImageViewManager->SetImageStep1( bbGetInputIn() );
87 _colorLayerImageViewManager->SetImageStep2( bbGetInputIn() );
89 bbSetOutputNewImage( _colorLayerImageViewManager->GetImageChangeInformation(0) );
90 bbSetOutputLookupTable( _colorLayerImageViewManager->GetLookupTable(0) );
91 // bbSetOutputOutOpacity( clivp->GetOpacity() );
92 // if (firsttime==true)
95 // clivp->ChangeOpacity();
96 // clivp->SetBox(this);
100 printf("EED Error!!! ColorLayerImageView::Process (%s) Missing Inputs: WxVtkBaseView , WxVtkBaseView1 , WxVtkBaseView2 \n", bbGetFullName().c_str() );
111 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
113 void ColorLayerImageView2::bbUserSetDefaultValues()
115 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
116 // Here we initialize the input 'In' to 0
119 bbSetInputActive(true);
120 bbSetInputOpacity(100);
121 bbSetInputPlainOrGradientColor(false);
122 // bbSetInputTypeControlsInterface(1);
123 bbSetInputWxVtkBaseView(NULL);
124 bbSetInputWxVtkBaseView1(NULL);
125 bbSetInputWxVtkBaseView2(NULL);
126 std::vector<int> lstColorBarPosition;
127 lstColorBarPosition.push_back(10);
128 lstColorBarPosition.push_back(105);
129 bbSetInputColorBarPosition(lstColorBarPosition);
130 // bbSetOutputWidget(NULL);
133 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
135 void ColorLayerImageView2::bbUserInitializeProcessing()
138 _colorLayerImageViewManager = new ColorLayerImageViewManager();
140 // THE INITIALIZATION METHOD BODY :
142 // but this is where you should allocate the internal/output pointers
148 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
150 void ColorLayerImageView2::bbUserFinalizeProcessing()
153 // THE FINALIZATION METHOD BODY :
155 // but this is where you should desallocate the internal/output pointers
160 // EO namespace bbcreaMaracasVisu