+/*# ---------------------------------------------------------------------
+#
+# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+# pour la Sant�)
+# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+# Previous Authors : Laurent Guigues, Jean-Pierre Roux
+# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+#
+# This software is governed by the CeCILL-B license under French law and
+# abiding by the rules of distribution of free software. You can use,
+# modify and/ or redistribute the software under the terms of the CeCILL-B
+# license as circulated by CEA, CNRS and INRIA at the following URL
+# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+# or in the file LICENSE.txt.
+#
+# As a counterpart to the access to the source code and rights to copy,
+# modify and redistribute granted by the license, users are provided only
+# with a limited warranty and the software's author, the holder of the
+# economic rights, and the successive licensors have only limited
+# liability.
+#
+# The fact that you are presently reading this means that you have had
+# knowledge of the CeCILL-B license and that you accept its terms.
+# ------------------------------------------------------------------------ */
+
#include "interfToolsPanels.h"
#include "interfMainPanel.h"
//wxPanel *panel = new wxPanel(parent,-1,wxDefaultPosition, wxDefaultSize,wxNO_BORDER, wxString("",wxConvUTF8));
wxButton *spreadResetBtn = new wxButton(this,-1,_T("Reset"),wxDefaultPosition, wxDefaultSize );
- wxButton *spreadAddBtn = new wxButton(this,-1,_T("Add"),wxDefaultPosition, wxDefaultSize);
+ wxButton *spreadAddBtn = new wxButton(this,-1,_T("Add key contour "),wxDefaultPosition, wxDefaultSize);
+ wxButton *spreadAddAllBtn = new wxButton(this,-1,_T("Add All to key contour"),wxDefaultPosition, wxDefaultSize);
wxString lstOptions[3];
lstOptions[0]=_T("A");
Connect( spreadResetBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadReset );
Connect( spreadAddBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadAdd );
+ Connect( spreadAddAllBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadAddAll );
Connect( spreadGoBtn->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfSpreadPanel::onSpreadGo );
wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
sizer -> Add( spreadResetBtn , 1, wxGROW );
sizer -> Add( spreadAddBtn , 1, wxGROW );
+ sizer -> Add( spreadAddAllBtn , 1, wxGROW );
sizer -> Add( _spreadMethodRadiobox , 1, wxGROW );
sizer -> Add( spreadGoBtn , 1, wxGROW );
sizer -> Add( _staticTextSpread , 1, wxGROW );
_wxtextctrlSpread->SetValue(wxString("",wxConvUTF8));
interfMainPanel::getInstance()->resetAppend();
}
+
void interfSpreadPanel::onSpreadAdd(wxCommandEvent& event){
interfMainPanel::getInstance()->onSpreadAdd();
}
-void interfSpreadPanel::onSpreadGo(wxCommandEvent& event){
+void interfSpreadPanel::onSpreadAddAll(wxCommandEvent& event){
+ interfMainPanel::getInstance()->onSpreadAddAll();
+}
+void interfSpreadPanel::onSpreadGo(wxCommandEvent& event){
setStringSpread(" ");
int typeMethodFindCtrlPoints=_spreadMethodRadiobox->GetSelection();
printf("EED interfSpreadPanel::onSpreadGo %d\n",typeMethodFindCtrlPoints);
}
//------------------------------------------------------------------------------------------------------------
+
+
+//////////////////////////////////////////////////////////////
+
+interfFlipPanel::interfFlipPanel(wxWindow* parent)
+: wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_SUNKEN)
+{
+ wxButton *buttonFlipX = new wxButton(this,wxID_ANY,_T("Flip Horizontally"), wxDefaultPosition, wxSize(200,35) );
+ wxButton *buttonFlipY = new wxButton(this,wxID_ANY,_T("Flip Vertically"), wxDefaultPosition, wxSize(200,35) );
+
+ wxString lstOptions[3];
+ lstOptions[0]=_T("Flip selected contours");
+ lstOptions[1]=_T("Flip all contours of actual slice");
+ lstOptions[2]=_T("Flip all contours");
+ _wichContoursRadioBox = new wxRadioBox(this, -1, _T("Transform"), wxDefaultPosition, wxDefaultSize, 3 , lstOptions, 1, wxRA_SPECIFY_COLS);
+ _wichContoursRadioBox->SetSelection(2);
+
+
+ Connect( buttonFlipX->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipXPressed );
+ Connect( buttonFlipY->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &interfFlipPanel::onFlipYPressed );
+
+ wxFlexGridSizer * sizer = new wxFlexGridSizer(1);
+ sizer -> Add( _wichContoursRadioBox, 1, wxGROW );
+ sizer -> Add( buttonFlipX, 1, wxGROW );
+ sizer -> Add( buttonFlipY, 1, wxGROW );
+
+ this->SetSizer( sizer );
+ this->SetAutoLayout( true );
+ this->Layout();
+}
+
+
+
+
+interfFlipPanel::~interfFlipPanel(){
+}
+
+void interfFlipPanel::onFlipXPressed(wxCommandEvent& event)
+{
+ std::cout << "interfToolsPanels.cxx interfFlipPanel::onFlipXPressed FlipX (btn)" << std::endl;
+ int typeContoursFlip = _wichContoursRadioBox->GetSelection();
+ interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 0 ); // type, direction
+}
+
+void interfFlipPanel::onFlipYPressed(wxCommandEvent& event)
+{
+ std::cout << "interfToolsPanels.cxx interfFlipPanel::onFlipYPressed FlipY (btn)" << std::endl;
+ int typeContoursFlip = _wichContoursRadioBox->GetSelection();
+ interfMainPanel::getInstance()->FlipContours( typeContoursFlip , 1 ); // type, direction
+}
+
+