COMPLEXINPUTS:5
COMPLEX_PORT
Image
--85.916642:51.532520:-900.000000
+-82.600387:87.016452:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
TitleAtribute
-38.925088:53.676472:-900.000000
+36.935335:85.180898:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
wxvtkbaseview_01
BOX
toolsbbtk:SaveMHD-Button:Box00
ISEXEC:FALSE
--110.966828:-4.496330:-900.000000
--65.391828:-14.496330:-900.000000
+-106.048862:0.749501:-900.000000
+-60.473862:-9.250499:-900.000000
FIN_BOX
BOX
creaMaracasVisu:ViewerNV:Box02
ISEXEC:FALSE
--61.126666:-4.994216:-900.000000
--15.551666:-14.994216:-900.000000
+-54.569378:0.907343:-900.000000
+6.070622:-9.092657:-900.000000
FIN_BOX
BOX
wx:LayoutTab:Box03
30.695720:-114.285815:-900.000000
FIN_BOX
BOX
-wx:LayoutSplit:Box04
-ISEXEC:FALSE
--44.771221:-81.345902:-900.000000
-0.803779:-91.345902:-900.000000
-PORT
-Orientation:"V"
-PORT
-Proportion:"30"
-PORT
-WinTitle:"Info. image"
-FIN_BOX
-BOX
vtk:vtkImageDataPointerRelay:Box09
ISEXEC:FALSE
-91.353292:33.000764:-900.000000
BOX
toolsbbtk:ImageVtkPropertiesWidget:Box10
ISEXEC:FALSE
--186.562751:-2.876554:-900.000000
--115.387751:-12.876554:-900.000000
+-180.333327:2.041412:-900.000000
+-109.158327:-7.958588:-900.000000
FIN_BOX
BOX
wx:LayoutLine:Box07
-66.494068:-62.859982:-900.000000
PORT
Orientation:"H"
+PORT
+WinTitle:"Info"
FIN_BOX
BOX
vtk:RescaleSlopeIntercept:Box08
PORT
A:"0"
PORT
-B:"1000"
+B:"90"
PORT
OutputFormat:"VTK_UNSIGNED_SHORT"
PORT
119.643147:-55.369167:-900.000000
PORT
Active:"false"
+PORT
+lstBaseColor:"0 0 1 0 1 1 1 1 0 1 0 0"
FIN_BOX
BOX
wx:LayoutLine:Box13
ISEXEC:FALSE
53.203629:-68.313438:-900.000000
-110.763629:-78.313438:-900.000000
+98.778629:-78.313438:-900.000000
PORT
WinTitle:"Color Layer"
FIN_BOX
+BOX
+wx:LayoutLine:Box14
+ISEXEC:FALSE
+-44.314991:-50.436135:-900.000000
+13.245009:-60.436135:-900.000000
+PORT
+Orientation:"H"
+PORT
+WinTitle:"View"
+FIN_BOX
CONNECTIONS:19
CONNECTION
-Box02:Widget:Box04:Widget2
-NumberOfControlPoints:0
-CONNECTION
Image:Image:Box09:In
NumberOfControlPoints:0
CONNECTION
Box10:widget:Box07:Widget1
NumberOfControlPoints:0
CONNECTION
-Box07:Widget:Box04:Widget1
-NumberOfControlPoints:0
-CONNECTION
-Box04:Widget:Box03:Widget1
-NumberOfControlPoints:0
-CONNECTION
Box03:Widget:widget:widget
NumberOfControlPoints:0
CONNECTION
Box11:Out:Box12:In
NumberOfControlPoints:0
CONNECTION
-wxvtkbaseview_01:wxvtkbaseview_01:Box12:WxVtkBaseView
+wxvtkbaseview_03:wxvtkbaseview_03:Box12:WxVtkBaseView2
+NumberOfControlPoints:0
+CONNECTION
+Box12:Widget:Box13:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box07:Widget:Box03:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box14:Widget1
NumberOfControlPoints:0
CONNECTION
wxvtkbaseview_02:wxvtkbaseview_02:Box12:WxVtkBaseView1
NumberOfControlPoints:0
CONNECTION
-wxvtkbaseview_03:wxvtkbaseview_03:Box12:WxVtkBaseView2
+wxvtkbaseview_01:wxvtkbaseview_01:Box12:WxVtkBaseView
NumberOfControlPoints:0
CONNECTION
-Box12:Widget:Box13:Widget1
+Box13:Widget:Box03:Widget1
NumberOfControlPoints:0
CONNECTION
-Box13:Widget:Box03:Widget2
+Box14:Widget:Box03:Widget2
NumberOfControlPoints:0
APP_END
new LayoutTab Box03
-new LayoutSplit Box04
- set Box04.Orientation "V"
- set Box04.Proportion "30"
- set Box04.WinTitle "Info. image"
-
new vtkImageDataPointerRelay Box09
new ImageVtkPropertiesWidget Box10
new LayoutLine Box07
set Box07.Orientation "H"
+ set Box07.WinTitle "Info"
new RescaleSlopeIntercept Box08
set Box08.A "0"
- set Box08.B "1000"
+ set Box08.B "90"
set Box08.OutputFormat "VTK_UNSIGNED_SHORT"
set Box08.Type "2"
new ColorLayerImageView Box12
set Box12.Active "false"
+ set Box12.lstBaseColor "0 0 1 0 1 1 1 1 0 1 0 0"
new LayoutLine Box13
set Box13.WinTitle "Color Layer"
+new LayoutLine Box14
+ set Box14.Orientation "H"
+ set Box14.WinTitle "View"
+
-connect Box02.Widget Box04.Widget2
connect Box09.Out Box00.In
connect Box09.Out Box10.in
connect Box09.Out Box02.In
connect Box00.Widget Box07.Widget2
connect Box10.widget Box07.Widget1
-connect Box07.Widget Box04.Widget1
-connect Box04.Widget Box03.Widget1
connect Box09.Out Box08.In
connect Box08.Out Box11.In
connect Box11.Out Box12.In
connect Box12.Widget Box13.Widget1
-connect Box13.Widget Box03.Widget2
+connect Box07.Widget Box03.Widget3
+connect Box02.Widget Box14.Widget1
+connect Box13.Widget Box03.Widget1
+connect Box14.Widget Box03.Widget2
# Complex input ports
input Image Box09.In " "
input TitleAtribute Box03.WinTitle " "
-input wxvtkbaseview_01 Box12.WxVtkBaseView " "
-input wxvtkbaseview_02 Box12.WxVtkBaseView1 " "
input wxvtkbaseview_03 Box12.WxVtkBaseView2 " "
+input wxvtkbaseview_02 Box12.WxVtkBaseView1 " "
+input wxvtkbaseview_01 Box12.WxVtkBaseView " "
# Complex output ports
output widget Box03.Widget " "
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/All/creatools_source/bbtk/packages/vtk/bbs/boxes/TransformWidget.bbg
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/TransformWidget.bbg
# ----------------------------------
APP_START
BoxChange
-190.649216:-158.865916:-900.000000
FIN_COMPLEX_PORT
-COMPLEXINPUTS:0
+COMPLEXINPUTS:1
+COMPLEX_PORT
+TitleWindow
+36.138665:171.471207:-900.000000
+FIN_COMPLEX_PORT
BOXES:29
BOX
wx:LayoutTab:Box00
ISEXEC:FALSE
14.507537:-147.233687:-900.000000
-60.082537:-157.233687:-900.000000
+72.067537:-157.233687:-900.000000
FIN_BOX
BOX
wx:LayoutLine:Box01
ISEXEC:FALSE
-41.534584:-108.537426:-900.000000
-4.040416:-118.537426:-900.000000
+16.025416:-118.537426:-900.000000
PORT
WinTitle:"Rotation"
FIN_BOX
wx:Slider:Box03
ISEXEC:FALSE
-197.665356:146.434686:-900.000000
--132.404978:136.434686:-900.000000
+-146.265356:136.434686:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:Box04
ISEXEC:FALSE
-153.996282:129.813557:-900.000000
--119.179436:119.813557:-900.000000
+-102.596282:119.813557:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:Box05
ISEXEC:FALSE
-68.019168:146.959188:-900.000000
--35.244168:136.959188:-900.000000
+-16.619168:136.959188:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:LayoutLine:Box06
ISEXEC:FALSE
23.720064:-108.213700:-900.000000
-69.295064:-118.213700:-900.000000
+81.280064:-118.213700:-900.000000
PORT
WinTitle:"Translate"
FIN_BOX
wx:Slider:Box07
ISEXEC:FALSE
-11.514057:86.479654:-900.000000
-21.260943:76.479654:-900.000000
+39.885943:76.479654:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:Box08
ISEXEC:FALSE
6.385006:71.964258:-900.000000
-39.160006:61.964258:-900.000000
+57.785006:61.964258:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:Box09
ISEXEC:FALSE
28.124282:58.249919:-900.000000
-60.899282:48.249919:-900.000000
+79.524282:48.249919:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:LayoutLine:Box10
ISEXEC:FALSE
101.086854:-111.014230:-900.000000
-146.661854:-121.014230:-900.000000
+158.646854:-121.014230:-900.000000
PORT
WinTitle:"Scale"
FIN_BOX
wx:Slider:Box11
ISEXEC:FALSE
70.956408:111.372736:-900.000000
-103.731408:101.372736:-900.000000
+122.356408:101.372736:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:Box12
ISEXEC:FALSE
88.855471:96.857340:-900.000000
-121.630471:86.857340:-900.000000
+140.255471:86.857340:-900.000000
PORT
ChangeResolution:"true"
PORT
wx:Slider:Box13
ISEXEC:FALSE
102.852794:83.842614:-900.000000
-135.627794:73.842614:-900.000000
+154.252794:73.842614:-900.000000
PORT
ChangeResolution:"true"
PORT
std:ConcatStrings:Box15
ISEXEC:FALSE
-223.525177:80.984845:-900.000000
--152.540071:70.984845:-900.000000
+-177.950177:70.984845:-900.000000
PORT
In2:" "
PORT
vtk:Transform:Box28
ISEXEC:FALSE
-235.026591:62.160050:-900.000000
--171.547037:52.160050:-900.000000
+-189.451591:52.160050:-900.000000
FIN_BOX
BOX
std:ConcatStrings:Box29
-116.001331:8.470310:-900.000000
-70.426331:-1.529690:-900.000000
FIN_BOX
-CONNECTIONS:48
+CONNECTIONS:49
CONNECTION
Box01:Widget:Box00:Widget1
NumberOfControlPoints:0
CONNECTION
Box32:Out:Box14:In
NumberOfControlPoints:0
+CONNECTION
+TitleWindow:TitleWindow:Box00:WinTitle
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/All/creatools_source/bbtk/packages/vtk/bbs/boxes/TransformWidget.bbs
+# - /home/davila/Creatis/creaTools/creatools_source/bbtk/packages/vtk/bbs/boxes/TransformWidget.bbs
# ----------------------------------
include std
connect Box32.Out Box14.In
# Complex input ports
+input TitleWindow Box00.WinTitle " "
# Complex output ports
output Transform Box14.Out " "
output Window Box00.Widget " "
output BoxChange Box14.BoxChange " "
+message
endefine
#include <string>
#include <wx/choice.h>
+#include <wx/control.h>
+#include <wx/listbox.h>
namespace bbwx
{
ComboBoxWidget( ComboBox* box, wxWindow *parent,
int iSelection,
std::string title,
- std::vector< std::string > lstIn );
+ std::vector< std::string > lstIn,
+ int typeForm );
~ComboBoxWidget();
void OnComboBox(wxEvent& event);
private:
- ComboBox *mBox;
+ int mTypeForm;
+ ComboBox *mBox;
+ wxListBox *wxlistbox;
wxChoice *wxchoice;
};
wxWindow *parent,
int iSelection,
std::string title,
- std::vector< std::string > lstIn )
+ std::vector< std::string > lstIn,
+ int typeForm)
:
wxPanel( parent, -1) ,
- mBox(box)
+ mBox(box),
+ mTypeForm(typeForm)
{
- wxPanel *panel = this;
+ wxPanel *panel = this;
+ wxlistbox = NULL;
+ wxchoice = NULL;
+ int i;
-
- //---------------------------------------------------------------------
- // 1) Creation de wxChoise widget
-
- wxchoice = new wxChoice ( panel , -1 );
-
- Connect( wxchoice->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
-
- int i;
- for (i=0;i<lstIn.size(); i++)
- {
- wxchoice->Append( bbtk::std2wx( lstIn[i] ) );
- } // for i
- wxchoice->SetSelection(iSelection);
//---------------------------------------------------------------------
// 2) Insertion of the components in the window
{
sizer->Add( new wxStaticText(panel,-1, bbtk::std2wx(title) ) );
}
- sizer->Add( wxchoice,1,wxGROW );
sizer->AddGrowableCol(0);
panel->SetSizer(sizer);
+
+ //---------------------------------------------------------------------
+ // 1) Creation de wxChoise widget
+
+ if (mTypeForm==1)
+ {
+
+ wxlistbox = new wxListBox ( panel , -1 );
+ Connect( wxlistbox->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
+ for (i=0;i<lstIn.size(); i++)
+ {
+ wxlistbox->Append( bbtk::std2wx( lstIn[i] ) );
+ } // for i
+ wxlistbox->SetSelection(iSelection);
+ sizer->Add( wxlistbox,1,wxGROW );
+
+ } else {
+
+ wxchoice = new wxChoice ( panel , -1 );
+ Connect( wxchoice->GetId(), wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
+ for (i=0;i<lstIn.size(); i++)
+ {
+ wxchoice->Append( bbtk::std2wx( lstIn[i] ) );
+ } // for i
+ wxchoice->SetSelection(iSelection);
+ sizer->Add( wxchoice,1,wxGROW );
+ }
+
+
// panel->SetAutoLayout(true);
// panel->Layout();
//--------------------------------------------------------------------------
void ComboBoxWidget::OnComboBox(wxEvent& event)
{
+ int iSelection;
+ if (mTypeForm==1)
+ {
+ iSelection = wxlistbox->GetSelection();
+ } else {
+ iSelection = wxchoice->GetSelection();
+ }
- int iSelection = wxchoice->GetSelection();
mBox->bbSetInputSelection( iSelection );
-
mBox->bbSetOutputOut( iSelection );
mBox->bbSetOutputOutString( bbtk::wx2std( wxchoice->GetString(iSelection) ) );
mBox->bbSignalOutputModification("Out");
parent,
bbGetInputSelection() ,
bbGetInputTitle(),
- bbGetInputIn() );
+ bbGetInputIn(),
+ bbGetInputForm() );
bbSetOutputOut( bbGetInputSelection() );
bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
{
bbSetInputSelection(0);
bbSetInputTitle("");
+ bbSetInputForm(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)
BBTK_DECLARE_INPUT(Title,std::string);
BBTK_DECLARE_INPUT(Selection, int );
BBTK_DECLARE_INPUT(In,std::vector< std::string >);
+ BBTK_DECLARE_INPUT(Form, int );
BBTK_DECLARE_OUTPUT(Out, int );
BBTK_DECLARE_OUTPUT(OutString, std::string );
BBTK_PROCESS(Process);
BBTK_INPUT(ComboBox,Title,"Title prepended to the text",std::string,"");
BBTK_INPUT(ComboBox,Selection,"i element to be selected (default 0)",int,"");
BBTK_INPUT(ComboBox,In,"Vector of strings",std::vector< std::string >,"");
+ BBTK_INPUT(ComboBox,Form,"0 Combobox, 1 List (default 0)",int,"");
BBTK_OUTPUT(ComboBox,Out,"i Item selected",int,"");
BBTK_OUTPUT(ComboBox,OutString,"string Item selected",std::string,"");
if (FD->GetReturnCode()==wxID_OK)
{
bbSetOutputOut( bbtk::wx2std (FD->GetPath()) );
+ bbSignalOutputModification(std::string("Out"));
}
else
{