]> Creatis software - bbtk.git/blob - packages/kw/src/bbkwTransferFunctionEditor.h
296e75eef0bb390f1dbb67bdc4b73deb203491f4
[bbtk.git] / packages / kw / src / bbkwTransferFunctionEditor.h
1 /*=========================================================================                                                                               
2   Program:   bbtk
3   Module:    $RCSfile: bbkwTransferFunctionEditor.h,v $
4   Language:  C++
5   Date:      $Date: 2008/12/16 13:00:27 $
6   Version:   $Revision: 1.2 $
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
14 *  This software is governed by the CeCILL-B license under French law and 
15 *  abiding by the rules of distribution of free software. You can  use, 
16 *  modify and/ or redistribute the software under the terms of the CeCILL-B 
17 *  license as circulated by CEA, CNRS and INRIA at the following URL 
18 *  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
19 *  or in the file LICENSE.txt.
20 *
21 *  As a counterpart to the access to the source code and  rights to copy,
22 *  modify and redistribute granted by the license, users are provided only
23 *  with a limited warranty  and the software's author,  the holder of the
24 *  economic rights,  and the successive licensors  have only  limited
25 *  liability. 
26 *
27 *  The fact that you are presently reading this means that you have had
28 *  knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */                                                                         
30
31 /**
32  * \file 
33  * \brief Short description in one line
34  * 
35  * Long description which 
36  * can span multiple lines
37 */
38
39 /**
40  * \class bbkw::TransferFunctionEditor
41  * \brief 
42
43  * \class bbkw::TransferFunctionEditorWidget
44  * \brief 
45  */
46
47 #ifdef USE_KWWIDGETS
48 #ifdef USE_VTK
49
50 // Prevents multiple inclusions : use symbols of the form
51 // __FILENAME_INCLUDED__ 
52 // where FILENAME must be replaced by the actual file name
53 #ifndef __bbkwTransferFunctionEditor_h_INCLUDED__
54 #define __bbkwTransferFunctionEditor_h_INCLUDED__
55
56 // Include KWBlackBox definition
57 #include "bbtkKWBlackBox.h"
58 #include "bbkw_EXPORT.h"
59
60 class vtkObject;
61 class vtkCommand;
62 #include "vtkCommand.h"
63 #include "vtkImageData.h"
64 #include "vtkPiecewiseFunction.h"
65
66
67 // Namespace of the package "kw" is "bbkw" 
68 // Namespace associated to packages should be of the form :
69 // bbPACKAGENAME
70 namespace bbkw
71 {
72   
73   //------------------------------------------------------------------------
74   // The black box
75   class bbkw_EXPORT TransferFunctionEditor : public bbtk::KWBlackBox, 
76                                              public vtkCommand
77   {
78     
79     BBTK_BLACK_BOX_INTERFACE(TransferFunctionEditor,bbtk::KWBlackBox);
80
81     BBTK_DECLARE_INPUT(In,vtkImageData*);
82     BBTK_DECLARE_OUTPUT(Out,vtkPiecewiseFunction*);
83
84     BBTK_DECLARE_INPUT(Title,std::string);
85
86     BBTK_PROCESS(Process);
87     BBTK_CREATE_KWWIDGET(CreateWidget);
88
89     void Process();
90     void CreateWidget(vtkKWFrame*);
91     virtual void Execute(vtkObject* caller, unsigned long, void*);
92     void OnChange();
93  protected:
94     virtual void bbUserConstructor();
95   };
96   //=================================================================
97  
98   //=================================================================
99   // the black box description
100   BBTK_BEGIN_DESCRIBE_BLACK_BOX(TransferFunctionEditor,bbtk::KWBlackBox);
101   BBTK_NAME("kwTransferFunctionEditor");
102   BBTK_AUTHOR("laurent.guigues@creatis.insa-lyon.fr");
103   // Already inserted for any KWBlackBox  BBTK_CATEGORY("widget");
104   BBTK_DESCRIPTION("Transfer function editor (vtkKWPiecewiseFunctionEditor)");
105   BBTK_INPUT(TransferFunctionEditor,In,
106              "Image from which to extract the histogram to display",
107              vtkImageData*,"");
108   BBTK_INPUT(TransferFunctionEditor,Title,
109              "Title",std::string,"");
110   BBTK_OUTPUT(TransferFunctionEditor,Out,"Piecewise function",
111               vtkPiecewiseFunction*,"");
112   BBTK_END_DESCRIBE_BLACK_BOX(TransferFunctionEditor);
113   //=================================================================
114   
115
116
117 } //namespace bbkw
118
119 #endif  //__bbkwTransferFunctionEditor_h_INCLUDED__
120
121 #endif // USE_KWWIDGETS
122
123 #endif // USE_VTK