X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk%2Fsrc%2FbbmaracasvisuTransferFunctionView.h;h=bcd1a09e348676de01513ce2fccb004fa9edad5c;hb=b0230890274e619c44f9ac7e1fd277ef28c18108;hp=0bd81ae811e05af8e2658f844f6c98ea26bcda2b;hpb=44e4be7013ea566bd2bdefb9d48e1da0071c3d91;p=creaMaracasVisu.git diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.h b/bbtk/src/bbmaracasvisuTransferFunctionView.h index 0bd81ae..bcd1a09 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.h +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.h @@ -1,35 +1,69 @@ #ifdef _USE_WXWIDGETS_ -#ifndef __bbmaracasvisuTransferFunctionView_h_INCLUDED__ -#define __bbmaracasvisuTransferFunctionView_h_INCLUDED__ +#ifndef __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__ +#define __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__ #include "bbtkWxBlackBox.h" #include "vtkImageData.h" -#include "HistogramWidget.h" +//#include "HistogramWidget.h" +#include "HistogramDialogComboBox.h" -namespace bbmaracasvisu +#include "vtkPiecewiseFunction.h" +#include "vtkColorTransferFunction.h" +#include + +namespace bbcreaMaracasVisu { + + class /*BBTK_EXPORT*/ TransferFunctionView : public bbtk::WxBlackBox { BBTK_BLACK_BOX_INTERFACE(TransferFunctionView,bbtk::WxBlackBox); -//================================================================== -/// User callback called in the box contructor -virtual void bbUserConstructor(); -/// User callback called in the box copy constructor -virtual void bbUserCopyConstructor(); -/// User callback called in the box destructor -virtual void bbUserDestructor(); -//================================================================== 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 ); + BBTK_DECLARE_OUTPUT(Value, std::vector ); + BBTK_DECLARE_OUTPUT(GreyLevelColors, std::vector); + BBTK_DECLARE_OUTPUT(Red, std::vector); + BBTK_DECLARE_OUTPUT(Green, std::vector); + BBTK_DECLARE_OUTPUT(Blue, std::vector);*/ + BBTK_PROCESS(Process); void Process(); BBTK_CREATE_WIDGET(CreateWidget); - void CreateWidget(); + 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); @@ -38,10 +72,22 @@ BBTK_AUTHOR("eduardo.davila [at] creatis.insa-lyon.fr"); BBTK_DESCRIPTION("Transfer Function Window"); //BBTK_CATEGORY("__CategoryBlackBox__"); 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,""); + BBTK_OUTPUT(TransferFunctionView,Value,"Value of the transparency in the transfer function",std::vector,""); + BBTK_OUTPUT(TransferFunctionView,GreyLevelColors,"Grey level of the color in the transfer function",std::vector,""); + BBTK_OUTPUT(TransferFunctionView,Red,"Red value according to the GreyLevelColors",std::vector,""); + BBTK_OUTPUT(TransferFunctionView,Green,"Green value according to the GreyLevelColors",std::vector,""); + BBTK_OUTPUT(TransferFunctionView,Blue,"Blue value according to the GreyLevelColors",std::vector,"");*/ BBTK_END_DESCRIBE_BLACK_BOX(TransferFunctionView); } -// EO namespace bbmaracasvisu -#endif // __bbmaracasvisuTransferFunctionView_h_INCLUDED__ + +// EO namespace bbcreaMaracasVisu + +#endif // __bbcreaMaracasVisuTransferFunctionView_h_INCLUDED__ #endif // _USE_WXWIDGETS_