]> Creatis software - creaContours.git/blob - lib/Interface_Icons_NDimensions/interfSegmentationMenu.cxx
*** empty log message ***
[creaContours.git] / lib / Interface_Icons_NDimensions / interfSegmentationMenu.cxx
1 #include "interfSegmentationMenu.h"
2 #include "interfMainPanel.h"
3
4 interfSegmentationMenu::interfSegmentationMenu(wxWindow * parent, int sizex, int sizey,wxEvtHandler* evtHandler, std::string datdir)
5         : interfMenuBar(parent, sizex, sizey)
6 {
7         this->datadir   = datdir;
8
9 /*EED Borrame
10         //contourevent  = (wxContourEventHandler*)evtHandler;
11         infoWin                 = NULL;
12         configPanel             = NULL;
13         spreadPanel             = NULL;
14         segmentPanelITK = NULL;
15         
16         //eventHandler  = evtHandler;
17 */
18
19         initButtons(this);
20 }
21
22 void interfSegmentationMenu::initButtons(wxEvtHandler* evtHandler) {
23
24         std::vector<std::string> path, nom;
25         std::vector<wxObjectEventFunction> funct;
26
27         path.push_back(datadir + "/Segmentation.png");
28         nom.push_back("Find shapes by automatic segmentation");
29         funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressed);
30
31         path.push_back(datadir + "/ITK.png");
32         nom.push_back("Find shapes by automatic segmentation with ITK");
33         funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSegmentationPressedITK);
34
35         path.push_back(datadir + "/snake.png");
36         nom.push_back("Find shapes using border snake interaction");
37         funct.push_back((wxObjectEventFunction) &interfSegmentationMenu:: onSnakePressed);
38
39 /*EED Borrame
40         path.push_back(datadir + "/Threshold.png");
41         nom.push_back("Superpose a 'Red Image' to the selected Image Threshold");
42         funct.push_back((wxObjectEventFunction)&interfSegmentationMenu::onThreshold);
43 */
44         this->addButtons(path, nom);    
45         this->setVectorFunction(funct);
46
47         this->connectEvents(evtHandler);
48            
49
50 }
51
52 interfSegmentationMenu::~interfSegmentationMenu()
53 {
54 }
55
56 /**
57         **      Responds to the events of the buttons, when the same panel is responsible for it. It gets the name
58         **      of the button corresponding to the method that has to be executed,
59         **      it uses attribute eventHandler to call the methods define by the application.
60         **      see setEventHandler(wxEventHandler*)
61         **/
62
63
64 void  interfSegmentationMenu::onSegmentationPressed(wxCommandEvent& event)
65 {
66         interfMainPanel::getInstance()->onSegmentationPressed();
67 }
68
69
70
71 void  interfSegmentationMenu::onSegmentationPressedITK(wxCommandEvent& event)
72 {
73         interfMainPanel::getInstance()->onSegmentationPressedITK();    
74 }
75
76 void  interfSegmentationMenu::onSnakePressed(wxCommandEvent& event)
77 {
78         interfMainPanel::getInstance()->onSnakePressed();
79 }
80
81 /*EED Borrame
82 void interfSegmentationMenu::onThreshold(wxCommandEvent& event)
83 {
84         interfMainPanel::getInstance()->onThresholdPressed();
85 }
86 */
87 //------------------------------------------------------------------------------------------------------------
88