X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FInterface_ManagerContour_NDimensions%2FwxContourViewPanel.cxx;h=61dc811b10969cfa1748b9759bddd56e8522111a;hb=c9965cf71b0d0cf7c85e8877d0c3505c97b1c3e9;hp=8d271f898c35797f8139a6400162cc53916e4137;hpb=b935f54c82b090852001860eb12f5433779c22c4;p=creaContours.git diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx index 8d271f8..61dc811 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,13 +147,12 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) //outSizer->Fit( this ); initializeScenceManager(); - } wxContourViewPanel :: ~wxContourViewPanel() { - + delete _sceneManager; } void wxContourViewPanel::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); - theViewPanel = new wxMaracas_N_ViewersWidget( this, showingVID, numViews ); + numViews->push_back(0); + 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); + } //------------------------------------------------------------------------------------------------------------ @@ -305,35 +304,35 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) //} //JCP 26 - 11 - 08 - } + } /** * Handles the event wxEVT_TSBAR_START from the horizontal bar */ 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 */ void wxContourViewPanel :: onSelectionEnd_Horizontal(wxCommandEvent& event) { - + } /** * Handles the event wxEVT_TSBAR_MOVED from the horizontal bar */ void wxContourViewPanel :: onMovedBar_Horizontal(wxCommandEvent& event) { - int nxStart_h = getStartHorizontal(); - int nxEnd_h = getEndHorizontal(); +// int nxStart_h = getStartHorizontal(); +// int nxEnd_h = getEndHorizontal(); } @@ -379,14 +378,14 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) */ void wxContourViewPanel :: onStartChange_Bar_Vertical(wxCommandEvent& event) { - int nxStart_v = getStartVertical(); +// int nxStart_v = getStartVertical(); } /** * Handles the event wxEVT_TSBAR_END from the vertical bar */ void wxContourViewPanel :: onEndChange_Bar_Vertical(wxCommandEvent& event) { - int nxEnd_v = getEndVertical(); +// int nxEnd_v = getEndVertical(); } /** * Handles the event wxEVT_SELECTION_END from the vertical bar @@ -400,8 +399,8 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) */ void wxContourViewPanel :: onMovedBar_Vertical(wxCommandEvent& event) { - int nxStart_v = getStartVertical(); - int nxEnd_v = getEndVertical(); +// int nxStart_v = getStartVertical(); +// int nxEnd_v = getEndVertical(); } @@ -672,6 +671,7 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) } wxContourMainFrame::getInstance()->changeInstant(); } + void wxContourViewPanel::onCreateMultipleROI (wxCommandEvent& event){ } void wxContourViewPanel::onCreateROI (wxCommandEvent& event){ @@ -691,6 +691,42 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE ) 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(){