3 //#include "vtkInteractorStyleBaseView.h"
5 #include "wxVtkBaseView.h"
6 #include "wxVtk2DBaseView.h"
7 #include "wxVTKRenderWindowInteractorPlus.h"
11 wxVtkBaseView::wxVtkBaseView()
15 _interactorStyle = NULL;
18 //-------------------------------------------------------------------
20 wxVtkBaseView::wxVtkBaseView(wxWindow *parent)
23 _iren = (wxVTKRenderWindowInteractor*)new wxVTKRenderWindowInteractorPlus(_parent,this);
24 // _iren->UseCaptureMouseOn();
25 // _iren = new wxVTKRenderWindowInteractor(_parent,-1);
26 _interactorStyle = NULL;
31 //-------------------------------------------------------------------
32 wxVtkBaseView::~wxVtkBaseView()
37 //-------------------------------------------------------------------
38 wxVTKRenderWindowInteractor* wxVtkBaseView::GetWxVTKRenderWindowInteractor() throw (char*)
42 throw "wxVtkBaseView::GetWxVTKRenderWindowInteractor() _iren wxVTKRenderWindowInteractorPlus =NULL";
46 //-------------------------------------------------------------------
47 void wxVtkBaseView::Configure() // virtual
50 //-------------------------------------------------------------------
51 void wxVtkBaseView::Refresh() // virtual
56 _iren->Refresh(false);
61 vtkRenderWindowInteractor *vri = GetWxVTKRenderWindowInteractor();
62 vri->vtkRenderWindowInteractor::Render();
69 //-------------------------------------------------------------------
70 void wxVtkBaseView::RefreshView() // virtual
75 GetRenWin()->Render();
77 //GetRenWin()->Render();
81 //---------------------------------------------------------------------------
82 vtkRenderer* wxVtkBaseView::GetRenderer() // virtual
86 //---------------------------------------------------------------------------
87 vtkRenderWindow* wxVtkBaseView::GetRenWin() // virtual
89 return _iren->GetRenderWindow();
92 //----------------------------------------------------------------------------
94 void wxVtkBaseView::TransfromeCoordScreenToWorld(double &X, double &Y, double &Z, int type) // virtual
96 GetRenderer()->SetDisplayPoint((int)X, (int)Y, (int)Z);
97 GetRenderer()->DisplayToWorld();
99 GetRenderer()->GetWorldPoint( fP );
108 vtkInteractorStyleBaseView* interactorstyle = (vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView();
109 wxVtk2DBaseView* baseview = (wxVtk2DBaseView*)interactorstyle->GetWxVtk2DBaseView();
110 baseview->TransformCoordinate_spacing_ViewToModel( fP[0] , fP[1] , fP[2] );
127 //---------------------------------------------------------------------------
129 vtkInteractorStyleBaseView* wxVtkBaseView::GetInteractorStyleBaseView()
131 return _interactorStyle;
134 vtkInteractorStyleImage* wxVtkBaseView::GetInteractorStyleBaseView()
136 return _interactorStyle;
140 //---------------------------------------------------------------------------
142 void wxVtkBaseView::SetInteractorStyleBaseView( vtkInteractorStyleImage* interactorStyle)
144 _interactorStyle = interactorStyle;
147 //---------------------------------------------------------------------------
149 void wxVtkBaseView::GetSpacing(double spc[3]) // virtual
158 //-------------------------------------------------------------------
159 //-------------------------------------------------------------------
160 //-------------------------------------------------------------------