]> Creatis software - bbtk.git/blobdiff - packages/std/src/bbstdCreateArithmeticSuiteVector.cxx
Feature #1743 Add a box building a vector ot arithmetic suite values.
[bbtk.git] / packages / std / src / bbstdCreateArithmeticSuiteVector.cxx
diff --git a/packages/std/src/bbstdCreateArithmeticSuiteVector.cxx b/packages/std/src/bbstdCreateArithmeticSuiteVector.cxx
new file mode 100644 (file)
index 0000000..caa2c07
--- /dev/null
@@ -0,0 +1,42 @@
+#include "bbstdCreateArithmeticSuiteVector.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,CreateArithmeticSuiteVector)
+BBTK_BLACK_BOX_IMPLEMENTATION(CreateArithmeticSuiteVector,bbtk::AtomicBlackBox);
+
+void CreateArithmeticSuiteVector::Process()
+{
+// THE MAIN PROCESSING METHOD BODY
+  std::vector<double> outputVector;
+
+  double value =  bbGetInputFirstValue();
+  double delta = bbGetInputDelta();
+  for (int i = 0; i <  bbGetInputSize(); i++)
+     {
+       outputVector.push_back(value + i*delta);
+     }
+
+   bbSetOutputArithmeticSuiteVector(outputVector);  
+}
+
+void CreateArithmeticSuiteVector::bbUserSetDefaultValues()
+{
+   // THE DEFAULT INPUT/OUTPUT VALUES
+  bbSetInputFirstValue(0);
+  bbSetInputDelta(0);
+  bbSetInputSize(0);
+}
+void CreateArithmeticSuiteVector::bbUserInitializeProcessing()
+{
+}
+
+void CreateArithmeticSuiteVector::bbUserFinalizeProcessing()
+{
+  
+}
+}
+// EO namespace bbstd