]> Creatis software - bbtk.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 20 Jun 2011 12:10:59 +0000 (12:10 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 20 Jun 2011 12:10:59 +0000 (12:10 +0000)
packages/std/src/bbstdStringWriter.cxx [new file with mode: 0644]
packages/std/src/bbstdStringWriter.h [new file with mode: 0644]
packages/toolsbbtk/bbs/boxes/SaveMHD-Button.bbg
packages/toolsbbtk/bbs/boxes/SaveMHD-Button.bbs

diff --git a/packages/std/src/bbstdStringWriter.cxx b/packages/std/src/bbstdStringWriter.cxx
new file mode 100644 (file)
index 0000000..e67c95e
--- /dev/null
@@ -0,0 +1,87 @@
+//===== 
+// 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)
+//===== 
+#include "bbstdStringWriter.h"
+#include "bbstdPackage.h"
+
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,StringWriter)
+BBTK_BLACK_BOX_IMPLEMENTATION(StringWriter,bbtk::AtomicBlackBox);
+//===== 
+// 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)
+//===== 
+void StringWriter::Process()
+{
+
+       if (bbGetInputFileName()!="")
+       {
+               FILE *ff = fopen(bbGetInputFileName().c_str(),"w");
+               if (ff!=NULL)
+               {
+                       fprintf(ff,"%s \n",bbGetInputIn0().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn1().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn2().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn3().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn4().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn5().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn6().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn7().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn8().c_str());
+                       fprintf(ff,"%s \n",bbGetInputIn9().c_str());
+                       fclose(ff);
+               }
+       }
+  
+}
+//===== 
+// 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)
+//===== 
+void StringWriter::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+       bbSetInputIn0("");
+       bbSetInputIn1("");
+       bbSetInputIn2("");
+       bbSetInputIn3("");
+       bbSetInputIn4("");
+       bbSetInputIn5("");
+       bbSetInputIn6("");
+       bbSetInputIn7("");
+       bbSetInputIn8("");
+       bbSetInputIn9("");
+       bbSetInputFileName("");
+  
+}
+//===== 
+// 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)
+//===== 
+void StringWriter::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// 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)
+//===== 
+void StringWriter::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbstd
+
+
diff --git a/packages/std/src/bbstdStringWriter.h b/packages/std/src/bbstdStringWriter.h
new file mode 100644 (file)
index 0000000..1043d68
--- /dev/null
@@ -0,0 +1,65 @@
+//===== 
+// 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)
+//===== 
+#ifndef __bbstdStringWriter_h_INCLUDED__
+#define __bbstdStringWriter_h_INCLUDED__
+#include "bbstd_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbstd
+{
+
+class bbstd_EXPORT StringWriter
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(StringWriter,bbtk::AtomicBlackBox);
+//===== 
+// 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(In0,std::string);
+       BBTK_DECLARE_INPUT(In1,std::string);
+       BBTK_DECLARE_INPUT(In2,std::string);
+       BBTK_DECLARE_INPUT(In3,std::string);
+       BBTK_DECLARE_INPUT(In4,std::string);
+       BBTK_DECLARE_INPUT(In5,std::string);
+       BBTK_DECLARE_INPUT(In6,std::string);
+       BBTK_DECLARE_INPUT(In7,std::string);
+       BBTK_DECLARE_INPUT(In8,std::string);
+       BBTK_DECLARE_INPUT(In9,std::string);
+       BBTK_DECLARE_INPUT(FileName,std::string);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// 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_BEGIN_DESCRIBE_BLACK_BOX(StringWriter,bbtk::AtomicBlackBox);
+       BBTK_NAME("StringWriter");  
+       BBTK_AUTHOR("Info-Dev Creatis");
+       BBTK_DESCRIPTION("Write a string in a file"); 
+       BBTK_CATEGORY("read/write");
+       BBTK_INPUT(StringWriter,In0,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In1,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In2,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In3,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In4,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In5,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In6,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In7,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In8,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,In9,"String to be write",std::string,"");
+       BBTK_INPUT(StringWriter,FileName,"Output file name",std::string,"");
+//  BBTK_OUTPUT(StringWriter,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(StringWriter);
+//===== 
+// 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)
+//===== 
+}
+// EO namespace bbstd
+
+#endif // __bbstdStringWriter_h_INCLUDED__
+
index 28b2161ab806b1390f2371b4b602e32ce7e36f24..91ef48e3a01c4d024342c0a925ba49e48c21f0ad 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.2 BBG BlackBox Diagram file
-# - /Users/davila/Creatis/All3/creatools_source/bbs/package/toolsbbtk/bbs/boxes/SaveMHD-Button.bbg
+# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/SaveMHD-Button.bbg
 # ----------------------------------
 
 APP_START
@@ -27,7 +27,7 @@ ISEXEC:FALSE
 -118.250801:-14.140786:900.000000
 -72.675801:-24.140786:900.000000
 PORT
-Label:"Save Image"
+Label:"Save Image (*.mhd)"
 PORT
 WinTitle:"Save Img."
 FIN_BOX
index d5797f56bf953f21825088b09959e162b5d014af..054099d3a39920207ec5866484b4a7465126cf63 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
 # - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)
-# - /Users/davila/Creatis/All3/creatools_source/creaMiniTools/bbtk_package_creaMiniToolsBase/bbs/boxes/SaveMHD-Button.bbs
+# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/SaveMHD-Button.bbs
 # ----------------------------------
 
 include std
@@ -16,7 +16,7 @@ description "Button that saves the input vtkImageData as a MHD file"
 category "read/write widget"
 
 new CommandButton Box00
-  set Box00.Label "Save Image"
+  set Box00.Label "Save Image (*.mhd)"
   set Box00.WinTitle "Save Img."
 
 new MetaImageWriter Box01