+//=====
+// 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 "bbcreaVtkLstOfVoxels.h"
+#include "bbcreaVtkPackage.h"
+
+#include "creaVtk_MACROS.h"
+
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,LstOfVoxels)
+BBTK_BLACK_BOX_IMPLEMENTATION(LstOfVoxels,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 LstOfVoxels::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')
+
+ if (bbGetInputIn()!=NULL)
+ {
+ DEF_POINTER_IMAGE_VTK_CREA(vIn,ssIn,pIn,stIn,bbGetInputIn()) \
+ std::vector<int> lstX;
+ std::vector<int> lstY;
+ std::vector<int> lstZ;
+ std::vector<double> lstValues;
+ int ext[6];
+ bbGetInputIn()->GetExtent(ext);
+ int dim[3];
+ dim[0]=ext[1]-ext[0]+1;
+ dim[1]=ext[3]-ext[2]+1;
+ dim[2]=ext[5]-ext[4]+1;
+ int i,j,k;
+ long int index=0;
+
+
+ int rangeType=0;
+ if (bbGetInputRange().size()==2)
+ {
+ rangeType=1;
+ }
+ bool addPoint;
+
+
+ for (k=0 ; k<dim[2] ; k++)
+ {
+ for (j=0 ; j<dim[1] ; j++)
+ {
+ for (i=0 ; i<dim[0] ; i++)
+ {
+ addPoint=false;
+ GETVALUE2_VTK_CREA(vIn,pIn,stIn,index)
+ if (rangeType==0)
+ {
+ if (vIn!=0)
+ {
+ addPoint=true;
+ } // if vIn ==0
+ } else {
+ if ( (vIn>=bbGetInputRange()[0]) && (vIn<=bbGetInputRange()[1]) )
+ {
+ addPoint=true;
+ } // if vIn ==0
+ } // if rangeType
+
+
+ if (addPoint==true)
+ {
+ lstX.push_back(i);
+ lstY.push_back(j);
+ lstZ.push_back(k);
+ lstValues.push_back(vIn);
+ } // if vIn ==0
+
+ index++;
+ } // for i
+ } // for j
+ } // for k
+ bbSetOutputLstX( lstX );
+ bbSetOutputLstY( lstY );
+ bbSetOutputLstZ( lstZ );
+ bbSetOutputLstValues( lstValues );
+ } else {
+ printf("EED Warning!! LstOfVoxels image not set.\n");
+ }// In
+
+}
+//=====
+// 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 LstOfVoxels::bbUserSetDefaultValues()
+{
+
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn(NULL);
+
+}
+//=====
+// 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 LstOfVoxels::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 LstOfVoxels::bbUserFinalizeProcessing()
+{
+
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+
+}
+}
+// EO namespace bbcreaVtk
+
+