]> Creatis software - creaMaracasVisu.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Tue, 5 Oct 2010 15:11:58 +0000 (15:11 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Tue, 5 Oct 2010 15:11:58 +0000 (15:11 +0000)
bbtk/src/bbcreaMaracasVisuReadAxisTree3D.cxx [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuReadAxisTree3D.h [new file with mode: 0644]

diff --git a/bbtk/src/bbcreaMaracasVisuReadAxisTree3D.cxx b/bbtk/src/bbcreaMaracasVisuReadAxisTree3D.cxx
new file mode 100644 (file)
index 0000000..c7aeb65
--- /dev/null
@@ -0,0 +1,130 @@
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+#include "bbcreaMaracasVisuReadAxisTree3D.h"
+#include "bbcreaMaracasVisuPackage.h"
+
+
+#include<vector>
+
+
+
+namespace bbcreaMaracasVisu
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ReadAxisTree3D)
+BBTK_BLACK_BOX_IMPLEMENTATION(ReadAxisTree3D,bbtk::AtomicBlackBox);
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+void ReadAxisTree3D::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+       
+       std::vector<int> tlstIndexs;
+       std::vector<double> tlstPointsX;
+       std::vector<double> tlstPointsY;
+       std::vector<double> tlstPointsZ;
+       
+       int numberOfLines = 0;
+       int numberOfPoints = 0;
+       FILE *ff1 = fopen( bbGetInputFileName_Points().c_str() , "r+" );
+       if (ff1!=NULL)
+       {
+               float xx,yy,zz;
+               while (!feof(ff1))
+               {
+                       fscanf(ff1,"%f %f %f",&xx,&yy,&zz);
+                       printf("EED ReadAxisTree3D point %d  >> %f %f %f\n", numberOfLines,xx,yy,zz);
+                       tlstPointsX.push_back( (double)xx );
+                       tlstPointsY.push_back( (double)yy );
+                       tlstPointsZ.push_back( (double)zz );
+                       numberOfLines++;                        
+               }       
+               fclose(ff1);
+       } else {   // else ff1
+               printf("bbcreaMaracasVisuReadAxisTree3D::Process  ...Error... reading file InputFileName_Points>%s", bbGetInputFileName_Points().c_str() );
+       } //ff1 
+
+       
+       FILE *ff2 = fopen( bbGetInputFileName_Indexs().c_str() , "r+" );
+       if (ff2!=NULL)
+       {
+               int ii,i=0;
+               while ( !feof(ff2) )
+               {
+                       fscanf(ff2,"%d ",&ii);
+                       printf("EED ReadAxisTree3D index %d >> %d\n", i,ii);
+                       i++;
+                       
+                       numberOfPoints = numberOfPoints +ii;
+                       tlstIndexs.push_back( ii );
+               }       
+               fclose(ff2);
+       } else {   // else ff
+               printf("bbcreaMaracasVisuReadAxisTree3D::Process  ...Error... reading file InputFileName_Indexs>%s", bbGetInputFileName_Indexs().c_str() );
+       } //ff2 
+       
+       printf("EED numberOfLines=%d   numberOfPoints=%d \n",numberOfLines,numberOfPoints);
+       
+       bbSetOutputlstIndexs( tlstIndexs );
+       bbSetOutputlstPointsX( tlstPointsX );
+       bbSetOutputlstPointsY( tlstPointsY );
+       bbSetOutputlstPointsZ( tlstPointsZ );
+       
+}
+       
+       
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+void ReadAxisTree3D::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputFileName_Indexs("");
+       bbSetInputFileName_Points("");  
+  
+}
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+void ReadAxisTree3D::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+void ReadAxisTree3D::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaMaracasVisu
+
+
diff --git a/bbtk/src/bbcreaMaracasVisuReadAxisTree3D.h b/bbtk/src/bbcreaMaracasVisuReadAxisTree3D.h
new file mode 100644 (file)
index 0000000..2966487
--- /dev/null
@@ -0,0 +1,55 @@
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+#ifndef __bbcreaMaracasVisuReadAxisTree3D_h_INCLUDED__
+#define __bbcreaMaracasVisuReadAxisTree3D_h_INCLUDED__
+#include "bbcreaMaracasVisu_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbcreaMaracasVisu
+{
+
+class bbcreaMaracasVisu_EXPORT ReadAxisTree3D
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(ReadAxisTree3D,bbtk::AtomicBlackBox);
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+       BBTK_DECLARE_INPUT(FileName_Points,std::string);
+       BBTK_DECLARE_INPUT(FileName_Indexs,std::string);
+       BBTK_DECLARE_OUTPUT(lstPointsX,std::vector<double> );
+       BBTK_DECLARE_OUTPUT(lstPointsY,std::vector<double> );
+       BBTK_DECLARE_OUTPUT(lstPointsZ,std::vector<double> );
+       BBTK_DECLARE_OUTPUT(lstIndexs,std::vector<int> );
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReadAxisTree3D,bbtk::AtomicBlackBox);
+BBTK_NAME("ReadAxisTree3D");
+BBTK_AUTHOR("eduardo.davila at creatis.insa-lyon.fr");
+BBTK_DESCRIPTION("Read txt file with the tree points 3D");
+BBTK_CATEGORY("read/write");
+BBTK_INPUT(ReadAxisTree3D,FileName_Points,"File name of Points",std::string,"");
+BBTK_INPUT(ReadAxisTree3D,FileName_Indexs,"File name of Index",std::string,"");
+
+BBTK_OUTPUT(ReadAxisTree3D,lstPointsX,"lst Points X",std::vector<double>,"");
+BBTK_OUTPUT(ReadAxisTree3D,lstPointsY,"lst Points Y",std::vector<double>,"");
+BBTK_OUTPUT(ReadAxisTree3D,lstPointsZ,"lst Points Z",std::vector<double>,"");
+BBTK_OUTPUT(ReadAxisTree3D,lstIndexs,"Indexs",std::vector<int>,"");
+       
+BBTK_END_DESCRIBE_BLACK_BOX(ReadAxisTree3D);
+//===== 
+// Don't edit this file. This file is generated from xml description.. 
+//===== 
+}
+// EO namespace bbcreaMaracasVisu
+
+#endif // __bbcreaMaracasVisuReadAxisTree3D_h_INCLUDED__
+