]> Creatis software - creaMaracasVisu.git/blobdiff - bbtk/src/bbmaracasvisuTransferFunctionView.h
*** empty log message ***
[creaMaracasVisu.git] / bbtk / src / bbmaracasvisuTransferFunctionView.h
index 5f7a0fe8ed4999a3df9f79b1ccfbab416b33c5df..bcd1a09e348676de01513ce2fccb004fa9edad5c 100644 (file)
@@ -4,14 +4,18 @@
 #include "bbtkWxBlackBox.h"
 
 #include "vtkImageData.h"
-#include "HistogramWidget.h"
+//#include "HistogramWidget.h"
+#include "HistogramDialogComboBox.h"
 
 #include "vtkPiecewiseFunction.h"
 #include "vtkColorTransferFunction.h"
+#include <wx/wx.h>
 
 namespace bbcreaMaracasVisu
 {
 
+  
+
 class /*BBTK_EXPORT*/ TransferFunctionView
  : 
    public bbtk::WxBlackBox
@@ -20,6 +24,9 @@ class /*BBTK_EXPORT*/ TransferFunctionView
        BBTK_DECLARE_INPUT(In, vtkImageData*);
        BBTK_DECLARE_OUTPUT(OpacityFunction, vtkPiecewiseFunction*);
        BBTK_DECLARE_OUTPUT(ColorFunction, vtkColorTransferFunction*);
+
+       BBTK_DECLARE_OUTPUT(WindowLevel, double);
+       BBTK_DECLARE_OUTPUT(ColorLevel, double);
        /*BBTK_DECLARE_OUTPUT(GreyLevel, std::vector<double> );
        BBTK_DECLARE_OUTPUT(Value, std::vector<double> );
        BBTK_DECLARE_OUTPUT(GreyLevelColors, std::vector<double>);
@@ -30,15 +37,35 @@ class /*BBTK_EXPORT*/ TransferFunctionView
   BBTK_PROCESS(Process);
   void Process();
   BBTK_CREATE_WIDGET(CreateWidget);
-  void CreateWidget(wxWindow* parent);
+  void CreateWidget(wxWindow* parent);  
+
+  void onColorChange();
+
+  void onSliderChange();
 
   private:
-       HistogramWidget *mwxwidget;
+       //HistogramWidget *mwxwidget;
+         HistogramDialogComboBox *mwxwidget;
        vtkImageData* _currentimg;
+       
        vtkPiecewiseFunction* _tfun;
        vtkColorTransferFunction* _ctfun;
 };
 
+class HandlerTransferFunctionView : public wxEvtHandler
+{
+       public:
+               HandlerTransferFunctionView(TransferFunctionView* box);
+               ~HandlerTransferFunctionView();    
+               
+                void onColorChange(wxCommandEvent& event);
+
+                void onSliderChange(wxCommandEvent& event);
+               
+       private:
+               TransferFunctionView                    *_box;  
+};
+
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(TransferFunctionView,bbtk::WxBlackBox);
 BBTK_NAME("TransferFunctionView");
 BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr");
@@ -47,6 +74,8 @@ BBTK_DESCRIPTION("Transfer Function Window");
   BBTK_INPUT(TransferFunctionView,In,"Input image",vtkImageData*,"");
        BBTK_OUTPUT(TransferFunctionView,OpacityFunction,"Transfer function for the opacity", vtkPiecewiseFunction*,"");
        BBTK_OUTPUT(TransferFunctionView,ColorFunction,"Transfer function for the color", vtkColorTransferFunction*,"");  
+       BBTK_OUTPUT(TransferFunctionView,WindowLevel,"WidowLevel for the current window", double,"");  
+       BBTK_OUTPUT(TransferFunctionView,ColorLevel,"ColorLevel for the current window", double,"");  
   /*BBTK_OUTPUT(TransferFunctionView,GreyLevel,"Greylevel related to the transparency",std::vector<double>,"");
   BBTK_OUTPUT(TransferFunctionView,Value,"Value of the transparency in the transfer function",std::vector<double>,"");
   BBTK_OUTPUT(TransferFunctionView,GreyLevelColors,"Grey level of the color in the transfer function",std::vector<double>,"");
@@ -55,6 +84,8 @@ BBTK_DESCRIPTION("Transfer Function Window");
   BBTK_OUTPUT(TransferFunctionView,Blue,"Blue value according to the GreyLevelColors",std::vector<double>,"");*/
 BBTK_END_DESCRIBE_BLACK_BOX(TransferFunctionView);
 }
+
+
 // EO namespace bbcreaMaracasVisu
 
 #endif // __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__