1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 #include "interfToolsMenu.h"
27 #include "interfMainPanel.h"
29 interfToolsMenu::interfToolsMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir)
30 : interfMenuBar(parent, sizex, sizey)
32 this->datadir = datdir;
33 //contourevent = (wxContourEventHandler*)evtHandler;
40 segmentPanelITK = NULL;
42 // eventHandler = evtHandler;
48 void interfToolsMenu::initButtons(wxEvtHandler* evtHandler) {
50 std::vector<std::string> path, nom;
51 std::vector<wxObjectEventFunction> funct;
53 path.push_back(datadir + "/Spread.png");
54 nom.push_back("The selected contour will spread through all slides");
55 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onRigidPressed);
57 path.push_back(datadir + "/Spread1.png");
58 nom.push_back("Select more than one contour and find the contours between them");
59 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onSpreadPressed);
61 path.push_back(datadir + "/Mirror.png");
62 nom.push_back("Create an Axis and select a contour to mirror it accordingly");
63 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onMirrorPressed);
65 //CMRU 17-08-09 ------------------------------------------------------------------
66 path.push_back(datadir + "/Letter.PNG");
67 nom.push_back("Insert a Label");
68 funct.push_back((wxObjectEventFunction)&interfToolsMenu::onPrintLabel);
69 //-------------------------------------------------------------------------------
72 path.push_back(datadir + "/FlipContours.png");
73 nom.push_back("Flop contours");
74 funct.push_back((wxObjectEventFunction) &interfToolsMenu:: onFlipPressed);
77 this->addButtons(path, nom);
78 this->setVectorFunction(funct);
80 //this->setButtonName(0, wxContour_ActionCommandsID::CHANGE_TOOL);
82 this->connectEvents(evtHandler);
87 interfToolsMenu::~interfToolsMenu()
92 ** Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
93 ** of the button corresponding to the method that has to be executed,
94 ** it uses attribute eventHandler to call the methods define by the application.
95 ** see setEventHandler(wxEventHandler*)
97 void interfToolsMenu::onRigidPressed(wxCommandEvent& event)
99 interfMainPanel::getInstance()->onRigidPressed();
102 void interfToolsMenu::onSpreadPressed(wxCommandEvent& event)
104 interfMainPanel::getInstance()->onSpreadPressed();
107 void interfToolsMenu::onMirrorPressed(wxCommandEvent& event)
109 interfMainPanel::getInstance()->onMirrorPressed();
112 void interfToolsMenu::onPrintLabel(wxCommandEvent& event)
114 interfMainPanel::getInstance()->onPrintLabel();
117 void interfToolsMenu::onFlipPressed(wxCommandEvent& event)
119 printf("EED interfToolsMenu::onFlipLabel \n");
120 interfMainPanel::getInstance()->onFlipContours();