00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00033 #ifdef _USE_WXWIDGETS_
00034 #ifdef _USE_VTK_
00035
00036
00037 #ifndef __bbWxViewer3D_h__
00038 #define __bbWxViewer3D_h__
00039
00040 #include <vtkRenderer.h>
00041 #include <vtkRenderWindow.h>
00042 #include <vtkInteractorStyleTrackballCamera.h>
00043
00044 #include "bbtkWxBlackBox.h"
00045 #include "wxVTKRenderWindowInteractor.h"
00046
00047
00048
00049
00050 namespace bbwxvtk
00051 {
00052 class Viewer3D;
00053
00054 class Viewer3DWidget : public wxPanel
00055 {
00056 public:
00057 Viewer3DWidget(Viewer3D* box, wxWindow *parent, bool stereo);
00058 ~Viewer3DWidget();
00059
00060 void Update();
00061 vtkRenderer *GetRenderer();
00062 wxVTKRenderWindowInteractor * GetInteractor();
00063 virtual void Refresh(bool eraseBackground = true, const wxRect* rect = NULL);
00064
00065 private:
00066 Viewer3D *mBox;
00067 vtkRenderer *renderer;
00068 vtkRenderWindow *renderwindow;
00069 vtkInteractorStyleTrackballCamera *interactorstyle;
00070 wxVTKRenderWindowInteractor *wxvtkrenderwindowinteractor;
00071 };
00072
00073
00074
00075
00076
00077 class Viewer3D : public bbtk::WxBlackBox
00078 {
00079 BBTK_BLACK_BOX_INTERFACE(Viewer3D,bbtk::WxBlackBox);
00080 BBTK_DECLARE_INPUT(In1, vtkProp3D *);
00081 BBTK_DECLARE_INPUT(In2, vtkProp3D *);
00082 BBTK_DECLARE_INPUT(In3, vtkProp3D *);
00083 BBTK_DECLARE_INPUT(In4, vtkProp3D *);
00084 BBTK_DECLARE_INPUT(In5, vtkProp3D *);
00085 BBTK_DECLARE_INPUT(Obs1, vtkInteractorObserver *);
00086 BBTK_DECLARE_INPUT(Obs2, vtkInteractorObserver *);
00087 BBTK_DECLARE_INPUT(Obs3, vtkInteractorObserver *);
00088 BBTK_DECLARE_INPUT(Obs4, vtkInteractorObserver *);
00089 BBTK_DECLARE_INPUT(Obs5, vtkInteractorObserver *);
00090 BBTK_DECLARE_INPUT(Stereo, bool);
00091 BBTK_DECLARE_OUTPUT(Renderer,vtkRenderer*);
00092 BBTK_DECLARE_OUTPUT(Interactor,wxVTKRenderWindowInteractor*);
00093 BBTK_PROCESS(Process);
00094 void Process();
00095 BBTK_CREATE_WIDGET(CreateWidget);
00096 void CreateWidget();
00097 void bbUserOnShow();
00098
00099 protected:
00100 virtual void bbUserConstructor();
00101 };
00102
00103
00104
00105 BBTK_BEGIN_DESCRIBE_BLACK_BOX(Viewer3D,bbtk::WxBlackBox);
00106 BBTK_NAME("Viewer3D");
00107 BBTK_AUTHOR("eduardo.davila@creatis.insa-lyon.fr");
00108 BBTK_DESCRIPTION("3D Viewer widget (vtk)");
00109 BBTK_CATEGORY("viewer");
00110 BBTK_INPUT(Viewer3D,In1,"Input actor",vtkProp3D *,"");
00111 BBTK_INPUT(Viewer3D,In2,"Input actor",vtkProp3D *,"");
00112 BBTK_INPUT(Viewer3D,In3,"Input actor",vtkProp3D *,"");
00113 BBTK_INPUT(Viewer3D,In4,"Input actor",vtkProp3D *,"");
00114 BBTK_INPUT(Viewer3D,In5,"Input actor",vtkProp3D *,"");
00115 BBTK_INPUT(Viewer3D,Obs1,"Input observer",vtkInteractorObserver *,"");
00116 BBTK_INPUT(Viewer3D,Obs2,"Input observer",vtkInteractorObserver *,"");
00117 BBTK_INPUT(Viewer3D,Obs3,"Input observer",vtkInteractorObserver *,"");
00118 BBTK_INPUT(Viewer3D,Obs4,"Input observer",vtkInteractorObserver *,"");
00119 BBTK_INPUT(Viewer3D,Obs5,"Input observer",vtkInteractorObserver *,"");
00120 BBTK_INPUT(Viewer3D,Stereo,"Stereo with Red-Blue filter. False/True (default False)",bool,"");
00121 BBTK_OUTPUT(Viewer3D,Renderer,"Renderer to which actors can be added.",vtkRenderer*,"");
00122 BBTK_OUTPUT(Viewer3D,Interactor,"Interactor with which vtk widgets can interact",wxVTKRenderWindowInteractor*,"");
00123 BBTK_END_DESCRIBE_BLACK_BOX(Viewer3D);
00124
00125
00126
00127 }
00128
00129 #endif //__bbtkWxViewer3D_h__
00130
00131 #endif //_USE_VTK_
00132 #endif //_USE_WXWIDGETS_
00133