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;
39 void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler)
41 std::vector<std::string> path, nom;
42 std::vector<wxObjectEventFunction> funct;
43 std::vector<wxEvtHandler*> hand;
44 path.push_back(datadir + "/Spline.png");
45 nom.push_back("Create a contour using splines");
46 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourSpline);
47 hand.push_back(evtHandler);
48 path.push_back(datadir+"/Rectangle.png");
49 nom.push_back("Create a contour using the basic shape of a rectangle");
50 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourRectangle);
51 hand.push_back(evtHandler);
52 path.push_back(datadir + "/Circle.png");
53 nom.push_back("Create a contour using the basic shape of a Circle");
54 funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourCircle);
55 hand.push_back(evtHandler);
56 path.push_back(datadir + "/bullseye.png");
57 nom.push_back("Create a contour using the bulls eye");
58 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourBullseye);
60 path.push_back(datadir + "/Line.png");
61 nom.push_back("Create a Line");
62 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
64 // RaC 09-09 ---------------------
65 path.push_back(datadir + "/Points.png");
66 nom.push_back("Create Points");
67 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPoints);
69 // RaC 09-09 ---------------------
70 // RaC 10-09 ---------------------
71 path.push_back(datadir + "/Polygon.png");
72 nom.push_back("Create Polygon");
73 funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPolygon);
75 // RaC 10-09 ---------------------
76 this->addButtons(path, nom);
77 this->setVectorFunction(funct);
78 this->setEventHandlers(hand);
79 this->connectEvents();
82 interfNewContourMenu::~interfNewContourMenu()
86 void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event)
89 panBull = new PanelBullEyeOptions(interfMainPanel::getInstance()->getInfoPanel(),
93 interfMainPanel::getInstance()->onCreateContoursBullEye(panBull);
94 //eventHandler->createContourBullsEye(panBull);
95 interfMainPanel::getInstance()->showPanel(panBull);
98 void interfNewContourMenu::onCreateContourSpline( wxCommandEvent& event )
100 interfMainPanel::getInstance()->onCreateContourSpline();
103 void interfNewContourMenu::onCreateContourRectangle( wxCommandEvent& event )
105 interfMainPanel::getInstance()->onCreateContourRectangle();
108 void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event )
110 interfMainPanel::getInstance()->onCreateContourCircle();
113 void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event )
115 interfMainPanel::getInstance()->onCreateContourLine();
118 // RaC 09-09 ---------------------
119 void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event )
121 interfMainPanel::getInstance()->onCreateContourPoints();
123 // RaC 09-09 ---------------------
125 // RaC 10-09 ---------------------
126 void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event )
128 interfMainPanel::getInstance()->onCreateContourPolygon();
130 // RaC 10-09 ---------------------