]> Creatis software - creaContours.git/blobdiff - lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_ManagerContour_NDimensions / wxContourEventHandler.cxx
index e53cf8723ecf1c0548232427983564e4c091fe6b..0bf6536690eb233c03ce3018a47fc44741e38e1b 100644 (file)
@@ -84,7 +84,7 @@ digraph example_0 {
 // Includes
 //------------------------------------------------------------------------------------------------------------
 
-#include "wxContour_ActionCommnadsID.h"
+#include "wxContour_ActionCommandsID.h"
 #include "NameWrapper.h"
 #include "ConceptDataWrap.h"
 #include "OutlineGroup.h"
@@ -368,7 +368,11 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown)
                inundo = 0;
                inredo = 0;
                stundoredo = "data/temp";
+#if(WIN32)
+               mkdir(stundoredo.c_str());
+#else
                mkdir(stundoredo.c_str(),755);
+#endif
                stundoredo += "/cont";
        }
        //------------------------------------------------------------------------------------------------------------
@@ -432,12 +436,12 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown)
                else
                {
                        dataConcept = _instantPanel->getLastConceptData();
-                       if( dataConcept->getName().compare( _theViewPanel->getVerticalConceptName() ) )
+                       if( dataConcept->getName().compare( _theViewPanel->getVerticalConceptName() ) == 0)
                        {
                                _theViewPanel->setActualVertical( dataConcept->getActualValue());
                                //_theViewPanel->setVerticalConcept( dataConcept->getName(), dataConcept->getMinShowedValue()/*dataConcept->getMinValue()*/, /*dataConcept->getMaxValue()*/ dataConcept->getMaxShowedValue(), dataConcept->getMinShowedValue(), dataConcept->getMaxShowedValue(), dataConcept->getActualValue());
                        }
-                       else if( dataConcept->getName().compare( _theViewPanel->getHorizontalConceptName() ) || _instantPanel->getIfConceptCheckedAt( dataConcept->getName(), 0 ) )
+                       else if( dataConcept->getName().compare( _theViewPanel->getHorizontalConceptName() ) == 0|| _instantPanel->getIfConceptCheckedAt( dataConcept->getName(), 0 ) )
                        {
                                _theViewPanel->setHorizontalConcept( dataConcept->getName(), dataConcept->getMinShowedValue()/*dataConcept->getMinValue()*/, /*dataConcept->getMaxValue()*/ dataConcept->getMaxShowedValue(), dataConcept->getMinShowedValue(), dataConcept->getMaxShowedValue(), dataConcept->getActualValue());
                        }
@@ -1769,7 +1773,7 @@ myfile.close();
                        int iTitle,sizeTitle = (maxX / _numberOfVariablesStatistics);
                        for ( iTitle=0; iTitle<sizeTitle ; iTitle++)
                        {
-                               fprintf(pFile,"-- \t %d-Size \t SizeRange \t Min \t Max \t Ave \t StDv \t" , iTitle,tmpString.char_str() );
+                               fprintf(pFile,"-- \t %d-Size \t SizeRange \t Min \t Max \t Ave \t StDv \t" , iTitle,tmpString.c_str() );
                        }
                        fprintf(pFile,"\n" );
 
@@ -2098,7 +2102,7 @@ myfile.close();
                std::vector<int> tempVector;
                _instantPanel->getInstant( tempVector );
         _performingOperation->reset();
-               _performingOperation->setStartCommand( (char)wxContour_ActionCommnadsID::COPY_TOOL );
+               _performingOperation->setStartCommand( (char)wxContour_ActionCommandsID::COPY_TOOL );
                _performingOperation->setStartOperationInstantVector( tempVector );
                _performingOperation->setKeyNamesOperationElems( keyNamesVector );
 
@@ -2107,7 +2111,7 @@ myfile.close();
        void wxContourEventHandler :: onPasteOutlines( )
        {
                char theStartCommand = _performingOperation->getStartCommand();
-               if (  theStartCommand == wxContour_ActionCommnadsID::COPY_TOOL )
+               if (  theStartCommand == wxContour_ActionCommandsID::COPY_TOOL )
                {
                        //JCP 20-10-08 Undo redo implementation
                        saveState();
@@ -2609,7 +2613,7 @@ myfile.close();
                _instantPanel = theInstantChooserPanel;
                _instantPanel->setWxEventHandler( this );
 
-               Connect( _instantPanel->GetId(), wxINSTANT_CHOOSER_CHANGE, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourEventHandler::onChangeInstant );
+               //Connect( _instantPanel->GetId(), wxINSTANT_CHOOSER_CHANGE, (wxObjectEventFunction) (wxCommandEventFunction)  &wxContourEventHandler::onChangeInstant );
 
                std::vector<int> vect;
                _instantPanel->getInstant( vect );
@@ -3131,35 +3135,35 @@ void wxContourEventHandler::OnInterpolation(wxCommandEvent& event)
        {
                std::vector<std::string> currentSelection = _sceneManager->getSelectedObjects();
                int elementsSelected = currentSelection.size();
-               if( toolCommand == (wxContour_ActionCommnadsID::CREATE_TOOL) )
+               if( toolCommand == (wxContour_ActionCommandsID::CREATE_TOOL) )
                {
                        onCreateContourFrame();
                }
-               if( toolCommand == (wxContour_ActionCommnadsID::CREATE_CONTOUR_KEY) )
+               if( toolCommand == (wxContour_ActionCommandsID::CREATE_CONTOUR_KEY) )
                {
                        createContour();
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::DELETE_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::DELETE_TOOL )
                {
                        onDeleteFrame( );
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::DELETE_KEY )
+               else if( toolCommand == wxContour_ActionCommandsID::DELETE_KEY )
                {
                        deleteContours( currentSelection );
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::SAVE_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::SAVE_TOOL )
                {
                        saveFileWithContours(  );
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::SAVE_KEY )
+               else if( toolCommand == wxContour_ActionCommandsID::SAVE_KEY )
                {
                        saveFileWithContoursAutomatique(  );
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::OPEN_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::OPEN_TOOL )
                {
                        openFileWithContours(  );
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::CHANGE_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::CHANGE_TOOL )
                {
                        if ( elementsSelected >= 1 )
                        {
@@ -3167,69 +3171,69 @@ void wxContourEventHandler::OnInterpolation(wxCommandEvent& event)
                        }
 
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::HIDE_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::HIDE_TOOL )
                {
                        if ( elementsSelected >= 1 )
                        {
                                onHideOutlines( currentSelection );
                        }                       
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::SHOW_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::SHOW_TOOL )
                {
                        if ( elementsSelected >= 1 )
                        {
                                onShowOutlines( currentSelection );
                        }
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::COPY_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::COPY_TOOL )
                {
                        if ( elementsSelected >= 1 )
                        {
                                onCopyOutlines( currentSelection );
                        }
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::PASTE_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::PASTE_TOOL )
                {
                        onPasteOutlines(  );                    
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::SPREAD_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::SPREAD_TOOL )
                {
                                onSpread();
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::AUTOMATIQUESEGMENTATION_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::AUTOMATIQUESEGMENTATION_TOOL )
                {
                        onAutomatiqueSegmentation(  );                  
                }
 
-               else if( toolCommand == wxContour_ActionCommnadsID::SELECT_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::SELECT_TOOL )
                {
                        onSelectOutlines( currentSelection );
                        
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::EDIT_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::EDIT_TOOL )
                {
                        if ( elementsSelected >= 1 )
                        {
                                onEditOutlines( currentSelection );
                        }
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::UNDO_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::UNDO_TOOL )
                {
                        onUNDO();
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::REDO_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::REDO_TOOL )
                {
                        onREDO();
                }               
-               else if( toolCommand == wxContour_ActionCommnadsID::INFORMATIONCONTOUR_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::INFORMATIONCONTOUR_TOOL )
                {
                        onInformationContourFrame();
                }               
-               else if( toolCommand == wxContour_ActionCommnadsID::INTERFACECONFIGURATION_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::INTERFACECONFIGURATION_TOOL )
                {
                        onInterfaceConfigurationFrame();
                }
-               else if( toolCommand == wxContour_ActionCommnadsID::TEST_TOOL )
+               else if( toolCommand == wxContour_ActionCommandsID::TEST_TOOL )
                {
                        onInterfaceTestFrame();
                }               
@@ -3717,10 +3721,15 @@ void wxContourEventHandler :: onREDO()
 
        std::string wxContourEventHandler::intToString(int num){
                std::string result;
-               for(int k = num; k == 0; k++){
-                       char temp = k % 10 + 48;
-                       k = k / 10;
-                       result = temp + result; 
+               if(num == 0){
+                       result = "0";
+               }else{
+                       int k=num;
+                       while (k > 0){
+                               char temp = k % 10 + 48;
+                               k = k / 10;
+                               result = temp + result; 
+                       }
                }
                return result;
        }