]> Creatis software - creaVtk.git/blobdiff - bbtk_creaVtk_PKG/src/bbcreaVtkCreateMeshFromPoints.h
#3502 Bug close surface in CreateMeshFromPoints
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkCreateMeshFromPoints.h
index 1c03523c25811bb9d552e907148e43c01adc5d72..5d5ed25508c813bfbd71533b219cfec2237b781c 100644 (file)
@@ -8,7 +8,11 @@
 #include "bbtkAtomicBlackBox.h"
 #include "iostream"
 
+#include "vtkPoints.h"
+#include "vtkCellArray.h"
 #include "vtkPolyData.h"
+#include "vtkCleanPolyData.h"
+#include "vtkTriangleFilter.h"
 
 
 namespace bbcreaVtk
@@ -26,9 +30,24 @@ class bbcreaVtk_EXPORT CreateMeshFromPoints
   BBTK_DECLARE_INPUT(LstY,std::vector<double>);
   BBTK_DECLARE_INPUT(LstZ,std::vector<double>);
   BBTK_DECLARE_INPUT(LstIndexs,std::vector<int>);
+  BBTK_DECLARE_INPUT(CloseSurface, bool);
   BBTK_DECLARE_OUTPUT(Out,vtkPolyData*);
   BBTK_PROCESS(Process);
   void Process();
+
+       vtkPoints                       *points;
+       vtkCellArray            *cells;
+       vtkPolyData             *polydata;
+       vtkCleanPolyData        *clean;
+       vtkTriangleFilter       *triangle;
+       
+       bool CalcValidCentroid(double(&centroid)[3], int start, int end, int increment, int numPoints);
+       bool CheckLinePointOrder();
+       bool isPointingCorrectly( int firstPointId, int secPointId, double(&centroid)[3], int contrPointId);
+       void CloseContourBottom(bool uPointOrder);
+       void CloseContourSides(std::vector<int> lstIndexs, bool uPointOrder);
+       void CloseOpenContourSurface(std::vector<int> lstIndexs);
+
 //===== 
 // 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)
 //===== 
@@ -44,6 +63,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(CreateMeshFromPoints,bbtk::AtomicBlackBox);
   BBTK_INPUT(CreateMeshFromPoints,LstY,"List Y point",std::vector<double>,"");
   BBTK_INPUT(CreateMeshFromPoints,LstZ,"List Z point",std::vector<double>,"");
   BBTK_INPUT(CreateMeshFromPoints,LstIndexs,"Number of points by segment",std::vector<int>,"");
+  BBTK_INPUT(CreateMeshFromPoints,CloseSurface,"(default false) Add the caps to close the surface",bool,"");
 
   BBTK_OUTPUT(CreateMeshFromPoints,Out,"vtkPolyData",vtkPolyData*,"");