interfNewContourMenu.cxx

Go to the documentation of this file.
00001 #include "interfNewContourMenu.h"
00002 
00003 
00004 interfNewContourMenu::interfNewContourMenu(wxWindow * parent, int sizex, int sizey, wxEvtHandler* evtHandler, std::string datdir)
00005         : interfMenuBar(parent, sizex, sizey)
00006 {
00007         this->datadir = datdir;
00008         //eventHandler = (wxContourEventHandler*)evtHandler;
00009 
00010         panBull = NULL;
00011         created = false;
00012 
00013         initButtons(this);      
00014 }
00015 
00016 void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler) {
00017 
00018         std::vector<std::string> path, nom;
00019         std::vector<wxObjectEventFunction> funct;
00020         std::vector<wxEvtHandler*> hand;
00021         
00022         path.push_back(datadir + "/Spline.png");
00023         nom.push_back("Create a contour using splines");        
00024         funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourSpline);
00025         hand.push_back(evtHandler);
00026 
00027         path.push_back(datadir+"/Rectangle.png");
00028         nom.push_back("Create a contour using the basic shape of a rectangle");
00029         funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourRectangle);
00030         hand.push_back(evtHandler);
00031 
00032         path.push_back(datadir + "/Circle.png");
00033         nom.push_back("Create a contour using the basic shape of a Circle");
00034         funct.push_back((wxObjectEventFunction)&interfNewContourMenu::onCreateContourCircle);
00035         hand.push_back(evtHandler);
00036 
00037         path.push_back(datadir + "/bullseye.png");
00038         nom.push_back("Create a contour using the bulls eye");
00039         funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourBullseye);
00040         hand.push_back(this);
00041 
00042         path.push_back(datadir + "/Line.png");
00043         nom.push_back("Create a Line");
00044         funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourLine);
00045         hand.push_back(this);
00046 
00047         // RaC 09-09 ---------------------
00048         path.push_back(datadir + "/Points.png");
00049         nom.push_back("Create Points");
00050         funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPoints);
00051         hand.push_back(this);
00052         // RaC 09-09 ---------------------      
00053 
00054         // RaC 10-09 ---------------------
00055         path.push_back(datadir + "/Polygon.png");
00056         nom.push_back("Create Polygon");
00057         funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPolygon);
00058         hand.push_back(this);
00059         // RaC 10-09 ---------------------      
00060 
00061     this->addButtons(path, nom);
00062 
00063         this->setVectorFunction(funct); 
00064         this->setEventHandlers(hand);   
00065         this->connectEvents();
00066 
00067 }
00068 
00069 
00070 
00071 interfNewContourMenu::~interfNewContourMenu()
00072 {
00073 }
00074 
00075 void interfNewContourMenu::onCreateContourBullseye(wxCommandEvent& event){
00076 
00077 
00078         if(!created){
00079 
00080                 panBull = new PanelBullEyeOptions(interfMainPanel::getInstance()->getInfoPanel(), 
00081                                                                 wxSize(100,200));
00082                 created = true;
00083         }
00084         interfMainPanel::getInstance()->onCreateContoursBullEye(panBull);
00085         //eventHandler->createContourBullsEye(panBull);
00086         interfMainPanel::getInstance()->showPanel(panBull);
00087 
00088 }
00089 
00090 void interfNewContourMenu::onCreateContourSpline( wxCommandEvent& event ){
00091         interfMainPanel::getInstance()->onCreateContourSpline();
00092 }
00093 void interfNewContourMenu::onCreateContourRectangle( wxCommandEvent& event ){
00094         interfMainPanel::getInstance()->onCreateContourRectangle();
00095 }
00096 void interfNewContourMenu::onCreateContourCircle( wxCommandEvent& event ){
00097         interfMainPanel::getInstance()->onCreateContourCircle();
00098 }
00099 void interfNewContourMenu::onCreateContourLine( wxCommandEvent& event ){
00100         interfMainPanel::getInstance()->onCreateContourLine();
00101 }
00102 
00103 // RaC 09-09 ---------------------
00104 void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event ){
00105         interfMainPanel::getInstance()->onCreateContourPoints();
00106 }
00107 // RaC 09-09 ---------------------
00108 
00109 // RaC 10-09 ---------------------
00110 void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event ){
00111         interfMainPanel::getInstance()->onCreateContourPolygon();
00112 }
00113 // RaC 10-09 ---------------------
00114 

Generated on Wed Jun 27 23:28:32 2012 for creaContours_lib by  doxygen 1.5.7.1