X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_ManagerContour_NDimensions%2FwxVtkBaseView_SceneManager.cxx;h=9e6a6056428936b7b26421363897f3c4cb87f712;hb=4473ecd3ff7567a6ae8fd054fae5b21ede175d00;hp=635dcd3da6f7670efdb1a29f1e9a6ef8d5cce69f;hpb=4d5574beaa0d2f56951b00a9fcca5dd945506e13;p=creaContours.git diff --git a/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx b/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx index 635dcd3..9e6a605 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx @@ -3,6 +3,7 @@ // Class definition include //---------------------------------------------------------------------------------------------------------------- #include "wxVtkBaseView_SceneManager.h" +#include "wxVtk2DBaseView.h" //---------------------------------------------------------------------------------------------------------------- // Class implementation @@ -61,7 +62,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) _wxVtk_BaseView = theWxBaseViewToManage; if( _wxVtk_BaseView!=NULL ) { - vtkInteractorStyleBaseView* theInteractorStyleBaseView = _wxVtk_BaseView->GetInteractorStyleBaseView(); + vtkInteractorStyleBaseView* theInteractorStyleBaseView = (vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView(); theInteractorStyleBaseView->AddInteractorStyleMaracas( this ); SetVtkInteractorStyleBaseView( theInteractorStyleBaseView ); } @@ -77,12 +78,12 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) _contours_ViewControl->erase( iter ); i++; } - delete _contours_ViewControl; _contours_ViewControl->clear(); + delete _contours_ViewControl; _workingGroup->clear(); delete _lastInteraction; delete _workingGroup; - delete _contours_ViewControl; + //delete _contours_ViewControl; } //------------------------------------------------------------------------------------------------------------ @@ -223,7 +224,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) _viewerSelectionROI->SetSpacing( spc ); _controlerSelectionROI->SetModelView( _modelSelectionROI , _viewerSelectionROI ); - _wxVtk_BaseView->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( _controlerSelectionROI ); + ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _controlerSelectionROI ); _controlerSelectionROI->SetActive(false); } @@ -392,7 +393,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) //fprintf(ff," %p \n", contourWRP->getControler() ); //fclose(ff); - _wxVtk_BaseView->GetInteractorStyleBaseView()->RemoveInteractorStyleMaracas( contourWRP->getControler() ); + ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->RemoveInteractorStyleMaracas( contourWRP->getControler() ); contourWRP->getControler()->SetActive( control ); contourWRP->getControler()->SetEditable( false ); @@ -414,7 +415,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) std::map :: iterator iter; iter = _sceneContours_ViewControl->find( theKeyName ); - if (iter != _sceneContours_ViewControl->end()){ + if (iter != _sceneContours_ViewControl->end()) + { ContourWrap_ViewControl * contourWRP = iter->second; removeFromScene( contourWRP ); //EED Borrame @@ -516,7 +518,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) if( control ) { - _wxVtk_BaseView->GetInteractorStyleBaseView()->AddInteractorStyleMaracas( contourWRP->getControler() ); + ((vtkInteractorStyleBaseView*)_wxVtk_BaseView->GetInteractorStyleBaseView())->AddInteractorStyleMaracas( contourWRP->getControler() ); } if( ifActive ) { @@ -582,7 +584,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) int size = _workingGroup->size(); for ( int i = 0; isecond->getViewer(); +//EED??? manualViewBaseContour * viewer = iter->second->getViewer(); selectedObjects.push_back( iter->first); iter++; @@ -593,8 +595,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) void wxVtkBaseView_SceneManager :: selectObjects( std::vector< std::string > theExistingObjectsToSelect ) { std::map ::iterator iter = _contours_ViewControl->begin(); - int size = _contours_ViewControl->size(); - bool selected; +//EED??? int size = _contours_ViewControl->size(); +//EED??? bool selected; /*for ( int i = 0; iGetEventPosition( X , Y ); bool ctrlKey = _vtkInteractorStyleBaseView->GetInteractor()->GetControlKey() == 1; - bool shiftKey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey() == 1; +//??? bool shiftKey = _vtkInteractorStyleBaseView->GetInteractor()->GetShiftKey() == 1; if( _waiting && !ctrlKey ) { @@ -786,7 +788,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) { //Multiple moving - bool ckecking = false; +//EED??? bool ckecking = false; for( i =0; isecond->getControler(); @@ -872,12 +874,12 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) fclose(ff);*/ - char aa = _vtkInteractorStyleBaseView->GetInteractor()->GetKeyCode(); +//EED??? char aa = _vtkInteractorStyleBaseView->GetInteractor()->GetKeyCode(); bool condition = false; //vtkCommand * theComand = _wxVtk_BaseView ->GetInteractorStyleBaseView()->GetCommand( - vtkRenderWindowInteractor * vtkRWInteractor1 = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor(); - wxVTKRenderWindowInteractor * vtkRWInteractor2 = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();//GetInteractorStyleBaseView()->GetInteractor(); - wxVTKRenderWindowInteractorPlus * vtkRWInteractor3 = (wxVTKRenderWindowInteractorPlus*)_wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();//GetInteractorStyleBaseView()->GetInteractor(); +//EED??? vtkRenderWindowInteractor * vtkRWInteractor1 = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor(); +//EED??? wxVTKRenderWindowInteractor * vtkRWInteractor2 = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();//GetInteractorStyleBaseView()->GetInteractor(); +//EED?? wxVTKRenderWindowInteractorPlus * vtkRWInteractor3 = (wxVTKRenderWindowInteractorPlus*)_wxVtk_BaseView ->GetWxVTKRenderWindowInteractor();//GetInteractorStyleBaseView()->GetInteractor(); vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor(); bool ctrlKey = vtkRWInteractor->GetControlKey() == 1; @@ -964,8 +966,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) bool wxVtkBaseView_SceneManager :: OnRightButtonDown() { bool condition = false; - vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor(); - bool ctrlKey = vtkRWInteractor->GetControlKey() == 1; +//EED??? vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor(); +//EED??? bool ctrlKey = vtkRWInteractor->GetControlKey() == 1; _waiting = true; condition = true; @@ -995,7 +997,8 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) //_lastInteraction->getControler()->SetPosibleToMove( false ); control->SetActive( false ); control->SetEditable( false ); - _wxVtk_BaseView->GetInteractorStyleBaseView()->RemoveInteractorStyleMaracas( control ); + control->SetPosibleToMove( false ); +// _wxVtk_BaseView->GetInteractorStyleBaseView()->RemoveInteractorStyleMaracas( control ); _lastInteraction->getViewer()->Refresh(); this->_vtkInteractorStyleBaseView->SetRefresh_waiting(); } @@ -1016,9 +1019,9 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) bool wxVtkBaseView_SceneManager :: OnRightDClick() { bool condition = false; condition = true; - vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor(); +//EED??? vtkRenderWindowInteractor * vtkRWInteractor = _vtkInteractorStyleBaseView->GetInteractor(); /*vtkRenderWindowInteractor * vtkRWInteractor1 =*/ _vtkInteractorStyleBaseView->OnChar(); - wxVTKRenderWindowInteractor * wxVtkRWInterator = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor(); +//EED??? wxVTKRenderWindowInteractor * wxVtkRWInterator = _wxVtk_BaseView ->GetWxVTKRenderWindowInteractor(); /*if( _waiting ) { @@ -1124,7 +1127,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) int tmpPx,tmpPy; wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); wxVTKiren->GetEventPosition( tmpPx , tmpPy ); - fprintf(ff,"::%s (x,y) = (%i, %i) t(sg): \n \n",method.c_str(), tmpPx, tmpPy, sg); + fprintf(ff,"::%s (x,y) = (%i, %i) t(sg): %f\n \n",method.c_str(), tmpPx, tmpPy, sg); fclose(ff); }