--- /dev/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)
+//=====
+#include "bbcreaVtkAddPolyDataToVector.h"
+#include "bbcreaVtkPackage.h"
+namespace bbcreaVtk
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,AddPolyDataToVector)
+BBTK_BLACK_BOX_IMPLEMENTATION(AddPolyDataToVector,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 AddPolyDataToVector::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;
+ std::vector<vtkPolyData*> lstPolyData=bbGetInputPolyDataVector();
+ if (bbGetInputIn0()!=NULL) { lstPolyData.push_back( bbGetInputIn0() ); }
+ if (bbGetInputIn1()!=NULL) { lstPolyData.push_back( bbGetInputIn1() ); }
+ if (bbGetInputIn2()!=NULL) { lstPolyData.push_back( bbGetInputIn2() ); }
+ if (bbGetInputIn3()!=NULL) { lstPolyData.push_back( bbGetInputIn3() ); }
+ if (bbGetInputIn4()!=NULL) { lstPolyData.push_back( bbGetInputIn4() ); }
+ if (bbGetInputIn5()!=NULL) { lstPolyData.push_back( bbGetInputIn5() ); }
+ if (bbGetInputIn6()!=NULL) { lstPolyData.push_back( bbGetInputIn6() ); }
+ if (bbGetInputIn7()!=NULL) { lstPolyData.push_back( bbGetInputIn7() ); }
+ if (bbGetInputIn8()!=NULL) { lstPolyData.push_back( bbGetInputIn8() ); }
+ if (bbGetInputIn9()!=NULL) { lstPolyData.push_back( bbGetInputIn9() ); }
+ bbSetOutputOut(lstPolyData);
+
+}
+
+//=====
+// 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 AddPolyDataToVector::bbUserSetDefaultValues()
+{
+// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
+// Here we initialize the input 'In' to 0
+ bbSetInputIn0(NULL);
+ bbSetInputIn1(NULL);
+ bbSetInputIn2(NULL);
+ bbSetInputIn3(NULL);
+ bbSetInputIn4(NULL);
+ bbSetInputIn5(NULL);
+ bbSetInputIn6(NULL);
+ bbSetInputIn7(NULL);
+ bbSetInputIn8(NULL);
+ bbSetInputIn9(NULL);
+ std::vector<vtkPolyData*> lstPolyData;
+ bbSetInputPolyDataVector(lstPolyData);
+}
+
+//=====
+// 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 AddPolyDataToVector::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 AddPolyDataToVector::bbUserFinalizeProcessing()
+{
+// THE FINALIZATION METHOD BODY :
+// Here does nothing
+// but this is where you should desallocate the internal/output pointers
+// if any
+}
+
+}// EO namespace bbcreaVtk
+
+
--- /dev/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)
+//=====
+#ifndef __bbcreaVtkAddPolyDataToVector_h_INCLUDED__
+#define __bbcreaVtkAddPolyDataToVector_h_INCLUDED__
+
+#include "bbcreaVtk_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "vtkPolyData.h"
+
+namespace bbcreaVtk
+{
+
+class bbcreaVtk_EXPORT AddPolyDataToVector
+ :
+ public bbtk::AtomicBlackBox
+{
+ BBTK_BLACK_BOX_INTERFACE(AddPolyDataToVector,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(PolyDataVector,std::vector<vtkPolyData*>);
+ BBTK_DECLARE_INPUT(In0,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In1,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In2,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In3,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In4,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In5,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In6,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In7,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In8,vtkPolyData*);
+ BBTK_DECLARE_INPUT(In9,vtkPolyData*);
+ BBTK_DECLARE_OUTPUT(Out,std::vector<vtkPolyData*>);
+ 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(AddPolyDataToVector,bbtk::AtomicBlackBox);
+ BBTK_NAME("AddPolyDataToVector");
+ BBTK_AUTHOR("Info-Dev");
+ BBTK_DESCRIPTION("eduardo.davila@creatis.insa-lyon.fr - Concat at the end of the PolyDataVector all the inputs. Add vtkPolyData* to a vector of vtkPolyData*");
+ BBTK_CATEGORY("void");
+ BBTK_INPUT(AddPolyDataToVector,PolyDataVector,"Vector of vtkImagesData*",std::vector<vtkPolyData*>,"");
+ BBTK_INPUT(AddPolyDataToVector,In0,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In1,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In2,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In3,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In4,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In5,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In6,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In7,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In8,"Input polydata ",vtkPolyData*,"");
+ BBTK_INPUT(AddPolyDataToVector,In9,"Input polydata ",vtkPolyData*,"");
+ BBTK_OUTPUT(AddPolyDataToVector,Out,"Vector of vtkPolyData*",std::vector<vtkPolyData*>,"");
+BBTK_END_DESCRIBE_BLACK_BOX(AddPolyDataToVector);
+//=====
+// 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 bbcreaVtk
+
+#endif // __bbcreaVtkAddPolyDataToVector_h_INCLUDED__
+
BBTK_BEGIN_DESCRIBE_BLACK_BOX(BoxWidget,bbtk::AtomicBlackBox);
BBTK_NAME("BoxWidget");
BBTK_AUTHOR("InfoDev");
- BBTK_DESCRIPTION("(C++,Python) No Description.");
+ BBTK_DESCRIPTION("(C++,Python,JavaScript) No Description.");
BBTK_CATEGORY("empty");
BBTK_INPUT(BoxWidget,Active,"(default false) true/false",bool,"");
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
- if ((bbGetInputInA()!=NULL) && (bbGetInputInB()!=NULL) )
+ if ( (bbGetInputActive()==true) && (bbGetInputInA()!=NULL) && (bbGetInputInB()!=NULL) )
{
vtkHausdorffDistancePointSetFilter *hausdorff = vtkHausdorffDistancePointSetFilter::New();
hausdorff->SetInputData(0, bbGetInputInA() );
bbSetOutputHausdorffDistance( hd );
bbSetOutputOutA( (vtkPolyData*) (hausdorff->GetOutput(0)) );
bbSetOutputOutB( (vtkPolyData*) (hausdorff->GetOutput(1)) );
- } // if
+ } else {
+ bbSetOutputOutA( bbGetInputInA() );
+ bbSetOutputOutB( bbGetInputInB() );
+ }// if Type InA InB
}
-//=====
+
+//=====
// 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 HausdorffDistancePointSetFilter::bbUserSetDefaultValues()
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
- bbSetInputInA(NULL);
- bbSetInputInB(NULL);
-
+ bbSetInputActive(true);
+ bbSetInputInA(NULL);
+ bbSetInputInB(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 HausdorffDistancePointSetFilter::bbUserInitializeProcessing()
{
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
-// if any
-
-
+// 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 HausdorffDistancePointSetFilter::bbUserFinalizeProcessing()
{
-
// THE FINALIZATION METHOD BODY :
// Here does nothing
// but this is where you should desallocate the internal/output pointers
// if any
-
-}
}
-// EO namespace bbcreaVtk
+
+}// EO namespace bbcreaVtk
//=====
// 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(Active,bool);
BBTK_DECLARE_INPUT(InA,vtkPolyData*);
BBTK_DECLARE_INPUT(InB,vtkPolyData*);
BBTK_DESCRIPTION("(C++,Python) Output Mesh with HausdorffDistance and RelativeDistance vector information ");
BBTK_CATEGORY("empty");
+ BBTK_INPUT(HausdorffDistancePointSetFilter,Active,"(default true) True/False",bool,"");
BBTK_INPUT(HausdorffDistancePointSetFilter,InA,"Mesh A",vtkPolyData*,"");
BBTK_INPUT(HausdorffDistancePointSetFilter,InB,"Mesh B",vtkPolyData*,"");
Here we include the standard header iostream.h -->
<include><PRE>iostream</PRE></include>
<include><PRE>vtkImageData.h</PRE></include>
+ <include><PRE>vtkDataSet.h</PRE></include>
<!--=====================================================================-->
<!--========================================================================
and description 'First input' -->
- <typedef><PRE>typedef std::vector<std::string> OutputTypeVectorString;</PRE></typedef>
- <typedef><PRE>typedef std::vector<vtkImageData*> OutputTypeVectorVtkImageData;</PRE></typedef>
+ <typedef><PRE>typedef std::vector<std::string> OutputTypeVectorString;</PRE></typedef>
+ <typedef><PRE>typedef std::vector<vtkImageData*> OutputTypeVectorVtkImageData;</PRE></typedef>
+ <typedef><PRE>typedef std::vector<vtkDataSet*> OutputTypeVectorVtkDataSet;</PRE></typedef>
<input name="FileNames" type="OutputTypeVectorString" description="First input"/>
<!-- Declares an output with name 'Out', type 'double'
and description 'First output' -->
- <output name="Out" type="vtkImageData*" description="Image Output"/>
- <output name="OutVector" type="OutputTypeVectorVtkImageData" description="lst of vtkImageData*"/>
+ <output name="Out" type="vtkDataSet*" description="first element of the vector"/>
+ <output name="OutVectorDataSet" type="OutputTypeVectorVtkDataSet" description="lst of vtkDataSet* example: vtkImageData* vtkPolyData*"/>
<!--=====================================================================-->
<process>
int i;
- int sizeLstImages = bbGetInputLstImages().size();
+ int sizeLstImages = bbGetInputLstImages().size();
+ int sizeLstPolyData = bbGetInputLstPolyData().size();
int sizeLstFileNames = bbGetInputLstFileNames().size();
vtkImageData *image;
+ vtkPolyData *polydata;
std::string filename;
+
+ // vtkImageData
+ if ( (sizeLstFileNames==1) && (bbGetInputImage()!=NULL) )
+ {
+ image = bbGetInputImage();
+ filename = bbGetInputLstFileNames()[0];
+ if (image!=NULL)
+ {
+ vtkJSONDataSetWriter *writer = vtkJSONDataSetWriter::New();
+ writer->GetArchiver()->SetArchiveName( filename.c_str() );
+ writer->SetInputData( image );
+ writer->Update();
+ } // if image
+ } // if Image
+
+ // lst vtkImageData
if ( (sizeLstImages>0) && (sizeLstImages==sizeLstFileNames) )
{
for ( i=0 ; i<sizeLstImages ; i++ )
} // if image
}// for
} // if size
+
+ // vtkPolyData
+ if ( (sizeLstFileNames==1) && (bbGetInputPolyData()!=NULL) )
+ {
+ polydata = bbGetInputPolyData();
+ filename = bbGetInputLstFileNames()[0];
+ printf("EED JSONDataSetWriter::Process filename=%s\n", filename.c_str() );
+ vtkJSONDataSetWriter *writer = vtkJSONDataSetWriter::New();
+ if (polydata!=NULL)
+ {
+ writer->GetArchiver()->SetArchiveName( filename.c_str() );
+ writer->SetInputData( bbGetInputPolyData() );
+ writer->Update();
+ } // if polydata
+ } // if PolyData
+
+ // lst vtkPolyData
+ if ( (sizeLstPolyData>0) && (sizeLstPolyData==sizeLstFileNames) )
+ {
+ for ( i=0 ; i<sizeLstPolyData ; i++ )
+ {
+ polydata = bbGetInputLstPolyData()[i];
+ filename = bbGetInputLstFileNames()[i];
+ if (polydata!=NULL)
+ {
+ vtkJSONDataSetWriter *writer = vtkJSONDataSetWriter::New();
+ writer->GetArchiver()->SetArchiveName( filename.c_str() );
+ writer->SetInputData( polydata );
+ writer->Update();
+ } // if polydata
+ }// for
+ } // if size
+
}
-//=====
+
+//=====
// 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 JSONDataSetWriter::bbUserSetDefaultValues()
{
-
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
-// bbSetInputIn(NULL);
-
+ bbSetInputImage(NULL);
+ bbSetInputPolyData(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 JSONDataSetWriter::bbUserInitializeProcessing()
{
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
-// if any
-
-
+// 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 JSONDataSetWriter::bbUserFinalizeProcessing()
{
-
// THE FINALIZATION METHOD BODY :
// Here does nothing
// but this is where you should desallocate the internal/output pointers
// if any
-
}
-}
-// EO namespace bbcreaVtk
+
+}// EO namespace bbcreaVtk
#include "iostream"
#include <vtkImageData.h>
+#include <vtkPolyData.h>
namespace bbcreaVtk
{
// 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(In,vtkImageData*);
- BBTK_DECLARE_INPUT(LstImages,std::vector <vtkImageData*>);
- BBTK_DECLARE_INPUT(LstFileNames,std::vector <std::string>);
+ BBTK_DECLARE_INPUT(Image,vtkImageData*);
+ BBTK_DECLARE_INPUT(PolyData,vtkPolyData*);
+ BBTK_DECLARE_INPUT(LstImages,std::vector <vtkImageData*>);
+ BBTK_DECLARE_INPUT(LstPolyData,std::vector <vtkPolyData*>);
+ BBTK_DECLARE_INPUT(LstFileNames,std::vector <std::string>);
// BBTK_DECLARE_OUTPUT(Out,double);
- BBTK_PROCESS(Process);
- void Process();
+ 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_AUTHOR("InfoDev");
BBTK_DESCRIPTION("No Description.");
BBTK_CATEGORY("empty");
- BBTK_INPUT(JSONDataSetWriter,LstImages,"Input Image",std::vector <vtkImageData*>,"");
+ BBTK_INPUT(JSONDataSetWriter,Image,"Input vtkImageData ",vtkImageData*,"");
+ BBTK_INPUT(JSONDataSetWriter,PolyData,"Input vtkPolyData ",vtkPolyData*,"");
+ BBTK_INPUT(JSONDataSetWriter,LstImages,"Input vtkImageData vector",std::vector <vtkImageData*>,"");
+ BBTK_INPUT(JSONDataSetWriter,LstPolyData,"Input vtkPolydata vector",std::vector <vtkPolyData*>,"");
BBTK_INPUT(JSONDataSetWriter,LstFileNames,"File Name",std::vector <std::string>,"");
// BBTK_OUTPUT(JSONDataSetWriter,Out,"First output",double,"");
BBTK_END_DESCRIBE_BLACK_BOX(JSONDataSetWriter);
//=====
void MarchingCubes2::Process()
{
-
// THE MAIN PROCESSING METHOD BODY
// Here we simply set the input 'In' value to the output 'Out'
// And print out the output value
// (the one provided in the attribute 'type' of the tag 'input')
// bbSetOutputOut( bbGetInputIn() );
// std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-
if ( (bbGetInputActive()==true) && (bbGetInputIn()!=NULL) )
{
if (marchingcubes!=NULL)
} else {
bbSetOutputOut(NULL);
} // Active
-
-
-
}
-//=====
+
+//=====
// 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 MarchingCubes2::bbUserSetDefaultValues()
{
-
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
marchingcubes=NULL;
bbSetInputComputeScalarsOn(true);
bbSetOutputOut(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 MarchingCubes2::bbUserInitializeProcessing()
{
-
// THE INITIALIZATION METHOD BODY :
// Here does nothing
// but this is where you should allocate the internal/output pointers
-// if any
-
-
+// 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 MarchingCubes2::bbUserFinalizeProcessing()
{
-
// THE FINALIZATION METHOD BODY :
// Here does nothing
// but this is where you should desallocate the internal/output pointers
// if any
-
-}
}
-// EO namespace bbcreaVtk
+
+}// EO namespace bbcreaVtk