+//=====
+// 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 "bbstdSaveLstPoints.h"
+#include "bbstdPackage.h"
+namespace bbstd
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,SaveLstPoints)
+BBTK_BLACK_BOX_IMPLEMENTATION(SaveLstPoints,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 SaveLstPoints::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')
+// bbSetOutputOut( bbGetInputIn() );
+// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+ printf("EED SaveLstPoints::Process Start \n");
+ std::string filenameX;
+ std::string filenameY;
+ std::string filenameZ;
+ std::vector<int> lstIndexs = bbGetInputLstIndexs();
+ std::vector<double> lstParams = bbGetInputParams();
+ std::vector<double> lstX = bbGetInputLstX();
+ std::vector<double> lstY = bbGetInputLstY();
+ std::vector<double> lstZ = bbGetInputLstZ();
+ if (bbGetInputType()==0)
+ {
+ FILE *ffx;
+ FILE *ffy;
+ FILE *ffz;
+ int iPoint,sizeLstPoints;
+ int iParams,sizeParams=lstParams.size();
+ int ii,size,iAcum;
+ for (iParams=0; iParams<sizeParams; iParams++)
+ {
+ if (iParams<lstIndexs.size())
+ {
+ iAcum = 0;
+ size = lstParams[iParams];
+ for (ii=0; ii<size; ii++)
+ {
+ iAcum = iAcum+lstIndexs[ii];
+ } // for ii
+ // printf( "SaveLstPoints::Process %d %d\n", iAcum, lstIndexs[iParams]);
+ sizeLstPoints = lstIndexs[iParams];
+ filenameX = bbGetInputFileNameBase()+"-X-"+std::to_string( (int)(lstParams[iParams]) ) +".pnt" ;
+ filenameY = bbGetInputFileNameBase()+"-Y-"+std::to_string( (int)(lstParams[iParams]) ) +".pnt" ;
+ filenameZ = bbGetInputFileNameBase()+"-Z-"+std::to_string( (int)(lstParams[iParams]) ) +".pnt" ;
+ ffx = fopen(filenameX.c_str(), "w+" );
+ ffy = fopen(filenameY.c_str(), "w+" );
+ ffz = fopen(filenameZ.c_str(), "w+" );
+ for (iPoint=0;iPoint<sizeLstPoints;iPoint++)
+ {
+ fprintf(ffx,"%f ", lstX[iPoint+iAcum]);
+ fprintf(ffy,"%f ", lstY[iPoint+iAcum]);
+ fprintf(ffz,"%f ", lstZ[iPoint+iAcum]);
+ } // for iPoint
+ fclose(ffx);
+ fclose(ffy);
+ fclose(ffz);
+ } // if iParams < lstIndexs.size()
+ } // for iParams
+ } // Type == O
+
+ printf("EED SaveLstPoints::Process End \n");
+
+}
+
+//=====
+// 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 SaveLstPoints::bbUserSetDefaultValues()
+{
+ // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+ // Here we initialize the input 'In' to 0
+ bbSetInputType(0);
+}
+
+//=====
+// 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 SaveLstPoints::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 SaveLstPoints::bbUserFinalizeProcessing()
+{
+ // THE FINALIZATION METHOD BODY :
+ // Here does nothing
+ // but this is where you should desallocate the internal/output pointers
+ // if any
+}
+
+} // EO namespace bbstd
+
+