]> Creatis software - bbtk.git/blobdiff - packages/vtk/src/bbvtkPolyDataToActor.cxx
#3352 BBTK Feature New Normal - box TemporaryPicker in 3D
[bbtk.git] / packages / vtk / src / bbvtkPolyDataToActor.cxx
index ba441439b4cb99b5466141ac7029ceb69ec2b190..2aad2ec130eb57e7ee73ab1be1e5634a342df18a 100644 (file)
 
 #include "vtkProperty.h"
 #include "vtkLinearTransform.h"
+#include "vtkCleanPolyData.h"
 
 #include "bbvtkPolyDataToActor.h"
 #include "bbvtkPackage.h"
 
+#include "vtkRenderWindow.h"
 
 namespace bbvtk
 {
@@ -104,16 +106,40 @@ namespace bbvtk
        
 //---------------------------------------------------------------------
 
-       void PolyDataToActor::DoProcess()
-       {
+void PolyDataToActor::DoProcess()
+{
+printf("EED WARNNIN!!!!! PolyDataToActor::DoProcess For better transparent ...  Clean this code in the correct part ..........\n");
+printf("EED WARNNIN!!!!! PolyDataToActor::DoProcess For better transparent ...  Clean this code in the correct part ..........\n");
+printf("EED WARNNIN!!!!! PolyDataToActor::DoProcess For better transparent ...  Clean this code in the correct part ..........\n");
+printf("EED WARNNIN!!!!! PolyDataToActor::DoProcess For better transparent ...  Clean this code in the correct part ..........\n");
+printf("EED WARNNIN!!!!! PolyDataToActor::DoProcess For better transparent ...  Clean this code in the correct part ..........\n");
+printf("EED WARNNIN!!!!! PolyDataToActor::DoProcess For better transparent ...  Clean this code in the correct part ..........\n");
+printf("EED WARNNIN!!!!! PolyDataToActor::DoProcess For better transparent ...  Clean this code in the correct part ..........\n");
+printf("EED WARNNIN!!!!! PolyDataToActor::DoProcess For better transparent ...  Clean this code in the correct part ..........\n");
+//https://stackoverflow.com/questions/47528086/problems-with-rendering-transparent-objects-in-vtk
+//https://itk.org/Wiki/VTK/Depth_Peeling
+bbGetInputRenderer()->SetUseDepthPeeling(1);
+bbGetInputRenderer()->SetOcclusionRatio(0.1);
+bbGetInputRenderer()->SetMaximumNumberOfPeels(100);
+bbGetInputRenderer()->GetRenderWindow()->SetMultiSamples(0);
+bbGetInputRenderer()->GetRenderWindow()->SetAlphaBitPlanes(1);
+
+
+               if (bbGetInputRenderer()==NULL)
+               {
+                       printf("EED Warnning! PolyDataToActor::DoProcess  missing Renderer.\n");
+               }
+
 
                if (bbGetInputActive()==true)
                {
+
+
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
                         polydatamapper->SetInput( bbGetInputIn() );
 #else
-                        polydatamapper->SetInputData( bbGetInputIn() );
+                        polydatamapper->SetInputData( bbGetInputIn() );  
 #endif
 
                         vtkactor->GetProperty()->SetRepresentation( bbGetInputRepresentation() );
@@ -173,7 +199,7 @@ printf("EED WARNNING!  PolyDataToActor::DoProcess  which is the default values o
                           bbGetInputRenderer()->RemoveActor( vtkactor );
                         }  // actorAdded
                } // Active
-       }
+}