]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkPointsXYZtoVTKPoints.cxx
f2a84952f828fbed74dcb9211926abc9793604ff
[bbtk.git] / packages / vtk / src / bbvtkPointsXYZtoVTKPoints.cxx
1 //===== 
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)
3 //===== 
4 #include "bbvtkPointsXYZtoVTKPoints.h"
5 #include "bbvtkPackage.h"
6 namespace bbvtk
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,PointsXYZtoVTKPoints)
10 BBTK_BLACK_BOX_IMPLEMENTATION(PointsXYZtoVTKPoints,bbtk::AtomicBlackBox);
11 //===== 
12 // 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)
13 //===== 
14 void PointsXYZtoVTKPoints::Process()
15 {
16
17 //std::cout << "RaC PointsXYZtoVTKPoints::Process START"<< std::endl;
18         std::vector<int> lstPointsX = bbGetInputLstPointsX();
19         std::vector<int> lstPointsY = bbGetInputLstPointsY();
20         std::vector<int> lstPointsZ = bbGetInputLstPointsZ();
21
22
23         if(_points==NULL)
24         {
25                 _points=vtkPoints::New();
26         } else {
27                 _points->Reset();//CLEAR
28         }
29         double point[3];
30         point[0]=0;
31         point[1]=0;
32         point[2]=0;
33
34         for (int i =0; i < lstPointsX.size(); ++i)
35         {
36                 point[0]=lstPointsX[i];
37                 if (lstPointsY.size()>i) { point[1]=lstPointsY[i]; }
38                 if (lstPointsZ.size()>i) { point[2]=lstPointsZ[i]; }
39                 _points->InsertPoint(i,point);
40         }
41         bbSetOutputPoints(_points);
42
43 std::cout << "RaC PointsXYZtoVTKPoints::Process END"<< std::endl;
44   
45 }
46 //===== 
47 // 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)
48 //===== 
49 void PointsXYZtoVTKPoints::bbUserSetDefaultValues()
50 {
51   _points=NULL;
52 }
53 //===== 
54 // 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)
55 //===== 
56 void PointsXYZtoVTKPoints::bbUserInitializeProcessing()
57 {
58
59
60   
61 }
62 //===== 
63 // 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)
64 //===== 
65 void PointsXYZtoVTKPoints::bbUserFinalizeProcessing()
66 {
67
68         _points->Delete();
69   
70 }
71 }
72 // EO namespace bbvtk
73
74