]> Creatis software - bbtk.git/blob - packages/vtk/src/bbvtkPlaneClipPolyData.cxx
e3432ee67f12f5bdb9eec91466d2d5668e8385ca
[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         clipper->SetInputConnection(inPolyData->GetProducerPort());
30         clipper->SetClipFunction(plane);
31         clipper->Update();
32
33         vtkPolyData* outPolydata = clipper->GetOutput();
34     bbSetOutputClippedPolyData(outPolydata);
35
36    // std::cout << "RaC PlaneClipPolyData::Process END "<<polydataCopy<< std::endl;
37   
38 }
39 //===== 
40 // 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)
41 //===== 
42 void PlaneClipPolyData::bbUserSetDefaultValues()
43 {
44
45   
46 }
47 //===== 
48 // 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)
49 //===== 
50 void PlaneClipPolyData::bbUserInitializeProcessing()
51 {
52
53   
54 }
55 //===== 
56 // 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)
57 //===== 
58 void PlaneClipPolyData::bbUserFinalizeProcessing()
59 {
60   
61 }
62 }
63 // EO namespace bbvtk
64
65