X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxVtk3DBaseView.cxx;h=1f2ee8024dd4e8d0b45ae5cbca3f3bd836fea8dd;hb=f40ea0e58a37e5419541915fdf7a24107513d9f3;hp=e601235c1bd8365c71b97f8b75ada2c789334f05;hpb=7dc7a00ebd0e9a30d2c992c0e439c2f7f7408e0f;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx index e601235..1f2ee80 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx @@ -14,9 +14,14 @@ wxVtk3DBaseView::wxVtk3DBaseView(wxWindow *parent) //------------------------------------------------------------------- wxVtk3DBaseView::~wxVtk3DBaseView() { - if (_aCamera!=NULL) { _aCamera -> Delete(); } - if (_aRenderer!=NULL) { _aRenderer -> Delete(); } - if (_renWin!=NULL) { _renWin -> Delete(); } + + if (_aCamera!=NULL) { _aCamera -> Delete(); _aCamera=NULL;} + if (_aRenderer!=NULL) { _aRenderer -> Delete(); _aRenderer=NULL;} + if (_renWin!=NULL) { + if(_renWin->GetReferenceCount()==0){ + _renWin -> Delete(); _renWin=NULL; + } + } } //------------------------------------------------------------------- vtkCamera* wxVtk3DBaseView::GetCamera() @@ -43,8 +48,10 @@ void wxVtk3DBaseView::Refresh() //------------------------------------------------------------------- void wxVtk3DBaseView::Configure() { + //printf("EED wxVtk3DBaseView::Configure A\n"); if (_configure==false) { + //printf("EED wxVtk3DBaseView::Configure B\n"); _configure=true; //wxVtkBaseView::Configure(); _aRenderer = vtkRenderer::New(); @@ -63,9 +70,6 @@ void wxVtk3DBaseView::Configure() GetWxVTKRenderWindowInteractor()->SetRenderWindow(_renWin); - -// EED Borrame -// vtkInteractorStyle3DMaracas *interactorStyle3DMaracas = vtkInteractorStyle3DMaracas::New(); vtkInteractorStyleBaseView3D *interactorStyleBaseView3D = vtkInteractorStyleBaseView3D::New(); SetInteractorStyleBaseView( interactorStyleBaseView3D ); @@ -73,12 +77,6 @@ void wxVtk3DBaseView::Configure() GetWxVTKRenderWindowInteractor()->SetInteractorStyle( interactorStyleBaseView3D ); interactorStyleBaseView3D->SetwxVtkBaseView(this); - -/* EED Borrame - vtkInteractorStyleSwitch *iss = dynamic_cast(_iren->GetInteractorStyle()); - iss->SetCurrentStyleToTrackballCamera(); -*/ - // It is convenient to create an initial view of the data. The // FocalPoint and Position form a vector direction. Later on // (ResetCamera() method) this vector is used to position the camera