BoxesVector boxs;
- for (int i = 0; i < (int)files.size(); ++i) {
+ for (int i = 0; i < (int)files.size(); ++i)
+ {
bbtk::BBPInterpreter::Pointer I = bbtk::BBPInterpreter::New();
I->InterpretFile(files[i].string());
+
+
boxs.push_back( ((bbtk::BBPInterpreter*)(I.get()))->boxName );
- deps.push_back( ((bbtk::BBPInterpreter*)(I.get()))->dependencies );
- //print box name and dependencies
+// EED 2016/02/19
+// deps.push_back( ((bbtk::BBPInterpreter*)(I.get()))->dependencies );
+ //--> Cleanning string package:boxname -> boxname
+ std::set<std::string> tmpDependencies1= ((bbtk::BBPInterpreter*)(I.get()))->dependencies ;
+ std::set<std::string> tmpDependencies2;
+ std::set<std::string>::const_iterator sit(tmpDependencies1.begin()), send(tmpDependencies1.end());
+ int pos;
+ std::string tmpStr;
// std::cout << ((bbtk::BBPInterpreter*)(I.get()))->boxName << ": ";
-// for(
+ for(;sit!=send;++sit)
+ {
+ pos=(*sit).find(":");
+ if (pos== std::string::npos )
+ {
+ tmpDependencies2.insert( *sit );
+// std::cout << *sit << ' ';
+ } else {
+ tmpStr=(*sit).substr(pos+1);
+ tmpDependencies2.insert( tmpStr );
+// std::cout << tmpStr << ' ';
+ } // if
+
+ } // for
+// std::cout << std::endl;
+ deps.push_back( tmpDependencies2 );
+ //<--
+
+
+
+// //print box name and dependencies OLD VERSION
+// std::cout << ((bbtk::BBPInterpreter*)(I.get()))->boxName << ": ";
+// for(
// Dependencies::iterator it = ((bbtk::BBPInterpreter*)(I.get()))->dependencies.begin();
// it != ((bbtk::BBPInterpreter*)(I.get()))->dependencies.end();
// it++) {
// }
// std::cout << std::endl;
- }
+ } // for i
// Only keep dependencies from package
Dependencies boxNamesSet(boxs.begin(), boxs.end());
- //std::cout << "after: " << std::endl;
- for (DependenciesVector::iterator it = deps.begin(); it != deps.end(); it++) {
+//std::cout << "after: " << std::endl;
+ for (DependenciesVector::iterator it = deps.begin(); it != deps.end(); it++)
+ {
BoxesVector tmp;
std::set_intersection(it->begin(), it->end(), boxNamesSet.begin(), boxNamesSet.end(),std::back_inserter(tmp));
Dependencies tmp1(tmp.begin(),tmp.end());
it->swap( tmp1 );
- //print clean dependencies
-// for(
-// Dependencies::iterator it1 = it->begin();
-// it1 != it->end();
-// it1++) {
+// //print clean dependencies
+// for( Dependencies::iterator it1 = it->begin(); it1 != it->end(); it1++)
+// {
// std::cout << *it1 << ", ";
// }
// std::cout << std::endl;
// find max priority level
int mx_priority = 0;
for (int i = 0; i < (int)priorities.size(); i++)
+ {
mx_priority = std::max(mx_priority, priorities[i]);
+ }
// for each priority level print scripts in that level.
for (int i = 0; i <= mx_priority; i++)
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
+# - /tmpEED/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
# ----------------------------------
APP_START
TypeName
88.917806:-71.094563:-900.000000
FIN_COMPLEX_PORT
-COMPLEXINPUTS:2
+COMPLEXINPUTS:3
COMPLEX_PORT
in
-34.967521:145.605564:-900.000000
+20.217710:145.236819:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
FileName
-102.519294:151.601731:-900.000000
+105.100511:147.914278:-900.000000
FIN_COMPLEX_PORT
-BOXES:9
+COMPLEX_PORT
+boxExecute
+-92.186317:150.079323:-900.000000
+FIN_COMPLEX_PORT
+BOXES:10
BOX
wx:OutputText:Box02
ISEXEC:FALSE
BOX
wx:OutputText:Box17
ISEXEC:FALSE
--80.770416:34.681383:-900.000000
--35.195416:24.681383:-900.000000
+-81.960343:34.681383:-900.000000
+-36.385343:24.681383:-900.000000
PORT
Title:"Size"
FIN_BOX
BOX
wx:OutputText:Box22
ISEXEC:FALSE
--35.332320:1.230494:-900.000000
-10.242680:-8.769506:-900.000000
+-33.844911:1.230494:-900.000000
+11.730089:-8.769506:-900.000000
PORT
Title:"TypeName"
FIN_BOX
BOX
wx:OutputText:Box26
ISEXEC:FALSE
--131.615626:26.628991:-900.000000
--86.040626:16.628991:-900.000000
+-128.670557:28.919600:-900.000000
+-83.095557:18.919600:-900.000000
PORT
Title:"Min Max"
FIN_BOX
BOX
vtk:ImageVtkProperties:Box09
ISEXEC:FALSE
-33.571051:113.198814:-900.000000
-79.146051:103.198814:-900.000000
+14.396297:109.880107:-900.000000
+59.971297:99.880107:-900.000000
FIN_BOX
BOX
wx:OutputText:Box10
PORT
Title:"Name"
FIN_BOX
-CONNECTIONS:21
+BOX
+std:MagicBox:Box14
+ISEXEC:FALSE
+-98.823731:125.742136:-900.000000
+-53.248731:115.742136:-900.000000
+FIN_BOX
+CONNECTIONS:30
CONNECTION
Box09:Components:Box10:In
NumberOfControlPoints:0
CONNECTION
Box13:Widget:Box11:Widget7
NumberOfControlPoints:0
+CONNECTION
+boxExecute:boxExecute:Box14:In
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box10:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box02:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box17:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box20:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box22:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box13:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:BoxChange:Box09:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box26:BoxExecute
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
+# - /tmpEED/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
# ----------------------------------
include std
include itkvtk
include wx
include vtk
+include std
define ImageVtkPropertiesWidget toolsbbtk
category "<VOID>"
-new OutputText Box02
+new wx:OutputText Box02
set Box02.Title "Dimensions"
-new OutputText Box17
+new wx:OutputText Box17
set Box17.Title "Size"
-new OutputText Box20
+new wx:OutputText Box20
set Box20.Title "Spacing"
-new OutputText Box22
+new wx:OutputText Box22
set Box22.Title "TypeName"
-new OutputText Box26
+new wx:OutputText Box26
set Box26.Title "Min Max"
-new ImageVtkProperties Box09
+new vtk:ImageVtkProperties Box09
-new OutputText Box10
+new wx:OutputText Box10
set Box10.Title "Components"
-new LayoutLine Box11
+new wx:LayoutLine Box11
set Box11.WinTitle "Image properties"
-new OutputText Box13
+new wx:OutputText Box13
set Box13.Title "Name"
+new std:MagicBox Box14
+
connect Box09.Components Box10.In
connect Box09.MinMax Box26.In
connect Box26.Widget Box11.Widget6
connect Box09.Dimension Box02.In
connect Box13.Widget Box11.Widget7
+connect Box14.Out Box10.BoxExecute
+connect Box14.Out Box02.BoxExecute
+connect Box14.Out Box17.BoxExecute
+connect Box14.Out Box20.BoxExecute
+connect Box14.Out Box22.BoxExecute
+connect Box14.Out Box13.BoxExecute
+connect Box14.BoxChange Box09.BoxExecute
+connect Box14.Out Box26.BoxExecute
# Complex input ports
input in Box09.In " "
input FileName Box13.In " "
+input boxExecute Box14.In " "
# Complex output ports
output widget Box11.Widget " "
output Spacing Box09.Spacing " "
output TypeName Box09.TypeName " "
+message
endefine
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_install/bin/../share/bbtk/bbs/vtk/boxes/bbIsoSurfaceExtractor.bbg
+# - /tmpEED/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbg
# ----------------------------------
APP_START
FIN_COMPLEX_PORT
COMPLEX_PORT
BoxExecute
--19.682203:99.666647:-900.000000
+-19.682203:95.133203:-900.000000
FIN_COMPLEX_PORT
BOXES:3
BOX
vtk:MarchingCubes:mc
ISEXEC:FALSE
--13.834130:38.831538:-900.000000
-31.740870:28.831538:-900.000000
+11.855384:37.572248:-900.000000
+57.430384:27.572248:-900.000000
FIN_BOX
BOX
vtk:PolyDataToActor:polydatatoactor
ISEXEC:FALSE
--99.833324:8.498185:-900.000000
--28.658324:-1.501815:-900.000000
+-89.255289:4.468457:-900.000000
+-18.080289:-5.531543:-900.000000
FIN_BOX
BOX
std:MultipleInputs:Box03
ISEXEC:FALSE
--27.966362:71.986554:-900.000000
-17.608638:61.986554:-900.000000
+-40.307403:60.149229:-900.000000
+5.267597:50.149229:-900.000000
PORT
BoxProcessMode:"reactive"
FIN_BOX
-CONNECTIONS:11
+CONNECTIONS:10
CONNECTION
mc:Out:polydatatoactor:In
NumberOfControlPoints:0
BoxExecute:BoxExecute:Box03:In1
NumberOfControlPoints:0
CONNECTION
-Box03:Out:polydatatoactor:BoxExecute
-NumberOfControlPoints:0
-CONNECTION
-Box03:Out:mc:BoxExecute
+Box03:BoxChange:polydatatoactor:BoxExecute
NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/creaTools/creatools_install/bin/../share/bbtk/bbs/vtk/boxes/bbIsoSurfaceExtractor.bbs
+# - /tmpEED/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbs
# ----------------------------------
include std
category "3D object creator"
-new MarchingCubes mc
+new vtk:MarchingCubes mc
-new PolyDataToActor polydatatoactor
+new vtk:PolyDataToActor polydatatoactor
-new MultipleInputs Box03
+new std:MultipleInputs Box03
set Box03.BoxProcessMode "reactive"
connect mc.Out polydatatoactor.In
-connect Box03.Out polydatatoactor.BoxExecute
-connect Box03.Out mc.BoxExecute
+connect Box03.BoxChange polydatatoactor.BoxExecute
# Complex input ports
input In mc.In " "
# Complex output ports
output Out polydatatoactor.Out " "
+message
endefine
std::vector<float> vspacing;
std::vector<float> vrange;
- if ( bbGetInputIn() ){
+ if ( bbGetInputIn() )
+ {
+ bbGetInputIn()->Modified();
bbGetInputIn()->Update();
bbGetInputIn()->GetWholeExtent(ext);
bbGetInputIn()->GetSpacing(spc);
for (unsigned int i=0;i<dim;++i)
+ {
vspacing.push_back((float)spc[i]);
+ }
vrange.push_back((float)range[0]);
vrange.push_back((float)range[1]);
- if (bbGetInputIn()->GetScalarType()==VTK_BIT) nametype="VTK_BIT"; // 1
- if (bbGetInputIn()->GetScalarType()==VTK_CHAR) nametype="VTK_CHAR"; // 2
+ if (bbGetInputIn()->GetScalarType()==VTK_BIT) nametype="VTK_BIT"; // 1
+ if (bbGetInputIn()->GetScalarType()==VTK_CHAR) nametype="VTK_CHAR"; // 2
if (bbGetInputIn()->GetScalarType()==VTK_SIGNED_CHAR) nametype="VTK_SIGNED_CHAR"; // 15
if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_CHAR) nametype="VTK_UNSIGNED_CHAR"; // 3
- if (bbGetInputIn()->GetScalarType()==VTK_SHORT) nametype="VTK_SHORT"; // 4
+ if (bbGetInputIn()->GetScalarType()==VTK_SHORT) nametype="VTK_SHORT"; // 4
if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_SHORT) nametype="VTK_UNSIGNED_SHORT"; // 5
- if (bbGetInputIn()->GetScalarType()==VTK_INT) nametype="VTK_INT"; // 6
+ if (bbGetInputIn()->GetScalarType()==VTK_INT) nametype="VTK_INT"; // 6
if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_INT) nametype="VTK_UNSIGNED_INT"; // 7
- if (bbGetInputIn()->GetScalarType()==VTK_LONG) nametype="VTK_LONG"; // 8
+ if (bbGetInputIn()->GetScalarType()==VTK_LONG) nametype="VTK_LONG"; // 8
if (bbGetInputIn()->GetScalarType()==VTK_UNSIGNED_LONG) nametype="VTK_UNSIGNED_LONG"; // 9
- if (bbGetInputIn()->GetScalarType()==VTK_FLOAT) nametype="VTK_FLOAT"; // 10
- if (bbGetInputIn()->GetScalarType()==VTK_DOUBLE) nametype="VTK_DOUBLE"; // 11
+ if (bbGetInputIn()->GetScalarType()==VTK_FLOAT) nametype="VTK_FLOAT"; // 10
+ if (bbGetInputIn()->GetScalarType()==VTK_DOUBLE) nametype="VTK_DOUBLE"; // 11
} else {
dim = 0;
numberoOfComponents = 0;
void ColourSelectorButton::Process()
{
+/*
// The widget may not be created : have to test it before using it
wxColourPickerCtrlWidget* w = ( wxColourPickerCtrlWidget* )bbGetOutputWidget();
if (w)
// to the input (which may have changed if the user set it)
bbSetOutputOut(bbGetInputIn());
}
+*/
+
}
cr , cg , cb );
bbSetOutputWidget( w );
+ bbSetOutputOut(bbGetInputIn());
}
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_install/bin/../share/bbtk/bbs/wxvtk/boxes/bbIsoSurfaceWidget.bbg
+# - /tmpEED/creaTools/creatools_source/bbtk/packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbg
# ----------------------------------
APP_START
Orientation:"HORIZONTAL"
FIN_BOX
BOX
-vtk:IsoSurfaceExtractor:surface
+vtk:IsoSurfaceExtractor:Asurface
ISEXEC:FALSE
-36.840302:-236.896173:-900.000000
-108.015302:-246.896173:-900.000000
+43.917303:-225.853762:-900.000000
+115.092303:-235.853762:-900.000000
FIN_BOX
BOX
wx:Slider:isovalue
ISEXEC:FALSE
-97.623363:33.580835:-900.000000
-149.023363:23.580835:-900.000000
+98.069545:33.134653:-900.000000
+149.469545:23.134653:-900.000000
PORT
ChangeResolution:"true"
PORT
BOX
wx:ColourSelectorButton:colour
ISEXEC:FALSE
-10.003991:41.822344:-900.000000
-81.178991:31.822344:-900.000000
+5.737517:35.117885:-900.000000
+76.912517:25.117885:-900.000000
FIN_BOX
BOX
std:MultipleInputs:refresh
-47.043071:-114.029679:-900.000000
FIN_BOX
BOX
-std:Div:div
+std:Div:Adiv
ISEXEC:FALSE
-0.000000:-110.000000:-900.000000
-26.375000:-120.000000:-900.000000
+1.523741:-151.750497:-900.000000
+34.298741:-161.750497:-900.000000
PORT
In2:"100"
FIN_BOX
BOX
vtk:UpdateRender:Box08
ISEXEC:FALSE
--7.502993:-172.858283:-900.000000
-38.072007:-182.858283:-900.000000
+-38.587305:-230.303310:-900.000000
+6.987695:-240.303310:-900.000000
PORT
Active:"true"
FIN_BOX
170.465036:-148.550905:-900.000000
216.040036:-158.550905:-900.000000
FIN_BOX
-CONNECTIONS:27
+CONNECTIONS:28
CONNECTION
-isovalue:Out:surface:Isovalue
+isovalue:Out:Asurface:Isovalue
NumberOfControlPoints:0
CONNECTION
-opacity:Out:div:In1
+opacity:Out:Adiv:In1
NumberOfControlPoints:0
CONNECTION
-div:Out:surface:Opacity
+Adiv:Out:Asurface:Opacity
NumberOfControlPoints:0
CONNECTION
-colour:Out:surface:Colour
+colour:Out:Asurface:Colour
NumberOfControlPoints:0
CONNECTION
isovalue:BoxChange:refresh:In1
opacity:BoxChange:refresh:In2
NumberOfControlPoints:0
CONNECTION
-colour:BoxChange:refresh:In3
-NumberOfControlPoints:0
-CONNECTION
colour:Widget:controls:Widget3
NumberOfControlPoints:0
CONNECTION
opacity:Widget:controls:Widget2
NumberOfControlPoints:0
CONNECTION
-Box09:Out:surface:Renderer
+Box09:Out:Asurface:Renderer
NumberOfControlPoints:0
CONNECTION
Box09:Out:Box08:Renderer
BoxExecute:BoxExecute:refresh:In4
NumberOfControlPoints:0
CONNECTION
-In:In:surface:In
+In:In:Asurface:In
NumberOfControlPoints:0
CONNECTION
maxIsovalue:maxIsovalue:isovalue:Max
vtkRenderer:vtkRenderer:Box09:In
NumberOfControlPoints:0
CONNECTION
-surface:Out:Out:Out
+Asurface:Out:Out:Out
NumberOfControlPoints:0
CONNECTION
controls:Widget:Widget:Widget
NumberOfControlPoints:0
CONNECTION
-refresh:Out:BoxChange:BoxChange
+opacity:BoxChange:refresh:BoxExecute
NumberOfControlPoints:0
CONNECTION
-refresh:Out:Box08:BoxExecute
+refresh:BoxChange:BoxChange:BoxChange
NumberOfControlPoints:0
CONNECTION
-refresh:Out:surface:BoxExecute
+refresh:BoxChange:Asurface:BoxExecute
NumberOfControlPoints:0
CONNECTION
-opacity:BoxChange:refresh:BoxExecute
+refresh:BoxChange:Box08:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+refresh:BoxChange:Adiv:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+colour:BoxChange:refresh:In3
NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/creaTools/creatools_install/bin/../share/bbtk/bbs/wxvtk/boxes/bbIsoSurfaceWidget.bbs
+# - /tmpEED/creaTools/creatools_source/bbtk/packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbs
# ----------------------------------
include std
category "image;mesh;widget;viewer"
-new LayoutLine controls
+new wx:LayoutLine controls
set controls.Orientation "HORIZONTAL"
-new IsoSurfaceExtractor surface
+new vtk:IsoSurfaceExtractor Asurface
-new Slider isovalue
+new wx:Slider isovalue
set isovalue.ChangeResolution "true"
set isovalue.Max "5000"
set isovalue.Title "Isovalue"
-new Slider opacity
+new wx:Slider opacity
set opacity.In "100"
set opacity.Max "100"
set opacity.Min "0"
set opacity.ReactiveOnTrack "true"
set opacity.Title "Opacity"
-new ColourSelectorButton colour
+new wx:ColourSelectorButton colour
-new MultipleInputs refresh
+new std:MultipleInputs refresh
-new Div div
- set div.In2 "100"
+new std:Div Adiv
+ set Adiv.In2 "100"
-new UpdateRender Box08
+new vtk:UpdateRender Box08
set Box08.Active "true"
-new MagicBox Box09
+new std:MagicBox Box09
-connect isovalue.Out surface.Isovalue
-connect opacity.Out div.In1
-connect div.Out surface.Opacity
-connect colour.Out surface.Colour
+connect isovalue.Out Asurface.Isovalue
+connect opacity.Out Adiv.In1
+connect Adiv.Out Asurface.Opacity
+connect colour.Out Asurface.Colour
connect isovalue.BoxChange refresh.In1
connect opacity.BoxChange refresh.In2
-connect colour.BoxChange refresh.In3
connect colour.Widget controls.Widget3
connect isovalue.Widget controls.Widget1
connect opacity.Widget controls.Widget2
-connect Box09.Out surface.Renderer
+connect Box09.Out Asurface.Renderer
connect Box09.Out Box08.Renderer
-connect refresh.Out Box08.BoxExecute
-connect refresh.Out surface.BoxExecute
connect opacity.BoxChange refresh.BoxExecute
+connect refresh.BoxChange Asurface.BoxExecute
+connect refresh.BoxChange Box08.BoxExecute
+connect refresh.BoxChange Adiv.BoxExecute
+connect colour.BoxChange refresh.In3
# Complex input ports
input Title controls.WinTitle " "
input Colour colour.In " "
input Vertical controls.Orientation " "
input BoxExecute refresh.In4 " "
-input In surface.In " "
+input In Asurface.In " "
input maxIsovalue isovalue.Max " "
input vtkRenderer Box09.In " "
# Complex output ports
-output Out surface.Out " "
+output Out Asurface.Out " "
output Widget controls.Widget " "
-output BoxChange refresh.Out " "
+output BoxChange refresh.BoxChange " "
+message
endefine