From c076290bfdc14f0eb8f73a9491ed178796f84409 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 1 Sep 2023 17:42:24 +0200 Subject: [PATCH] #3541 Bug ShowNPoints in IdInsidePoint --- bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg | 2 ++ bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs | 1 + bbtk/src/bbmaracasvisuShowNPoints.cxx | 3 +-- .../src/interface/wxWindows/widgets/ModelShowNPoints.cxx | 4 ++-- .../src/interface/wxWindows/widgets/WidgetShowNPoints.cxx | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg index 5ddd3f6..58fab7b 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg @@ -98,6 +98,8 @@ PORT DoubleContour:"1" PORT NbPoints:"100" +PORT +Param:"1" FIN_BOX BOX wx:LayoutLine:Box08 diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs index 32e1106..bba90f5 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs @@ -27,6 +27,7 @@ new creaVtk:CreateMeshFromPoints Box04 new creaMaracasVisu:ManualContourModel_Box Box06 set Box06.DoubleContour "1" set Box06.NbPoints "100" + set Box06.Param "1" new wx:LayoutLine Box08 diff --git a/bbtk/src/bbmaracasvisuShowNPoints.cxx b/bbtk/src/bbmaracasvisuShowNPoints.cxx index 7843235..1e5c528 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.cxx +++ b/bbtk/src/bbmaracasvisuShowNPoints.cxx @@ -101,9 +101,9 @@ void ShowNPoints::Process() { if (mwxwidget!=NULL) { + mwxwidget->SetImage( bbGetInputImage() ); mwxwidget->SetRenderer( bbGetInputRenderer() ); mwxwidget->SetReferencePoint( bbGetInputIn() ); - mwxwidget->SetImage( bbGetInputImage() ); mwxwidget->SetColour( bbGetInputColour() ); // mwxwidget->SetOpacity( bbGetInputOpacity() ); mwxwidget->SetRadio( bbGetInputRadio() ); @@ -112,7 +112,6 @@ void ShowNPoints::Process() backOpacity = bbGetInputOpacity(); mwxwidget->SetOpacity( bbGetInputOpacity() ); } // if backOpacity - // if (firsttime==true) // { // firsttime=false; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx index 69196bb..41cb959 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx @@ -362,9 +362,9 @@ int ModelShowNPoints::IdInsidePoint() double spc[3]; double tmpRadio = mradio/3; double radio2=(tmpRadio+1)*(tmpRadio+1); - if(mimage ==NULL) + if ( (mimage==NULL) || (mReferencePoint.size()!=3) ) { - printf("WidgetShowNPoints::IdInsidePoint image not set\n"); + printf("WidgetShowNPoints::IdInsidePoint image not set or ReferencePoint not set\n"); return -1; }else{ mimage->GetSpacing(spc); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx index 80ab6f8..ee698ca 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx @@ -1250,7 +1250,7 @@ void WidgetShowNPoints::SetReferencePoint(std::vector point) { GetModelShowNPoints()->SetReferencePoint(point); int i,size=lstModelShowNPoints.size(); - for (i=0;iSetReferencePoint(point); // All collection } // for i -- 2.47.1