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->onThresholdInterpolation ( bbGetInputInterpolation() );
69 _colorLayerImageViewManager->SetActive ( bbGetInputActive() );
72 // CM Sets the fitting mode if an appropriate value is provided.
73 if (bbGetInputFittingMode() == -1 || bbGetInputFittingMode() == 1 || bbGetInputFittingMode() == 2 || bbGetInputFittingMode() == 3)
75 fitting_mode = bbGetInputFittingMode();
77 //Otherwise, an exception should be thrown (value 0 is fine, it corresponds to an empty field i.e. the default value is kept).
78 else if (bbGetInputFittingMode() != 0) {
79 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;
84 // clivp->SetFittingMode( bbGetInputFittingMode() );
85 // clivp->SetImage( bbGetInputIn() );
86 _colorLayerImageViewManager->SetFittingMode( fitting_mode );
87 _colorLayerImageViewManager->SetImageStep1( bbGetInputIn() );
88 _colorLayerImageViewManager->SetImageStep2( bbGetInputIn() );
90 bbSetOutputNewImage( _colorLayerImageViewManager->GetImageChangeInformation(0) );
91 bbSetOutputLookupTable( _colorLayerImageViewManager->GetLookupTable(0) );
92 // bbSetOutputOutOpacity( clivp->GetOpacity() );
93 // if (firsttime==true)
96 // clivp->ChangeOpacity();
97 // clivp->SetBox(this);
101 printf("EED Error!!! ColorLayerImageView::Process (%s) Missing Inputs: WxVtkBaseView , WxVtkBaseView1 , WxVtkBaseView2 \n", bbGetFullName().c_str() );
112 // 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)
114 void ColorLayerImageView2::bbUserSetDefaultValues()
116 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
117 // Here we initialize the input 'In' to 0
120 bbSetInputActive(true);
121 bbSetInputOpacity(100);
122 bbSetInputInterpolation(true);
123 bbSetInputPlainOrGradientColor(false);
124 // bbSetInputTypeControlsInterface(1);
125 bbSetInputWxVtkBaseView(NULL);
126 bbSetInputWxVtkBaseView1(NULL);
127 bbSetInputWxVtkBaseView2(NULL);
128 std::vector<int> lstColorBarPosition;
129 lstColorBarPosition.push_back(10);
130 lstColorBarPosition.push_back(105);
131 bbSetInputColorBarPosition(lstColorBarPosition);
132 // bbSetOutputWidget(NULL);
135 // 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)
137 void ColorLayerImageView2::bbUserInitializeProcessing()
140 _colorLayerImageViewManager = new ColorLayerImageViewManager();
142 // THE INITIALIZATION METHOD BODY :
144 // but this is where you should allocate the internal/output pointers
150 // 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)
152 void ColorLayerImageView2::bbUserFinalizeProcessing()
155 // THE FINALIZATION METHOD BODY :
157 // but this is where you should desallocate the internal/output pointers
162 // EO namespace bbcreaMaracasVisu