2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------ */
28 /*=========================================================================
31 Module: $RCSfile: bbwxvtkViewer3D.h,v $
33 Date: $Date: 2012/11/16 08:52:36 $
34 Version: $Revision: 1.15 $
36 =========================================================================*//**
37 * \brief Short description in one line
39 * Long description which
40 * can span multiple lines
44 * \brief Pattern for the definition of a new type of Node (header)
47 * \class bbtk::NodePatern
48 * \brief Pattern for the definition of a new type of Node
52 #ifdef _USE_WXWIDGETS_
56 #ifndef __bbWxViewer3D_h__
57 #define __bbWxViewer3D_h__
59 #include <vtkRenderer.h>
60 #include <vtkRenderWindow.h>
61 #include <vtkInteractorStyleTrackballCamera.h>
63 #include "bbtkWxBlackBox.h"
64 #include "wxVTKRenderWindowInteractor.h"
72 //--------------------------------------------------------------------------
73 class Viewer3DWidget : public wxPanel
76 Viewer3DWidget(Viewer3D* box, wxWindow *parent, bool stereo);
80 vtkRenderer *GetRenderer();
81 wxVTKRenderWindowInteractor * GetInteractor();
82 virtual void Refresh(bool eraseBackground = true, const wxRect* rect = NULL);
86 vtkRenderer *renderer;
87 vtkRenderWindow *renderwindow;
88 vtkInteractorStyleTrackballCamera *interactorstyle;
89 wxVTKRenderWindowInteractor *wxvtkrenderwindowinteractor;
92 //------------------------------------------------------------------------
93 //------------------------------------------------------------------------
94 //------------------------------------------------------------------------
96 class /*BBTK_EXPORT*/ Viewer3D : public bbtk::WxBlackBox
98 BBTK_BLACK_BOX_INTERFACE(Viewer3D,bbtk::WxBlackBox);
99 BBTK_DECLARE_INPUT(In1, vtkProp3D *);
100 BBTK_DECLARE_INPUT(In2, vtkProp3D *);
101 BBTK_DECLARE_INPUT(In3, vtkProp3D *);
102 BBTK_DECLARE_INPUT(In4, vtkProp3D *);
103 BBTK_DECLARE_INPUT(In5, vtkProp3D *);
104 BBTK_DECLARE_INPUT(Obs1, vtkInteractorObserver *);
105 BBTK_DECLARE_INPUT(Obs2, vtkInteractorObserver *);
106 BBTK_DECLARE_INPUT(Obs3, vtkInteractorObserver *);
107 BBTK_DECLARE_INPUT(Obs4, vtkInteractorObserver *);
108 BBTK_DECLARE_INPUT(Obs5, vtkInteractorObserver *);
109 BBTK_DECLARE_INPUT(Stereo, bool);
110 BBTK_DECLARE_INPUT(BackgroundColor,std::vector<double>);
111 BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer*);
112 BBTK_DECLARE_OUTPUT(Interactor,wxVTKRenderWindowInteractor*);
113 BBTK_PROCESS(Process);
114 BBTK_CREATE_WIDGET(CreateWidget);
115 BBTK_ON_SHOW_WIDGET(OnShowWidget);
118 void CreateWidget(wxWindow*);
121 void DisableObservers();
127 //=================================================================
128 // UserBlackBox description
129 BBTK_BEGIN_DESCRIBE_BLACK_BOX(Viewer3D,bbtk::WxBlackBox);
130 BBTK_NAME("Viewer3D");
131 BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
132 BBTK_DESCRIPTION("3D Viewer widget (vtk)");
133 BBTK_CATEGORY("viewer");
134 BBTK_INPUT(Viewer3D,BackgroundColor,"Render background's color",std::vector<double>,"");
135 BBTK_INPUT(Viewer3D,In1,"Input actor",vtkProp3D *,"");
136 BBTK_INPUT(Viewer3D,In2,"Input actor",vtkProp3D *,"");
137 BBTK_INPUT(Viewer3D,In3,"Input actor",vtkProp3D *,"");
138 BBTK_INPUT(Viewer3D,In4,"Input actor",vtkProp3D *,"");
139 BBTK_INPUT(Viewer3D,In5,"Input actor",vtkProp3D *,"");
140 BBTK_INPUT(Viewer3D,Obs1,"Input observer",vtkInteractorObserver *,"");
141 BBTK_INPUT(Viewer3D,Obs2,"Input observer",vtkInteractorObserver *,"");
142 BBTK_INPUT(Viewer3D,Obs3,"Input observer",vtkInteractorObserver *,"");
143 BBTK_INPUT(Viewer3D,Obs4,"Input observer",vtkInteractorObserver *,"");
144 BBTK_INPUT(Viewer3D,Obs5,"Input observer",vtkInteractorObserver *,"");
145 BBTK_INPUT(Viewer3D,Stereo,"Stereo with Red-Blue filter. False/True (default False)",bool,"");
146 BBTK_OUTPUT(Viewer3D,Renderer,"Renderer to which actors can be added.",vtkRenderer*,"");
147 BBTK_OUTPUT(Viewer3D,Interactor,"Interactor with which vtk widgets can interact",wxVTKRenderWindowInteractor*,"");
148 BBTK_END_DESCRIBE_BLACK_BOX(Viewer3D);
149 //=================================================================
154 #endif //__bbtkWxViewer3D_h__
157 #endif //_USE_WXWIDGETS_