]> Creatis software - creaMaracasVisu.git/blob - bbtk/src/bbcreaMaracasVisuReadAxisTree3D.cxx
no message
[creaMaracasVisu.git] / bbtk / src / bbcreaMaracasVisuReadAxisTree3D.cxx
1 //===== 
2 // Don't edit this file. This file is generated from xml description.. 
3 //===== 
4 #include "bbcreaMaracasVisuReadAxisTree3D.h"
5 #include "bbcreaMaracasVisuPackage.h"
6
7
8 #include<vector>
9
10
11
12 namespace bbcreaMaracasVisu
13 {
14
15 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ReadAxisTree3D)
16 BBTK_BLACK_BOX_IMPLEMENTATION(ReadAxisTree3D,bbtk::AtomicBlackBox);
17 //===== 
18 // Don't edit this file. This file is generated from xml description.. 
19 //===== 
20 void ReadAxisTree3D::Process()
21 {
22
23 // THE MAIN PROCESSING METHOD BODY
24 //   Here we simply set the input 'In' value to the output 'Out'
25 //   And print out the output value
26 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
27 //    void bbSet{Input|Output}NAME(const TYPE&)
28 //    const TYPE& bbGet{Input|Output}NAME() const 
29 //    Where :
30 //    * NAME is the name of the input/output
31 //      (the one provided in the attribute 'name' of the tag 'input')
32 //    * TYPE is the C++ type of the input/output
33 //      (the one provided in the attribute 'type' of the tag 'input')
34
35         
36         std::vector<int> tlstIndexs;
37         std::vector<double> tlstPointsX;
38         std::vector<double> tlstPointsY;
39         std::vector<double> tlstPointsZ;
40         
41         int numberOfLines = 0;
42         int numberOfPoints = 0;
43         FILE *ff1 = fopen( bbGetInputFileName_Points().c_str() , "r+" );
44         if (ff1!=NULL)
45         {
46                 float xx,yy,zz;
47                 while (!feof(ff1))
48                 {
49                         fscanf(ff1,"%f %f %f",&xx,&yy,&zz);
50                         printf("EED ReadAxisTree3D point %d  >> %f %f %f\n", numberOfLines,xx,yy,zz);
51                         tlstPointsX.push_back( (double)xx );
52                         tlstPointsY.push_back( (double)yy );
53                         tlstPointsZ.push_back( (double)zz );
54                         numberOfLines++;                        
55                 }       
56                 fclose(ff1);
57         } else {   // else ff1
58                 printf("bbcreaMaracasVisuReadAxisTree3D::Process  ...Error... reading file InputFileName_Points>%s", bbGetInputFileName_Points().c_str() );
59         } //ff1 
60
61         
62         FILE *ff2 = fopen( bbGetInputFileName_Indexs().c_str() , "r+" );
63         if (ff2!=NULL)
64         {
65                 int ii,i=0;
66                 while ( !feof(ff2) )
67                 {
68                         fscanf(ff2,"%d ",&ii);
69                         printf("EED ReadAxisTree3D index %d >> %d\n", i,ii);
70                         i++;
71                         
72                         numberOfPoints = numberOfPoints +ii;
73                         tlstIndexs.push_back( ii );
74                 }       
75                 fclose(ff2);
76         } else {   // else ff
77                 printf("bbcreaMaracasVisuReadAxisTree3D::Process  ...Error... reading file InputFileName_Indexs>%s", bbGetInputFileName_Indexs().c_str() );
78         } //ff2 
79         
80         printf("EED numberOfLines=%d   numberOfPoints=%d \n",numberOfLines,numberOfPoints);
81         
82         bbSetOutputlstIndexs( tlstIndexs );
83         bbSetOutputlstPointsX( tlstPointsX );
84         bbSetOutputlstPointsY( tlstPointsY );
85         bbSetOutputlstPointsZ( tlstPointsZ );
86         
87 }
88         
89         
90 //===== 
91 // Don't edit this file. This file is generated from xml description.. 
92 //===== 
93 void ReadAxisTree3D::bbUserSetDefaultValues()
94 {
95
96 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
97 //    Here we initialize the input 'In' to 0
98    bbSetInputFileName_Indexs("");
99         bbSetInputFileName_Points("");  
100   
101 }
102 //===== 
103 // Don't edit this file. This file is generated from xml description.. 
104 //===== 
105 void ReadAxisTree3D::bbUserInitializeProcessing()
106 {
107
108 //  THE INITIALIZATION METHOD BODY :
109 //    Here does nothing 
110 //    but this is where you should allocate the internal/output pointers 
111 //    if any 
112
113   
114 }
115 //===== 
116 // Don't edit this file. This file is generated from xml description.. 
117 //===== 
118 void ReadAxisTree3D::bbUserFinalizeProcessing()
119 {
120
121 //  THE FINALIZATION METHOD BODY :
122 //    Here does nothing 
123 //    but this is where you should desallocate the internal/output pointers 
124 //    if any
125   
126 }
127 }
128 // EO namespace bbcreaMaracasVisu
129
130