From: Ricardo Corredor Date: Thu, 26 Nov 2009 01:28:26 +0000 (+0000) Subject: RaC Changes that includes a Polygon contour in creaMaracasVisu and creaContours X-Git-Tag: CREATOOLS.2-0-3~38 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaContours.git;a=commitdiff_plain;h=40033c782c0c68ecc676bb59de5c7fe9eb3cac44 RaC Changes that includes a Polygon contour in creaMaracasVisu and creaContours --- diff --git a/data/Icons/Polygon.png b/data/Icons/Polygon.png new file mode 100644 index 0000000..bc96204 Binary files /dev/null and b/data/Icons/Polygon.png differ diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx index cca0646..5e5f84f 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.cxx +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.cxx @@ -372,6 +372,14 @@ void interfMainPanel::onCreateContourPoints( ) } // RaC 09-09 --------------------- +// RaC 10-09 --------------------- +void interfMainPanel::onCreateContourPolygon( ) +{ + wxContourMainFrame::getInstance()->showAxis(false); + wxContourMainFrame::getInstance()->onCreateContourPolygon(); +} +// RaC 10-09 --------------------- + void interfMainPanel::onCreateContoursBullEye(wxPanel* panBull) { wxContourMainFrame::getInstance()->showAxis(false); diff --git a/lib/Interface_Icons_NDimensions/interfMainPanel.h b/lib/Interface_Icons_NDimensions/interfMainPanel.h index 460fbf2..83911f7 100644 --- a/lib/Interface_Icons_NDimensions/interfMainPanel.h +++ b/lib/Interface_Icons_NDimensions/interfMainPanel.h @@ -94,11 +94,14 @@ public: void onCreateContourSpline( ); void onCreateContourRectangle( ); void onCreateContourCircle( ); - void onCreateContourLine( ); - + void onCreateContourLine( ); // RaC 09-09 --------------------- void onCreateContourPoints( ); // RaC 09-09 --------------------- + + // RaC 10-09 --------------------- + void onCreateContourPolygon( ); + // RaC 10-09 --------------------- void onCreateContoursBullEye(wxPanel* panBull); ///////////////////////////////// diff --git a/lib/Interface_Icons_NDimensions/interfMenuBar.h b/lib/Interface_Icons_NDimensions/interfMenuBar.h index 55905bf..00cff41 100644 --- a/lib/Interface_Icons_NDimensions/interfMenuBar.h +++ b/lib/Interface_Icons_NDimensions/interfMenuBar.h @@ -41,7 +41,10 @@ public: int sizex = 80; int sizey = 80; - flexsizer = new wxFlexGridSizer(2,vpath.size(),2,2); + //RaC 11-09 + //This constructor function as well but it is neccessary to change vpath.size() by 6 + //flexsizer = new wxFlexGridSizer(2,vpath.size(),2,2); + flexsizer = new wxFlexGridSizer(6); this->SetSizer(flexsizer, true); this->SetAutoLayout( true ); diff --git a/lib/Interface_Icons_NDimensions/interfNewContourMenu.cxx b/lib/Interface_Icons_NDimensions/interfNewContourMenu.cxx index 35cb02b..7566064 100644 --- a/lib/Interface_Icons_NDimensions/interfNewContourMenu.cxx +++ b/lib/Interface_Icons_NDimensions/interfNewContourMenu.cxx @@ -51,6 +51,13 @@ void interfNewContourMenu::initButtons(wxEvtHandler* evtHandler) { hand.push_back(this); // RaC 09-09 --------------------- + // RaC 10-09 --------------------- + path.push_back(datadir + "/Polygon.png"); + nom.push_back("Create Polygon"); + funct.push_back((wxObjectEventFunction) &interfNewContourMenu::onCreateContourPolygon); + hand.push_back(this); + // RaC 10-09 --------------------- + this->addButtons(path, nom); this->setVectorFunction(funct); @@ -99,3 +106,9 @@ void interfNewContourMenu::onCreateContourPoints( wxCommandEvent& event ){ } // RaC 09-09 --------------------- +// RaC 10-09 --------------------- +void interfNewContourMenu::onCreateContourPolygon( wxCommandEvent& event ){ + interfMainPanel::getInstance()->onCreateContourPolygon(); +} +// RaC 10-09 --------------------- + diff --git a/lib/Interface_Icons_NDimensions/interfNewContourMenu.h b/lib/Interface_Icons_NDimensions/interfNewContourMenu.h index 3584d95..a108197 100644 --- a/lib/Interface_Icons_NDimensions/interfNewContourMenu.h +++ b/lib/Interface_Icons_NDimensions/interfNewContourMenu.h @@ -44,12 +44,16 @@ private: /** ** This method is in charge of capturing the event when the button is clicked **/ - void onCreateContourLine( wxCommandEvent& event ); - + void onCreateContourLine( wxCommandEvent& event ); /** ** This method is in charge of capturing the event when the button is clicked **/ void onCreateContourPoints( wxCommandEvent& event ); + /** + ** This method is in charge of capturing the event when the button is clicked + ** RaC - Creates a new Polygon contour + **/ + void onCreateContourPolygon( wxCommandEvent& event ); }; diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx index 4e810ca..1957a9e 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx @@ -346,6 +346,15 @@ void wxContourMainFrame::onCreateContourPoints( ){ } // RaC 09-09 -------------------------------------- +// RaC 10-09 -------------------------------------- +void wxContourMainFrame::onCreateContourPolygon( ){ + //JCP 20-10-08 Undo redo implementation + saveState(); + //JCP 20-10-08 Undo redo implementation + createContour( 10 ); +} +// RaC 10-09 -------------------------------------- + //------------------------------------------------------------------------------------------------------------ void wxContourMainFrame :: onCreateContourBullEye(wxPanel* panel ) diff --git a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h index 21004c6..77a3ebe 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h +++ b/lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h @@ -208,6 +208,7 @@ class wxContourMainFrame : public wxPanel { void onCreateContourCircle( ); void onCreateContourLine( ); void onCreateContourPoints( ); + void onCreateContourPolygon( ); void onCreateContourBullEye(wxPanel* pan); ///////////////////////////////// void onDeleteContour(); diff --git a/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx b/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx index ab420d8..128f1bc 100644 --- a/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx +++ b/lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx @@ -172,12 +172,21 @@ DEFINE_EVENT_TYPE( wxEVT_CHANGED_DEEP ) manContourControl = new manualLineControler(); manViewerContour = new manualViewLine(); } + + //Points if (typeContour==7) { manContourControl = new manualContourControler(); manViewerContour = new manualViewPoints(); } + //Polygon + if (typeContour==10) + { + manContourControl = new manualContourControler(); + manViewerContour = new manualViewContour(); + } + _lastInteraction = insertWrap( theKeyName, manContourControl, manViewerContour ); diff --git a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx index 236e4a5..ec6251f 100644 --- a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx +++ b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx @@ -401,6 +401,12 @@ manualBaseModel * KernelManagerContour::factoryManualContourModel(int typeContou manModelContour = new manualBaseModel(); } + // polygon + if (typeContour==10) + { + manModelContour = new manualContourModelPolygon(); + } + return manModelContour; } diff --git a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.h b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.h index d89f6c4..f7c2853 100644 --- a/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.h +++ b/lib/kernel_ManagerContour_NDimensions/KernelManagerContour.h @@ -20,6 +20,7 @@ #include "manualContourModelCircle.h" #include "manualContourModelLine.h" #include "manualContourModelRoi.h" +#include "manualContourModelPolygon.h" #include