]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkDelaunay3D.cxx
#3274 creaVtk Feature New Normal - BooleanOperationPolyDataFilter BoxWidget ClipPol...
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkDelaunay3D.cxx
index 02a26e735024e8cb59469b211495efa0b3327b36..baeb1f1a8b90a9620a17d78c3b15abb860f88c72 100644 (file)
@@ -48,8 +48,6 @@ void Delaunay3D::Process()
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
   
-
-printf("EED Delaunay3D::Process Start\n");
        std::vector<double> lstX=bbGetInputLstPointsX();
        std::vector<double> lstY=bbGetInputLstPointsY();
        std::vector<double> lstZ=bbGetInputLstPointsZ();
@@ -72,150 +70,15 @@ printf("EED Delaunay3D::Process Start\n");
                delaunay->SetAlpha( bbGetInputAlpha() ); //0.2
                delaunay->BoundingTriangulationOff();
                delaunay->Update();
-
                vtkGeometryFilter *geometry = vtkGeometryFilter::New();
                geometry->SetInputData( delaunay->GetOutput() );
                geometry->Update();
-
                bbSetOutputOut( geometry->GetOutput() );
-
-
-/* vtkExtractSurface
-  double bounds[6];
-  inputpolydata->GetBounds(bounds);
-  double range[3];
-  for (int i = 0; i < 3; ++i)
-  {
-    range[i] = bounds[2*i + 1] - bounds[2*i];
-  }
-
-  int sampleSize = inputpolydata->GetNumberOfPoints() * .00005;
-  if (sampleSize < 10)
-  {
-    sampleSize = 10;
-  }
-  std::cout << "Sample size is: " << sampleSize << std::endl;
-  // Do we need to estimate normals?
-  vtkSmartPointer<vtkSignedDistance> distance =
-    vtkSmartPointer<vtkSignedDistance>::New();
-  if (inputpolydata->GetPointData()->GetNormals())
-  {
-    std::cout << "Using normals from input file" << std::endl;
-    distance->SetInputData (inputpolydata);
-  }  else{
-       std::cout << "Estimating normals using PCANormalEstimation" << std::endl;
-    vtkSmartPointer<vtkPCANormalEstimation> normals =
-      vtkSmartPointer<vtkPCANormalEstimation>::New();
-    normals->SetInputData (inputpolydata);
-    normals->SetSampleSize(sampleSize);
-    normals->SetNormalOrientationToGraphTraversal();
-    normals->FlipNormalsOn();
-    distance->SetInputConnection (normals->GetOutputPort());
-  }
-  std::cout << "Range: "
-            << range[0] << ", "
-            << range[1] << ", "
-            << range[2] << std::endl;
-  int dimension = 256;
-  double radius;
-
-  radius = std::max(std::max(range[0], range[1]), range[2])
-    / static_cast<double>(dimension) * 4; // ~4 voxels
-
-//EED
- radius = bbGetInputTolerance();
-
-
-  std::cout << "Radius: " << radius << std::endl;
-
-  distance->SetRadius(radius);
-  distance->SetDimensions(dimension, dimension, dimension);
-  distance->SetBounds(
-    bounds[0] - range[0] * .1,
-    bounds[1] + range[0] * .1,
-    bounds[2] - range[1] * .1,
-    bounds[3] + range[1] * .1,
-    bounds[4] - range[2] * .1,
-    bounds[5] + range[2] * .1);
-
-
-               vtkExtractSurface *surface = vtkExtractSurface::New();
-               surface->SetInputConnection (distance->GetOutputPort());
-               surface->SetRadius(radius * .99 ); // 
-               surface->Update();
-               bbSetOutputOut( surface->GetOutput() );
-*/
-
-/*vtkPoissonReconstruction
-                vtkPolyData *polyData=inputpolydata;
-
-                vtkSmartPointer<vtkPoissonReconstruction> surface =
-                       vtkSmartPointer<vtkPoissonReconstruction>::New();
-                 surface->SetDepth(12);
-
-                 int sampleSize = polyData->GetNumberOfPoints() * .00005;
-                 if (sampleSize < 10)
-                 {
-                       sampleSize = 10;
-                 }
-                 if (polyData->GetPointData()->GetNormals())
-                 {
-                       std::cout << "Using normals from input file" << std::endl;
-                       surface->SetInputData (polyData);
-                 }
-                 else
-                 {
-                       std::cout << "Estimating normals using PCANormalEstimation" << std::endl;
-                       vtkSmartPointer<vtkPCANormalEstimation> normals =
-                         vtkSmartPointer<vtkPCANormalEstimation>::New();
-                       normals->SetInputData (polyData);
-                       normals->SetSampleSize(sampleSize);
-                       normals->SetNormalOrientationToGraphTraversal();
-                       normals->FlipNormalsOff();
-                       surface->SetInputConnection(normals->GetOutputPort());
-                 }
-
-               surface->Update();      
-               bbSetOutputOut( surface->GetOutput() );
-
-*/
-
-
-
-/*SurfaceReconstructionFilter
-
-               vtkPolyData *polydata=inputpolydata;
-
-               // Construct the surface and create isosurface.   
-                 vtkSmartPointer<vtkSurfaceReconstructionFilter> surf =
-                       vtkSmartPointer<vtkSurfaceReconstructionFilter>::New();
-                 surf->SetInputData(polydata);
-
-                 vtkSmartPointer<vtkContourFilter> cf =
-                       vtkSmartPointer<vtkContourFilter>::New();
-                 cf->SetInputConnection(surf->GetOutputPort());
-                 cf->SetValue(0, 0.0);
-
-                 // Sometimes the contouring algorithm can create a volume whose gradient
-                 // vector and ordering of polygon (using the right hand rule) are
-                 // inconsistent. vtkReverseSense cures this problem.
-                 vtkSmartPointer<vtkReverseSense> reverse =
-                       vtkSmartPointer<vtkReverseSense>::New();
-                 reverse->SetInputConnection(cf->GetOutputPort());
-                 reverse->ReverseCellsOn();
-                 reverse->ReverseNormalsOn();
-
-                 bbSetOutputOut( reverse->GetOutput() );
-
-*/
-
        } else {
                printf("Warnning! Delaunay3D::Process:  list of points empty. \n");
        } // if lstX.size
-
-printf("EED Delaunay3D::Process End\n");
-
 }
+
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
 //===== 
@@ -224,10 +87,8 @@ void Delaunay3D::bbUserSetDefaultValues()
 
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
-   bbSetInputTolerance( 0.01 );
-   bbSetInputAlpha( 0.2 );
-   bbSetInputShrinkFactor( 0.9 );
-  
+   bbSetInputTolerance( 0 );
+   bbSetInputAlpha( 0 );
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)