]> Creatis software - creaContours.git/commitdiff
RaC Changes that includes a Polygon contour in creaMaracasVisu and creaContours
authorRicardo Corredor <Ricardo.Corredor@creatis.insa-lyon.fr>
Thu, 26 Nov 2009 01:28:26 +0000 (01:28 +0000)
committerRicardo Corredor <Ricardo.Corredor@creatis.insa-lyon.fr>
Thu, 26 Nov 2009 01:28:26 +0000 (01:28 +0000)
data/Icons/Polygon.png [new file with mode: 0644]
lib/Interface_Icons_NDimensions/interfMainPanel.cxx
lib/Interface_Icons_NDimensions/interfMainPanel.h
lib/Interface_Icons_NDimensions/interfMenuBar.h
lib/Interface_Icons_NDimensions/interfNewContourMenu.cxx
lib/Interface_Icons_NDimensions/interfNewContourMenu.h
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.cxx
lib/Interface_ManagerContour_NDimensions/wxContourMainFrame.h
lib/Interface_ManagerContour_NDimensions/wxVtkBaseView_SceneManager.cxx
lib/kernel_ManagerContour_NDimensions/KernelManagerContour.cxx
lib/kernel_ManagerContour_NDimensions/KernelManagerContour.h

diff --git a/data/Icons/Polygon.png b/data/Icons/Polygon.png
new file mode 100644 (file)
index 0000000..bc96204
Binary files /dev/null and b/data/Icons/Polygon.png differ
index cca064646a7ad5b550606c77b4eba06f27bd2af4..5e5f84f10c089db4ca911d508460b0baa43755f7 100644 (file)
@@ -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);
index 460fbf26c5cb5c537c5ee5bbf1fb359571103c95..83911f7627416d7b5ca9a9d7746bf8c3190b2a83 100644 (file)
@@ -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);
        /////////////////////////////////
index 55905bfb8f7fb2eaa526fd2368682e0d76267e5a..00cff41d34b816d1981e52339d64a1ee6f8f0849 100644 (file)
@@ -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 );
                
index 35cb02bfd61a3b774ecb2a6f11092817d5007383..75660640030e122cc90549e1aa2748fad5948c9c 100644 (file)
@@ -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 ---------------------
+
index 3584d955b8ae89834723484b9ae67328241bf663..a1081971af4694c1af0b1be1467ef33680391b45 100644 (file)
@@ -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 );
        
 };
 
index 4e810cae54fe05a8a5bb78e44665db12ee571ddd..1957a9e4d37aed7e1a61f5576abc4e8e7f95cb0d 100644 (file)
@@ -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 )
index 21004c63d2766ea2574c70b14570e4264da9cca0..77a3ebe607768dff22cc7806d8d9a856cfbd0ccc 100644 (file)
@@ -208,6 +208,7 @@ class wxContourMainFrame : public wxPanel {
        void onCreateContourCircle( );
        void onCreateContourLine( );
        void onCreateContourPoints( );
+       void onCreateContourPolygon( );
        void onCreateContourBullEye(wxPanel* pan);
        /////////////////////////////////
        void onDeleteContour();
index ab420d82327ebe29d530dd04e9037fed5d344744..128f1bca280b567bb6e3659a5756a728f0205189 100644 (file)
@@ -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 );
index 236e4a5556eb41acffe248539567a397581bd632..ec6251f994dd2b3e51319a3f7f3a4fab92902ed3 100644 (file)
@@ -401,6 +401,12 @@ manualBaseModel * KernelManagerContour::factoryManualContourModel(int typeContou
                manModelContour = new manualBaseModel();
        }
 
+       // polygon
+       if (typeContour==10)
+       {
+               manModelContour = new manualContourModelPolygon();
+       }
+
        return manModelContour;
 }
 
index d89f6c4de6c10a239b57c1a0ce76d3e83b246fe7..f7c28535c02407f115c8d124c8d94371468a55b0 100644 (file)
@@ -20,6 +20,7 @@
 #include "manualContourModelCircle.h"
 #include "manualContourModelLine.h"
 #include "manualContourModelRoi.h"
+#include "manualContourModelPolygon.h"
 
 #include <vtkImageChangeInformation.h>