]> Creatis software - creaMaracasVisu.git/commitdiff
Fix BUG interaction Line, Rectangle, Circle
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Tue, 21 Apr 2009 18:06:03 +0000 (18:06 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Tue, 21 Apr 2009 18:06:03 +0000 (18:06 +0000)
lib/maracasVisuLib/src/interface/wxWindows/manualContour.cpp

index 8f314e4de79bc4573c8fbe53db555436946c0c1b..1e211963c23697acf53f6bcb3ce1864e2a152d7f 100644 (file)
@@ -4436,6 +4436,7 @@ void manualRoiControler::Configure() //virtual
 }
 
 // ----------------------------------------------------------------------------
+
 void manualRoiControler::MouseClickLeft(int x, int y){
        int z = GetZ();
        if ( (GetState()==0) && (GetManualViewBaseContour()->GetIdPoint(x,y,z)!=-1 ) ){
@@ -4446,7 +4447,21 @@ void manualRoiControler::MouseClickLeft(int x, int y){
                GetManualViewBaseContour()->InitMove(x,y,z);
                SetState(6);
        }
+       
+       
        int size=GetManualViewBaseContour()->GetNumberOfPoints();
+       if (GetState()==0) {
+               if (size==0){
+                       AddPoint(x,y,z);
+                       AddPoint(x,y,z);
+                       AddPoint(x,y,z);
+                       AddPoint(x,y,z);
+                       bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+                       SetState(5);
+               }
+       }
+       
+/*EED 21 Avril 2009
        if (GetState()==0) {
                if (size==0){
                        AddPoint(x,y,z);
@@ -4462,8 +4477,11 @@ void manualRoiControler::MouseClickLeft(int x, int y){
                bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
                SetState(5);
        }
+*/
+       
        GetManualViewBaseContour()->Refresh();
 }
+
 // ----------------------------------------------------------------------------
 void manualRoiControler::MouseMove(int x, int y) // virtual
 {
@@ -4632,17 +4650,25 @@ void manualCircleControler::MouseClickLeft(int x, int y){
                if (size==0){
                        AddPoint(x,y,z);
                        AddPoint(x,y,z);
-//                     AddPoint(x,y,z);
-//                     AddPoint(x,y,z);
+                       bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
+                       SetState(5);
+               }
+       }       
+       
+/*EED 21 Avril 2009    
+       if (GetState()==0) {
+               if (size==0){
+                       AddPoint(x,y,z);
+                       AddPoint(x,y,z);
                } else {
                        SetPoint(0,x,y,z);
                        SetPoint(1,x,y,z);
-//                     SetPoint(2,x,y,z);
-//                     SetPoint(3,x,y,z);
                }
                bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);
                SetState(5);
        }
+*/
+       
        GetManualViewBaseContour()->Refresh();
 }
 // ----------------------------------------------------------------------------
@@ -4800,6 +4826,7 @@ void manualLineControler::CopyAttributesTo( manualLineControler * cloneObject)
        manualContourBaseControler::CopyAttributesTo(cloneObject);
 }
 
+
 // ----------------------------------------------------------------------------
 void manualLineControler::MouseClickLeft(int x, int y){
        int z = GetZ();
@@ -4811,7 +4838,19 @@ void manualLineControler::MouseClickLeft(int x, int y){
                GetManualViewBaseContour()->InitMove(x,y,z);
                SetState(6);
        }
+       
        int size=GetManualViewBaseContour()->GetNumberOfPoints();
+       if (GetState()==0) { 
+               if (size==0){
+                       AddPoint(x,y,z); 
+                       AddPoint(x,y,z); 
+                       bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);     
+                       SetState(5);
+               }
+       }
+       
+       
+/*EED 21 Avril 2009            
        if (GetState()==0) { 
                if (size==0){
                        AddPoint(x,y,z); 
@@ -4823,6 +4862,8 @@ void manualLineControler::MouseClickLeft(int x, int y){
                bakIdPoint = GetManualViewBaseContour()->GetIdPoint(x,y,z);     
                SetState(5);
        }
+*/
+       
        GetManualViewBaseContour()->Refresh();
 }
 // ----------------------------------------------------------------------------