From: Juan Prieto Date: Thu, 6 Nov 2008 20:01:01 +0000 (+0000) Subject: 85% X-Git-Tag: EED.02Oct2009~97 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c7aa7286e02028ade712c1284fea9439d0d3c61c;p=creaContours.git 85% --- diff --git a/lib/Interface_Icons_NDimensions/interfEditMenu.cxx b/lib/Interface_Icons_NDimensions/interfEditMenu.cxx index 75aec01..d566f3e 100644 --- a/lib/Interface_Icons_NDimensions/interfEditMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfEditMenu.cxx @@ -33,8 +33,8 @@ void interfEditMenu::initButtons(wxEvtHandler* evtHandler) { this->addButtons(path, nom); this->setVectorFunction(funct); - this->setButtonName(0, wxContour_ActionCommandsID::COPY_TOOL); - this->setButtonName(1, wxContour_ActionCommandsID::PASTE_TOOL); + this->setButtonName(0, wxContour_ActionCommnadsID::COPY_TOOL); + this->setButtonName(1, wxContour_ActionCommnadsID::PASTE_TOOL); this->setButtonName(2, '-'); this->setButtonName(3, '-'); diff --git a/lib/Interface_Icons_NDimensions/interfIOMenu.cxx b/lib/Interface_Icons_NDimensions/interfIOMenu.cxx index ddf20f9..4884a6a 100644 --- a/lib/Interface_Icons_NDimensions/interfIOMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfIOMenu.cxx @@ -24,8 +24,8 @@ void interfIOMenu::initButtons(wxEvtHandler* evtHandler) { this->addButtons(path, nom); this->setVectorFunction(funct); - this->setButtonName(0, wxContour_ActionCommandsID::OPEN_TOOL); - this->setButtonName(1, wxContour_ActionCommandsID::SAVE_TOOL); + this->setButtonName(0, wxContour_ActionCommnadsID::OPEN_TOOL); + this->setButtonName(1, wxContour_ActionCommnadsID::SAVE_TOOL); this->connectEvents(evtHandler); diff --git a/lib/Interface_Icons_NDimensions/interfIOMenu.h b/lib/Interface_Icons_NDimensions/interfIOMenu.h index ce3bd5c..a9910e0 100644 --- a/lib/Interface_Icons_NDimensions/interfIOMenu.h +++ b/lib/Interface_Icons_NDimensions/interfIOMenu.h @@ -13,11 +13,11 @@ public: virtual void initButtons(wxEvtHandler* evtHandler) ; - void interfIOMenu :: onActionButtonPressed( wxCommandEvent& event ); + void onActionButtonPressed( wxCommandEvent& event ); private: //wxEvtHandler* eventHandler; }; -#endif \ No newline at end of file +#endif diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx index 720c24e..e4fe6a5 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx @@ -24,12 +24,12 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH PANEL4 = "Tools"; PANEL5 = "Segmentation"; - splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString("")); + splitterwindow = new wxSplitterWindow(this,-1, wxDefaultPosition, wxSize(sizex, sizey), wxSP_3DSASH, wxString(_T(""))); sizey = sizey/8; currentWindow = NULL; - wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString("")); + wxPanel* toolpanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); wxFlexGridSizer* flexsizer = new wxFlexGridSizer(6,2,1,1); toolpanel->SetSizer(flexsizer, true); @@ -48,12 +48,12 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH wxButton* b5 = getButton(toolpanel); b5->SetClientData(&PANEL5); - wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString("")); - wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString("")); - wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString("")); - wxPanel* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString("")); - wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString("")); - wxPanel* mentex5 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString("")); + wxPanel* mentex = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); + wxPanel* mentex1 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); + wxPanel* mentex2 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); + wxPanel* mentex3 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); + wxPanel* mentex4 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); + wxPanel* mentex5 = new wxPanel(toolpanel, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); menubar = new interfNewContourMenu(mentex, sizex, sizey, evtHandler, datadir); menubar1 = new interfIOMenu(mentex1, sizex, sizey, evtHandler, datadir); @@ -90,7 +90,7 @@ interfMainPanel::interfMainPanel(wxWindow * parent, int sizex, int sizey, wxEvtH toolpanel->Update(); toolpanel->Layout(); - infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString("")); + infoPanel = new wxPanel(splitterwindow, -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T(""))); wxFlexGridSizer* infosizer = new wxFlexGridSizer(1,1,2,2); infoPanel->SetSizer(infosizer, true); infoPanel->SetAutoLayout( true ); @@ -238,7 +238,7 @@ interfMainPanel* interfMainPanel::getInstance(){ wxPanel* interfMainPanel::initializeToolsPanel(wxWindow* parent, int sizex, int sizey, wxEvtHandler * evtHandler){ - wxPanel* panel = new wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN, wxString("Spread")); + wxPanel* panel = new wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_SUNKEN, wxString(_T("Spread"))); wxFlexGridSizer* flexsizer = new wxFlexGridSizer(2,1,2,2) ; panel->SetSizer(flexsizer, true); @@ -283,34 +283,34 @@ void interfMainPanel::onActionButtonPressed1( wxCommandEvent& event ){ int sizechange=0; - if(dstring==PANEL){ + if(dstring.compare(PANEL)==0){ dmenu = menubar; text = statictext; - }else if( dstring==PANEL1){ + }else if(dstring.compare(PANEL1)==0 ){ dmenu = menubar1; text = statictext1; - }else if(dstring==PANEL2){ + }else if(dstring.compare(PANEL2)==0){ dmenu = menubar2; text = statictext2; - }else if(dstring==PANEL3){ + }else if(dstring.compare(PANEL3)==0){ dmenu = menubar3; text = statictext3; - }else if(dstring==PANEL4){ + }else if(dstring.compare(PANEL4)==0){ dmenu = menubar4; text = statictext4; - }else if(dstring==PANEL5){ + }else if(dstring.compare(PANEL5)==0){ dmenu = menubar5; text = statictext5; } - if(b->GetLabel() == "+" ){ + if(wxStrcmp(b->GetLabel(),_T("+"))==0 ){ dmenu->Show(true); sizechange = 1; - b->SetLabel("-"); + b->SetLabel(_T("-")); }else{ dmenu->Show(false); sizechange = -1; - b->SetLabel("+"); + b->SetLabel(_T("+")); } sizechange *= dmenu->GetSize().GetHeight(); @@ -321,13 +321,13 @@ void interfMainPanel::onActionButtonPressed1( wxCommandEvent& event ){ } wxStaticText* interfMainPanel::getText(wxWindow* parent, std::string nom){ - return new wxStaticText(parent, -1, wxString(nom), wxDefaultPosition, - wxDefaultSize, wxALIGN_CENTRE, wxString(nom)); + return new wxStaticText(parent, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition, + wxDefaultSize, wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8)); } wxButton* interfMainPanel::getButton(wxWindow* parent){ - wxButton* b = new wxButton(parent, -1, wxString("-"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, - wxDefaultValidator, wxString("-")); + wxButton* b = new wxButton(parent, -1, wxString(_T("-")), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT, + wxDefaultValidator, wxString(_T("-"))); return b; } diff --git a/lib/Interface_Icons_NDimensions/interfMenuBar.h b/lib/Interface_Icons_NDimensions/interfMenuBar.h index 53b11f7..f9879da 100644 --- a/lib/Interface_Icons_NDimensions/interfMenuBar.h +++ b/lib/Interface_Icons_NDimensions/interfMenuBar.h @@ -55,11 +55,8 @@ public: for(int i = 0; i < vnom.size(); i++){ //sizex = vectbutton[i]->GetSize().GetWidth(); - //const std::string n = vnom[i]; - wxString newstring1(vnom[i].c_str() , wxConvUTF8); - //vectbutton[i]->SetToolTip(wxString(n)); - vectbutton[i]->SetToolTip(newstring1); - + std::string n = vnom[i]; + vectbutton[i]->SetToolTip(wxString(n.c_str(),wxConvUTF8)); //wxStaticText* statictext = getText(n, sizex, 15); //flexsizer->Add(statictext, wxEXPAND |wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTRE_HORIZONTAL|wxSHAPED); } @@ -76,13 +73,12 @@ public: virtual wxBitmapButton* getButton(std::string imgpath, int sizex, int sizey){ vectimgpath.push_back(imgpath); - wxString newstring1( imgpath.c_str() , wxConvUTF8); - //wxBitmap* bitmap = new wxBitmap(imgpath, wxBITMAP_TYPE_PNG); - wxBitmap* bitmap = new wxBitmap(newstring1, wxBITMAP_TYPE_PNG); + wxBitmap* bitmap = new wxBitmap(wxString(imgpath.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG); + //wxSize(sizex,sizey) wxBitmapButton* bitmapbutton = new wxBitmapButton(this, -1, *bitmap, wxDefaultPosition, wxDefaultSize, - wxBU_AUTODRAW, wxDefaultValidator, _T("")); + wxBU_AUTODRAW, wxDefaultValidator, wxString(_T(""))); vectbutton.push_back(bitmapbutton); return bitmapbutton; @@ -97,10 +93,8 @@ public: **/ virtual wxStaticText* getText(std::string nom, int sizex, int sizey){ vectnom.push_back(nom); - wxString newstring1(nom.c_str() , wxConvUTF8); - return new wxStaticText(this, -1, newstring1 /*wxString(nom)*/, wxDefaultPosition, - //wxSize(sizex,sizey), wxALIGN_CENTRE, wxString(nom)); - wxSize(sizex,sizey), wxALIGN_CENTRE, newstring1); + return new wxStaticText(this, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition, + wxSize(sizex,sizey), wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8)); } /** ** Sets the vector funcion, this vector must contain a function for each button created @@ -143,7 +137,8 @@ public: **/ virtual void setButtonName(int i, const char c){ if(i < vectbutton.size()){ - vectbutton[i]->SetName(c); + std::string ac = c+""; + vectbutton[i]->SetName(wxString(ac.c_str(),wxConvUTF8)); } } diff --git a/lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx b/lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx index fb5e8ea..8ae1df6 100644 --- a/lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx @@ -56,7 +56,7 @@ interfSegmentationMenu::~interfSegmentationMenu() void interfSegmentationMenu::onSegmentationPressed(wxCommandEvent& event){ if(segmentPanel == NULL){ - segmentPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString("")); + segmentPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T(""))); wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1); @@ -67,8 +67,8 @@ void interfSegmentationMenu::onSegmentationPressed(wxCommandEvent& event){ wxPanel* panel = contourevent->getSegmentationPanel(segmentPanel); - wxStaticText* stattext = new wxStaticText(segmentPanel, -1, wxString(" Automatic Segmentation "), wxDefaultPosition, - wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString("")); + wxStaticText* stattext = new wxStaticText(segmentPanel, -1, wxString(_T(" Automatic Segmentation ")), wxDefaultPosition, + wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T(""))); flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE); flexsizer->Add(panel, wxEXPAND); @@ -89,7 +89,7 @@ void interfSegmentationMenu::hideAxis(){ void interfSegmentationMenu::onSegmentationPressedITK(wxCommandEvent& event){ if(segmentPanelITK == NULL){ - segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString("")); + segmentPanelITK = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T(""))); wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1); @@ -100,8 +100,8 @@ void interfSegmentationMenu::onSegmentationPressedITK(wxCommandEvent& event){ wxPanel* panel = contourevent->getSegmentationPanelITK(segmentPanelITK); - wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(" Automatic ITK Segmentation "), wxDefaultPosition, - wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString("")); + wxStaticText* stattext = new wxStaticText(segmentPanelITK, -1, wxString(_T(" Automatic ITK Segmentation ")), wxDefaultPosition, + wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T(""))); flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE); flexsizer->Add(panel, wxEXPAND); diff --git a/lib/Interface_Icons_NDimensions/interfToolsMenu.cxx b/lib/Interface_Icons_NDimensions/interfToolsMenu.cxx index d92b5a5..6ee87b3 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfToolsMenu.cxx @@ -42,7 +42,7 @@ void interfToolsMenu::initButtons(wxEvtHandler* evtHandler) { this->addButtons(path, nom); this->setVectorFunction(funct); - this->setButtonName(0, wxContour_ActionCommandsID::CHANGE_TOOL); + this->setButtonName(0, wxContour_ActionCommnadsID::CHANGE_TOOL); this->connectEvents(evtHandler); @@ -68,7 +68,7 @@ void interfToolsMenu::onSpreadPressed(wxCommandEvent& event){ if(spreadPanel==NULL){ - spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString("")); + spreadPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC, wxString(_T(""))); wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1); spreadPanel->SetSizer(flexsizer, true); spreadPanel->SetAutoLayout( true ); @@ -77,8 +77,8 @@ void interfToolsMenu::onSpreadPressed(wxCommandEvent& event){ wxPanel* panel = contourevent->getSpreadPanel(spreadPanel); - wxStaticText* stattext = new wxStaticText(spreadPanel, -1, wxString(" Automatic Spread "), wxDefaultPosition, - wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString("")); + wxStaticText* stattext = new wxStaticText(spreadPanel, -1, wxString(_T(" Automatic Spread ")), wxDefaultPosition, + wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T(""))); flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE); flexsizer->Add(panel, wxEXPAND); @@ -122,7 +122,7 @@ void interfToolsMenu::onInformationPressed(wxCommandEvent& event){ void interfToolsMenu::onConfigurationPressed(wxCommandEvent& event){ if(configPanel == NULL){ - configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString("")); + configPanel = new wxPanel(interfMainPanel::getInstance()->getInfoPanel(), -1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxString(_T(""))); wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1); configPanel->SetSizer(flexsizer, true); configPanel->SetAutoLayout( true ); @@ -130,8 +130,8 @@ void interfToolsMenu::onConfigurationPressed(wxCommandEvent& event){ wxPanel* panel = contourevent->getConfigurationPanel(configPanel); - wxStaticText* stattext = new wxStaticText(configPanel, -1, wxString(" Interface Configuration "), wxDefaultPosition, - wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString("")); + wxStaticText* stattext = new wxStaticText(configPanel, -1, wxString(_T(" Interface Configuration ")), wxDefaultPosition, + wxDefaultSize, wxALIGN_CENTRE|wxBORDER_SIMPLE|wxFULL_REPAINT_ON_RESIZE, wxString(_T(""))); flexsizer->Add(stattext,wxALIGN_CENTER | wxALIGN_CENTRE); diff --git a/lib/Interface_Icons_NDimensions/interfToolsSpreadPanel.cxx b/lib/Interface_Icons_NDimensions/interfToolsSpreadPanel.cxx index 20d6c8c..f00b780 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsSpreadPanel.cxx +++ b/lib/Interface_Icons_NDimensions/interfToolsSpreadPanel.cxx @@ -31,7 +31,7 @@ interfToolsSpreadPanel::~interfToolsSpreadPanel() } wxPanel* interfToolsSpreadPanel::initializeRadioBox(){ - wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, _T("")); + wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); wxString lstOptions[3]; lstOptions[0]=_T("A"); lstOptions[1]=_T("B"); @@ -44,20 +44,20 @@ wxPanel* interfToolsSpreadPanel::initializeRadioBox(){ wxPanel* interfToolsSpreadPanel::initializeButton(std::string path, std::string nom){ - wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, _T("")); + wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T(""))); wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1,2,2,2); panel->SetSizer(flexsizer, true); panel->SetAutoLayout( true ); - wxBitmap* bitmap = new wxBitmap(path, wxBITMAP_TYPE_PNG); + wxBitmap* bitmap = new wxBitmap(wxString(path.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG); wxBitmapButton* bitmapbutton = new wxBitmapButton(panel, -1, *bitmap, wxDefaultPosition, wxDefaultSize, - wxBU_AUTODRAW, wxDefaultValidator, _T("")); + wxBU_AUTODRAW, wxDefaultValidator, wxString(_T(""))); - wxStaticText* statictext = new wxStaticText(panel, -1, wxString(nom), wxDefaultPosition, - wxDefaultSize, wxALIGN_CENTRE, wxString(nom)); + wxStaticText* statictext = new wxStaticText(panel, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition, + wxDefaultSize, wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8)); flexsizer->Add(bitmapbutton, wxFIXED_MINSIZE); @@ -70,9 +70,9 @@ wxPanel* interfToolsSpreadPanel::initializeButton(std::string path, std::string wxPanel* interfToolsSpreadPanel::initializeAddRemoveContour(){ - wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE |wxVSCROLL , _T("")); + wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE |wxVSCROLL , wxString(_T(""))); - scrollwin = new wxScrolledWindow(panel, -1, wxDefaultPosition, wxSize(80,50), wxVSCROLL, _T("")); + scrollwin = new wxScrolledWindow(panel, -1, wxDefaultPosition, wxSize(80,50), wxVSCROLL, wxString(_T(""))); checkboxsizer = new wxFlexGridSizer(0,1,2,2); @@ -88,8 +88,8 @@ wxPanel* interfToolsSpreadPanel::initializeAddRemoveContour(){ void interfToolsSpreadPanel::addContourCheckBox(std::string id){ - wxCheckBox* check = new wxCheckBox(scrollwin, -1, wxString(id), wxDefaultPosition, wxDefaultSize, 0, - wxDefaultValidator, wxString(id)); + wxCheckBox* check = new wxCheckBox(scrollwin, -1, wxString(id.c_str(),wxConvUTF8), wxDefaultPosition, wxDefaultSize, 0, + wxDefaultValidator, wxString(id.c_str(),wxConvUTF8)); checkvect.push_back(id); diff --git a/lib/Interface_Icons_NDimensions/interfToolsSpreadPanel.h b/lib/Interface_Icons_NDimensions/interfToolsSpreadPanel.h index afd5ca1..a0ffdb7 100644 --- a/lib/Interface_Icons_NDimensions/interfToolsSpreadPanel.h +++ b/lib/Interface_Icons_NDimensions/interfToolsSpreadPanel.h @@ -71,6 +71,4 @@ private: }; -#endif - - +#endif \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/ConceptDataWrap.h b/lib/Interface_ManagerContour_NDimensions/ConceptDataWrap.h index c2ad82b..40fd49d 100644 --- a/lib/Interface_ManagerContour_NDimensions/ConceptDataWrap.h +++ b/lib/Interface_ManagerContour_NDimensions/ConceptDataWrap.h @@ -92,6 +92,4 @@ private: }; -#endif // __ConceptDataWrap_HEADER_FILE__ - - +#endif // __ConceptDataWrap_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/PerformingOperation.h b/lib/Interface_ManagerContour_NDimensions/PerformingOperation.h index 7f42311..565350b 100644 --- a/lib/Interface_ManagerContour_NDimensions/PerformingOperation.h +++ b/lib/Interface_ManagerContour_NDimensions/PerformingOperation.h @@ -83,6 +83,4 @@ private: char _endCommand; }; -#endif // __PerformingOperation_HEADER_FILE__ - - +#endif // __PerformingOperation_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/__wxContourEventHandler.cxx__ b/lib/Interface_ManagerContour_NDimensions/__wxContourEventHandler.cxx__ index 0a2ad3b..a78be78 100644 --- a/lib/Interface_ManagerContour_NDimensions/__wxContourEventHandler.cxx__ +++ b/lib/Interface_ManagerContour_NDimensions/__wxContourEventHandler.cxx__ @@ -84,7 +84,7 @@ digraph example_0 { // Includes //------------------------------------------------------------------------------------------------------------ -#include "wxContour_ActionCommandsID.h" +#include "wxContour_ActionCommnadsID.h" #include "NameWrapper.h" #include "ConceptDataWrap.h" #include "OutlineGroup.h" @@ -1791,7 +1791,7 @@ myfile.close(); std::vector tempVector; _instantPanel->getInstant( tempVector ); _performingOperation->reset(); - _performingOperation->setStartCommand( (char)wxContour_ActionCommandsID::COPY_TOOL ); + _performingOperation->setStartCommand( (char)wxContour_ActionCommnadsID::COPY_TOOL ); _performingOperation->setStartOperationInstantVector( tempVector ); _performingOperation->setKeyNamesOperationElems( keyNamesVector ); @@ -1800,7 +1800,7 @@ myfile.close(); void wxContourEventHandler :: onPasteOutlines( ) { char theStartCommand = _performingOperation->getStartCommand(); - if ( theStartCommand == wxContour_ActionCommandsID::COPY_TOOL ) + if ( theStartCommand == wxContour_ActionCommnadsID::COPY_TOOL ) { std::vector tempVector; _instantPanel->getInstant( tempVector ); @@ -2638,35 +2638,35 @@ void wxContourEventHandler::OnInterpolation(wxCommandEvent& event) { std::vector currentSelection = _sceneManager->getSelectedObjects(); int elementsSelected = currentSelection.size(); - if( toolCommand == (wxContour_ActionCommandsID::CREATE_TOOL) ) + if( toolCommand == (wxContour_ActionCommnadsID::CREATE_TOOL) ) { onCreateContourFrame(); } - if( toolCommand == (wxContour_ActionCommandsID::CREATE_CONTOUR_KEY) ) + if( toolCommand == (wxContour_ActionCommnadsID::CREATE_CONTOUR_KEY) ) { createContour(); } - else if( toolCommand == wxContour_ActionCommandsID::DELETE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::DELETE_TOOL ) { onDeleteFrame( ); } - else if( toolCommand == wxContour_ActionCommandsID::DELETE_KEY ) + else if( toolCommand == wxContour_ActionCommnadsID::DELETE_KEY ) { deleteContours( currentSelection ); } - else if( toolCommand == wxContour_ActionCommandsID::SAVE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::SAVE_TOOL ) { saveFileWithContours( ); } - else if( toolCommand == wxContour_ActionCommandsID::SAVE_KEY ) + else if( toolCommand == wxContour_ActionCommnadsID::SAVE_KEY ) { saveFileWithContoursAutomatique( ); } - else if( toolCommand == wxContour_ActionCommandsID::OPEN_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::OPEN_TOOL ) { openFileWithContours( ); } - else if( toolCommand == wxContour_ActionCommandsID::CHANGE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::CHANGE_TOOL ) { if ( elementsSelected >= 1 ) { @@ -2674,69 +2674,69 @@ void wxContourEventHandler::OnInterpolation(wxCommandEvent& event) } } - else if( toolCommand == wxContour_ActionCommandsID::HIDE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::HIDE_TOOL ) { if ( elementsSelected >= 1 ) { onHideOutlines( currentSelection ); } } - else if( toolCommand == wxContour_ActionCommandsID::SHOW_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::SHOW_TOOL ) { if ( elementsSelected >= 1 ) { onShowOutlines( currentSelection ); } } - else if( toolCommand == wxContour_ActionCommandsID::COPY_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::COPY_TOOL ) { if ( elementsSelected >= 1 ) { onCopyOutlines( currentSelection ); } } - else if( toolCommand == wxContour_ActionCommandsID::PASTE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::PASTE_TOOL ) { onPasteOutlines( ); } - else if( toolCommand == wxContour_ActionCommandsID::SPREAD_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::SPREAD_TOOL ) { onSpread(); } - else if( toolCommand == wxContour_ActionCommandsID::AUTOMATIQUESEGMENTATION_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::AUTOMATIQUESEGMENTATION_TOOL ) { onAutomatiqueSegmentation( ); } - else if( toolCommand == wxContour_ActionCommandsID::SELECT_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::SELECT_TOOL ) { onSelectOutlines( currentSelection ); } - else if( toolCommand == wxContour_ActionCommandsID::EDIT_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::EDIT_TOOL ) { if ( elementsSelected >= 1 ) { onEditOutlines( currentSelection ); } } - else if( toolCommand == wxContour_ActionCommandsID::UNDO_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::UNDO_TOOL ) { onUNDO(); } - else if( toolCommand == wxContour_ActionCommandsID::REDO_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::REDO_TOOL ) { onREDO(); } - else if( toolCommand == wxContour_ActionCommandsID::INFORMATIONCONTOUR_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::INFORMATIONCONTOUR_TOOL ) { onInformationContourFrame(); } - else if( toolCommand == wxContour_ActionCommandsID::INTERFACECONFIGURATION_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::INTERFACECONFIGURATION_TOOL ) { onInterfaceConfigurationFrame(); } - else if( toolCommand == wxContour_ActionCommandsID::TEST_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::TEST_TOOL ) { onInterfaceTestFrame(); } diff --git a/lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx b/lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx index 833c047..47c1c7e 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxConceptControl.cxx @@ -232,10 +232,18 @@ DEFINE_EVENT_TYPE( wxEVT_CONCEPT_RELEASE ) //------------------------------------------------------------------------------------------------------------ wxCheckBox * wxConceptControl :: createCheckBoxAndAddToSizer(wxSizer *sizer, std::string label, wxWindowID id,int groupID) { - char buffer[33]; - //itoa( groupID, buffer, 10); // No ANSI C! - sprintf(buffer, "%d", groupID); - wxCheckBox *checkbox = new wxCheckBox( this, -1, wxString( label.c_str(), wxConvUTF8), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxString( buffer, wxConvUTF8) ); + //char buffer[33]; + //itoa( groupID, buffer, 10); + + std::string buffer; + for(int k = groupID; k == 0; k++){ + char temp = k % 10 + 48; + k = k / 10; + buffer = temp + buffer; + } + + //wxCheckBox *checkbox = new wxCheckBox( this, -1, wxString( label.c_str(), wxConvUTF8), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxString( buffer, wxConvUTF8) ); + wxCheckBox *checkbox = new wxCheckBox( this, -1, wxString( label.c_str(), wxConvUTF8), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, wxString( buffer.c_str(), wxConvUTF8) ); sizer->Add(checkbox, 0, wxLEFT | wxRIGHT, 5); sizer->Add(0, 2, 0, wxGROW); checkBoxes.push_back( checkbox ); diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.cxx index ace7008..e53cf87 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.cxx @@ -1,6 +1,6 @@ -/* Diagrama de Secuencia de cambiar un instante +/* Diagrama de Secuaencia de cambiar un instante wxContourEventHandler :: changeInstant() OutlineModelManager :: ->setInstant( _actualInstant ); OutlineModelManager :: updateToActualInstant() @@ -84,7 +84,7 @@ digraph example_0 { // Includes //------------------------------------------------------------------------------------------------------------ -#include "wxContour_ActionCommandsID.h" +#include "wxContour_ActionCommnadsID.h" #include "NameWrapper.h" #include "ConceptDataWrap.h" #include "OutlineGroup.h" @@ -103,7 +103,6 @@ digraph example_0 { #include - //------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------ @@ -119,9 +118,9 @@ PanelBullEyeOptions::PanelBullEyeOptions (wxWindow * parent, wxSize size) : wxString lstOptions[2]; - lstOptions[0]=_T("General options"); - lstOptions[1]=_T("Detail options"); - _radioboxBullEyeGenOpt = new wxRadioBox(panel, -1, _T("General/Detail options"), wxDefaultPosition, wxSize(200,45), 2 , lstOptions, 2, wxRA_SPECIFY_COLS); + lstOptions[0]= wxString("General options",wxConvUTF8); + lstOptions[1]= wxString("Detail options",wxConvUTF8); + _radioboxBullEyeGenOpt = new wxRadioBox(panel, -1, wxString("General/Detail options",wxConvUTF8), wxDefaultPosition, wxSize(200,45), 2 , lstOptions, 2, wxRA_SPECIFY_COLS); _radioboxBullEyeGenOpt->SetSelection(0); _spinctrlBullEyeNumOfCrowns = new wxSpinCtrl( panel , -1,_T("B"),wxDefaultPosition, wxSize(40,20) ); @@ -369,10 +368,7 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown) inundo = 0; inredo = 0; stundoredo = "data/temp"; - char buff[3000]; // hope it's enough! - sprintf(buff, "mkdir %s;",stundoredo.c_str()); - system(buff); - //mkdir(stundoredo.c_str()); + mkdir(stundoredo.c_str(),755); stundoredo += "/cont"; } //------------------------------------------------------------------------------------------------------------ @@ -521,7 +517,7 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown) void wxContourEventHandler::onSpreadReset( wxCommandEvent& event ) { - _wxtextctrlSpread->SetValue(_T("")); + _wxtextctrlSpread->SetValue(wxString("",wxConvUTF8)); _contourPropagation->resetAppend(); } @@ -545,13 +541,16 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown) _contourPropagation->appendContour(&vecX , &vecY , &vecZ); wxString newstring; - newstring.Printf(_T("%s %d -"), - _wxtextctrlSpread->GetValue().c_str(), - actualSlice ); + //newstring.Printf("%s %d -",_wxtextctrlSpread->GetValue(), actualSlice ); + newstring.append(wxString(_wxtextctrlSpread->GetValue(),wxConvUTF8)); + newstring.append(wxString(" ",wxConvUTF8)); + newstring.append(wxString(intToString(actualSlice).c_str(),wxConvUTF8)); _wxtextctrlSpread->SetValue(newstring); } // if } + + //------------------------------------------------------------------------------------------------------------ void wxContourEventHandler::onSpreadGo( wxCommandEvent& event ) { @@ -589,7 +588,11 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown) for ( z=(int)minZ ; z<=(int)maxZ ; z++ ) { porcent = 100.0* (z-minZ)/totalZ; - tmpString.Printf( _T(" %d %c %d/%d %d"), (int)porcent , 37 , (int)(z-minZ+1), (int)totalZ,z ); + int numero = (int)(z-minZ+1)/(int)totalZ; + std::string stringtemp = " "+intToString(porcent)+"% "+intToString(numero)+" "+intToString(z); + tmpString.Append(wxString(stringtemp.c_str(),wxConvUTF8)); + + //tmpString.Printf(" %d %c %d/%d %d", (int)porcent , 37 , (int)(z-minZ+1), (int)totalZ,z ); _staticTextSpread->SetLabel(tmpString); if (_contourPropagation->ifSliceKeyContourExist(z)==false) @@ -632,7 +635,7 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown) } // if addedModel }// ifSliceKeyContourExist } // for z - _staticTextSpread->SetLabel(_T(" ")); + _staticTextSpread->SetLabel(wxString(" ",wxConvUTF8)); //RefreshInterface(); @@ -703,7 +706,7 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown) _contourPropagation = new ContourPropagation(); - wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, /*wxString("")*/ _T("") ); + wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, wxString("",wxConvUTF8)); wxButton *spreadResetBtn = new wxButton(panel,-1,_T("Reset"),wxDefaultPosition, wxDefaultSize ); wxButton *spreadAddBtn = new wxButton(panel,-1,_T("Add"),wxDefaultPosition, wxDefaultSize); @@ -712,13 +715,13 @@ double PanelBullEyeOptions::GetAngDeltaOfCrownSection(int nCrown) lstOptions[0]=_T("A"); lstOptions[1]=_T("B"); lstOptions[2]=_T("C"); - _spreadMethodRadiobox = new wxRadioBox(panel, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxDefaultSize, 3 , lstOptions, 3, wxRA_SPECIFY_COLS); + _spreadMethodRadiobox = new wxRadioBox(panel, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxDefaultSize, 3 , lstOptions, 3, wxRA_SPECIFY_COLS); _spreadMethodRadiobox->SetSelection(2); wxButton *spreadGoBtn = new wxButton(panel,-1,_T("Go"),wxDefaultPosition, wxDefaultSize); _staticTextSpread = new wxStaticText(panel,-1,_T(" ")); - _wxtextctrlSpread = new wxTextCtrl(panel,-1, _T("") ,wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); + _wxtextctrlSpread = new wxTextCtrl(panel,-1, _T(""),wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); Connect( spreadResetBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContourEventHandler::onSpreadReset ); @@ -1051,7 +1054,7 @@ myfile.close(); lstOptions[0]=_T("A"); lstOptions[1]=_T("B"); lstOptions[2]=_T("C"); - methodRadiobox = new wxRadioBox(panel, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxSize(200,45), 3 , lstOptions, 3, wxRA_SPECIFY_COLS); + methodRadiobox = new wxRadioBox(panel, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxSize(200,45), 3 , lstOptions, 3, wxRA_SPECIFY_COLS); methodRadiobox->SetSelection(2); _staticTextSegmentation = new wxStaticText(panel,-1,_T(" ")); @@ -1109,7 +1112,7 @@ myfile.close(); wxButton *spreadResetBtn = new wxButton(panel,-1,_T("Reset"),wxDefaultPosition, wxSize(80,35) ); wxButton *spreadAddBtn = new wxButton(panel,-1,_T("Add"),wxDefaultPosition, wxSize(80,35)); wxButton *spreadGoBtn = new wxButton(panel,-1,_T("GoA"),wxDefaultPosition, wxSize(80,35)); - _wxtextctrlTest = new wxTextCtrl(panel,-1, _T(""),wxDefaultPosition, wxSize(200,150), wxTE_MULTILINE ); + _wxtextctrlTest = new wxTextCtrl(panel,-1, _T(""),wxDefaultPosition, wxSize(200,150), wxTE_MULTILINE ); _TestFrame->SetEventHandler( this ); Connect( spreadResetBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContourEventHandler::onTestReset ); @@ -1162,15 +1165,12 @@ myfile.close(); } // for _contourPropagation->appendContour(&vecX , &vecY , &vecZ); - wxString newstring1( _wxtextctrlTest->GetValue().c_str() , wxConvUTF8); - wxString newstring2; - newstring2.Printf(_T(" %d -"), actualSlice ); - wxString newstring; - newstring = newstring1+newstring2; - - //newstring.Printf("%s %d -",_wxtextctrlTest->GetValue(), actualSlice ); - + newstring.append(_wxtextctrlTest->GetValue()); + newstring.append(_T(" ")); + newstring.append(wxString(intToString(actualSlice).c_str(),wxConvUTF8)); + //newstring.Printf(_T("%s %d -"),, ); + newstring.append(_T(" -")); _wxtextctrlTest->SetValue(newstring); } // if } @@ -1256,6 +1256,7 @@ myfile.close(); //------------------------------------------------------------------------------------------------------------ void wxContourEventHandler::FillGridWithContoursInformation() { + wxString tempString; _grid->ClearGrid(); _grid->SetColLabelValue(0, _T("A") ); _grid->SetColLabelValue(1, _T("B") ); @@ -1276,19 +1277,14 @@ myfile.close(); std::vector lstContourThings = this->_modelManager->getOutlinesAtInstant( &instant ); sizeLstContourThings = lstContourThings.size(); - wxString tempString; - tempString.Printf(_T("%d - %d"), - z, - sizeLstContourThings); - + tempString.Printf(_T("%d - %d"),z, sizeLstContourThings); _grid->SetRowLabelValue(z, tempString ); for (ii=0 ; iigetName() ; // Doesn't compile. See Creatis Wiki ! - const wxString tempString2((*contourthing)->getName().c_str(),wxConvUTF8 ); - _grid->SetCellValue( z, ii, tempString2 ); + tempString = wxString((*contourthing)->getName().c_str(),wxConvUTF8) ; + _grid->SetCellValue( z, ii, tempString ); } } @@ -1536,7 +1532,9 @@ myfile.close(); { porcent = 100.0* (z-minZ)/totalZ; - tmpString.Printf(_T("Saving Values %d %c %d/%d %d"), (int)porcent , 37 , z-minZ+1, (int)totalZ ,z); + + tmpString.Printf(_T("Saving Values")); + tmpString.Printf(_T(" %d %c %d/%d %d"), (int)porcent , 37 , z-minZ+1, (int)totalZ ,z); _staticTextInformation->SetLabel(tmpString); @@ -1588,7 +1586,14 @@ myfile.close(); &pLstValuePosZ); wxString filename; - filename.Printf(_T("%s\\%s-slice%d-cont%d.txt"),directory.c_str(),namefile.c_str(),z,iContourGroup); + filename.Printf(_T("%s"),directory.c_str()); + filename.Printf(_T("\\")); + filename.Printf(_T("%s"),namefile.c_str()); + filename.Printf(_T("-slice")); + filename.Printf(_T("%d"),z); + filename.Printf(_T("-cont")); + filename.Printf(_T("%d"),iContourGroup); + filename.Printf(_T(".txt")); FILE *pFile=fopen((const char *)filename.mb_str(),"w+"); fprintf(pFile,"value \t x \t y \t z\n" ); int iLstValue,sizeLstValue=pLstValue.size(); @@ -1646,7 +1651,8 @@ myfile.close(); { porcent = 100.0* (z-minZ)/totalZ; - tmpString.Printf(_T("Saving Values %d %c %d/%d %d"), (int)porcent , 37 , z-minZ+1, (int)totalZ ,z); + tmpString.Printf(_T("Saving Values")); + tmpString.Printf(_T("%d %c %d/%d %d"), (int)porcent , 37 , z-minZ+1, (int)totalZ ,z); _staticTextInformation->SetLabel(tmpString); //Extraction data from contours of each slice @@ -1700,7 +1706,11 @@ myfile.close(); wxString filename; - filename.Printf(_T("%s\\%s-Value.mhd"),directory.c_str(),namefile.c_str(),z); + //filename.Printf(_T("%s\\%s-Value.mhd",directory.c_str(),namefile.c_str(),z); + filename.Printf(_T("%s"),directory.c_str()); + filename.Printf(_T("\\")); + filename.Printf(_T("%s"),namefile.c_str()); + filename.Printf(_T("-Value.mhd")); // Image Value vtkMetaImageWriter *writerValueImage = vtkMetaImageWriter::New( ); @@ -1710,7 +1720,11 @@ myfile.close(); writerValueImage->Write( ); // Image Mask - filename.Printf(_T("%s\\%s-Mask.mhd"),directory.c_str(),namefile.c_str(),z); + // filename.Printf("%s\\%s-Mask.mhd",directory.c_str(),namefile.c_str(),z); + filename.Printf(_T("%s"),directory.c_str()); + filename.Printf(_T("\\")); + filename.Printf(_T("%s"),namefile.c_str()); + filename.Printf(_T("-Mask.mhd")); vtkMetaImageWriter *writerMaskImage = vtkMetaImageWriter::New( ); writerMaskImage->SetInput( contourextractdata->GetVtkImageMaskResult() ); writerMaskImage->SetFileName( (const char *)filename.mb_str() ); @@ -1755,7 +1769,7 @@ myfile.close(); int iTitle,sizeTitle = (maxX / _numberOfVariablesStatistics); for ( iTitle=0; iTitle tempVector; _instantPanel->getInstant( tempVector ); _performingOperation->reset(); - _performingOperation->setStartCommand( (char)wxContour_ActionCommandsID::COPY_TOOL ); + _performingOperation->setStartCommand( (char)wxContour_ActionCommnadsID::COPY_TOOL ); _performingOperation->setStartOperationInstantVector( tempVector ); _performingOperation->setKeyNamesOperationElems( keyNamesVector ); @@ -2093,7 +2107,7 @@ myfile.close(); void wxContourEventHandler :: onPasteOutlines( ) { char theStartCommand = _performingOperation->getStartCommand(); - if ( theStartCommand == wxContour_ActionCommandsID::COPY_TOOL ) + if ( theStartCommand == wxContour_ActionCommnadsID::COPY_TOOL ) { //JCP 20-10-08 Undo redo implementation saveState(); @@ -2179,7 +2193,7 @@ myfile.close(); } //------------------------------------------------------------------------------------------------------------ - void wxContourEventHandler :: deleteContours( std::vector & keyNamesVector ) + void wxContourEventHandler :: deleteContours( std::vector keyNamesVector ) { int i,size=keyNamesVector.size(); for (i=0;iGetlstContoursNameActualSlice() ); - - ///\TODO : find something less stupid! - - std::vector oops; - oops = _sceneManager->GetlstContoursNameActualSlice(); - deleteContours( oops ); + deleteContours( (std::vector)_sceneManager->GetlstContoursNameActualSlice() ); + } @@ -3035,8 +3044,8 @@ void wxContourEventHandler::OnInterpolation(wxCommandEvent& event) return panel;*/ - wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, _T("")); - _withOfContourLine = new wxSlider(panel, -1, 1 , 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); + wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, wxString(_T(""))); + _withOfContourLine = new wxSlider(panel, -1, 1 , 1, 10, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL|wxSL_LABELS, wxDefaultValidator); double range[2]; this->_sceneManager->GetImageDataRange(range); @@ -3122,35 +3131,35 @@ void wxContourEventHandler::OnInterpolation(wxCommandEvent& event) { std::vector currentSelection = _sceneManager->getSelectedObjects(); int elementsSelected = currentSelection.size(); - if( toolCommand == (wxContour_ActionCommandsID::CREATE_TOOL) ) + if( toolCommand == (wxContour_ActionCommnadsID::CREATE_TOOL) ) { onCreateContourFrame(); } - if( toolCommand == (wxContour_ActionCommandsID::CREATE_CONTOUR_KEY) ) + if( toolCommand == (wxContour_ActionCommnadsID::CREATE_CONTOUR_KEY) ) { createContour(); } - else if( toolCommand == wxContour_ActionCommandsID::DELETE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::DELETE_TOOL ) { onDeleteFrame( ); } - else if( toolCommand == wxContour_ActionCommandsID::DELETE_KEY ) + else if( toolCommand == wxContour_ActionCommnadsID::DELETE_KEY ) { deleteContours( currentSelection ); } - else if( toolCommand == wxContour_ActionCommandsID::SAVE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::SAVE_TOOL ) { saveFileWithContours( ); } - else if( toolCommand == wxContour_ActionCommandsID::SAVE_KEY ) + else if( toolCommand == wxContour_ActionCommnadsID::SAVE_KEY ) { saveFileWithContoursAutomatique( ); } - else if( toolCommand == wxContour_ActionCommandsID::OPEN_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::OPEN_TOOL ) { openFileWithContours( ); } - else if( toolCommand == wxContour_ActionCommandsID::CHANGE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::CHANGE_TOOL ) { if ( elementsSelected >= 1 ) { @@ -3158,69 +3167,69 @@ void wxContourEventHandler::OnInterpolation(wxCommandEvent& event) } } - else if( toolCommand == wxContour_ActionCommandsID::HIDE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::HIDE_TOOL ) { if ( elementsSelected >= 1 ) { onHideOutlines( currentSelection ); } } - else if( toolCommand == wxContour_ActionCommandsID::SHOW_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::SHOW_TOOL ) { if ( elementsSelected >= 1 ) { onShowOutlines( currentSelection ); } } - else if( toolCommand == wxContour_ActionCommandsID::COPY_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::COPY_TOOL ) { if ( elementsSelected >= 1 ) { onCopyOutlines( currentSelection ); } } - else if( toolCommand == wxContour_ActionCommandsID::PASTE_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::PASTE_TOOL ) { onPasteOutlines( ); } - else if( toolCommand == wxContour_ActionCommandsID::SPREAD_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::SPREAD_TOOL ) { onSpread(); } - else if( toolCommand == wxContour_ActionCommandsID::AUTOMATIQUESEGMENTATION_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::AUTOMATIQUESEGMENTATION_TOOL ) { onAutomatiqueSegmentation( ); } - else if( toolCommand == wxContour_ActionCommandsID::SELECT_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::SELECT_TOOL ) { onSelectOutlines( currentSelection ); } - else if( toolCommand == wxContour_ActionCommandsID::EDIT_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::EDIT_TOOL ) { if ( elementsSelected >= 1 ) { onEditOutlines( currentSelection ); } } - else if( toolCommand == wxContour_ActionCommandsID::UNDO_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::UNDO_TOOL ) { onUNDO(); } - else if( toolCommand == wxContour_ActionCommandsID::REDO_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::REDO_TOOL ) { onREDO(); } - else if( toolCommand == wxContour_ActionCommandsID::INFORMATIONCONTOUR_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::INFORMATIONCONTOUR_TOOL ) { onInformationContourFrame(); } - else if( toolCommand == wxContour_ActionCommandsID::INTERFACECONFIGURATION_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::INTERFACECONFIGURATION_TOOL ) { onInterfaceConfigurationFrame(); } - else if( toolCommand == wxContour_ActionCommandsID::TEST_TOOL ) + else if( toolCommand == wxContour_ActionCommnadsID::TEST_TOOL ) { onInterfaceTestFrame(); } @@ -3290,11 +3299,12 @@ void wxContourEventHandler::OnInterpolation(wxCommandEvent& event) inredo = 0; - char str[9000]; + //char str[9000]; //itoa(inundo, str, 10); - sprintf(str, "%d", inundo); + std::string str = intToString(inundo); - std::string temp = stundoredo + *str + ".roi"; + + std::string temp = stundoredo + str + ".roi"; saveFileWithContours(temp); inundo++; @@ -3330,12 +3340,12 @@ void wxContourEventHandler :: onREDO() inredo--; inundo++; - char str[9000]; + //char str[9000]; //itoa(inundo, str, 10); - sprintf(str, "%d", inundo); + std::string str = intToString(inundo); - std::string temp = stundoredo + *str + ".roi"; + std::string temp = stundoredo + str + ".roi"; loadState(temp); @@ -3347,25 +3357,25 @@ void wxContourEventHandler :: onREDO() void wxContourEventHandler :: onUNDO() { if(inundo>0){ - char str[9000]; if(inredo==0){ - + //char str[9000]; //itoa(inundo, str, 10); - sprintf(str, "%d",inundo); + std::string str = intToString(inundo); - std::string temp = stundoredo + *str + ".roi"; + std::string temp = stundoredo + str + ".roi"; saveFileWithContours(temp); } inredo++; inundo--; - + //char str[9000]; //itoa(inundo, str, 10); - sprintf(str, "%d",inundo); + std::string str = intToString(inundo); + - std::string temp = stundoredo + *str + ".roi"; + std::string temp = stundoredo + str + ".roi"; loadState(temp); } @@ -3534,7 +3544,8 @@ void wxContourEventHandler :: onREDO() { porcent = 100.0* (z-minZ)/totalZ; - tmpString.Printf(_T("Saving Values %d %c %d/%d %d"), (int)porcent , 37 , z-minZ+1, (int)totalZ ,z); + tmpString.Printf(_T("Saving Values")); + tmpString.Printf(_T(" %d %c %d/%d %d"), (int)porcent , 37 , z-minZ+1, (int)totalZ ,z); _staticTextInformation->SetLabel(tmpString); //Extraction data from contours of each slice @@ -3606,7 +3617,7 @@ void wxContourEventHandler :: onREDO() lstOptions[0]=_T("A"); lstOptions[1]=_T("B"); lstOptions[2]=_T("C"); - methodRadiobox = new wxRadioBox(panel, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxSize(200,45), 3 , lstOptions, 3, wxRA_SPECIFY_COLS); + methodRadiobox = new wxRadioBox(panel, -1, _T("Method (find ctrl. Points)"), wxDefaultPosition, wxSize(200,45), 3 , lstOptions, 3, wxRA_SPECIFY_COLS); methodRadiobox->SetSelection(2); _staticTextSegmentation = new wxStaticText(panel,-1,_T(" ")); @@ -3689,9 +3700,9 @@ void wxContourEventHandler :: onREDO() vecZ[i] = actualSlice; } // for - wxDialog* dialog = new wxDialog(parent, -1, _T("Snake")); + wxDialog* dialog = new wxDialog(parent, -1, wxString(_T("Snake"))); wxPanel* panel = new wxPanel(dialog,-1); - wxStaticText* sttext = new wxStaticText(panel, -1, _T("Panel para snake")); + wxStaticText* sttext = new wxStaticText(panel, -1, wxString(_T("Panel para snake"))); dialog->ShowModal(); } // if @@ -3703,4 +3714,14 @@ void wxContourEventHandler :: onREDO() _InformationContourFrame->Show(false); } } + + 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; + } + return result; + } //JCP 21 - 10 - 09 diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.h b/lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.h index 61b122a..401b41c 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourEventHandler.h @@ -17,6 +17,7 @@ #include +#include //------------------------------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------------------------------ @@ -32,7 +33,7 @@ #include "wxContour_StandardToolsPanel.h" #include "wxContour_EdtionToolsPanel.h" #include "wxContour_ListViewPanel.h" -#include "wxContour_ActionCommandsID.h" +#include "wxContour_ActionCommnadsID.h" #include "PerformingOperation.h" #include "ContourThing.h" @@ -133,7 +134,7 @@ class wxContourEventHandler : public wxEvtHandler { void createCopyContourOf( std::string anExistingKName, std::vector &instantNoTouchData, bool append = false ); void createContour( int typeContour=1 ); void deleteContour( std::string theKeyName ); - void deleteContours( std::vector & keyNamesVector ); + void deleteContours( std::vector keyNamesVector ); void deleteAllContours( ); void openContours( FILE *pFile, bool staticContour ); void openFileWithContours(); @@ -350,5 +351,7 @@ private: void saveState(); void loadState(std::string filename); + + std::string intToString(int num); }; #endif // __wxContourEventHandler_HEADER_FILE__ diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_AutomaticFormsToolsPanel.h b/lib/Interface_ManagerContour_NDimensions/wxContour_AutomaticFormsToolsPanel.h index 6d3814b..b07ec2d 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_AutomaticFormsToolsPanel.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_AutomaticFormsToolsPanel.h @@ -80,6 +80,4 @@ private: }; -#endif // __wxContour_AutomaticFormsToolsPanel_HEADER_FILE__ - - +#endif // __wxContour_AutomaticFormsToolsPanel_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_ButtonsBar.cxx b/lib/Interface_ManagerContour_NDimensions/wxContour_ButtonsBar.cxx index 5e98af6..d4c4979 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_ButtonsBar.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_ButtonsBar.cxx @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------------------------------ -#include "wxContour_ActionCommandsID.h" +#include "wxContour_ActionCommnadsID.h" #include "wx/toolbar.h" #include "wx/log.h" @@ -21,7 +21,7 @@ #include "wx/filedlg.h" #include "wx/spinctrl.h" #include "wx/srchctrl.h" - +#include //------------------------------------------------------------------------------------------------------------ // Generated events declaration and definition //------------------------------------------------------------------------------------------------------------ @@ -35,103 +35,89 @@ :wxPanel( parent, id)//, pos, size, style, name) { //SetToolBitmapSize(wxSize(16,16)); - - - wxString string_create(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::CREATE_TOOL] , wxConvUTF8); - - _createContour_Button = new wxButton( this, - -1, - _T("+ New Contour"), - wxDefaultPosition, - wxDefaultSize, - 0, - wxDefaultValidator, - string_create ); - + std::string as = (char)wxContour_ActionCommnadsID::CREATE_TOOL +""; + _createContour_Button = new wxButton( this, -1, _T("+ New Contour"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); // _createContour_Button->SetToolTip(_T("CTRL-N")); Connect( _createContour_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - - wxString string_delete(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::DELETE_TOOL] , wxConvUTF8); - _delete_Button = new wxButton( this, -1, _T("+ Delete"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_delete ); + as = (char)wxContour_ActionCommnadsID::DELETE_TOOL +""; + _delete_Button = new wxButton( this, -1, _T("+ Delete"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); _delete_Button->SetToolTip(_T("BACK SPACE or DELETE key")); Connect( _delete_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); /* - _hideContour_Button = new wxButton( this, -1, "Hide Contour", wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::HIDE_TOOL ); + _hideContour_Button = new wxButton( this, -1, "Hide Contour", wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommnadsID::HIDE_TOOL ); Connect( _hideContour_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - _show_Button = new wxButton( this, -1, _T("Show"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::SHOW_TOOL ); + _show_Button = new wxButton( this, -1, _T("Show"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommnadsID::SHOW_TOOL ); Connect( _show_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); */ - wxString string_copy(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::COPY_TOOL] , wxConvUTF8); - - _copy_Button = new wxButton( this, -1, _T("Copy"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_copy ); + as = (char)wxContour_ActionCommnadsID::COPY_TOOL +""; + _copy_Button = new wxButton( this, -1, _T("Copy"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); _copy_Button->SetToolTip(_T("CTRL-C")); - Connect( _copy_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - - wxString string_paste(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::PASTE_TOOL] , wxConvUTF8); + Connect( _copy_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - _paste_Button = new wxButton( this, -1, _T("Paste"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_paste ); + as = (char)wxContour_ActionCommnadsID::PASTE_TOOL +""; + _paste_Button = new wxButton( this, -1, _T("Paste"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); _paste_Button->SetToolTip(_T("CTRL-V")); Connect( _paste_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - wxString string_change(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::CHANGE_TOOL] , wxConvUTF8); - _change_Button = new wxButton( this, -1, _T(" <--> "), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_change ); + as = (char)wxContour_ActionCommnadsID::CHANGE_TOOL +""; + _change_Button = new wxButton( this, -1, _T(" <--> "), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); _change_Button->SetToolTip(_T("CTRL-K")); Connect( _change_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - wxString string_save(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::SAVE_TOOL] , wxConvUTF8); - _save_Button = new wxButton( this, -1, _T("Save"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_save ); + as = (char)wxContour_ActionCommnadsID::SAVE_TOOL +""; + _save_Button = new wxButton( this, -1, _T("Save"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); _save_Button->SetToolTip(_T("CTRL-S")); - Connect( _save_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - - - wxString string_open(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::OPEN_TOOL] , wxConvUTF8); - _open_Button = new wxButton( this, -1, _T("Open"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, string_open ); + Connect( _save_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); + + as = (char)wxContour_ActionCommnadsID::OPEN_TOOL +""; + _open_Button = new wxButton( this, -1, _T("Open"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); _open_Button->SetToolTip(_T("CTRL-O")); Connect( _open_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - wxString string_spread(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::SPREAD_TOOL] , wxConvUTF8); - _spread_Button = new wxButton( this, -1, _T("+ Spread"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_spread ); + as = (char)wxContour_ActionCommnadsID::SPREAD_TOOL +""; + _spread_Button = new wxButton( this, -1, _T("+ Spread"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); // _spread_Button->SetToolTip(_T("CTRL-XXXXXXX")); Connect( _spread_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - wxString string_automatiqueSegmentation(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::AUTOMATIQUESEGMENTATION_TOOL] , wxConvUTF8); - _automatiqueSegmentation_Button = new wxButton( this, -1, _T("+ Segmentation"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_automatiqueSegmentation ); + as = (char)wxContour_ActionCommnadsID::AUTOMATIQUESEGMENTATION_TOOL +""; + _automatiqueSegmentation_Button = new wxButton( this, -1, _T("+ Segmentation"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); // _automatiqueSegmentation_Button->SetToolTip(_T("CTRL-XXXXXXX")); Connect( _automatiqueSegmentation_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - wxString string_informationcontour(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::INFORMATIONCONTOUR_TOOL] , wxConvUTF8); - _informationContour_Button = new wxButton( this, -1, _T("+ Information"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_informationcontour ); + as = (char)wxContour_ActionCommnadsID::INFORMATIONCONTOUR_TOOL +""; + _informationContour_Button = new wxButton( this, -1, _T("+ Information"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); // _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX")); Connect( _informationContour_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - wxString string_interfaceconfiguration(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::INTERFACECONFIGURATION_TOOL] , wxConvUTF8); - _interfaceConfiguration_Button = new wxButton( this, -1, _T("+ Configuration"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_interfaceconfiguration ); + as = (char)wxContour_ActionCommnadsID::INTERFACECONFIGURATION_TOOL +""; + _interfaceConfiguration_Button = new wxButton( this, -1, _T("+ Configuration"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); // _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX")); Connect( _interfaceConfiguration_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - wxString string_test(wxContour_ActionCommandsID::TOOL_CODES[wxContour_ActionCommandsID::TEST_TOOL] , wxConvUTF8); + //Test button Methods A-B-C in Juan Carlos Prieto 22-09-08 - _interfaceTest_Button = new wxButton( this, -1, _T("+ Test"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, string_test ); + as = (char)wxContour_ActionCommnadsID::TEST_TOOL +""; + _interfaceTest_Button = new wxButton( this, -1, _T("+ Test"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8)); // _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX")); Connect( _interfaceTest_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); /* - _spread_Button = new wxButton( this, -1, _T("Spread"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::SPREAD_TOOL ); + _spread_Button = new wxButton( this, -1, _T("Spread"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommnadsID::SPREAD_TOOL ); Connect( _spread_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - _select_Button = new wxButton( this, -1, _T("Select"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::SELECT_TOOL ); + _select_Button = new wxButton( this, -1, _T("Select"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommnadsID::SELECT_TOOL ); Connect( _select_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - _edit_Button = new wxButton( this, -1, _T("Edit"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::EDIT_TOOL ); + _edit_Button = new wxButton( this, -1, _T("Edit"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommnadsID::EDIT_TOOL ); Connect( _edit_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - _undo_Button = new wxButton( this, -1, _T("Undo"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::UNDO_TOOL ); + _undo_Button = new wxButton( this, -1, _T("Undo"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommnadsID::UNDO_TOOL ); Connect( _undo_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); - _redo_Button = new wxButton( this, -1, _T("Redo"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::REDO_TOOL ); + _redo_Button = new wxButton( this, -1, _T("Redo"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommnadsID::REDO_TOOL ); Connect( _redo_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed ); */ wxFlexGridSizer * panelSizer = new wxFlexGridSizer(9); diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_ControlPanel.h b/lib/Interface_ManagerContour_NDimensions/wxContour_ControlPanel.h index 128ce18..e68a623 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_ControlPanel.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_ControlPanel.h @@ -86,6 +86,4 @@ private: wxContour_ListViewPanel * instantContours; }; -#endif // __wxContour_ControlPanel_HEADER_FILE__ - - +#endif // __wxContour_ControlPanel_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_DrawToolsPanel.h b/lib/Interface_ManagerContour_NDimensions/wxContour_DrawToolsPanel.h index 75e15be..5abcfdd 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_DrawToolsPanel.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_DrawToolsPanel.h @@ -78,6 +78,4 @@ private: }; -#endif // __wxContour_DrawToolsPanel_HEADER_FILE__ - - +#endif // __wxContour_DrawToolsPanel_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_EdtionToolsPanel.h b/lib/Interface_ManagerContour_NDimensions/wxContour_EdtionToolsPanel.h index 3701f9f..986bae3 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_EdtionToolsPanel.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_EdtionToolsPanel.h @@ -78,6 +78,4 @@ private: }; -#endif // __wxContour_EdtionToolsPanel_HEADER_FILE__ - - +#endif // __wxContour_EdtionToolsPanel_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_Grid.h b/lib/Interface_ManagerContour_NDimensions/wxContour_Grid.h index 1298670..c87c24f 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_Grid.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_Grid.h @@ -78,6 +78,4 @@ private: }; -#endif // __wxContour_Grid_HEADER_FILE__ - - +#endif // __wxContour_Grid_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_ListViewPanel.h b/lib/Interface_ManagerContour_NDimensions/wxContour_ListViewPanel.h index c81456b..5dd98e8 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_ListViewPanel.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_ListViewPanel.h @@ -127,6 +127,4 @@ private: wxListItemAttr itemsStyle; }; -#endif // __wxContour_ListViewPanel_HEADER_FILE__ - - +#endif // __wxContour_ListViewPanel_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_MenuBar.cxx b/lib/Interface_ManagerContour_NDimensions/wxContour_MenuBar.cxx index 9b9d21f..305fdee 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_MenuBar.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_MenuBar.cxx @@ -58,9 +58,4 @@ // Attributtes //------------------------------------------------------------------------------------------------------------ - - - - - diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_MenuBar.h b/lib/Interface_ManagerContour_NDimensions/wxContour_MenuBar.h index d387c80..8540218 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_MenuBar.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_MenuBar.h @@ -78,6 +78,4 @@ private: }; -#endif // __wxContour_MenuBar_HEADER_FILE__ - - +#endif // __wxContour_MenuBar_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_OperationsToolsPanel.h b/lib/Interface_ManagerContour_NDimensions/wxContour_OperationsToolsPanel.h index f5156b2..047b210 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_OperationsToolsPanel.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_OperationsToolsPanel.h @@ -78,6 +78,4 @@ private: }; -#endif // __wxContour_OperationsToolsPanel_HEADER_FILE__ - - +#endif // __wxContour_OperationsToolsPanel_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxContour_StandardToolsPanel.h b/lib/Interface_ManagerContour_NDimensions/wxContour_StandardToolsPanel.h index 1577259..86fe4d9 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContour_StandardToolsPanel.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContour_StandardToolsPanel.h @@ -78,6 +78,4 @@ private: }; -#endif // __wxContour_StandardToolsPanel_HEADER_FILE__ - - +#endif // __wxContour_StandardToolsPanel_HEADER_FILE__ \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx b/lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx index 3184c94..96e77ab 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxInstantChooserPanel.cxx @@ -442,6 +442,4 @@ DEFINE_EVENT_TYPE( wxINSTANT_CHOOSER_CHANGE ) } return isChecked; - } - - + } \ No newline at end of file diff --git a/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx b/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx index c765d33..dbebb4e 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx @@ -13,7 +13,7 @@ //------------------------------------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------------------------------------ -#include "wxContour_ActionCommandsID.h" +#include "wxContour_ActionCommnadsID.h" //------------------------------------------------------------------------------------------------------------ // Generated events declaration and definition @@ -332,7 +332,7 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) setControlActiveStateOf( _workingGroup, false ); _workingGroup->clear(); } - std::map ::iterator iter; // = NULL; + std::map ::iterator iter; //EED Borrame // FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+"); @@ -674,27 +674,27 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) if ( _lastKeyCode == 3 && ctrlKey ) //'C' || 'c' { - toolCommand = &(wxContour_ActionCommandsID::COPY_TOOL); + toolCommand = &(wxContour_ActionCommnadsID::COPY_TOOL); } else if( _lastKeyCode == 22 && ctrlKey ) //'V' || 'v' { - toolCommand = &(wxContour_ActionCommandsID::PASTE_TOOL); + toolCommand = &(wxContour_ActionCommnadsID::PASTE_TOOL); } else if( _lastKeyCode == 8 || (_lastKeyCode==127) ) // Delete { - toolCommand = &(wxContour_ActionCommandsID::DELETE_KEY); + toolCommand = &(wxContour_ActionCommnadsID::DELETE_KEY); } else if( _lastKeyCode == 14 && ctrlKey ) //'N' || 'n' { - toolCommand = &(wxContour_ActionCommandsID::CREATE_CONTOUR_KEY); + toolCommand = &(wxContour_ActionCommnadsID::CREATE_CONTOUR_KEY); } else if( _lastKeyCode == 15 && ctrlKey ) //'O' || 'o' { - toolCommand = &(wxContour_ActionCommandsID::OPEN_TOOL); + toolCommand = &(wxContour_ActionCommnadsID::OPEN_TOOL); } else if( _lastKeyCode == 19 && ctrlKey ) //'S' || 's' { - toolCommand = &(wxContour_ActionCommandsID::SAVE_KEY); + toolCommand = &(wxContour_ActionCommnadsID::SAVE_KEY); } if ( toolCommand!=NULL ) @@ -1092,8 +1092,11 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) { FILE *ff = fopen("c:/temp/wxVtkBaseView_SceneManagerStadistics.txt","a+"); long int start = clock(); - //double sg = (double)(start) / (double)CLK_TCK; // CLK_TCK not ANSI C. - double sg = (double)(start) / (double)CLOCKS_PER_SEC; +#if(WIN32) + double sg = (double)(start) / (double)CLK_TCK; +#else + double sg = (double)(start) / CLOCKS_PER_SEC; +#endif int tmpPx,tmpPy; wxVTKRenderWindowInteractor *wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor(); wxVTKiren->GetEventPosition( tmpPx , tmpPy ); diff --git a/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.cxx b/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.cxx index 2c7d703..3271dbc 100644 --- a/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.cxx +++ b/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.cxx @@ -295,7 +295,8 @@ bool OutlineModelManager :: addOutlinesGroup( std::string theOutlineName, OutlineGroup * theGroup ) { outlineGroups.insert(std::pair ( theOutlineName, theGroup )); - std::map :: iterator iter = NULL; +// std::map :: iterator iter = NULL; + std::map :: iterator iter; iter = outlineGroups.find( theOutlineName ); bool ifAdded = iter->first.compare( theOutlineName ) == 0; return ifAdded; diff --git a/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.h b/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.h index a2ccf8d..c08e357 100644 --- a/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.h +++ b/lib/kernel_ManagerContour_NDimensions/OutlineModelManager.h @@ -297,7 +297,6 @@ public: * Gets all instants outlines * @return The instants set */ - std::vector getOutlineInstants(); /*