2 // 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)
4 #include "bbcreaVtkDelaunay3D.h"
5 #include "bbcreaVtkPackage.h"
8 #include "vtkDelaunay2D.h"
9 #include "vtkDelaunay3D.h"
10 #include "vtkShrinkFilter.h"
11 #include "vtkGeometryFilter.h"
12 #include <vtkUnstructuredGrid.h>
13 #include <vtkCleanPolyData.h>
15 #include <vtkPCANormalEstimation.h>
16 #include <vtkSignedDistance.h>
17 #include <vtkExtractSurface.h>
18 #include <vtkPointData.h>
20 #include <vtkSurfaceReconstructionFilter.h>
21 #include <vtkContourFilter.h>
22 #include <vtkReverseSense.h>
29 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Delaunay3D)
30 BBTK_BLACK_BOX_IMPLEMENTATION(Delaunay3D,bbtk::AtomicBlackBox);
32 // 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)
34 void Delaunay3D::Process()
37 // THE MAIN PROCESSING METHOD BODY
38 // Here we simply set the input 'In' value to the output 'Out'
39 // And print out the output value
40 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
41 // void bbSet{Input|Output}NAME(const TYPE&)
42 // const TYPE& bbGet{Input|Output}NAME() const
44 // * NAME is the name of the input/output
45 // (the one provided in the attribute 'name' of the tag 'input')
46 // * TYPE is the C++ type of the input/output
47 // (the one provided in the attribute 'type' of the tag 'input')
48 // bbSetOutputOut( bbGetInputIn() );
49 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
51 std::vector<double> lstX=bbGetInputLstPointsX();
52 std::vector<double> lstY=bbGetInputLstPointsY();
53 std::vector<double> lstZ=bbGetInputLstPointsZ();
56 vtkPoints *points = vtkPoints::New();
57 int i,size=lstX.size();
60 points->InsertNextPoint( lstX[i], lstY[i], lstZ[i] );
63 vtkPolyData *inputpolydata = vtkPolyData::New();
64 inputpolydata->SetPoints( points );
67 vtkDelaunay3D* delaunay = vtkDelaunay3D::New();
68 delaunay->SetInputData( inputpolydata );
69 delaunay->SetTolerance( bbGetInputTolerance() ); //0.01
70 delaunay->SetAlpha( bbGetInputAlpha() ); //0.2
71 delaunay->BoundingTriangulationOff();
73 vtkGeometryFilter *geometry = vtkGeometryFilter::New();
74 geometry->SetInputData( delaunay->GetOutput() );
76 bbSetOutputOut( geometry->GetOutput() );
78 printf("Warnning! Delaunay3D::Process: list of points empty. \n");
83 // 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)
85 void Delaunay3D::bbUserSetDefaultValues()
88 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
89 // Here we initialize the input 'In' to 0
90 bbSetInputTolerance( 0 );
94 // 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)
96 void Delaunay3D::bbUserInitializeProcessing()
99 // THE INITIALIZATION METHOD BODY :
101 // but this is where you should allocate the internal/output pointers
107 // 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)
109 void Delaunay3D::bbUserFinalizeProcessing()
112 // THE FINALIZATION METHOD BODY :
114 // but this is where you should desallocate the internal/output pointers
119 // EO namespace bbcreaVtk