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) )
+ {
+ vtkJSONDataSetWriter *writer = vtkJSONDataSetWriter::New();
+ writer->GetArchiver()->SetArchiveName( bbGetInputLstFileNames()[0].c_str() );
+ writer->SetInputData( bbGetInputImage() );
+ writer->Update();
+ } // 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) )
+ {
+ vtkJSONDataSetWriter *writer = vtkJSONDataSetWriter::New();
+ writer->GetArchiver()->SetArchiveName( bbGetInputLstFileNames()[0].c_str() );
+ writer->SetInputData( bbGetInputPolyData() );
+ writer->Update();
+ } // 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