From 40033c782c0c68ecc676bb59de5c7fe9eb3cac44 Mon Sep 17 00:00:00 2001 From: Ricardo Corredor Date: Thu, 26 Nov 2009 01:28:26 +0000 Subject: [PATCH] RaC Changes that includes a Polygon contour in creaMaracasVisu and creaContours --- data/Icons/Polygon.png | Bin 0 -> 849 bytes .../interfMainPanel.cxx | 8 ++++++++ lib/Interface_Icons_NDimensions/interfMainPanel.h | 7 +++++-- lib/Interface_Icons_NDimensions/interfMenuBar.h | 5 ++++- .../interfNewContourMenu.cxx | 13 +++++++++++++ .../interfNewContourMenu.h | 8 ++++++-- .../wxContourMainFrame.cxx | 9 +++++++++ .../wxContourMainFrame.h | 1 + .../wxVtkBaseView_SceneManager.cxx | 9 +++++++++ .../KernelManagerContour.cxx | 6 ++++++ .../KernelManagerContour.h | 1 + 11 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 data/Icons/Polygon.png diff --git a/data/Icons/Polygon.png b/data/Icons/Polygon.png new file mode 100644 index 0000000000000000000000000000000000000000..bc96204a9369dea3621d7fdaf6ad368de85dd69e GIT binary patch literal 849 zcmV-X1FrmuP){m@|6G0e$_oE@PC0!!50TCC>Rl4{G67UcB53C0-3K~3!o=i^OBzV+=?N9LF zv2^_b!sg&bY*{SPdeClQ+r(r)e5XucSdvY4X4ZPh3zOMHc;}htdFPpT0G6?giw)&p zFZlG~gL+9F*~7R1MP-CzY(0Oy+nx1)Jx?&V@4vc^lSM~^%!h$*T-JPWgDRN%F^-=` zS`Ix=FgT_zPM9-P|9qYodfs4?F+gdDk?xfh-#Cj3a2Rd!1AO`D?&HbApGVi=M_9=O zhK7y9nT!u_o^^49`*dS4FIOr+KPq;<23KKC89-?PIg()Z-aeUC{0;+I1<#btd|PRMRMP>DEiWuNy`Tc$f{jVC z4%X1RL^m>pjT!;H!)ZHNL&#)bz?S04H|9~e7-SOM!)YfWi-U`7N%T;DfDFi1LK<5D zq`ipDYL<)$vdv13_G8ra?>7473+kD`d6MM-q#$=GNbic)M=M$}oY9RI@yv{=oLm4h zAR8(~o*$Ray^?sQ0E1Q@&4NpQs@m^`Fa8t;4XF&$=(xeAK|Jy#yyOzk%!5Hyz!tWN ztS2b%uc+KgYdU9?NjFahS-Wv*O>&nB-Sn0efD`s+faL}_i$(PU*-HX!2m_SNUJ{@b zn~}*L+$^~6x_SoWg}15Yx-bjx{(6H(Z7Ro>Ob;aB!y|t(r6+BsQN};>I8@T11MP-XjUk zL?@gnPNO13cz-kbTJxT(b0rq&_vYqHlXl@lLUu}$p^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 -- 2.45.0