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 "interfNewContourMenu.h"
29 interfNewContourMenu::interfNewContourMenu(wxWindow * parent, int sizex, int sizey, wxEvtHandler* evtHandler, std::string datdir)
30 : interfMenuBar(parent, sizex, sizey)
32 this->datadir = datdir;
33 //eventHandler = (wxContourEventHandler*)evtHandler;
41 void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler) {
43 std::vector<std::string> path, nom;
44 std::vector<wxObjectEventFunction> funct;
45 std::vector<wxEvtHandler*> hand;
47 path.push_back(datadir + "/Spline.png");
48 nom.push_back("Create a contour using splines");
49 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourSpline);
50 hand.push_back(evtHandler);
52 path.push_back(datadir+"/Rectangle.png");
53 nom.push_back("Create a contour using the basic shape of a rectangle");
54 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourRectangle);
55 hand.push_back(evtHandler);
57 path.push_back(datadir + "/Circle.png");
58 nom.push_back("Create a contour using the basic shape of a Circle");
59 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourCircle);
60 hand.push_back(evtHandler);
62 path.push_back(datadir + "/bullseye.png");
63 nom.push_back("Create a contour using the bulls eye");
64 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourBullseye);
67 path.push_back(datadir + "/Line.png");
68 nom.push_back("Create a Line");
69 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
72 // RaC 09-09 ---------------------
73 path.push_back(datadir + "/Points.png");
74 nom.push_back("Create Points");
75 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPoints);
77 // RaC 09-09 ---------------------
79 // RaC 10-09 ---------------------
80 path.push_back(datadir + "/Polygon.png");
81 nom.push_back("Create Polygon");
82 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPolygon);
84 // RaC 10-09 ---------------------
86 this->addButtons(path, nom);
88 this->setVectorFunction(funct);
89 this->setEventHandlers(hand);
90 this->connectEvents();
96 interfNewContourMenu::~interfNewContourMenu()
100 void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event){
105 panBull = new PanelBullEyeOptions(interfMainPanel::getInstance()->getInfoPanel(),
109 interfMainPanel::getInstance()->onCreateContoursBullEye(panBull);
110 //eventHandler->createContourBullsEye(panBull);
111 interfMainPanel::getInstance()->showPanel(panBull);
115 void interfNewContourMenu::onCreateContourSpline( wxCommandEvent& event ){
116 interfMainPanel::getInstance()->onCreateContourSpline();
118 void interfNewContourMenu::onCreateContourRectangle( wxCommandEvent& event ){
119 interfMainPanel::getInstance()->onCreateContourRectangle();
121 void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event ){
122 interfMainPanel::getInstance()->onCreateContourCircle();
124 void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event ){
125 interfMainPanel::getInstance()->onCreateContourLine();
128 // RaC 09-09 ---------------------
129 void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event ){
130 interfMainPanel::getInstance()->onCreateContourPoints();
132 // RaC 09-09 ---------------------
134 // RaC 10-09 ---------------------
135 void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event ){
136 interfMainPanel::getInstance()->onCreateContourPolygon();
138 // RaC 10-09 ---------------------