]> Creatis software - creaMaracasVisu.git/commitdiff
Clean code
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Sat, 8 Feb 2025 09:08:51 +0000 (10:08 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Sat, 8 Feb 2025 09:08:51 +0000 (10:08 +0100)
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourControler.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp

index f00f0cce8d916c62edd6458611a3e2cfa4ae7899..cf4c32e93c68b3ba6fbcad3528ef8a5252ef5dbd 100644 (file)
@@ -81,6 +81,7 @@ void manualContourControler::MouseClickLeft(int x, int y)
     
        if( IsEditable() )
        {
+        // Insert Point with shift + click
                if ( (_vtkInteractorStyleBaseView!=NULL) && (GetState()==0) && ( (vtkrenderwindowinteractor!=NULL) && (vtkrenderwindowinteractor->GetShiftKey()==1) )   &&  (GetManualViewBaseContour()->GetPosibleSelected()==false) &&  (GetManualViewBaseContour()->GetIdPoint(x,y,z)==-1) )
                {
                        ok=true;
@@ -92,15 +93,15 @@ void manualContourControler::MouseClickLeft(int x, int y)
                {
                        ok=true;
                        SetState(1);
-                       GetManualContourModel()->SetCloseContour(false);
+                       GetManualContourModel()->SetCloseContour(true);
                        AddPoint(x,y,z);
                }
                // Continue to Insert Control Points with ClickLeft (After being empty the contour)
                if ((GetState()==1) && (_easyCreation==true) )
                {
-                       ok=true;
-                       AddPoint(x,y,z);
-                       _bakIdPoint=GetNumberOfPointsManualContour() - 1;
+            ok=true;
+            AddPoint(x,y,z);
+            _bakIdPoint=GetNumberOfPointsManualContour() - 1;
                }
         
                // Insert Control Points IF Contour is Selected
index 3dc3ebc7f6dd1d37b739d6b8929c2421c97468ef..043b6d5980de4478fcf6a449d9551e5c7eebc872 100644 (file)
@@ -400,7 +400,7 @@ void manualViewBaseContour::UpdateViewPoints()
        for( id=0; id<size; id++)
        {
                UpdateViewPoint( id );
-       }
+       } // for id
 }
 
 // ----------------------------------------------------------------------------
@@ -409,14 +409,13 @@ void manualViewBaseContour::AddPoint()
        manualViewPoint *mvp    = new manualViewPoint( this->GetWxVtkBaseView() );
        AddPoint( mvp );
 }
+
 // ----------------------------------------------------------------------------
 void manualViewBaseContour::AddPoint( manualViewPoint * manualViewPoint )
 {
        _lstViewPoints.push_back( manualViewPoint );
-
        // EED 3 oct 2006
        manualViewPoint->SetSpacing(_spc);
-
        vtkActor *actor = manualViewPoint->CreateVtkPointActor();
        _wxvtkbaseview->GetRenderer()->AddActor( actor );       
 }
@@ -425,10 +424,8 @@ void manualViewBaseContour::AddPoint( manualViewPoint * manualViewPoint )
 void manualViewBaseContour::InsertPoint(int id)
 {
        manualViewPoint         *mvp    = new manualViewPoint( this->GetWxVtkBaseView() );
-
 // EED 3 oct 2006
        mvp->SetSpacing(_spc);
-
        std::vector<manualViewPoint*>::iterator itNum = _lstViewPoints.begin() + id;
        _lstViewPoints.insert(itNum,mvp);
        _wxvtkbaseview->GetRenderer()->AddActor( mvp->CreateVtkPointActor() );
@@ -443,9 +440,10 @@ void manualViewBaseContour::DeleteContour()
        }*/
        DeleteVtkObjects();
        int i,size=_lstViewPoints.size();
-       for (i=0;i<size;i++){
+       for (i=0;i<size;i++)
+    {
                manualViewBaseContour::DeletePoint(0);
-       }
+       } // for i
        Refresh();
 }