From 7be08bdfdb30264f4aa4a82b842cbce9d3cd5fb1 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 11 Jul 2022 10:16:05 +0200 Subject: [PATCH] #3488 Extrusion Boxes --- bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.cxx | 112 ++++++++++++++++ bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.h | 55 ++++++++ .../src/bbcreaVtkLinearExtrusionFilter.cxx | 111 ++++++++++++++++ .../src/bbcreaVtkLinearExtrusionFilter.h | 58 ++++++++ .../src/bbcreaVtkPolyDataNormals.cxx | 87 +++++++++++- .../src/bbcreaVtkPolyDataNormals.h | 13 +- .../src/bbcreaVtkTrimmedExtrusionFilter.cxx | 124 ++++++++++++++++++ .../src/bbcreaVtkTrimmedExtrusionFilter.h | 63 +++++++++ 8 files changed, 618 insertions(+), 5 deletions(-) create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.cxx create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.h create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.cxx create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.h create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.cxx create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.h diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.cxx new file mode 100644 index 0000000..b23dbf2 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.cxx @@ -0,0 +1,112 @@ +//===== +// 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 "bbcreaVtkExtrusion.h" +#include "bbcreaVtkPackage.h" + +#include +#include +#include + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Extrusion) +BBTK_BLACK_BOX_IMPLEMENTATION(Extrusion,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 Extrusion::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 = " <=0) && (bbGetInputType()<=1)) + { + vtkTrimmedExtrusionFilter *extrusion = vtkTrimmedExtrusionFilter::New(); + extrusion->SetExtrusionDirection(1,1,1); + extrusion->SetInputData( bbGetInputIn() ); + extrusion->SetTrimSurfaceData( bbGetInputIn2() ); + if (bbGetInputType()==0) + { + extrusion->SetExtrusionStrategy(vtkTrimmedExtrusionFilter::BOUNDARY_EDGES); + } else { + extrusion->SetExtrusionStrategy(vtkTrimmedExtrusionFilter::ALL_EDGES); + } + extrusion->Update(); + bbSetOutputOut( extrusion->GetTrimSurface() ); + } // if Type 0 1 + + if (bbGetInputType()==2) + { + // Apply linear extrusion + vtkLinearExtrusionFilter *extrude=vtkLinearExtrusionFilter::New(); + extrude->SetInputData( bbGetInputIn() ); + extrude->SetExtrusionTypeToNormalExtrusion(); + extrude->SetVector(0, -1, 0); + extrude->SetScaleFactor(-7); + extrude->Update(); + vtkTriangleFilter *triangleFilter = vtkTriangleFilter::New(); + triangleFilter->SetInputData( extrude->GetOutput() ); + triangleFilter->Update( ); + bbSetOutputOut( triangleFilter->GetOutput() ); + } // if Type 2 + + } // if bbGetInputIn + +} +//===== +// 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 Extrusion::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + 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 Extrusion::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 Extrusion::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.h b/bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.h new file mode 100644 index 0000000..63d9482 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkExtrusion.h @@ -0,0 +1,55 @@ +//===== +// 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 __bbcreaVtkExtrusion_h_INCLUDED__ +#define __bbcreaVtkExtrusion_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT Extrusion + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(Extrusion,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(In,vtkPolyData*); + BBTK_DECLARE_INPUT(In2,vtkPolyData*); + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_OUTPUT(Out,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(Extrusion,bbtk::AtomicBlackBox); +BBTK_NAME("Extrusion"); +BBTK_AUTHOR("InfoDev"); +BBTK_DESCRIPTION("No Description."); +BBTK_CATEGORY("empty"); + + BBTK_INPUT(Extrusion,In,"PolyData input ",vtkPolyData*,""); + BBTK_INPUT(Extrusion,In2,"PolyData input ",vtkPolyData*,""); + BBTK_INPUT(Extrusion,Type,"(default 0) Type 0:BOUNDARY_EDGES 1:ALL_EDGES",int,""); + + BBTK_OUTPUT(Extrusion,Out,"PolyData output",vtkPolyData*,""); + +BBTK_END_DESCRIBE_BLACK_BOX(Extrusion); +//===== +// 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 // __bbcreaVtkExtrusion_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.cxx new file mode 100644 index 0000000..5d0ea97 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.cxx @@ -0,0 +1,111 @@ +//===== +// 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 "bbcreaVtkLinearExtrusionFilter.h" +#include "bbcreaVtkPackage.h" + + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,LinearExtrusionFilter) +BBTK_BLACK_BOX_IMPLEMENTATION(LinearExtrusionFilter,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 LinearExtrusionFilter::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 = " <Delete(); + } + if (triangleFilter!=NULL) + { + triangleFilter->Delete(); + } + + extrude = vtkLinearExtrusionFilter::New(); + triangleFilter = vtkTriangleFilter::New(); + extrude->SetInputData( bbGetInputIn() ); + extrude->SetExtrusionTypeToNormalExtrusion(); + std::vector dir = bbGetInputDirection(); + if (dir.size()==3) + { + extrude->SetVector( dir[0],dir[1],dir[2] ); + } else { + extrude->SetVector(1, 0, 0); + } + extrude->SetScaleFactor( bbGetInputScalarFactor() ); + extrude->Update(); + triangleFilter->SetInputData( extrude->GetOutput() ); + triangleFilter->Update( ); + bbSetOutputOut( triangleFilter->GetOutput() ); + } // if bbGetInputIn +} +//===== +// 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 LinearExtrusionFilter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + + extrude = NULL; + triangleFilter = NULL; + bbSetInputIn(NULL); + + std::vector dir; + dir.push_back(1); + dir.push_back(0); + dir.push_back(0); + bbSetInputDirection( dir ); + bbSetInputScalarFactor(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 LinearExtrusionFilter::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 LinearExtrusionFilter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.h new file mode 100644 index 0000000..e68ba66 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkLinearExtrusionFilter.h @@ -0,0 +1,58 @@ +//===== +// 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 __bbcreaVtkLinearExtrusionFilter_h_INCLUDED__ +#define __bbcreaVtkLinearExtrusionFilter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include +#include +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT LinearExtrusionFilter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(LinearExtrusionFilter,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(In,vtkPolyData*); + BBTK_DECLARE_INPUT(Direction,std::vector); + BBTK_DECLARE_INPUT(ScalarFactor,double); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); + vtkLinearExtrusionFilter *extrude; + vtkTriangleFilter *triangleFilter; + +//===== +// 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(LinearExtrusionFilter,bbtk::AtomicBlackBox); +BBTK_NAME("LinearExtrusionFilter"); +BBTK_AUTHOR("InfoDev"); +BBTK_DESCRIPTION("No Description."); +BBTK_CATEGORY("empty"); + BBTK_INPUT(LinearExtrusionFilter,In,"PolyData input ",vtkPolyData*,""); + BBTK_INPUT(LinearExtrusionFilter,Direction,"default [1 0 0] Direction [x,y,z] ",std::vector,""); + BBTK_INPUT(LinearExtrusionFilter,ScalarFactor,"(default 0) ",double,""); + + BBTK_OUTPUT(LinearExtrusionFilter,Out,"PolyData output",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(LinearExtrusionFilter); +//===== +// 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 // __bbcreaVtkLinearExtrusionFilter_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx index 5db5dcb..92cf883 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.cxx @@ -6,6 +6,10 @@ #include +#include +#include +#include +#include namespace bbcreaVtk { @@ -17,7 +21,7 @@ BBTK_BLACK_BOX_IMPLEMENTATION(PolyDataNormals,bbtk::AtomicBlackBox); //===== void PolyDataNormals::Process() { - + printf("EED PolyDataNormals::Process Start\n"); // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value @@ -43,8 +47,87 @@ void PolyDataNormals::Process() } // normal->SetFeatureAngle(60.0); normal->Update(); + + // >>>>>>>>>>>>>>>>>>>> Calculate the MeanNormal + vtkPolyData *polydata = normal->GetOutput(); + vtkPointData *pointdata = polydata->GetPointData(); + vtkDataArray *dataarray; + double *pValue; + /* + int i,size=pointdata->GetNumberOfArrays(); + for(i=0;iGetArray(i); + printf("EED creaVtkCallbackPointPicker::Execute dataarray=%s n=%ld p=%ld\n", dataarray->GetName(),dataarray->GetNumberOfValues() ,polydata->GetNumberOfPoints() ); + } // for i + */ + dataarray = pointdata->GetNormals(); + std::vector meanNormal; + meanNormal.push_back(1); + meanNormal.push_back(0); + meanNormal.push_back(0); + if (dataarray!=NULL) + { + meanNormal[0]=0; + int i , size=dataarray->GetNumberOfTuples(); + for (i=0; iGetTuple3( i ); + meanNormal[0] = meanNormal[0] + pValue[0]; + meanNormal[1] = meanNormal[1] + pValue[1]; + meanNormal[2] = meanNormal[2] + pValue[2]; + } + + if (size!=0) + { + meanNormal[0] = meanNormal[0] / size; + meanNormal[1] = meanNormal[1] / size; + meanNormal[2] = meanNormal[2] / size; + } else { + meanNormal[0] = 1; + meanNormal[1] = 0; + meanNormal[2] = 0; + } + } // if dataarray + // <<<<<<<<<<<<<<<<<<<<< Calculate the MeanNormal + + if ((bbGetInputType()==1) && (dataarray!=NULL) ) + { + double meanN[3]; + double wxyz[4]; + double meanNormalresult[3]; + double ang; + double crossResult[3]; + printf("EED PolyDataNormals::Process 1\n"); + meanN[0] = meanNormal[0]; + meanN[1] = meanNormal[1]; + meanN[2] = meanNormal[2]; + printf("EED PolyDataNormals::Process 2\n"); + int i , size=dataarray->GetNumberOfTuples(); + for (i=0; iGetTuple3( i ); + ang = vtkMath::AngleBetweenVectors( pValue, meanN ); + + vtkMath::Cross(meanN,pValue,crossResult); + wxyz[0] = ang * bbGetInputParam(); + wxyz[1] = crossResult[0]; + wxyz[2] = crossResult[1]; + wxyz[3] = crossResult[2]; + printf("EED PolyDataNormals::Process 4\n"); + vtkMath::RotateVectorByWXYZ(meanN, wxyz ,meanNormalresult); + dataarray->SetTuple3( i , meanNormalresult[0], meanNormalresult[1], meanNormalresult[2] ); + } // for + + } // if Type==1 && dataarray + bbSetOutputMeanNormal( meanNormal ); bbSetOutputOut( normal->GetOutput() ); - } // In + } // if In + + printf("EED PolyDataNormals::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) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.h b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.h index 0cc7b29..1bcfafd 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkPolyDataNormals.h @@ -23,7 +23,11 @@ class bbcreaVtk_EXPORT PolyDataNormals //===== BBTK_DECLARE_INPUT(In,vtkPolyData*); BBTK_DECLARE_INPUT(ComputeType,int); + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_INPUT(Param,double); BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_DECLARE_OUTPUT(MeanNormal,std::vector); + BBTK_PROCESS(Process); void Process(); //===== @@ -36,9 +40,12 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(PolyDataNormals,bbtk::AtomicBlackBox); BBTK_AUTHOR("InfoDev"); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); - BBTK_INPUT(PolyDataNormals,In,"Mesh input",vtkPolyData*,""); - BBTK_INPUT(PolyDataNormals,ComputeType,"(0 default) 0:points 1:Cells",int,""); - BBTK_OUTPUT(PolyDataNormals,Out,"Mesh output",vtkPolyData*,""); + BBTK_INPUT(PolyDataNormals,In,"Mesh input",vtkPolyData*,""); + BBTK_INPUT(PolyDataNormals,ComputeType,"(0 default) 0:points 1:Cells",int,""); + BBTK_INPUT(PolyDataNormals,Type,"(0 default) 0:Normal Action 1:Apply correction direction (try param=1)",int,""); + BBTK_INPUT(PolyDataNormals,Param,"(0 default) For Type=1 [-2 2] 0:parallel 1:NormalState -1:OpositState",double ,""); + BBTK_OUTPUT(PolyDataNormals,Out,"Mesh output",vtkPolyData*,""); + BBTK_OUTPUT(PolyDataNormals,MeanNormal,"Mean Normal",std::vector,""); BBTK_END_DESCRIBE_BLACK_BOX(PolyDataNormals); //===== // 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) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.cxx new file mode 100644 index 0000000..886ff89 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.cxx @@ -0,0 +1,124 @@ +//===== +// 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 "bbcreaVtkTrimmedExtrusionFilter.h" +#include "bbcreaVtkPackage.h" + + + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,TrimmedExtrusionFilter) +BBTK_BLACK_BOX_IMPLEMENTATION(TrimmedExtrusionFilter,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 TrimmedExtrusionFilter::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 = " <Delete(); + } + extrusion = vtkTrimmedExtrusionFilter::New(); + std::vector dir=bbGetInputDirection(); + if (dir.size()==3) + { + extrusion->SetExtrusionDirection( dir[0],dir[1],dir[2] ); + } else { + extrusion->SetExtrusionDirection( 1,0,0 ); + } + extrusion->SetInputData( bbGetInputIn() ); + extrusion->SetTrimSurfaceData( bbGetInputIn2() ); + if (bbGetInputType()==0) + { + extrusion->SetExtrusionStrategy(vtkTrimmedExtrusionFilter::BOUNDARY_EDGES); + } else { + extrusion->SetExtrusionStrategy(vtkTrimmedExtrusionFilter::ALL_EDGES); + } + extrusion->Update(); + bbSetOutputOut( extrusion->GetTrimSurface() ); + } else { + printf("EED Warning!!! TrimmedExtrusionFilter::Process Either In or In2 is missing \n"); + } // if bbGetInputIn + + +} +//===== +// 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 TrimmedExtrusionFilter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + extrusion=NULL; + bbSetInputIn(NULL); + bbSetInputIn2(NULL); + bbSetInputType(0); + + std::vector dir; + dir.push_back(1); + dir.push_back(0); + dir.push_back(0); + bbSetInputDirection( dir ); + +} +//===== +// 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 TrimmedExtrusionFilter::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 TrimmedExtrusionFilter::bbUserFinalizeProcessing() +{ + +// THE FINALIZATION METHOD BODY : +// Here does nothing +// but this is where you should desallocate the internal/output pointers +// if any + +} +} +// EO namespace bbcreaVtk + + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.h new file mode 100644 index 0000000..bad5740 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkTrimmedExtrusionFilter.h @@ -0,0 +1,63 @@ +//===== +// 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 __bbcreaVtkTrimmedExtrusionFilter_h_INCLUDED__ +#define __bbcreaVtkTrimmedExtrusionFilter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include +#include + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT TrimmedExtrusionFilter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(TrimmedExtrusionFilter,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(In,vtkPolyData*); + BBTK_DECLARE_INPUT(In2,vtkPolyData*); + BBTK_DECLARE_INPUT(Direction,std::vector); + + BBTK_DECLARE_INPUT(Type,int); + BBTK_DECLARE_OUTPUT(Out,vtkPolyData*); + BBTK_PROCESS(Process); + void Process(); + + vtkTrimmedExtrusionFilter *extrusion; + +//===== +// 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(TrimmedExtrusionFilter,bbtk::AtomicBlackBox); +BBTK_NAME("TrimmedExtrusionFilter"); +BBTK_AUTHOR("InfoDev"); +BBTK_DESCRIPTION("No Description."); +BBTK_CATEGORY("empty"); + + BBTK_INPUT(TrimmedExtrusionFilter,In,"PolyData input ",vtkPolyData*,""); + BBTK_INPUT(TrimmedExtrusionFilter,In2,"PolyData input ",vtkPolyData*,""); + BBTK_INPUT(TrimmedExtrusionFilter,Direction,"default [1 0 0] Direction [x,y,z] ",std::vector,""); + BBTK_INPUT(TrimmedExtrusionFilter,Type,"(default 0) Type 0:BOUNDARY_EDGES 1:ALL_EDGES",int,""); + + BBTK_OUTPUT(TrimmedExtrusionFilter,Out,"PolyData output",vtkPolyData*,""); + + +BBTK_END_DESCRIBE_BLACK_BOX(TrimmedExtrusionFilter); +//===== +// 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 // __bbcreaVtkTrimmedExtrusionFilter_h_INCLUDED__ + -- 2.45.1