From 6c224481d5e3157653e65aeba476725d7c007b23 Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Sat, 8 Feb 2025 10:08:51 +0100 Subject: [PATCH] Clean code --- .../widgets/manualContour/manualContourControler.cpp | 9 +++++---- .../widgets/manualContour/manualViewBaseContour.cpp | 12 +++++------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourControler.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourControler.cpp index f00f0cc..cf4c32e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourControler.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourControler.cpp @@ -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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp index 3dc3ebc..043b6d5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp @@ -400,7 +400,7 @@ void manualViewBaseContour::UpdateViewPoints() for( id=0; idGetWxVtkBaseView() ); 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::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