From 532a74917e244cd6af7d17770c7905a76b75de9a Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 24 Aug 2023 11:46:28 +0200 Subject: [PATCH] 3539 ShowNPoints single selection --- .../bbcreaMaracasVisuShowNPoints_Tools.cxx | 2 -- bbtk/src/bbmaracasvisuShowNPoints.cxx | 29 +++++++------------ .../wxWindows/widgets/ModelShowNPoints.cxx | 16 +++++----- .../wxWindows/widgets/WidgetShowNPoints.cxx | 23 +++++++++------ 4 files changed, 33 insertions(+), 37 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx index 46998f9..fb3a57f 100644 --- a/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx +++ b/bbtk/src/bbcreaMaracasVisuShowNPoints_Tools.cxx @@ -15,8 +15,6 @@ namespace bbcreaMaracasVisu BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ShowNPoints_Tools) BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints_Tools,bbtk::AtomicBlackBox); - - void ShowNPoints_Tools::NearestPointToMesh( vtkPoints *points,vtkStaticPointLocator *pointLocator,double *spc,double *p,double *pM) { p[0] = p[0] * spc[0]; diff --git a/bbtk/src/bbmaracasvisuShowNPoints.cxx b/bbtk/src/bbmaracasvisuShowNPoints.cxx index 0163609..7843235 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.cxx +++ b/bbtk/src/bbmaracasvisuShowNPoints.cxx @@ -88,15 +88,11 @@ void WidgetShowNPointsBox::SetOutputBox() } - //------------------------------------------------------------------------ //------------------------------------------------------------------------ //------------------------------------------------------------------------ //------------------------------------------------------------------------ - - - BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ShowNPoints) BBTK_BLACK_BOX_IMPLEMENTATION(ShowNPoints,bbtk::WxBlackBox); @@ -130,10 +126,8 @@ void ShowNPoints::Process() mwxwidget->SetInitLstPoints( bbGetInputInitLstPointsX() , bbGetInputInitLstPointsY() , bbGetInputInitLstPointsZ() , bbGetInputInitLstLabels() , bbGetInputInitLstIndexs() ); } // } // firsttime OJO machete Eduardo pour ANDREAS a verificar - mwxwidget->AutoAddPoints(); mwxwidget->TrackingPoint(); - bbSetOutputlstPointsX( mwxwidget->GetLstPointsX() ); bbSetOutputlstPointsY( mwxwidget->GetLstPointsY() ); bbSetOutputlstPointsZ( mwxwidget->GetLstPointsZ() ); @@ -141,9 +135,7 @@ void ShowNPoints::Process() bbSetOutputlstIndexs( mwxwidget->GetLstIndexs() ); bbSetOutputlstSelectedIndexs( mwxwidget->GetLstSelectedIndexs() ); bbSetOutputWidgetShowNPoints( (WidgetShowNPoints*)mwxwidget ); - } // mwxwidget - } //----------------------------------------------------------------- @@ -156,9 +148,9 @@ void ShowNPoints::CreateWidget(wxWindow* parent) //----------------------------------------------------------------- void ShowNPoints::bbUserSetDefaultValues() { - firsttime=true; + firsttime = true; backOpacity = -1; - mwxwidget = NULL; + mwxwidget = NULL; bbSetInputRadio(10); bbSetInputOpacity(1); std::vector colour; @@ -172,17 +164,16 @@ void ShowNPoints::bbUserSetDefaultValues() bbSetOutputWidgetShowNPoints(NULL); } -//------------------ ----------------------------------------------- - void ShowNPoints::bbUserInitializeProcessing() - { - } +//----------------------------------------------------------------- +void ShowNPoints::bbUserInitializeProcessing() +{ +} //----------------------------------------------------------------- - void ShowNPoints::bbUserFinalizeProcessing() - { - } +void ShowNPoints::bbUserFinalizeProcessing() +{ +} //----------------------------------------------------------------- -} -// EO namespace bbcreaMaracasVisu +} // EO namespace bbcreaMaracasVisu diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx index 2f9db62..69196bb 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx @@ -69,15 +69,16 @@ std::vector ModelShowNPoints::GetLstLabels() void ModelShowNPoints::SetReferencePoint(std::vector ppoint) { mReferencePoint = ppoint; - if(lstPointsX.size() > 0){ + if(lstPointsX.size() > 0) + { int idPoint = IdInsidePoint(); - if(idPoint == -1 && idCurrentPoint >= 0 && idCurrentPoint < lstPointsX.size()){ + if(idPoint == -1 && idCurrentPoint >= 0 && idCurrentPoint < lstPointsX.size()) + { idCurrentPoint = idCurrentPoint; - } - else{ + } else{ idCurrentPoint = idPoint; - } - } + } // if idPoint + } // if lstPointsX.size } //------------------------------------------------------------------------ @@ -359,7 +360,8 @@ int ModelShowNPoints::IdInsidePoint() int id=-1; int i, size=(int)( lstPointsX.size() ); double spc[3]; - double radio2=(mradio+1)*(mradio+1); + double tmpRadio = mradio/3; + double radio2=(tmpRadio+1)*(tmpRadio+1); if(mimage ==NULL) { printf("WidgetShowNPoints::IdInsidePoint image not set\n"); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index bdce5b2..280e0c7 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -10,7 +10,6 @@ #include #include #include -#include #include #include "vtkSphereSource.h" @@ -1670,15 +1669,21 @@ void WidgetShowNPoints::OnNextCollection(wxCommandEvent &event) void WidgetShowNPoints::DetectCollectionActive() { int id; - int i,size=lstModelShowNPoints.size(); - for (i=0;iGetValue()==false ) { - id = lstModelShowNPoints[i]->IdInsidePoint(); - if (id>=0) + int i,size=lstModelShowNPoints.size(); + for (i=0;i=0 - } // for i + id = lstModelShowNPoints[i]->IdInsidePoint(); + if (id>=0) + { + mActualCollection=i; + } // if id>=0 + } // for i + } else { + id = GetModelShowNPoints()->IdInsidePoint(); // forcing the selection of the point + } // if cbVisuActualCollection + RefreshCollectionText(); RefreshColourCollection(); } @@ -1858,8 +1863,8 @@ void WidgetShowNPoints::OnLoadCollections_( std::string filename ) GetViewShowNPoints()->AddVtkPoint(); }// for } // for i - fclose(ff); + mActualCollection=0; } else { // else ff printf("WidgetShowNPoints::Load Group of Points ...Error... reading file"); } //ff -- 2.47.1