i++)
{
std::string full_path(*i);
-printf("EED InterpreterVirtual::SwitchToFile 1. >>%s\n", full_path.c_str() );
// we *really* want '.' to be the current working directory
if (full_path == ".")
{
std::vector<std::string>::iterator i;
for (i=script_paths.begin();i!=script_paths.end();i++)
{
-
-printf("EED InterpreterVirtual::SwitchToFile (1) >> %s\n", (*i).c_str() );
bbtkMessage("interpreter",1,
"--> Looking in '" << *i << "'" << std::endl);
for (std::vector<std::string>::iterator j = Filenames.begin();
j!= Filenames.end(); ++j)
{
-
-printf("EED InterpreterVirtual::SwitchToFile (2) >> %s\n", (*j).c_str() );
-
int lgr = (*j).size();
if (lgr < 5) continue;
// ignore non .bbp file
bbtkError("No ["<<pkgname<<".bbs/.bbp] script found");
return;
} else {
-//EED printf("EED D. SwitchToFile %s\n", fullPathScriptName.c_str() );
LoadScript(fullPathScriptName,name);
-//EED Borrame if (source) GetExecuter()->SetCurrentFileName(fullPathScriptName);
if (source)
{
// Over writing the fullpath of the bbp file.
virtual void bbDestroyWindow() {}
//==================================================================
+ //==================================================================
+ // method to be added in the proces of a window
+ virtual void PutWinTitle() {}
+ //==================================================================
private:
WxDialog* w = 0;
w = new WxDialog( GetThisPointer<WxBlackBox>(),
Wx::GetTopWindow(),
- std2wx( bbGetInputWinTitle()
- + " - bbtk (c) CREATIS"),
+// std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS"),
+ std2wx( ConstructWinTitle() ),
wxSize( bbGetInputWinWidth() ,
bbGetInputWinHeight() ) );
w->Show(false);
WxFrame* w = 0;
w = new WxFrame( GetThisPointer<WxBlackBox>(),
Wx::GetTopWindow(),
- std2wx( bbGetInputWinTitle()
- + " - bbtk (c) CREATIS"),
+// std2wx( bbGetInputWinTitle() + " - bbtk (c) CREATIS"),
+ std2wx( ConstructWinTitle() ),
wxSize( bbGetInputWinWidth() ,
bbGetInputWinHeight() ) );
w->Show();
}
//==================================================================
+
+ //==================================================================
+ void WxBlackBox::PutWinTitle()
+ {
+ if ( ! bbIsOutputWidgetConnected() )
+ {
+ wxTopLevelWindow* wParent = (wxTopLevelWindow*)( bbGetOutputWidget()->GetParent() );
+ wParent->SetTitle( std2wx( ConstructWinTitle() ) );
+ } // if
+ }
+ //==================================================================
+
+ //==================================================================
+ std::string WxBlackBox::ConstructWinTitle()
+ {
+ std::string title( bbGetInputWinTitle() + " - bbtk (c) CREATIS");
+ return title;
+ }
+ //==================================================================
+
+
}//namespace bbtk
virtual void bbDestroyWindow();
//==================================================================
+ //==================================================================
+ virtual void PutWinTitle();
+ //==================================================================
+
+ virtual std::string ConstructWinTitle();
+
private:
wxWindow* bbmWindow;
// We create an interpolator of the found type
typename InterpolatorType::Pointer interpolator = InterpolatorType::New();
filter->SetInterpolator( interpolator );
-printf("EED ResampleImageFilter NearestNeighbor \n");
}
else if ( bbGetInputInterpolation() == "BSpline") {
-printf("EED ResampleImageFilter BSpline \n");
typedef itk::BSplineInterpolateImageFunction < ImageType, double > InterpolatorType;
// We create an interpolator of the found type
typename InterpolatorType::Pointer interpolator = InterpolatorType::New();
} //end else if
// Interpolation
else { // if ( bbGetInputInterpolation() == "Linear" ) {
-printf("EED ResampleImageFilter Linear \n");
typedef itk::LinearInterpolateImageFunction < ImageType, double > InterpolatorType;
// We create an interpolator of the found type
typename InterpolatorType::Pointer interpolator = InterpolatorType::New();
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/ApplyMaskWithTransparence.bbg
+# - ApplyMaskWithTransparence.bbg
# ----------------------------------
APP_START
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/ApplyMaskWithTransparence.bbs
+# - ApplyMaskWithTransparence.bbs
# ----------------------------------
include std
category "<VOID>"
-new BinaryOperations Box06
+new vtk:BinaryOperations Box06
set Box06.Operation "2"
-new ImageVtkProperties Box16
+new vtk:ImageVtkProperties Box16
-new BinaryOperations Box20
+new vtk:BinaryOperations Box20
-new GetVectorFloatElement Box22
+new std:GetVectorFloatElement Box22
set Box22.I "0"
-new RescaleSlopeIntercept Box23
+new vtk:RescaleSlopeIntercept Box23
set Box23.OutputFormat "VTK_DOUBLE"
set Box23.Type "1"
-new UnaryOperations Box24
+new vtk:UnaryOperations Box24
set Box24.InConstant "1"
set Box24.Operation "11"
-new vtkImageDataPointerRelay Box18
+new vtk:vtkImageDataPointerRelay Box18
-new vtkImageDataPointerRelay Box19
+new vtk:vtkImageDataPointerRelay Box19
-new UnaryOperations Box09
+new vtk:UnaryOperations Box09
set Box09.Operation "3"
-new ImageVtkProperties Box10
+new vtk:ImageVtkProperties Box10
-new GetVectorFloatElement Box11
+new std:GetVectorFloatElement Box11
set Box11.I "1"
-new RescaleSlopeIntercept Box12
+new vtk:RescaleSlopeIntercept Box12
set Box12.OutputFormat "VTK_DOUBLE"
# Complex output ports
output OutImage Box20.Out " "
-message
endefine
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/BaseViewerInfo.bbg
+# - BaseViewerInfo.bbg
# ----------------------------------
APP_START
creaMaracasVisu:ViewerNV:Box02
ISEXEC:FALSE
-54.569378:0.907343:-900.000000
-6.070622:-9.092657:-900.000000
+-8.994378:-9.092657:-900.000000
FIN_BOX
BOX
wx:LayoutTab:Box03
wx:LayoutLine:Box14
ISEXEC:FALSE
-44.314991:-50.436135:-900.000000
-13.245009:-60.436135:-900.000000
+1.260009:-60.436135:-900.000000
PORT
Orientation:"H"
PORT
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/BaseViewerInfo.bbs
+# - BaseViewerInfo.bbs
# ----------------------------------
include std
category "<VOID>"
-new SaveMHD-Button Box00
+new toolsbbtk:SaveMHD-Button Box00
-new ViewerNV Box02
+new creaMaracasVisu:ViewerNV Box02
-new LayoutTab Box03
+new wx:LayoutTab Box03
-new vtkImageDataPointerRelay Box09
+new vtk:vtkImageDataPointerRelay Box09
-new ImageVtkPropertiesWidget Box10
+new toolsbbtk:ImageVtkPropertiesWidget Box10
-new LayoutLine Box07
+new wx:LayoutLine Box07
set Box07.Orientation "H"
set Box07.WinTitle "Info"
-new RescaleSlopeIntercept Box08
+new vtk:RescaleSlopeIntercept Box08
set Box08.A "0"
set Box08.B "90"
set Box08.OutputFormat "VTK_UNSIGNED_SHORT"
set Box08.Type "2"
-new ImageChangeInformation Box11
+new creaMaracasVisu:ImageChangeInformation Box11
set Box11.NewSpacing "1 1 1"
-new ColorLayerImageView Box12
+new creaMaracasVisu:ColorLayerImageView Box12
set Box12.Active "false"
set Box12.lstBaseColor "0 0 1 0 1 1 1 1 0 1 0 0"
-new LayoutLine Box13
+new wx:LayoutLine Box13
set Box13.WinTitle "Color Layer"
-new LayoutLine Box14
+new wx:LayoutLine Box14
set Box14.Orientation "H"
set Box14.WinTitle "View"
# Complex output ports
output widget Box03.Widget " "
-message
endefine
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /tmpEED/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
+# - imageVtkPropertiesWidget.bbg
# ----------------------------------
APP_START
wx:OutputText:Box10
ISEXEC:FALSE
-196.439793:65.504307:-900.000000
--150.864793:55.504307:-900.000000
+-150.584398:55.504307:-900.000000
PORT
Title:"Components"
FIN_BOX
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /tmpEED/creaTools/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
+# - imageVtkPropertiesWidget.bbs
# ----------------------------------
include std
output Spacing Box09.Spacing " "
output TypeName Box09.TypeName " "
-message
endefine
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /tmpEED/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/RescaleSlopeIntercept_Interface.bbg
+# - RescaleSlopeIntercept_Interface.bbg
# ----------------------------------
APP_START
wx:LayoutLine:Box06
ISEXEC:TRUE
39.929176:-34.289764:-900.000000
-97.489176:-44.289764:-900.000000
+85.504176:-44.289764:-900.000000
FIN_BOX
BOX
wx:ComboBox:Box07
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /tmpEED/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/RescaleSlopeIntercept_Interface.bbs
+# - RescaleSlopeIntercept_Interface.bbs
# ----------------------------------
include std
output Format Box08.OutString " "
output Type Box07.Out " "
-message
exec Box06
endefine
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/TransformWidget.bbg
+# - TransformWidget.bbg
# ----------------------------------
APP_START
wx:Slider:Box03
ISEXEC:FALSE
-197.665356:146.434686:-900.000000
--158.227070:136.434686:-900.000000
+-132.404978:136.434686:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:Box04
ISEXEC:FALSE
-153.996282:129.813557:-900.000000
--121.221282:119.813557:-900.000000
+-119.179436:119.813557:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:Box09
ISEXEC:FALSE
28.124282:58.249919:-900.000000
-79.524282:48.249919:-900.000000
+60.899282:48.249919:-900.000000
PORT
ChangeResolution:"true"
PORT
std:ConcatStrings:Box15
ISEXEC:FALSE
-224.132618:19.025896:-900.000000
--178.557618:9.025896:-900.000000
+-152.840652:9.025896:-900.000000
PORT
In2:" "
PORT
vtk:Transform:Box34
ISEXEC:FALSE
-227.533440:-90.367558:-900.000000
--181.958440:-100.367558:-900.000000
+-169.142393:-100.367558:-900.000000
FIN_BOX
BOX
std:Add:Box35
std:Add:Box55
ISEXEC:FALSE
-246.170786:89.536993:-900.000000
--210.461013:79.536993:-900.000000
+-184.093423:79.536993:-900.000000
FIN_BOX
BOX
std:GetVectorDoubleElement:Box56
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/TransformWidget.bbs
+# - TransformWidget.bbs
# ----------------------------------
include std
category "<VOID>"
-new LayoutTab Box00
+new wx:LayoutTab Box00
-new LayoutLine Box01
+new wx:LayoutLine Box01
set Box01.WinTitle "Rotation"
-new Slider Box03
+new wx:Slider Box03
set Box03.ChangeResolution "true"
set Box03.Label "true"
set Box03.Max "180"
set Box03.ReactiveOnTrack "true"
set Box03.Title "Rotation X"
-new Slider Box04
+new wx:Slider Box04
set Box04.ChangeResolution "true"
set Box04.Label "true"
set Box04.Max "180"
set Box04.ReactiveOnTrack "true"
set Box04.Title "Rotation Y"
-new Slider Box05
+new wx:Slider Box05
set Box05.ChangeResolution "true"
set Box05.Label "true"
set Box05.Max "180"
set Box05.ReactiveOnTrack "true"
set Box05.Title "Rotation Z"
-new LayoutLine Box06
+new wx:LayoutLine Box06
set Box06.WinTitle "Translate"
-new Slider Box07
+new wx:Slider Box07
set Box07.ChangeResolution "true"
set Box07.Label "true"
set Box07.Max "1800"
set Box07.ReactiveOnTrack "true"
set Box07.Title "Translation X"
-new Slider Box08
+new wx:Slider Box08
set Box08.ChangeResolution "true"
set Box08.Label "true"
set Box08.Max "1800"
set Box08.ReactiveOnTrack "true"
set Box08.Title "Translation Y"
-new Slider Box09
+new wx:Slider Box09
set Box09.ChangeResolution "true"
set Box09.Label "true"
set Box09.Max "1800"
set Box09.ReactiveOnTrack "true"
set Box09.Title "Translation Z"
-new LayoutLine Box10
+new wx:LayoutLine Box10
set Box10.WinTitle "Scale"
-new Slider Box11
+new wx:Slider Box11
set Box11.ChangeResolution "true"
set Box11.In "100"
set Box11.Label "true"
set Box11.ReactiveOnTrack "true"
set Box11.Title "Scale X"
-new Slider Box12
+new wx:Slider Box12
set Box12.ChangeResolution "true"
set Box12.In "100"
set Box12.Label "true"
set Box12.ReactiveOnTrack "true"
set Box12.Title "Scale Y"
-new Slider Box13
+new wx:Slider Box13
set Box13.ChangeResolution "true"
set Box13.In "100"
set Box13.Label "true"
set Box13.ReactiveOnTrack "true"
set Box13.Title "Scale Z"
-new Transform Box14
+new vtk:Transform Box14
-new ConcatStrings Box15
+new std:ConcatStrings Box15
set Box15.In2 " "
set Box15.In3 "1 0 0"
-new ConcatStrings Box16
+new std:ConcatStrings Box16
set Box16.In2 " "
set Box16.In4 " "
-new MultipleInputs Box17
+new std:MultipleInputs Box17
-new MultipleInputs Box18
+new std:MultipleInputs Box18
-new MultipleInputs Box19
+new std:MultipleInputs Box19
-new MultipleInputs Box20
+new std:MultipleInputs Box20
-new Div Box22
+new std:Div Box22
set Box22.In2 "100"
-new Div Box23
+new std:Div Box23
set Box23.In2 "100"
-new Div Box24
+new std:Div Box24
set Box24.In2 "100"
-new Transform Box28
+new vtk:Transform Box28
-new ConcatStrings Box29
+new std:ConcatStrings Box29
set Box29.In2 " "
set Box29.In3 "0 1 0"
-new Transform Box30
+new vtk:Transform Box30
-new ConcatStrings Box31
+new std:ConcatStrings Box31
set Box31.In2 " "
set Box31.In3 "0 0 1"
-new Transform Box32
+new vtk:Transform Box32
-new Transform Box33
+new vtk:Transform Box33
-new Transform Box34
+new vtk:Transform Box34
-new Add Box35
+new std:Add Box35
-new GetVectorDoubleElement Box36
+new std:GetVectorDoubleElement Box36
set Box36.ErrorValue "0"
set Box36.I "0"
-new Add Box40
+new std:Add Box40
-new GetVectorDoubleElement Box41
+new std:GetVectorDoubleElement Box41
set Box41.ErrorValue "0"
set Box41.I "1"
-new Add Box42
+new std:Add Box42
-new GetVectorDoubleElement Box43
+new std:GetVectorDoubleElement Box43
set Box43.ErrorValue "0"
set Box43.I "2"
-new Add Box44
+new std:Add Box44
-new ConcatStrings Box45
+new std:ConcatStrings Box45
set Box45.In2 " "
set Box45.In4 " "
-new GetVectorDoubleElement Box47
+new std:GetVectorDoubleElement Box47
set Box47.ErrorValue "1"
set Box47.I "0"
-new GetVectorDoubleElement Box49
+new std:GetVectorDoubleElement Box49
set Box49.ErrorValue "1"
set Box49.I "1"
-new GetVectorDoubleElement Box50
+new std:GetVectorDoubleElement Box50
set Box50.ErrorValue "1"
set Box50.I "2"
-new MagicBox Box52
+new std:MagicBox Box52
-new MagicBox Box53
+new std:MagicBox Box53
-new Add Box55
+new std:Add Box55
-new GetVectorDoubleElement Box56
+new std:GetVectorDoubleElement Box56
set Box56.ErrorValue "0"
set Box56.I "0"
-new Add Box57
+new std:Add Box57
-new GetVectorDoubleElement Box58
+new std:GetVectorDoubleElement Box58
set Box58.ErrorValue "0"
set Box58.I "1"
-new GetVectorDoubleElement Box59
+new std:GetVectorDoubleElement Box59
set Box59.ErrorValue "0"
set Box59.I "2"
-new Add Box60
+new std:Add Box60
-new MagicBox Box61
+new std:MagicBox Box61
-new Mul Box62
+new std:Mul Box62
-new Mul Box63
+new std:Mul Box63
-new Mul Box64
+new std:Mul Box64
connect Box01.Widget Box00.Widget1
output Transform Box33.Out " "
output BoxChange Box33.BoxChange " "
-message
endefine
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /tmpEED/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbg
+# - bbIsoSurfaceExtractor.bbg
# ----------------------------------
APP_START
vtk:PolyDataToActor:polydatatoactor
ISEXEC:FALSE
-89.255289:4.468457:-900.000000
--18.080289:-5.531543:-900.000000
+-43.680289:-5.531543:-900.000000
FIN_BOX
BOX
std:MultipleInputs:Box03
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /tmpEED/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/bbIsoSurfaceExtractor.bbs
+# - bbIsoSurfaceExtractor.bbs
# ----------------------------------
include std
# Complex output ports
output Out polydatatoactor.Out " "
-message
endefine
}
- void LayoutLine::Process()
- {
- }
+ void LayoutLine::Process()
+ {
+ PutWinTitle();
+ }
/*
{
}
- void LayoutSplit::Process()
- {
- }
+ void LayoutSplit::Process()
+ {
+ PutWinTitle();
+ }
void LayoutSplit::CreateWidget(wxWindow* parent)
{
#include "bbwxLayoutTab.h"
#include "bbwxPackage.h"
#include "bbtkUtilities.h"
-
+#include "bbtkBlackBoxInputConnector.h"
{
}
-
//-----------------------------------------------------------------
void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
{
wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
if (w!=NULL)
- {
- book->AddPage(w,w->GetName());
- }
+ {
+ book->AddPage(w,w->GetName());
+ }
+ }
+
+
+ void LayoutTab::SetTitleTabs()
+ {
+
+ std::vector<std::string> vecTitle;
+ std::vector<std::string> vecInputNameWidget;
+ vecInputNameWidget.push_back("Widget1");
+ vecInputNameWidget.push_back("Widget2");
+ vecInputNameWidget.push_back("Widget3");
+ vecInputNameWidget.push_back("Widget4");
+ vecInputNameWidget.push_back("Widget5");
+ vecInputNameWidget.push_back("Widget6");
+ vecInputNameWidget.push_back("Widget7");
+ vecInputNameWidget.push_back("Widget8");
+ vecInputNameWidget.push_back("Widget9");
+ int iWidget,sizeVecInputNameWidget= vecInputNameWidget.size();
+ for (iWidget=0; iWidget<sizeVecInputNameWidget; iWidget++)
+ {
+ bbtk::BlackBoxInputConnector* c = bbGetInputConnectorMap().find( vecInputNameWidget[iWidget] )->second ;
+ if ( c->IsConnected() )
+ {
+ // Get black box from
+ BlackBox::Pointer from = c->GetConnection()->GetBlackBoxFrom();
+ typename WidgetBlackBox<wxWindow>::Pointer wfrom
+ = boost::dynamic_pointer_cast<WidgetBlackBox<wxWindow> >(from);
+ vecTitle.push_back( wfrom->bbGetInputWinTitle() );
+ } // if c
+ } // for iWidget
+
+
+ wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+ if (w!=NULL)
+ {
+ int i,size=vecTitle.size();
+ for (i=0; i<size; i++)
+ {
+ w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) );
+ } // for i
+ } //w
}
+
void LayoutTab::Process()
{
+ PutWinTitle();
+ SetTitleTabs();
}
void OnShowWidget();
protected:
+ void SetTitleTabs();
void TryInsertWindow(wxNotebook *book, const std::string& input);
};
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /tmpEED/creaTools/creatools_source/bbtk/packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbg
+# - bbIsoSurfaceWidget.bbg
# ----------------------------------
APP_START
vtk:IsoSurfaceExtractor:Asurface
ISEXEC:FALSE
43.917303:-225.853762:-900.000000
-115.092303:-235.853762:-900.000000
+89.492303:-235.853762:-900.000000
FIN_BOX
BOX
wx:Slider:isovalue
ISEXEC:FALSE
98.069545:33.134653:-900.000000
-149.469545:23.134653:-900.000000
+130.844545:23.134653:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:opacity
ISEXEC:FALSE
32.910163:-25.716566:-900.000000
-84.310163:-35.716566:-900.000000
+65.685163:-35.716566:-900.000000
PORT
In:"100"
PORT
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /tmpEED/creaTools/creatools_source/bbtk/packages/wxvtk/bbs/boxes/bbIsoSurfaceWidget.bbs
+# - bbIsoSurfaceWidget.bbs
# ----------------------------------
include std
output Widget controls.Widget " "
output BoxChange refresh.BoxChange " "
-message
endefine