]> Creatis software - bbtk.git/commitdiff
#3490 Init param PolyDataToActor
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 30 Aug 2022 15:02:55 +0000 (17:02 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Tue, 30 Aug 2022 15:02:55 +0000 (17:02 +0200)
kernel/src/bbtkBlackBox.cxx
packages/vtk/src/bbvtkPolyDataToActor.cxx

index 7ec068c721c57626206c01eaa9149aa6f8b51baf..b9f376a45c2a28abd031c0845480c69612860a24 100644 (file)
@@ -748,9 +748,9 @@ namespace bbtk
                           ( (bbBoxProcessModeIsManual()==true)&&(bbLetRecursiveExecuteManualMode==true) ) 
                         )
                        {
-  printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
+//  printf("EED BlackBox::bbRecursiveExecute bbProcess start %s \n", bbGetFullName().c_str() );
                                this->bbProcess();              
-  printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
+//  printf("EED BlackBox::bbRecursiveExecute bbProcess end %s \n", bbGetFullName().c_str() );
                    } // Manual analysis
                  
 //EED ups                      if ((bbBoxProcessModeIsManual()==true) && (bbLetRecursiveExecuteManualMode==false))
index 75e24aede52bc9e10c2e81236dc65291f98d4584..ae47cccd7854803109b4995e03e000fb249679d9 100644 (file)
@@ -158,94 +158,97 @@ er<vtkLookupTable>::New();
 
 void PolyDataToActor::DoProcess()
 {
-               if (bbGetInputRenderer()==NULL)
-               {
-                       printf("EED Warnning! PolyDataToActor::DoProcess  missing Renderer.\n");
-               }
-
-    printf("EED Warnning! PolyDataToActor::DoProcess  In=%p\n" ,bbGetInputIn()  );
-
-               if (bbGetInputActive()==true)
-               {
-
-            if (bbGetInputIn()!=NULL)
+    bool ok_removeActor=false;
+    if (bbGetInputRenderer()==NULL)
+    {
+        printf("EED Warnning! PolyDataToActor::DoProcess  missing Renderer.\n");
+    }
+    if (bbGetInputActive()==true)
+    {
+        if (bbGetInputIn()!=NULL)
+        {
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+             polydatamapper->SetInput( bbGetInputIn() );
+#else
+             polydatamapper->SetInputData( bbGetInputIn() );
+#endif
+             vtkactor->GetProperty()->SetRepresentation( bbGetInputRepresentation() );
+            if (bbGetInputRepresentation()==0)
             {
-    //EED 2017-01-01 Migration VTK7
-    #if VTK_MAJOR_VERSION <= 5
-                 polydatamapper->SetInput( bbGetInputIn() );
-    #else
-                 polydatamapper->SetInputData( bbGetInputIn() );
-    #endif
-                 vtkactor->GetProperty()->SetRepresentation( bbGetInputRepresentation() );
-                if (bbGetInputRepresentation()==0)
-                {
-                     vtkactor->GetProperty()->SetAmbient(1);
-                     vtkactor->GetProperty()->SetDiffuse(1);
-                     vtkactor->GetProperty()->SetSpecular(0);
-    printf("EED WARNNING!  PolyDataToActor::DoProcess  which is the default values of Ambient, Diffuse, Specular for points option? \n");
-                } else if (bbGetInputRepresentation()==1)
-                {
-                     vtkactor->GetProperty()->SetAmbient(1);
-                     vtkactor->GetProperty()->SetDiffuse(1);
-                     vtkactor->GetProperty()->SetSpecular(0);
-                } else if (bbGetInputRepresentation()==2)
+                 vtkactor->GetProperty()->SetAmbient(1);
+                 vtkactor->GetProperty()->SetDiffuse(1);
+                 vtkactor->GetProperty()->SetSpecular(0);
+printf("EED WARNNING!  PolyDataToActor::DoProcess  which is the default values of Ambient, Diffuse, Specular for points option? \n");
+            } else if (bbGetInputRepresentation()==1)
+            {
+                 vtkactor->GetProperty()->SetAmbient(1);
+                 vtkactor->GetProperty()->SetDiffuse(1);
+                 vtkactor->GetProperty()->SetSpecular(0);
+            } else if (bbGetInputRepresentation()==2)
+            {
+                 vtkactor->GetProperty()->SetAmbient(0);
+                 vtkactor->GetProperty()->SetDiffuse(1);
+                 vtkactor->GetProperty()->SetSpecular(0);
+            }
+             vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
+             vtkactor->GetProperty()->SetColor( bbGetInputColour()[0],
+                            bbGetInputColour()[1],
+                            bbGetInputColour()[2] );
+             vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
+             if ( bbGetInputTransform()!=NULL )
+             {
+                vtkactor->SetUserTransform( bbGetInputTransform() );
+             }
+             bbSetOutputOut( vtkactor );
+             // Interface Update
+             if ((actorAdded==false) && (bbGetInputRenderer()!=NULL ))
+             {
+               actorAdded=true;
+               bbGetInputRenderer()->AddActor( vtkactor );
+             }  // actorAdded
+             if (bbGetInputScalarVisibility()==true )
+             {
+                polydatamapper->ScalarVisibilityOn();
+                if (bbGetInputScalarVisibilityOn_LookupTable()!=NULL)
                 {
-                     vtkactor->GetProperty()->SetAmbient(0);
-                     vtkactor->GetProperty()->SetDiffuse(1);
-                     vtkactor->GetProperty()->SetSpecular(0);
-                }
-                 vtkactor->GetProperty()->SetLineWidth( bbGetInputLineWidth() );
-                 vtkactor->GetProperty()->SetColor( bbGetInputColour()[0],
-                                bbGetInputColour()[1],
-                                bbGetInputColour()[2] );
-                 vtkactor->GetProperty()->SetOpacity( bbGetInputOpacity() );
-                 if ( bbGetInputTransform()!=NULL )
-                 {
-                    vtkactor->SetUserTransform( bbGetInputTransform() );
-                 }
-                 bbSetOutputOut( vtkactor );
-                 // Interface Update
-                 if ((actorAdded==false) && (bbGetInputRenderer()!=NULL ))
-                 {
-                   actorAdded=true;
-                   bbGetInputRenderer()->AddActor( vtkactor );
-                 }  // actorAdded
-                 if (bbGetInputScalarVisibility()==true )
-                 {
-                    polydatamapper->ScalarVisibilityOn();
-                    if (bbGetInputScalarVisibilityOn_LookupTable()!=NULL)
+//                                     polydatamapper->SetScalarModeToDefault();
+//                                     polydatamapper->SetScalarModeToUseCellData();
+//                                     polydatamapper->SetScalarModeToUseCellFieldData();
+//                                     polydatamapper->SetScalarModeToUseFieldData();    //    1/2     hausdorff->SetTargetDistanceMethodToPointToCell();
+//                                     polydatamapper->SetScalarModeToUsePointData();   // *
+                    polydatamapper->SetScalarModeToUsePointFieldData();
+                    polydatamapper->SetColorModeToMapScalars();
+                    polydatamapper->SetLookupTable( bbGetInputScalarVisibilityOn_LookupTable() );
+                    if (bbGetInputScalarVisibilityOn_NameColorArray()!="")
+                    {
+                        polydatamapper->SelectColorArray( bbGetInputScalarVisibilityOn_NameColorArray().c_str() );
+                    }
+                    if (bbGetInputScalarVisibilityOn_ScalarRange().size()==2)
                     {
-    //                                 polydatamapper->SetScalarModeToDefault();
-    //                                 polydatamapper->SetScalarModeToUseCellData();
-    //                                 polydatamapper->SetScalarModeToUseCellFieldData();
-    //                                 polydatamapper->SetScalarModeToUseFieldData();    //    1/2     hausdorff->SetTargetDistanceMethodToPointToCell();
-    //                                 polydatamapper->SetScalarModeToUsePointData();   // *
-                        polydatamapper->SetScalarModeToUsePointFieldData();
-                        polydatamapper->SetColorModeToMapScalars();
-                        polydatamapper->SetLookupTable( bbGetInputScalarVisibilityOn_LookupTable() );
-                        if (bbGetInputScalarVisibilityOn_NameColorArray()!="")
-                        {
-                            polydatamapper->SelectColorArray( bbGetInputScalarVisibilityOn_NameColorArray().c_str() );
-                        }
-                        if (bbGetInputScalarVisibilityOn_ScalarRange().size()==2)
-                        {
-                            polydatamapper->SetScalarRange(  bbGetInputScalarVisibilityOn_ScalarRange()[0] , bbGetInputScalarVisibilityOn_ScalarRange()[1]   );
-                        }
-                     } // if ScalarVisibilityOn_LookupTable
-                 } else {
-                     polydatamapper->ScalarVisibilityOff();
-                 } // ScalarVisibility
-            } else {
-                printf("EED Warnning! PolyDataToActor::DoProcess   In (PolyData) not defined. \n"  );
-            }// if In !=NULL
-               } else {
-                        // Interface Update
-                        if ((actorAdded==true) && (bbGetInputRenderer()!=NULL ))
-                        {
-                          actorAdded=false;
-                          bbGetInputRenderer()->RemoveActor( vtkactor );
-                        }  // actorAdded
-               } // Active
+                        polydatamapper->SetScalarRange(  bbGetInputScalarVisibilityOn_ScalarRange()[0] , bbGetInputScalarVisibilityOn_ScalarRange()[1]   );
+                    }
+                 } // if ScalarVisibilityOn_LookupTable
+             } else {
+                 polydatamapper->ScalarVisibilityOff();
+             } // ScalarVisibility
+        } else {
+            ok_removeActor=true;
+            printf("EED Warnning! PolyDataToActor::DoProcess   In (PolyData) not defined. \n"  );
+        }// if In !=NULL
+    } else {
+         ok_removeActor=true;
+    } // Active
+    
+    if (ok_removeActor==true)
+    {
+        // Interface Update
+        if ((actorAdded==true) && (bbGetInputRenderer()!=NULL ))
+        {
+          actorAdded=false;
+          bbGetInputRenderer()->RemoveActor( vtkactor );
+        }  // actorAdded
+    } // if ok_removeActor
     
 }