]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx
3195 creaVtk Feature New Normal - new Boxes ImageCutByAxis LightKit MeshCutByAxis
[creaVtk.git] / bbtk_creaVtk_PKG / src / bbcreaVtkPlaneSource.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 "bbcreaVtkPlaneSource.h"
5 #include "bbcreaVtkPackage.h"
6 #include "vtkPlaneSource.h"
7 #include "vtkDataSet.h"
8 #include "iostream" 
9 namespace bbcreaVtk
10 {
11
12 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,PlaneSource)
13 BBTK_BLACK_BOX_IMPLEMENTATION(PlaneSource,bbtk::AtomicBlackBox);
14 //===== 
15 // 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)
16 //===== 
17 void PlaneSource::Process()
18 {
19                 vtkPlaneSource *plane;
20                 plane = vtkPlaneSource::New();
21                 double p0[3];
22                 p0[0]=0;
23                 p0[1]=0;
24                 p0[2]=0;
25     double p1[3];
26                 p1[0]=0;
27                 p1[1]=1;
28                 p1[2]=0;    
29                 double p2[3];
30                 p2[0]=0;
31                 p2[1]=0;
32                 p2[2]=1;
33                 double c[3];
34                 c[0]=bbGetInputCenter()[0];
35                 c[1]=bbGetInputCenter()[1];
36                 c[2]=bbGetInputCenter()[2];
37
38                 plane->SetResolution( bbGetInputXResolution(), bbGetInputYResolution() );
39                 plane->SetOrigin( p0 );
40                 plane->SetPoint1( p1 );
41                 plane->SetPoint2( p2 );
42                 plane->Update( );
43                 plane->SetNormal( bbGetInputNormal()[0], bbGetInputNormal()[1], bbGetInputNormal()[2] );
44                 plane->Update( );
45                 plane->SetCenter( c );
46                 plane->Update( );
47     bbSetOutputPlane( (vtkDataSet*)plane );
48     bbSetOutputPolyData( plane->GetOutput() );
49
50 }
51 //===== 
52 // 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)
53 //===== 
54 void PlaneSource::bbUserSetDefaultValues()
55 {
56    std::vector<double> c;
57    std::vector<double> n;
58         c.push_back(0);
59         c.push_back(0);
60         c.push_back(0);
61         n.push_back(1);
62         n.push_back(0);
63         n.push_back(0);
64    bbSetInputCenter(c);
65    bbSetInputNormal(n);
66    bbSetInputXResolution(100);
67    bbSetInputYResolution(100);
68 }
69 //===== 
70 // 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)
71 //===== 
72 void PlaneSource::bbUserInitializeProcessing()
73 {
74
75   
76 }
77 //===== 
78 // 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)
79 //===== 
80 void PlaneSource::bbUserFinalizeProcessing()
81 {
82
83   
84 }
85 }
86 // EO namespace bbcreaVtk
87
88