X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_ManagerContour_NDimensions%2FwxContourViewPanel.cxx;h=08bc31e0ec5465420e9dd667d0daadf9044825e8;hb=d20aa4c87071dd7795678e7716c6f8ba248cebc1;hp=c2b2b2be969d6d537dc81880df61b8afa1f59f1d;hpb=6e3c929c883c405e0075fa8df10b12a935979367;p=creaContours.git diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx index c2b2b2b..08bc31e 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx @@ -8,7 +8,7 @@ //---------------------------------------------------------------------------------------------------------------- // Other includes //---------------------------------------------------------------------------------------------------------------- -#include "ConceptDataWrap.h" +//#include "ConceptDataWrap.h" //this should be eliminated at some point //#include "wxContourEventHandler.h" @@ -91,7 +91,6 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) :wxPanel(parent, -1, pos, size, style) { theShowingImage->GetSpacing(last_spacing); - showingVID = theShowingImage; int gapH = 20; int gapV = 10; @@ -137,7 +136,7 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) Connect(_verticalBar->GetId(),wxEVT_TSBAR_MOVED,(wxObjectEventFunction) (wxCommandEventFunction) &wxContourViewPanel::onMovedBar_Vertical ); - SetSizer( outSizer ); + this->SetSizer( outSizer ); this->SetAutoLayout( true ); this->Layout(); @@ -148,7 +147,6 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) //outSizer->Fit( this ); initializeScenceManager(); - } @@ -212,17 +210,18 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) } //------------------------------------------------------------------------------------------------------------ - void wxContourViewPanel :: createViewPanel() + void wxContourViewPanel::createViewPanel() { std::vector * numViews = new std::vector (); - numViews->push_back(2); + numViews->push_back(-1); theViewPanel = new wxMaracas_N_ViewersWidget( this, showingVID, numViews ); SetVisibleAxis(false); theViewPanel->SetBackgroundColour(wxColour(0,0,0)); theViewPanel->SetSize(800,600); - theViewPanel->GetWindow(1)->SetSize(800,600); + theViewPanel->GetWindow(1)->SetSize(800,600); + } //------------------------------------------------------------------------------------------------------------ @@ -311,14 +310,14 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) */ void wxContourViewPanel :: onStartChange_Bar_Horizontal(wxCommandEvent& event) { - int nxStart_h = getStartHorizontal(); +// int nxStart_h = getStartHorizontal(); } /** * Handles the event wxEVT_TSBAR_END from the horizontal bar */ void wxContourViewPanel :: onEndChange_Bar_Horizontal(wxCommandEvent& event) { - int nxEnd_h = getEndHorizontal(); +// int nxEnd_h = getEndHorizontal(); } /** * Handles the event wxEVT_SELECTION_END from the horizontal bar @@ -332,8 +331,8 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) */ void wxContourViewPanel :: onMovedBar_Horizontal(wxCommandEvent& event) { - int nxStart_h = getStartHorizontal(); - int nxEnd_h = getEndHorizontal(); +// int nxStart_h = getStartHorizontal(); +// int nxEnd_h = getEndHorizontal(); } @@ -680,13 +679,53 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) } void wxContourViewPanel::onChangedDeep (wxCommandEvent& event){ double val = getCurrentDeep(); - setActualVertical( (int)val ); + //setActualVertical( (int)val ); wxContourMainFrame::getInstance()->onChangeDeep((int)val); //_instantPanel->setConceptValue( "Axe Depth", (int)val ); // changeInstant(); } + void wxContourViewPanel::changeDeep(){ + double val = getCurrentDeep(); + setActualVertical( (int)val ); + } void wxContourViewPanel::onActionButtonPressed(wxCommandEvent& event){ + + + std::vector currentSelection = _sceneManager->getSelectedObjects(); + int elementsSelected = currentSelection.size(); + bool ctrlKey = _sceneManager->isCtrlPressed(); + char toolCommand = _sceneManager->getLastKeyCode(); + + + if ( toolCommand == 3 && ctrlKey ) //'C' || 'c' + { + wxContourMainFrame::getInstance()->onCopy(); + } + else if( toolCommand == 22 && ctrlKey ) //'V' || 'v' + { + wxContourMainFrame::getInstance()->onPaste(); + } + else if( toolCommand == 8 || (toolCommand==127) ) // backspace Delete + { + wxContourMainFrame::getInstance()->onDeleteContour(); + } + else if( toolCommand == 14 && ctrlKey ) //'N' || 'n' + { + //toolCommand = &(CREATE_CONTOUR_KEY); + } + else if( toolCommand == 15 && ctrlKey ) //'O' || 'o' + { + wxContourMainFrame::getInstance()->onLoad(); + } + else if( toolCommand == 19 && ctrlKey ) //'S' || 's' + { + wxContourMainFrame::getInstance()->saveFileWithContoursAutomatique(); + }else if( toolCommand == 26 ){ + wxContourMainFrame::getInstance()->onUndo(); + }else if( toolCommand == 25 ){ + wxContourMainFrame::getInstance()->onRedo(); + } } void wxContourViewPanel::removeSceneContours(){ @@ -763,4 +802,9 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) void wxContourViewPanel::GetPointsOfActualContour( std::vector *vecX, std::vector *vecY, std::vector *vecZ ){ _sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ); + } + + void wxContourViewPanel::setImageSlice(int z){ + _sceneManager->getWxVtkViewBase()->GetInteractorStyleBaseView()->GetWxVtk2DBaseView()->SetActualSlice(z); + RefreshInterface(); } \ No newline at end of file