From: Eduardo DAVILA Date: Fri, 16 Jul 2021 10:37:16 +0000 (+0200) Subject: #3468 cutter stripper fillholes box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9dedc58b507030e97e7cf4abc68de4e6d5037dce;p=creaVtk.git #3468 cutter stripper fillholes box --- diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbg new file mode 100644 index 0000000..2ef10f0 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbg @@ -0,0 +1,219 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:17 +BOX +creaVtk:Stripper:Box03 +ISEXEC:FALSE +6.762907:33.247744:-900.000000 +40.437907:23.247744:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box05 +ISEXEC:FALSE +23.670785:-15.139648:-900.000000 +87.390785:-25.139648:-900.000000 +FIN_BOX +BOX +vtk:LoadHola:Box06 +ISEXEC:FALSE +57.254540:51.170565:-900.000000 +92.804540:41.170565:-900.000000 +FIN_BOX +BOX +creaVtk:OutputWindow:Box08 +ISEXEC:TRUE +-66.866442:-103.666489:-900.000000 +-26.266442:-113.666489:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box09 +ISEXEC:TRUE +20.844703:-115.072869:-900.000000 +59.924703:-125.072869:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +vtk:PolyDataToActor:Box11 +ISEXEC:FALSE +-98.079015:-46.165323:-900.000000 +-52.839015:-56.165323:-900.000000 +PORT +Representation:"2" +FIN_BOX +BOX +vtk:UpdateRender:Box12 +ISEXEC:FALSE +-67.131351:-85.498261:-900.000000 +-26.806351:-95.498261:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:SphereSource:Box13 +ISEXEC:FALSE +-32.341283:37.565115:-900.000000 +7.483717:27.565115:-900.000000 +PORT +PhiResolution:"20" +PORT +Radius:"40" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +creaVtk:MeshCutByAxis:Box14 +ISEXEC:FALSE +-47.918925:9.265731:-900.000000 +-6.843925:-0.734269:-900.000000 +PORT +InsideVol:"false" +PORT +Point:"0 0 0" +PORT +Type:"x" +FIN_BOX +BOX +creaVtk:FillHolesFilter:Box15 +ISEXEC:FALSE +-32.600910:-15.139242:-900.000000 +5.774090:-25.139242:-900.000000 +PORT +HoleSize:"500" +FIN_BOX +BOX +vtk:PolyDataToActor:Box16 +ISEXEC:FALSE +-10.056643:-64.330547:-900.000000 +35.183357:-74.330547:-900.000000 +PORT +Colour:"1 0 0" +PORT +Representation:"1" +FIN_BOX +BOX +wx:Slider:Box17 +ISEXEC:FALSE +-139.644776:80.915665:-900.000000 +-88.244776:70.915665:-900.000000 +PORT +In:"100" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +FIN_BOX +BOX +std:Div:Box18 +ISEXEC:FALSE +-120.720951:61.339294:-900.000000 +-91.395951:51.339294:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +wx:LayoutLine:Box19 +ISEXEC:FALSE +-146.170233:11.745822:-900.000000 +-88.610233:1.745822:-900.000000 +FIN_BOX +BOX +wx:Slider:Box20 +ISEXEC:FALSE +-88.322583:75.792656:-900.000000 +-36.922583:65.792656:-900.000000 +PORT +In:"100" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +FIN_BOX +BOX +std:Div:Box21 +ISEXEC:FALSE +-78.208125:56.542558:-900.000000 +-48.883125:46.542558:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +std:MultipleInputs:Box22 +ISEXEC:FALSE +-76.674118:-1.305091:-900.000000 +-36.974118:-11.305091:-900.000000 +FIN_BOX +CONNECTIONS:21 +CONNECTION +Box06:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box09:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box11:Renderer +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box12:Renderer +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box11:In +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box15:In +NumberOfControlPoints:0 +CONNECTION +Box15:Out:Box16:In +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box16:Renderer +NumberOfControlPoints:0 +CONNECTION +Box11:BoxChange:Box16:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box16:BoxChange:Box12:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box18:In1 +NumberOfControlPoints:0 +CONNECTION +Box17:Widget:Box19:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box11:Opacity +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box21:In1 +NumberOfControlPoints:0 +CONNECTION +Box20:Widget:Box19:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box19:Widget:Box09:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box16:Opacity +NumberOfControlPoints:0 +CONNECTION +Box20:BoxChange:Box22:In2 +NumberOfControlPoints:0 +CONNECTION +Box17:BoxChange:Box22:In1 +NumberOfControlPoints:0 +CONNECTION +Box22:BoxChange:Box11:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbs new file mode 100644 index 0000000..30d3e77 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbs @@ -0,0 +1,122 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleFillHoles.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include creaMaracasVisu +include vtk +include wx +include std + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:Stripper Box03 + +new creaMaracasVisu:ViewerNV Box05 + +new vtk:LoadHola Box06 + +new creaVtk:OutputWindow Box08 + +new wx:LayoutSplit Box09 + set Box09.Orientation "H" + +new vtk:PolyDataToActor Box11 + set Box11.Representation "2" + +new vtk:UpdateRender Box12 + set Box12.Active "true" + +new vtk:SphereSource Box13 + set Box13.PhiResolution "20" + set Box13.Radius "40" + set Box13.ThetaResolution "20" + +new creaVtk:MeshCutByAxis Box14 + set Box14.InsideVol "false" + set Box14.Point "0 0 0" + set Box14.Type "x" + +new creaVtk:FillHolesFilter Box15 + set Box15.HoleSize "500" + +new vtk:PolyDataToActor Box16 + set Box16.Colour "1 0 0" + set Box16.Representation "1" + +new wx:Slider Box17 + set Box17.In "100" + set Box17.Max "100" + set Box17.ReactiveOnTrack "true" + +new std:Div Box18 + set Box18.In2 "100" + +new wx:LayoutLine Box19 + +new wx:Slider Box20 + set Box20.In "100" + set Box20.Max "100" + set Box20.ReactiveOnTrack "true" + +new std:Div Box21 + set Box21.In2 "100" + +new std:MultipleInputs Box22 + + +connect Box06.Out Box05.In + +connect Box05.Widget Box09.Widget2 + +connect Box05.Renderer1 Box11.Renderer + +connect Box05.Renderer1 Box12.Renderer + +connect Box13.Out Box14.In + +connect Box14.Out Box11.In + +connect Box14.Out Box15.In + +connect Box15.Out Box16.In + +connect Box05.Renderer1 Box16.Renderer + +connect Box11.BoxChange Box16.BoxExecute + +connect Box16.BoxChange Box12.BoxExecute + +connect Box17.Out Box18.In1 + +connect Box17.Widget Box19.Widget1 + +connect Box18.Out Box11.Opacity + +connect Box20.Out Box21.In1 + +connect Box20.Widget Box19.Widget3 + +connect Box19.Widget Box09.Widget1 + +connect Box21.Out Box16.Opacity + +connect Box20.BoxChange Box22.In2 + +connect Box17.BoxChange Box22.In1 + +connect Box22.BoxChange Box11.BoxExecute + + + +# Complex input ports +exec Box08 +exec Box09 diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbg new file mode 100644 index 0000000..a9c759c --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbg @@ -0,0 +1,292 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:21 +BOX +creaVtk:Stripper:Box03 +ISEXEC:FALSE +-11.080041:-28.602722:-900.000000 +22.594959:-38.602722:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box05 +ISEXEC:FALSE +69.707883:6.867455:-900.000000 +133.427883:-3.132545:-900.000000 +FIN_BOX +BOX +vtk:LoadHola:Box06 +ISEXEC:FALSE +77.511222:77.041163:-900.000000 +113.061222:67.041163:-900.000000 +FIN_BOX +BOX +creaVtk:OutputWindow:Box08 +ISEXEC:TRUE +-31.378810:-187.920863:-900.000000 +9.221190:-197.920863:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box09 +ISEXEC:TRUE +-95.327818:-189.758498:-900.000000 +-56.247818:-199.758498:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +vtk:PolyDataToActor:Box11 +ISEXEC:FALSE +-102.646835:-36.050865:-900.000000 +-57.406835:-46.050865:-900.000000 +PORT +Representation:"2" +FIN_BOX +BOX +vtk:UpdateRender:Box12 +ISEXEC:FALSE +-65.173714:-134.156961:-900.000000 +-24.848714:-144.156961:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:SphereSource:Box13 +ISEXEC:FALSE +1.890546:75.328227:-900.000000 +41.715546:65.328227:-900.000000 +PORT +PhiResolution:"20" +PORT +Radius:"40" +PORT +ThetaResolution:"20" +FIN_BOX +BOX +creaVtk:MeshCutByAxis:Box14 +ISEXEC:FALSE +-3.502359:32.303106:-900.000000 +37.572641:22.303106:-900.000000 +PORT +InsideVol:"false" +PORT +Point:"0 0 0" +FIN_BOX +BOX +vtk:PolyDataToActor:Box16 +ISEXEC:FALSE +-93.582490:-73.466187:-900.000000 +-48.342490:-83.466187:-900.000000 +PORT +Colour:"1 0 0" +PORT +Representation:"1" +FIN_BOX +BOX +wx:Slider:Box17 +ISEXEC:FALSE +-164.947235:74.138978:-900.000000 +-113.547235:64.138978:-900.000000 +PORT +In:"30" +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Surface" +FIN_BOX +BOX +std:Div:Box18 +ISEXEC:FALSE +-117.898202:45.100858:-900.000000 +-88.573202:35.100858:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +wx:LayoutLine:Box19 +ISEXEC:FALSE +-150.477035:4.926720:-900.000000 +-92.917035:-5.073280:-900.000000 +FIN_BOX +BOX +wx:Slider:Box20 +ISEXEC:FALSE +-87.903471:71.768822:-900.000000 +-36.503471:61.768822:-900.000000 +PORT +In:"30" +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Surface + cutter" +FIN_BOX +BOX +std:Div:Box21 +ISEXEC:FALSE +-64.112323:45.768018:-900.000000 +-34.787323:35.768018:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +std:MultipleInputs:Box22 +ISEXEC:FALSE +-76.674118:-1.305091:-900.000000 +-36.974118:-11.305091:-900.000000 +FIN_BOX +BOX +creaVtk:Cutter:Box24 +ISEXEC:FALSE +-9.135640:-4.567820:-900.000000 +23.064360:-14.567820:-900.000000 +FIN_BOX +BOX +creaVtk:Plane:Box25 +ISEXEC:FALSE +27.533219:17.245608:-900.000000 +59.258219:7.245608:-900.000000 +PORT +Origin:"0 0 10" +FIN_BOX +BOX +vtk:PolyDataToActor:Box26 +ISEXEC:FALSE +-73.286561:-101.665584:-900.000000 +-28.046561:-111.665584:-900.000000 +PORT +Colour:"0 1 1" +PORT +Representation:"1" +FIN_BOX +BOX +wx:Slider:Box27 +ISEXEC:FALSE +-223.463982:73.636316:-900.000000 +-172.063982:63.636316:-900.000000 +PORT +In:"30" +PORT +Label:"true" +PORT +Max:"100" +PORT +ReactiveOnTrack:"true" +PORT +Title:"Surface + cutter + stripper" +FIN_BOX +BOX +std:Div:Box28 +ISEXEC:FALSE +-213.575990:47.651098:-900.000000 +-184.250990:37.651098:-900.000000 +PORT +In2:"100" +FIN_BOX +CONNECTIONS:30 +CONNECTION +Box06:Out:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box09:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box11:Renderer +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box12:Renderer +NumberOfControlPoints:0 +CONNECTION +Box13:Out:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box11:In +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box16:Renderer +NumberOfControlPoints:0 +CONNECTION +Box11:BoxChange:Box16:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box18:In1 +NumberOfControlPoints:0 +CONNECTION +Box17:Widget:Box19:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box11:Opacity +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box21:In1 +NumberOfControlPoints:0 +CONNECTION +Box20:Widget:Box19:Widget3 +NumberOfControlPoints:0 +CONNECTION +Box19:Widget:Box09:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box16:Opacity +NumberOfControlPoints:0 +CONNECTION +Box20:BoxChange:Box22:In2 +NumberOfControlPoints:0 +CONNECTION +Box17:BoxChange:Box22:In1 +NumberOfControlPoints:0 +CONNECTION +Box22:BoxChange:Box11:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box24:In +NumberOfControlPoints:0 +CONNECTION +Box25:Out:Box24:ImplicitFunction +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box16:In +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box05:Renderer1:Box26:Renderer +NumberOfControlPoints:0 +CONNECTION +Box03:Out:Box26:In +NumberOfControlPoints:0 +CONNECTION +Box16:BoxChange:Box26:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box26:BoxChange:Box12:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box27:Out:Box28:In1 +NumberOfControlPoints:0 +CONNECTION +Box27:Widget:Box19:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box27:BoxChange:Box22:In6 +NumberOfControlPoints:0 +CONNECTION +Box28:Out:Box26:Opacity +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbs new file mode 100644 index 0000000..ea9421f --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbs @@ -0,0 +1,159 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleStripper.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaVtk +include creaMaracasVisu +include vtk +include wx +include std + +author "Author ??" +description "Description ??" +category "" + +new creaVtk:Stripper Box03 + +new creaMaracasVisu:ViewerNV Box05 + +new vtk:LoadHola Box06 + +new creaVtk:OutputWindow Box08 + +new wx:LayoutSplit Box09 + set Box09.Orientation "H" + +new vtk:PolyDataToActor Box11 + set Box11.Representation "2" + +new vtk:UpdateRender Box12 + set Box12.Active "true" + +new vtk:SphereSource Box13 + set Box13.PhiResolution "20" + set Box13.Radius "40" + set Box13.ThetaResolution "20" + +new creaVtk:MeshCutByAxis Box14 + set Box14.InsideVol "false" + set Box14.Point "0 0 0" + +new vtk:PolyDataToActor Box16 + set Box16.Colour "1 0 0" + set Box16.Representation "1" + +new wx:Slider Box17 + set Box17.In "30" + set Box17.Label "true" + set Box17.Max "100" + set Box17.ReactiveOnTrack "true" + set Box17.Title "Surface" + +new std:Div Box18 + set Box18.In2 "100" + +new wx:LayoutLine Box19 + +new wx:Slider Box20 + set Box20.In "30" + set Box20.Label "true" + set Box20.Max "100" + set Box20.ReactiveOnTrack "true" + set Box20.Title "Surface + cutter" + +new std:Div Box21 + set Box21.In2 "100" + +new std:MultipleInputs Box22 + +new creaVtk:Cutter Box24 + +new creaVtk:Plane Box25 + set Box25.Origin "0 0 10" + +new vtk:PolyDataToActor Box26 + set Box26.Colour "0 1 1" + set Box26.Representation "1" + +new wx:Slider Box27 + set Box27.In "30" + set Box27.Label "true" + set Box27.Max "100" + set Box27.ReactiveOnTrack "true" + set Box27.Title "Surface + cutter + stripper" + +new std:Div Box28 + set Box28.In2 "100" + + +connect Box06.Out Box05.In + +connect Box05.Widget Box09.Widget2 + +connect Box05.Renderer1 Box11.Renderer + +connect Box05.Renderer1 Box12.Renderer + +connect Box13.Out Box14.In + +connect Box14.Out Box11.In + +connect Box05.Renderer1 Box16.Renderer + +connect Box11.BoxChange Box16.BoxExecute + +connect Box17.Out Box18.In1 + +connect Box17.Widget Box19.Widget1 + +connect Box18.Out Box11.Opacity + +connect Box20.Out Box21.In1 + +connect Box20.Widget Box19.Widget3 + +connect Box19.Widget Box09.Widget1 + +connect Box21.Out Box16.Opacity + +connect Box20.BoxChange Box22.In2 + +connect Box17.BoxChange Box22.In1 + +connect Box22.BoxChange Box11.BoxExecute + +connect Box14.Out Box24.In + +connect Box25.Out Box24.ImplicitFunction + +connect Box24.Out Box16.In + +connect Box24.Out Box03.In + +connect Box05.Renderer1 Box26.Renderer + +connect Box03.Out Box26.In + +connect Box16.BoxChange Box26.BoxExecute + +connect Box26.BoxChange Box12.BoxExecute + +connect Box27.Out Box28.In1 + +connect Box27.Widget Box19.Widget6 + +connect Box27.BoxChange Box22.In6 + +connect Box28.Out Box26.Opacity + + + +# Complex input ports +exec Box08 +exec Box09 diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx index 44af51b..5f0aaa1 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkCutter.cxx @@ -4,7 +4,6 @@ #include "bbcreaVtkCutter.h" #include "bbcreaVtkPackage.h" #include "vtkCutter.h" -#include "vtkStripper.h" namespace bbcreaVtk { @@ -31,16 +30,10 @@ void Cutter::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " <SetInputData( bbGetInputIn() ); @@ -48,15 +41,6 @@ void Cutter::Process() cutter->Update(); bbSetOutputOut( cutter->GetOutput() ); -/* - strips = vtkStripper::New(); - strips->SetInputData( cutter->GetOutput() ); - strips->Update(); - poly = vtkPolyData::New(); - poly->SetPoints( strips->GetOutput()->GetPoints() ); - poly->SetPolys( strips->GetOutput()->GetLines() ); - bbSetOutputOut( poly ); -*/ } //===== diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.cxx new file mode 100644 index 0000000..4fc6141 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.cxx @@ -0,0 +1,83 @@ +//===== +// 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 "bbcreaVtkFillHolesFilter.h" +#include "bbcreaVtkPackage.h" + +#include "vtkFillHolesFilter.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,FillHolesFilter) +BBTK_BLACK_BOX_IMPLEMENTATION(FillHolesFilter,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 FillHolesFilter::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 = " <SetInputData( bbGetInputIn() ); + filler->SetHoleSize( bbGetInputHoleSize() ); + filler->Update(); + bbSetOutputOut( filler->GetOutput() ); + } // if + +} +//===== +// 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 FillHolesFilter::bbUserSetDefaultValues() +{ + +// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX +// Here we initialize the input 'In' to 0 + bbSetInputIn(NULL); + bbSetInputHoleSize(500); +} +//===== +// 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 FillHolesFilter::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 FillHolesFilter::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/bbcreaVtkFillHolesFilter.h b/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.h new file mode 100644 index 0000000..f2ab5b4 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkFillHolesFilter.h @@ -0,0 +1,50 @@ +//===== +// 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 __bbcreaVtkFillHolesFilter_h_INCLUDED__ +#define __bbcreaVtkFillHolesFilter_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT FillHolesFilter + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(FillHolesFilter,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(HoleSize,double); + 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(FillHolesFilter,bbtk::AtomicBlackBox); + BBTK_NAME("FillHolesFilter"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("vtk - Mesh fill holes"); + BBTK_CATEGORY("empty"); + BBTK_INPUT(FillHolesFilter,In,"Input mesh polydata",vtkPolyData*,""); + BBTK_INPUT(FillHolesFilter,HoleSize,"(default 500) Hole size",double,""); + BBTK_OUTPUT(FillHolesFilter,Out,"Output mesh",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(FillHolesFilter); +//===== +// 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 // __bbcreaVtkFillHolesFilter_h_INCLUDED__ + diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.cxx index 52bcb5b..11f4e19 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStlReader.cxx @@ -5,7 +5,6 @@ #include "bbcreaVtkPackage.h" #include "vtkSTLReader.h" -#include "vtkFillHolesFilter.h" namespace bbcreaVtk { @@ -35,13 +34,6 @@ void StlReader::Process() reader->Update(); bbSetOutputOut( reader->GetOutput() ); -/* - vtkFillHolesFilter *filler = vtkFillHolesFilter::New(); - filler->SetInputData( reader->GetOutput() ); - filler->SetHoleSize(500); - filler->Update(); - bbSetOutputOut( filler->GetOutput() ); - */ } //===== // 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/bbcreaVtkStripper.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.cxx new file mode 100644 index 0000000..4f03879 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.cxx @@ -0,0 +1,85 @@ +//===== +// 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 "bbcreaVtkStripper.h" +#include "bbcreaVtkPackage.h" + +#include "vtkStripper.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,Stripper) +BBTK_BLACK_BOX_IMPLEMENTATION(Stripper,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 Stripper::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 = " <SetInputData( bbGetInputIn() ); + strips->Update(); + vtkPolyData *poly = vtkPolyData::New(); + poly->SetPoints( strips->GetOutput()->GetPoints() ); + poly->SetPolys( strips->GetOutput()->GetLines() ); + bbSetOutputOut( poly ); + } // 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 Stripper::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 Stripper::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 Stripper::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/bbcreaVtkStripper.h b/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.h new file mode 100644 index 0000000..fe70671 --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkStripper.h @@ -0,0 +1,48 @@ +//===== +// 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 __bbcreaVtkStripper_h_INCLUDED__ +#define __bbcreaVtkStripper_h_INCLUDED__ + +#include "bbcreaVtk_EXPORT.h" +#include "bbtkAtomicBlackBox.h" +#include "iostream" + +#include "vtkPolyData.h" + +namespace bbcreaVtk +{ + +class bbcreaVtk_EXPORT Stripper + : + public bbtk::AtomicBlackBox +{ + BBTK_BLACK_BOX_INTERFACE(Stripper,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_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(Stripper,bbtk::AtomicBlackBox); + BBTK_NAME("Stripper"); + BBTK_AUTHOR("InfoDev"); + BBTK_DESCRIPTION("Close contour polydata ??"); + BBTK_CATEGORY("empty"); + BBTK_INPUT(Stripper,In,"Input mesh",vtkPolyData*,""); + BBTK_OUTPUT(Stripper,Out,"Output mesh",vtkPolyData*,""); +BBTK_END_DESCRIBE_BLACK_BOX(Stripper); +//===== +// 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 // __bbcreaVtkStripper_h_INCLUDED__ +