]> Creatis software - creaMaracasVisu.git/commitdiff
#3541 Bug ShowNPoints in IdInsidePoint
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 1 Sep 2023 15:42:24 +0000 (17:42 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 1 Sep 2023 15:42:24 +0000 (17:42 +0200)
bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbg
bbtk/bbs/boxes/Mesh_tool_ApplySurface.bbs
bbtk/src/bbmaracasvisuShowNPoints.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/ModelShowNPoints.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/WidgetShowNPoints.cxx

index 5ddd3f60bc6143138a202679bcc4046fdb342951..58fab7b477b00f85fed86f6e69adf04285cbf1e0 100644 (file)
@@ -98,6 +98,8 @@ PORT
 DoubleContour:"1"
 PORT
 NbPoints:"100"
+PORT
+Param:"1"
 FIN_BOX
 BOX
 wx:LayoutLine:Box08
index 32e110694eaffa824753de34232cc8d1d94ad685..bba90f5f4564cbf459dde78b4570e716549c2c9f 100644 (file)
@@ -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
 
index 7843235b8bd7550134a4356c45b37fc9f96da26f..1e5c5283349c6940e3ed7ba2d1ce6abe41569aa7 100644 (file)
@@ -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;
index 69196bbe604e6632e449977ffabb313de2bd3338..41cb959f1b812edf5d0867c54ab65b241283886f 100644 (file)
@@ -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);
index 80ab6f838c5ca565c8f04ccdc0b12064baffc669..ee698ca65d79678f7cf6e4703a562199d9ab88e2 100644 (file)
@@ -1250,7 +1250,7 @@ void  WidgetShowNPoints::SetReferencePoint(std::vector<double> point)
 {
        GetModelShowNPoints()->SetReferencePoint(point);
     int i,size=lstModelShowNPoints.size();
-    for (i=0;i<size;i++)
+    for ( i=0 ; i<size ; i++ )
     {
         lstModelShowNPoints[i]->SetReferencePoint(point);    // All collection
     } // for i