]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourViewPanel.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourViewPanel.cxx
index c2b2b2be969d6d537dc81880df61b8afa1f59f1d..9c860f40d9968808fcf8d88f2e43266db31f28a2 100644 (file)
@@ -8,7 +8,7 @@
 //----------------------------------------------------------------------------------------------------------------
 // Other includes
 //----------------------------------------------------------------------------------------------------------------
-#include "ConceptDataWrap.h"
+//#include "ConceptDataWrap.h"
 
 //this should be eliminated at some point
 //#include "wxContourEventHandler.h"
@@ -680,13 +680,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<std::string> 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 +803,9 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHANGE )
 
        void wxContourViewPanel::GetPointsOfActualContour( std::vector<double> *vecX, std::vector<double> *vecY, std::vector<double> *vecZ ){
                _sceneManager->GetPointsOfActualContour(vecX, vecY, vecZ);
+       }
+
+       void wxContourViewPanel::setImageSlice(int z){
+               _sceneManager->getWxVtkViewBase()->GetInteractorStyleBaseView()->GetWxVtk2DBaseView()->SetActualSlice(z);
+               RefreshInterface();
        }
\ No newline at end of file