]> Creatis software - creaVtk.git/commitdiff
#2542 creaVtk Feature New Normal - VectorPolyDataReader DirName
authordavila <eduardo.davila@creatis.insa-lyon.fr>
Fri, 20 Feb 2015 17:34:02 +0000 (18:34 +0100)
committerdavila <eduardo.davila@creatis.insa-lyon.fr>
Fri, 20 Feb 2015 17:34:02 +0000 (18:34 +0100)
bbtk_creaVtk_PKG/src/bbcreaVtkVectorPolyDataReader.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkVectorPolyDataReader.h

index 25be54cdbb44e63f7112ea7dc8a4d06e2d759cfd..654a5554d1b456c98951a6b8b99082a53b5859ce 100644 (file)
@@ -31,12 +31,14 @@ void VectorPolyDataReader::Process()
 
 
         std::vector<vtkPolyData*> vecPolyData;
+        std::string tmpFileName;
 
     int i,size=bbGetInputFileNameVector().size();
         for (i=0;i<size; i++)
     {
        vtkPolyDataReader *reader = vtkPolyDataReader::New();
-                reader->SetFileName( bbGetInputFileNameVector()[i].c_str() );
+                tmpFileName=bbGetInputDirName() + "/" + bbGetInputFileNameVector()[i];
+                reader->SetFileName( tmpFileName.c_str() );
        reader->ReadAllScalarsOn();
        reader->ReadAllVectorsOn();
        reader->ReadAllNormalsOn();
@@ -60,7 +62,7 @@ void VectorPolyDataReader::bbUserSetDefaultValues()
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
 
-//   bbSetInputIn(0);
+   bbSetInputDirName("");
   
 }
 //===== 
index 393eb04cfbb2e4802a7ed2e9611982c9a418dd10..13ba8c2929752370ca7def2cd947ac2067c1233c 100644 (file)
@@ -20,6 +20,7 @@ class bbcreaVtk_EXPORT VectorPolyDataReader
 //===== 
 // 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)
 //===== 
+  BBTK_DECLARE_INPUT(DirName,std::string);
   BBTK_DECLARE_INPUT(FileNameVector,std::vector<std::string>);
   BBTK_DECLARE_OUTPUT(PolyDataVector,std::vector<vtkPolyData*>);
   BBTK_PROCESS(Process);
@@ -34,6 +35,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(VectorPolyDataReader,bbtk::AtomicBlackBox);
   BBTK_AUTHOR("Info-Dev");
   BBTK_DESCRIPTION("No Description.");
   BBTK_CATEGORY("empty");
+  BBTK_INPUT(VectorPolyDataReader,DirName,"DirectoryName",std::string,"");
   BBTK_INPUT(VectorPolyDataReader,FileNameVector,"String vector with the name of the .vtk files",std::vector<std::string>,"");
   BBTK_OUTPUT(VectorPolyDataReader,PolyDataVector,"Std::vector with PolyData(s)",std::vector<vtkPolyData*>,"");
 BBTK_END_DESCRIBE_BLACK_BOX(VectorPolyDataReader);