]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkPlaneClipPolyData.cxx
#3107 BBTK Bug New Normal - branch vtk7itk4 compilation with vtk7
[bbtk.git] / packages / vtk / src / bbvtkPlaneClipPolyData.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 "bbvtkPlaneClipPolyData.h"
5 #include "bbvtkPackage.h"
6 namespace bbvtk
7 {
8
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(vtk,PlaneClipPolyData)
10 BBTK_BLACK_BOX_IMPLEMENTATION(PlaneClipPolyData,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 PlaneClipPolyData::Process()
15 {
16
17         //std::cout << "RaC PlaneClipPolyData::Process START"<< std::endl;
18
19         std::vector<double> origin = bbGetInputPlaneOrigin();
20         std::vector<double> normal = bbGetInputPlaneNormal();
21
22         vtkPolyData* inPolyData = bbGetInputPolyData();
23
24         vtkPlane* plane = vtkPlane::New();
25         plane->SetOrigin(origin[0],origin[1],origin[2]);
26         plane->SetNormal(normal[0],normal[1],normal[2]);
27
28         vtkClipPolyData* clipper = vtkClipPolyData::New();
29
30 //EED 2017-01-01 Migration VTK7
31 #if VTK_MAJOR_VERSION <= 5
32         clipper->SetInputConnection(inPolyData->GetProducerPort());
33 #else
34         clipper->SetInputData(inPolyData);
35 #endif
36
37         clipper->SetClipFunction(plane);
38         clipper->Update();
39
40         vtkPolyData* outPolydata = clipper->GetOutput();
41     bbSetOutputClippedPolyData(outPolydata);
42
43    // std::cout << "RaC PlaneClipPolyData::Process END "<<polydataCopy<< 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 PlaneClipPolyData::bbUserSetDefaultValues()
50 {
51
52   
53 }
54 //===== 
55 // 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)
56 //===== 
57 void PlaneClipPolyData::bbUserInitializeProcessing()
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 PlaneClipPolyData::bbUserFinalizeProcessing()
66 {
67   
68 }
69 }
70 // EO namespace bbvtk
71
72