]> Creatis software - bbtk.git/blob - packages/wxvtk/src/bbwxvtkViewer3D.h
ea51a54339997dc26f4908cb2d94b66c5bcba346
[bbtk.git] / packages / wxvtk / src / bbwxvtkViewer3D.h
1 /*=========================================================================
2                                                                                 
3   Program:   bbtk
4   Module:    $RCSfile: bbwxvtkViewer3D.h,v $
5   Language:  C++
6   Date:      $Date: 2008/03/19 13:30:19 $
7   Version:   $Revision: 1.2 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/bbtk/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*//**
18  * \brief Short description in one line
19  * 
20  * Long description which 
21  * can span multiple lines
22  */
23 /**
24  * \file 
25  * \brief Pattern for the definition of a new type of Node (header)
26  */
27 /**
28  * \class bbtk::NodePatern 
29  * \brief Pattern for the definition of a new type of Node 
30  */
31
32
33 #ifdef _USE_WXWIDGETS_
34 #ifdef _USE_VTK_
35
36
37 #ifndef __bbWxViewer3D_h__
38 #define __bbWxViewer3D_h__
39
40 #include <vtkRenderer.h>
41 #include <vtkRenderWindow.h>
42
43 #include "bbtkWxBlackBox.h"
44 #include "wxVTKRenderWindowInteractor.h"
45
46
47
48 namespace bbwxvtk
49 {
50   class Viewer3D; 
51   //--------------------------------------------------------------------------
52   class Viewer3DWidget : public wxPanel
53   {
54   public:
55     Viewer3DWidget(Viewer3D* box, wxWindow *parent);
56     ~Viewer3DWidget();
57
58     void Update();
59     vtkRenderer *GetRenderer();
60     wxVTKRenderWindowInteractor * GetInteractor();
61   private:
62     Viewer3D                     *mBox;
63     vtkRenderer                  *renderer;
64     vtkRenderWindow              *renderwindow;
65     wxVTKRenderWindowInteractor  *wxvtkrenderwindowinteractor;
66   };
67   
68   //------------------------------------------------------------------------
69   //------------------------------------------------------------------------
70   //------------------------------------------------------------------------
71   
72   class /*BBTK_EXPORT*/ Viewer3D : public bbtk::WxBlackBox
73   {    
74     BBTK_USER_BLACK_BOX_INTERFACE(Viewer3D,bbtk::WxBlackBox);
75     BBTK_DECLARE_INPUT(In1, vtkProp3D *);
76     BBTK_DECLARE_INPUT(In2, vtkProp3D *);
77     BBTK_DECLARE_INPUT(In3, vtkProp3D *);
78     BBTK_DECLARE_INPUT(In4, vtkProp3D *);
79     BBTK_DECLARE_INPUT(In5, vtkProp3D *);
80     BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer*);
81     BBTK_DECLARE_OUTPUT(Interactor,wxVTKRenderWindowInteractor*);
82     BBTK_PROCESS(Process);
83     void Process();
84     BBTK_CREATE_WIDGET(CreateWidget);
85     void CreateWidget();
86
87   protected:
88     virtual void bbUserConstructor();
89   };
90    
91   //=================================================================
92   // UserBlackBox description
93   BBTK_BEGIN_DESCRIBE_BLACK_BOX(Viewer3D,bbtk::WxBlackBox);
94   BBTK_NAME("Viewer3D");
95   BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
96   BBTK_DESCRIPTION("3D Viewer (vtk)");
97   BBTK_CATEGORY("viewer");
98   BBTK_INPUT(Viewer3D,In1,"Input actor",vtkProp3D *);
99   BBTK_INPUT(Viewer3D,In2,"Input actor",vtkProp3D *);
100   BBTK_INPUT(Viewer3D,In3,"Input actor",vtkProp3D *);
101   BBTK_INPUT(Viewer3D,In4,"Input actor",vtkProp3D *);
102   BBTK_INPUT(Viewer3D,In5,"Input actor",vtkProp3D *);
103   BBTK_OUTPUT(Viewer3D,Renderer,"Renderer to which actors can be added.",vtkRenderer*);
104   BBTK_OUTPUT(Viewer3D,Interactor,"Interactor with which vtk widgets can interact",wxVTKRenderWindowInteractor*);
105   BBTK_END_DESCRIBE_BLACK_BOX(Viewer3D);
106   //=================================================================
107
108
109 }//namespace bbtk
110
111 #endif  //__bbtkWxViewer3D_h__
112
113 #endif //_USE_VTK_
114 #endif //_USE_WXWIDGETS_
115