]> Creatis software - creaVtk.git/blob - bbtk_creaVtk_PKG/src/bbcreaVtkPlaneSource.cxx
2284 creaVtk Feature New Normal Plane Source 2014-02-03 16:49
[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]=0;
28                 p1[2]=0;    
29                 double p2[3];
30                 p2[0]=0;
31                 p2[1]=0;
32                 p2[2]=0;
33                 double c[3];
34                 c[0]=bbGetInputCenter()[0];
35                 c[1]=bbGetInputCenter()[1];
36                 c[2]=bbGetInputCenter()[2];
37
38                 plane->SetResolution( 100, 100);
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     std::cout << "CFT End of Process() CFT" << std::endl;
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  
57 }
58 //===== 
59 // 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)
60 //===== 
61 void PlaneSource::bbUserInitializeProcessing()
62 {
63
64   
65 }
66 //===== 
67 // 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)
68 //===== 
69 void PlaneSource::bbUserFinalizeProcessing()
70 {
71
72   
73 }
74 }
75 // EO namespace bbcreaVtk
76
77