--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:12
+BOX
+vtk:LoadHola:Box00
+ISEXEC:FALSE
+42.970380:121.375067:-900.000000
+78.520380:111.375067:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box01
+ISEXEC:FALSE
+12.381685:53.142024:-900.000000
+48.256685:43.142024:-900.000000
+PORT
+nTypeView:"6 1 2 0"
+FIN_BOX
+BOX
+wx:LayoutSplit:Box02
+ISEXEC:TRUE
+-21.881348:-68.528094:-900.000000
+14.793652:-78.528094:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:LayoutLine:Box03
+ISEXEC:FALSE
+-89.318321:28.465101:-900.000000
+-52.743321:18.465101:-900.000000
+FIN_BOX
+BOX
+vtk:PolyDataToActor:Box05
+ISEXEC:FALSE
+49.016284:-54.225839:-900.000000
+91.416284:-64.225839:-900.000000
+PORT
+Colour:"1 0 0"
+FIN_BOX
+BOX
+wx:Slider:Box06
+ISEXEC:FALSE
+-88.015958:64.249653:-900.000000
+-56.440958:54.249653:-900.000000
+PORT
+In:"100"
+PORT
+Max:"100"
+PORT
+Min:"0"
+PORT
+ReactiveOnTrack:"true"
+FIN_BOX
+BOX
+std:Div:Box07
+ISEXEC:FALSE
+-32.712798:46.677489:-900.000000
+-3.387798:36.677489:-900.000000
+PORT
+In2:"100"
+FIN_BOX
+BOX
+creaVtk:MeshCutByAxis:Box08
+ISEXEC:FALSE
+80.897806:-31.255502:-900.000000
+121.972806:-41.255502:-900.000000
+PORT
+InsideVol:"true"
+PORT
+Point:"30 30 30"
+FIN_BOX
+BOX
+vtk:MarchingCubes:Box14
+ISEXEC:FALSE
+74.384670:4.520731:-900.000000
+116.184670:-5.479269:-900.000000
+PORT
+Value:"500"
+FIN_BOX
+BOX
+wx:RadioButton:Box17
+ISEXEC:FALSE
+-36.357203:77.589847:-900.000000
+1.542797:67.589847:-900.000000
+PORT
+In0:"Inside"
+PORT
+In1:"Outside"
+FIN_BOX
+BOX
+vtk:ImageVtkProperties:Box18
+ISEXEC:FALSE
+111.800931:65.662813:-900.000000
+157.150931:55.662813:-900.000000
+FIN_BOX
+BOX
+std:MathOperationVector:Box19
+ISEXEC:FALSE
+113.596399:21.834168:-900.000000
+161.121399:11.834168:-900.000000
+PORT
+Type:"2"
+FIN_BOX
+CONNECTIONS:18
+CONNECTION
+Box00:Out:Box01:In
+NumberOfControlPoints:0
+CONNECTION
+Box01:Widget:Box02:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box02:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box01:Renderer1:Box05:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box03:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box06:Out:Box07:In1
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box05:Opacity
+NumberOfControlPoints:0
+CONNECTION
+Box08:Out:Box05:In
+NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChange:Box08:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChange:Box05:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box14:In
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box08:In
+NumberOfControlPoints:0
+CONNECTION
+Box17:Widget:Box03:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box08:InsideVol
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box18:In
+NumberOfControlPoints:0
+CONNECTION
+Box18:Spacing:Box19:In1
+NumberOfControlPoints:0
+CONNECTION
+Box01:Point:Box19:In0
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box08:Point
+NumberOfControlPoints:0
+APP_END
--- /dev/null
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include vtk
+include creaMaracasVisu
+include wx
+include std
+include creaVtk
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new vtk:LoadHola Box00
+
+new creaMaracasVisu:ViewerNV Box01
+ set Box01.nTypeView "6 1 2 0"
+
+new wx:LayoutSplit Box02
+ set Box02.Orientation "H"
+
+new wx:LayoutLine Box03
+
+new vtk:PolyDataToActor Box05
+ set Box05.Colour "1 0 0"
+
+new wx:Slider Box06
+ set Box06.In "100"
+ set Box06.Max "100"
+ set Box06.Min "0"
+ set Box06.ReactiveOnTrack "true"
+
+new std:Div Box07
+ set Box07.In2 "100"
+
+new creaVtk:MeshCutByAxis Box08
+ set Box08.InsideVol "true"
+ set Box08.Point "30 30 30"
+
+new vtk:MarchingCubes Box14
+ set Box14.Value "500"
+
+new wx:RadioButton Box17
+ set Box17.In0 "Inside"
+ set Box17.In1 "Outside"
+
+new vtk:ImageVtkProperties Box18
+
+new std:MathOperationVector Box19
+ set Box19.Type "2"
+
+
+connect Box00.Out Box01.In
+
+connect Box01.Widget Box02.Widget2
+
+connect Box03.Widget Box02.Widget1
+
+connect Box01.Renderer1 Box05.Renderer
+
+connect Box06.Widget Box03.Widget1
+
+connect Box06.Out Box07.In1
+
+connect Box07.Out Box05.Opacity
+
+connect Box08.Out Box05.In
+
+connect Box01.BoxChange Box08.BoxExecute
+
+connect Box01.BoxChange Box05.BoxExecute
+
+connect Box00.Out Box14.In
+
+connect Box14.Out Box08.In
+
+connect Box17.Widget Box03.Widget2
+
+connect Box17.Out Box08.InsideVol
+
+connect Box00.Out Box18.In
+
+connect Box18.Spacing Box19.In1
+
+connect Box01.Point Box19.In0
+
+connect Box19.Out Box08.Point
+
+
+
+# Complex input ports
+exec Box02
} // for j
} //c4
-
+ newData->Modified();
bbSetOutputOut( newData );
}
// SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
// Here we initialize the input 'In' to 0
bbSetInputIn(NULL);
- bbSetInputType("x+y+z+");
+ bbSetInputType("x-y-z+");
bbSetInputInsideVol(true);
std::vector<int> point;
point.push_back(0);
BBTK_DESCRIPTION("No Description.");
BBTK_CATEGORY("empty");
BBTK_INPUT(ImageCutByAxis,In,"Input image",vtkImageData*,"");
- BBTK_INPUT(ImageCutByAxis,Type,"x y z x+y+ x-y+ x+y- x-y- y+z+ y+z- y-z+ y-z- x+z+ x+z- x-z+ x-z- x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,"");
+ BBTK_INPUT(ImageCutByAxis,Type,"(default x-y-z+) missing all options:x y z x+y+ x-y+ x+y- x-y- y+z+ y+z- y-z+ y-z- x+z+ x+z- x-z+ x-z- x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,"");
BBTK_INPUT(ImageCutByAxis,InsideVol,"Inside volume",bool,"");
BBTK_INPUT(ImageCutByAxis,Point,"First input",std::vector<int>,"");
BBTK_INPUT(ImageCutByAxis,TypeOrientation,"TypeOrientation (default 0) 0=XY 1=XZ 2=YZ",int,"");
#include <vtkBox.h>
#include <vtkPlane.h>
#include <vtkClipPolyData.h>
-
+#include <vtkPolyDataNormals.h>
namespace bbcreaVtk
{
vtkPlane *clipPlane = vtkPlane::New();
vtkBox *clipBox = vtkBox::New();
vtkClipPolyData *clipper = vtkClipPolyData::New();
+// clipper->GenerateClipScalarsOn();
+// clipper->GenerateClippedOutputOff();
//EED 2017-01-01 Migration VTK7
#if VTK_MAJOR_VERSION <= 5
clipper -> SetInput( bbGetInputIn() );
#else
+// vtkPolyDataNormals *nn = vtkPolyDataNormals::New();
+// nn->SetInputData( bbGetInputIn() );
+// clipper -> SetInputData( nn->GetOutput() );
clipper -> SetInputData( bbGetInputIn() );
#endif
clipper->SetInsideOut( bbGetInputInsideVol() );
-
int a; // correction border
if (bbGetInputInsideVol()==false)
{
} else {
a=0;
}
-
int px=bbGetInputPoint()[0];
int py=bbGetInputPoint()[1];
int pz=bbGetInputPoint()[2];
-
if ( bbGetInputType()=="x" ) { clipPlane->SetNormal(1, 0, 0); ok=1; } else
if ( bbGetInputType()=="y" ) { clipPlane->SetNormal(0, 1, 0); ok=1; } else
if ( bbGetInputType()=="z" ) { clipPlane->SetNormal(0, 0, 1); ok=1; } else
-
if ( bbGetInputType()=="x+y+" ) { clipBox->SetBounds(px ,px+sb ,py ,py+sb ,pz-sb ,pz+sb ); ok=2; } else
if ( bbGetInputType()=="x-y+" ) { clipBox->SetBounds(px-sb,px+a ,py ,py+sb ,pz-sb ,pz+sb ); ok=2; } else
if ( bbGetInputType()=="x+y-" ) { clipBox->SetBounds(px ,px+sb ,py-sb ,py+a ,pz-sb ,pz+sb ); ok=2; } else
if ( bbGetInputType()=="x+z-" ) { clipBox->SetBounds(px ,px+sb ,py-sb ,py+sb ,pz-sb ,pz+a ); ok=2; } else
if ( bbGetInputType()=="x-z-" ) { clipBox->SetBounds(px-sb,px+a ,py-sb ,py+sb ,pz-sb ,pz+a ); ok=2; } else
-
if ( bbGetInputType()=="x+y+z+" ) { clipBox->SetBounds(px ,px+sb ,py ,py+sb ,pz ,pz+sb ); ok=2; } else
if ( bbGetInputType()=="x-y+z+" ) { clipBox->SetBounds(px-sb,px+a ,py ,py+sb ,pz ,pz+sb ); ok=2; } else
if ( bbGetInputType()=="x+y-z+" ) { clipBox->SetBounds(px ,px+sb ,py-sb ,py+a ,pz ,pz+sb ); ok=2; } else
if (ok==1) {
clipPlane -> SetOrigin(px,py,pz);
+ clipPlane -> Modified();
clipper -> SetClipFunction(clipPlane);
+ clipper -> Update();
bbSetOutputOut( clipper->GetOutput() );
- } else if (ok==2) {
-
- clipper -> SetClipFunction(clipBox);
+ } else if (ok==2) {
+ clipBox -> Modified();
+ clipper -> SetClipFunction(clipBox);
+ clipper -> Update();
bbSetOutputOut( clipper->GetOutput() );
} else {
bbSetOutputOut( bbGetInputIn() );
BBTK_DESCRIPTION("MeshCutByAxis");
BBTK_CATEGORY("empty");
BBTK_INPUT(MeshCutByAxis,In,"Mesh to be cut",vtkPolyData*,"");
- BBTK_INPUT(MeshCutByAxis,Type,"x y z x+y+ x-y+ x+y- x-y- y+z+ y+z- y-z+ y-z- x+z+ x+z- x-z+ x-z- x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,"");
+ BBTK_INPUT(MeshCutByAxis,Type,"(defalut x+y+z+) x y z x+y+ x-y+ x+y- x-y- y+z+ y+z- y-z+ y-z- x+z+ x+z- x-z+ x-z- x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,"");
BBTK_INPUT(MeshCutByAxis,InsideVol,"Inside volume",bool,"");
BBTK_INPUT(MeshCutByAxis,Point,"First input",std::vector<int>,"");
BBTK_OUTPUT(MeshCutByAxis,Out,"First output",vtkPolyData*,"");
_colorLookupTable->SetTableValue(500-i,rgba);
} // for
*/
+ colorLookupTable->Modified();
_scalarstocolors = colorLookupTable;
} // if Type 0