@ONLY
)
IF (WIN32)
- INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
- DESTINATION "." )
+ CONFIGURE_FILE(
+ ${BBTK_CMAKE_DIR}/PlugPackage.bat.in
+ ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat
+ COPYONLY
+ )
+ INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage DESTINATION "." )
+ INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat DESTINATION "." )
ENDIF (WIN32)
#---------------------------------------------------------------------------
ELSE(NOT BBTK_CORE_PACKAGE)
@ONLY
)
IF (WIN32)
- INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage
- DESTINATION "." )
+ CONFIGURE_FILE(
+ ${BBTK_CMAKE_DIR}/PlugPackage.bat.in
+ ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat
+ COPYONLY
+ )
+ INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/bbtkPackage DESTINATION "." )
+ INSTALL ( FILES ${${BBTK_PACKAGE_NAME}_BINARY_DIR}/PlugPackage.bat DESTINATION "." )
ENDIF (WIN32)
#---------------------------------------------------------------------------
ELSE(NOT BBTK_CORE_PACKAGE)
--- /dev/null
+bbPlugPackage %~dp0
+pause
\ No newline at end of file
std::string BlackBox::bbGetNameWithParent() const
{
if (bbmParent.lock())
- {
- return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName;
- }
- else
- {
- return bbmName;
- }
+ {
+ return bbmParent.lock()->bbGetNameWithParent() + ":" + bbmName;
+ } else {
+ return bbmName;
+ }
}
//=========================================================================
// SIGNAL/SLOT MECHANISM
// FOR bbtk WINDOWS CREATION/DESTRUCTION OBSERVATION
// BBTKWXSIG
-#include <boost/signal.hpp>
+
+//EED 2020-03-17
+//#include <boost/signal.hpp>
+#include <boost/signals2/signal.hpp>
+
#include <boost/bind.hpp>
//typedef boost::signals::trackable SignalObserver;
// BBTKWXSIG
// The keyword 'signals' is also a macro in qt
// typedef boost::signals::trackable SignalObserver;
- typedef boost::signals::trackable SignalObserver;
- typedef boost::signal<void ()> Signal_type;
+
+// typedef boost::signals::trackable SignalObserver;
+// typedef boost::signal<void ()> Signal_type;
+
+ typedef boost::signals2::trackable SignalObserver;
+ typedef boost::signals2::signal<void ()> Signal_type;
+
typedef Signal_type::slot_function_type Slot_function_type;
// \BBTKWXSIG
DirName = bbGetInputIn();
/*int nbFiles = */ Explore(DirName, bbGetInputRecursive(), bbGetInputRecursiveLevel() );
CleanFilenames( DirName );
- bbSetOutputOut(Filenames);
- bbSetOutputOutSimple(SimpleFilenames);
} // if In
+ bbSetOutputOut(Filenames);
+ bbSetOutputOutSimple(SimpleFilenames);
}
void FilesFromDirectory::bbUserSetDefaultValues()
void FilesFromDirectory::CleanFilenames( std::string basePath )
{
std::string tmpString;
- int i,ii,sizeFilenames = Filenames.size();
- int j,sizeFileEnd = bbGetInputFileEnd().size();
-
+ int i,ii,sizeFilenames = Filenames.size();
+ int j,sizeFileEnd = bbGetInputFileEnd().size();
int okEraseElement;
-
+ int posStr;
//Selecting just the files in the FileEnd List
if (bbGetInputFileEnd().size()!=0)
{
for (i=sizeFilenames-1; i>=0; i--)
{
- okEraseElement=0;
+ okEraseElement = 0;
for (j=0; j<sizeFileEnd; j++)
{
- std::string tmp=Filenames[i].substr( (Filenames[i].length()) - (bbGetInputFileEnd()[j]).length() ) ;
- if (bbGetInputFileEnd()[j].compare( tmp )==0 )
+ posStr=(Filenames[i].length()) - (bbGetInputFileEnd()[j]).length();
+ if (posStr>=0)
{
- okEraseElement++;
- } // if FileEnd
+ std::string tmp=Filenames[i].substr( posStr ) ;
+ if (bbGetInputFileEnd()[j].compare( tmp )==0 )
+ {
+ okEraseElement++;
+ } // if FileEnd
+ }// if posStr
} // for j
if (okEraseElement==0)
}
} // for i
} // if FileEnd !=0
-
sizeFilenames = Filenames.size();
-
// Cleanning paths with spaces
for (i=0; i<sizeFilenames; i++)
{
tmpString=Filenames[i];
-
std::string::size_type spacePosition = tmpString.find_first_of(' ');
if (spacePosition != std::string::npos)
{
} // if spacePosition
}
-
// Alphabetical order
for (i=0; i<sizeFilenames; i++)
{
} // if
} // for ii
} // for i
-
// Creating SimpleFilenames
unsigned int lenghtBasePath = basePath.length();
for (i=0; i<sizeFilenames; i++)
{
SimpleFilenames.push_back( Filenames[i].substr( lenghtBasePath ) );
} // for i
-
}
BBTK_DESCRIPTION("Gets the i-th element from the input vector ("+bbtk::TypeName<std::vector<T> >());
typedef std::vector<T> Tvector;
BBTK_TEMPLATE_INPUT(GetVectorElement, In,"Input",Tvector);
- BBTK_TEMPLATE_INPUT(GetVectorElement, I, "Input",int);
+ BBTK_TEMPLATE_INPUT(GetVectorElement, I, "iElement (default 0)",int);
BBTK_TEMPLATE_INPUT(GetVectorElement, ErrorValue, "ErrorValue",T);
BBTK_TEMPLATE_OUTPUT(GetVectorElement,Out,"Output",T);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorElement);
template <class T>
void GetVectorElement<T>::bbUserSetDefaultValues()
{
-
+ bbSetInputI(0);
}
//=================================================================
//=================================================================
BBTK_DESCRIPTION("Sets the value of the i-element ("+bbtk::TypeName<std::vector<T> >());
typedef std::vector<T>* pTvector;
BBTK_TEMPLATE_INPUT(SetElementVector, PVec,"Pointer to Vector",pTvector);
- BBTK_TEMPLATE_INPUT(SetElementVector, I, "id-element",int);
+ BBTK_TEMPLATE_INPUT(SetElementVector, I, "id-element (default 0)",int);
BBTK_TEMPLATE_INPUT(SetElementVector, Value, "Input Value",T);
BBTK_TEMPLATE_OUTPUT(SetElementVector,Vec,"Output Vector",std::vector<T>);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(SetElementVector);
template <class T>
void SetElementVector<T>::bbUserSetDefaultValues()
{
-
+ bbSetInputI(0);
}
//=================================================================
//=================================================================
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
# ----------------------------------
-# - BBTKGEditor v 1.2 BBG BlackBox Diagram file
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbg
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbg
# ----------------------------------
APP_START
COMPLEXBOX:TRUE
COMPLEXBOXNAME:ImageItkPropertiesWidget
PACKAGENAME:toolsbbtk
-COMPLEXINPUTS:1
-COMPLEX_PORT
-in
--80.663770:148.604993:900.000000
-FIN_COMPLEX_PORT
-COMPLEXOUTPUTS:7
+COMPLEXOUTPUTS:8
COMPLEX_PORT
widget
--142.967861:-58.247376:900.000000
+-142.967861:-58.247376:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Dimensions
--124.883681:-57.175644:900.000000
+-124.883681:-57.175644:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Index
--108.940640:-56.720128:900.000000
+-108.940640:-56.720128:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
MinMax
--92.628104:-54.898845:900.000000
+-92.628104:-54.898845:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Size
--81.734224:-56.500886:900.000000
+-55.578467:-54.074063:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Spacing
--70.199528:-56.180478:900.000000
+-38.111538:-54.967067:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
TypeName
--57.383199:-56.821294:900.000000
+-25.564856:-54.529295:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+origin
+-75.421485:-52.421824:-900.000000
+FIN_COMPLEX_PORT
+COMPLEXINPUTS:2
+COMPLEX_PORT
+in
+-80.663770:148.604993:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+FileName
+-13.739739:147.116939:-900.000000
FIN_COMPLEX_PORT
-BOXES:8
+BOXES:14
BOX
itk:ImageProperties:Box00
ISEXEC:FALSE
--86.392715:120.167267:900.000000
--40.817715:110.167267:900.000000
+-86.392715:120.167267:-900.000000
+-44.192715:110.167267:-900.000000
FIN_BOX
BOX
wx:OutputText:Box02
ISEXEC:FALSE
--348.493528:57.422012:900.000000
--302.918528:47.422012:900.000000
+-348.493528:57.422012:-900.000000
+-311.718528:47.422012:-900.000000
PORT
Title:"Dimension"
FIN_BOX
BOX
wx:OutputText:Box14
ISEXEC:FALSE
--306.197846:44.988878:900.000000
--260.622846:34.988878:900.000000
+-306.197846:44.988878:-900.000000
+-269.422846:34.988878:-900.000000
PORT
Title:"Index"
FIN_BOX
BOX
wx:LayoutLine:Box15
ISEXEC:FALSE
--196.596247:-31.096236:900.000000
--139.036247:-41.096236:900.000000
+-196.596247:-31.096236:-900.000000
+-139.036247:-41.096236:-900.000000
PORT
WinTitle:"Image Properties"
FIN_BOX
BOX
wx:OutputText:Box17
ISEXEC:FALSE
--262.616712:54.641899:900.000000
--217.041712:44.641899:900.000000
+-262.616712:54.641899:-900.000000
+-225.841712:44.641899:-900.000000
PORT
Title:"Size"
FIN_BOX
BOX
wx:OutputText:Box20
ISEXEC:FALSE
--232.876715:39.300084:900.000000
--187.301715:29.300084:900.000000
+-232.876715:39.300084:-900.000000
+-196.101715:29.300084:-900.000000
PORT
Title:"Spacing"
FIN_BOX
BOX
wx:OutputText:Box22
ISEXEC:FALSE
--191.029461:30.782065:900.000000
--145.454461:20.782065:900.000000
+-191.029461:30.782065:-900.000000
+-154.254461:20.782065:-900.000000
PORT
Title:"TypeName"
FIN_BOX
BOX
wx:OutputText:Box26
ISEXEC:FALSE
--166.067448:13.413901:900.000000
--120.492448:3.413901:900.000000
+-154.877098:-1.551506:-900.000000
+-118.102098:-11.551506:-900.000000
PORT
Title:"Min Max"
FIN_BOX
-CONNECTIONS:20
+BOX
+wx:OutputText:Box09
+ISEXEC:FALSE
+-174.515204:12.516260:-900.000000
+-137.740204:2.516260:-900.000000
+PORT
+Title:"Origin"
+FIN_BOX
+BOX
+std:ConcatStrings:Box10
+ISEXEC:FALSE
+-15.155386:29.281210:-900.000000
+24.569614:19.281210:-900.000000
+PORT
+In2:" "
+PORT
+In4:" "
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box11
+ISEXEC:FALSE
+-11.582563:52.605674:-900.000000
+39.467437:42.605674:-900.000000
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box12
+ISEXEC:FALSE
+8.417437:72.605674:-900.000000
+59.467437:62.605674:-900.000000
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box13
+ISEXEC:FALSE
+28.417437:92.605674:-900.000000
+79.467437:82.605674:-900.000000
+PORT
+I:"2"
+FIN_BOX
+BOX
+wx:OutputText:Box16
+ISEXEC:FALSE
+-141.887920:-15.796672:-900.000000
+-105.112920:-25.796672:-900.000000
+PORT
+Title:"Name"
+FIN_BOX
+CONNECTIONS:31
CONNECTION
Box00:Dimension:Box02:In
NumberOfControlPoints:0
Box22:Widget:Box15:Widget5
NumberOfControlPoints:0
CONNECTION
-Box26:Widget:Box15:Widget6
-NumberOfControlPoints:0
-CONNECTION
Box00:Dimension:Dimensions:Dimensions
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box00:TypeName:TypeName:TypeName
NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:origin:origin
+NumberOfControlPoints:0
+CONNECTION
+Box09:Widget:Box15:Widget6
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box13:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box12:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Origin:Box11:In
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box10:In1
+NumberOfControlPoints:0
+CONNECTION
+Box12:Out:Box10:In3
+NumberOfControlPoints:0
+CONNECTION
+Box13:Out:Box10:In5
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box09:In
+NumberOfControlPoints:0
+CONNECTION
+Box26:Widget:Box15:Widget7
+NumberOfControlPoints:0
+CONNECTION
+Box16:Widget:Box15:Widget9
+NumberOfControlPoints:0
+CONNECTION
+FileName:FileName:Box16:In
+NumberOfControlPoints:0
APP_END
-# ---------------------------------------------------------------------
-#
-# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
-# pour la SantÈ)
-# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
-# Previous Authors : Laurent Guigues, Jean-Pierre Roux
-# CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
-#
-# This software is governed by the CeCILL-B license under French law and
-# abiding by the rules of distribution of free software. You can use,
-# modify and/ or redistribute the software under the terms of the CeCILL-B
-# license as circulated by CEA, CNRS and INRIA at the following URL
-# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-# or in the file LICENSE.txt.
-#
-# As a counterpart to the access to the source code and rights to copy,
-# modify and redistribute granted by the license, users are provided only
-# with a limited warranty and the software's author, the holder of the
-# economic rights, and the successive licensors have only limited
-# liability.
-#
-# The fact that you are presently reading this means that you have had
-# knowledge of the CeCILL-B license and that you accept its terms.
-# ------------------------------------------------------------------------ */
-
-
# ----------------------------------
-# - BBTKGEditor v 1.2 BBS BlackBox Script (Complex Box)
-# - /Users/davila/Creatis/All3/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbs
+# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageItkPropertiesWidget.bbs
# ----------------------------------
include std
include itkvtk
include itk
include wx
+include std
define ImageItkPropertiesWidget toolsbbtk
category "<VOID>"
-new ImageProperties Box00
+new itk:ImageProperties Box00
-new OutputText Box02
+new wx:OutputText Box02
set Box02.Title "Dimension"
-new OutputText Box14
+new wx:OutputText Box14
set Box14.Title "Index"
-new LayoutLine Box15
+new wx:LayoutLine Box15
set Box15.WinTitle "Image Properties"
-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 wx:OutputText Box09
+ set Box09.Title "Origin"
+
+new std:ConcatStrings Box10
+ set Box10.In2 " "
+ set Box10.In4 " "
+
+new std:GetVectorDoubleElement Box11
+ set Box11.I "0"
+
+new std:GetVectorDoubleElement Box12
+ set Box12.I "1"
+
+new std:GetVectorDoubleElement Box13
+ set Box13.I "2"
+
+new wx:OutputText Box16
+ set Box16.Title "Name"
+
connect Box00.Dimension Box02.In
connect Box00.Index Box14.In
connect Box17.Widget Box15.Widget3
connect Box20.Widget Box15.Widget4
connect Box22.Widget Box15.Widget5
-connect Box26.Widget Box15.Widget6
-
+connect Box09.Widget Box15.Widget6
+connect Box00.Origin Box13.In
+connect Box00.Origin Box12.In
+connect Box00.Origin Box11.In
+connect Box11.Out Box10.In1
+connect Box12.Out Box10.In3
+connect Box13.Out Box10.In5
+connect Box10.Out Box09.In
+connect Box26.Widget Box15.Widget7
+connect Box16.Widget Box15.Widget9
# Complex input ports
input in Box00.In " "
+input FileName Box16.In " "
# Complex output ports
output widget Box15.Widget " "
output Size Box00.Size " "
output Spacing Box00.Spacing " "
output TypeName Box00.TypeName " "
+output origin Box00.Origin " "
+
endefine
# ----------------------------------
# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - imageVtkPropertiesWidget.bbg
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbg
# ----------------------------------
APP_START
COMPLEXBOX:TRUE
COMPLEXBOXNAME:ImageVtkPropertiesWidget
PACKAGENAME:toolsbbtk
-COMPLEXOUTPUTS:6
+COMPLEXOUTPUTS:7
COMPLEX_PORT
widget
3.333144:-72.520645:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Size
-64.566781:-70.774155:-900.000000
+76.763110:-69.490331:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
Spacing
-76.101477:-70.453747:-900.000000
+87.976850:-69.972313:-900.000000
FIN_COMPLEX_PORT
COMPLEX_PORT
TypeName
-88.917806:-71.094563:-900.000000
+98.867443:-69.650261:-900.000000
+FIN_COMPLEX_PORT
+COMPLEX_PORT
+origin
+65.467976:-67.826409:-900.000000
FIN_COMPLEX_PORT
COMPLEXINPUTS:3
COMPLEX_PORT
boxExecute
-92.186317:150.079323:-900.000000
FIN_COMPLEX_PORT
-BOXES:10
+BOXES:15
BOX
wx:OutputText:Box02
ISEXEC:FALSE
-173.282353:46.940241:-900.000000
--127.707353:36.940241:-900.000000
+-136.507353:36.940241:-900.000000
PORT
Title:"Dimensions"
FIN_BOX
wx:OutputText:Box17
ISEXEC:FALSE
-81.960343:34.681383:-900.000000
--36.385343:24.681383:-900.000000
+-45.185343:24.681383:-900.000000
PORT
Title:"Size"
FIN_BOX
wx:OutputText:Box20
ISEXEC:FALSE
-52.452230:20.761380:-900.000000
--6.877230:10.761380:-900.000000
+-15.677230:10.761380:-900.000000
PORT
Title:"Spacing"
FIN_BOX
wx:OutputText:Box22
ISEXEC:FALSE
-33.844911:1.230494:-900.000000
-11.730089:-8.769506:-900.000000
+2.930089:-8.769506:-900.000000
PORT
Title:"TypeName"
FIN_BOX
wx:OutputText:Box26
ISEXEC:FALSE
-128.670557:28.919600:-900.000000
--83.095557:18.919600:-900.000000
+-91.895557:18.919600:-900.000000
PORT
Title:"Min Max"
FIN_BOX
vtk:ImageVtkProperties:Box09
ISEXEC:FALSE
14.396297:109.880107:-900.000000
-59.971297:99.880107:-900.000000
+59.746297:99.880107:-900.000000
FIN_BOX
BOX
wx:OutputText:Box10
ISEXEC:FALSE
-196.439793:65.504307:-900.000000
--150.584398:55.504307:-900.000000
+-159.664793:55.504307:-900.000000
PORT
Title:"Components"
FIN_BOX
BOX
wx:LayoutLine:Box11
ISEXEC:FALSE
--69.746079:-39.358124:-900.000000
--12.186079:-49.358124:-900.000000
+-57.992403:-49.764245:-900.000000
+-0.432403:-59.764245:-900.000000
PORT
WinTitle:"Image properties"
FIN_BOX
BOX
wx:OutputText:Box13
ISEXEC:FALSE
--27.886899:-16.541426:-900.000000
-17.688101:-26.541426:-900.000000
+8.178439:-32.145808:-900.000000
+44.953439:-42.145808:-900.000000
PORT
Title:"Name"
FIN_BOX
std:MagicBox:Box14
ISEXEC:FALSE
-98.823731:125.742136:-900.000000
--53.248731:115.742136:-900.000000
+-62.748731:115.742136:-900.000000
+FIN_BOX
+BOX
+wx:OutputText:Box15
+ISEXEC:FALSE
+-27.670236:-19.010277:-900.000000
+9.104764:-29.010277:-900.000000
+PORT
+Title:"Origin"
+FIN_BOX
+BOX
+std:ConcatStrings:Box16
+ISEXEC:FALSE
+113.399842:22.194464:-900.000000
+153.124842:12.194464:-900.000000
+PORT
+In2:" "
+PORT
+In4:" "
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box18
+ISEXEC:FALSE
+77.073454:52.393509:-900.000000
+128.123454:42.393509:-900.000000
+PORT
+I:"0"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box19
+ISEXEC:FALSE
+94.301561:68.016836:-900.000000
+145.351561:58.016836:-900.000000
+PORT
+I:"1"
+FIN_BOX
+BOX
+std:GetVectorDoubleElement:Box21
+ISEXEC:FALSE
+114.301561:88.016836:-900.000000
+165.351561:78.016836:-900.000000
+PORT
+I:"2"
FIN_BOX
-CONNECTIONS:30
+CONNECTIONS:40
CONNECTION
Box09:Components:Box10:In
NumberOfControlPoints:0
FileName:FileName:Box13:In
NumberOfControlPoints:0
CONNECTION
-Box13:Widget:Box11:Widget7
-NumberOfControlPoints:0
-CONNECTION
boxExecute:boxExecute:Box14:In
NumberOfControlPoints:0
CONNECTION
CONNECTION
Box14:Out:Box26:BoxExecute
NumberOfControlPoints:0
+CONNECTION
+Box13:Widget:Box11:Widget9
+NumberOfControlPoints:0
+CONNECTION
+Box15:Widget:Box11:Widget7
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box15:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box18:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box19:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:Box21:In
+NumberOfControlPoints:0
+CONNECTION
+Box21:Out:Box16:In5
+NumberOfControlPoints:0
+CONNECTION
+Box18:Out:Box16:In1
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box16:In3
+NumberOfControlPoints:0
+CONNECTION
+Box16:Out:Box15:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Origin:origin:origin
+NumberOfControlPoints:0
APP_END
# ----------------------------------
# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - imageVtkPropertiesWidget.bbs
+# - /home/davila/Creatis/C10/creatools_source/bbtk/packages/toolsbbtk/bbs/boxes/imageVtkPropertiesWidget.bbs
# ----------------------------------
include std
new std:MagicBox Box14
+new wx:OutputText Box15
+ set Box15.Title "Origin"
+
+new std:ConcatStrings Box16
+ set Box16.In2 " "
+ set Box16.In4 " "
+
+new std:GetVectorDoubleElement Box18
+ set Box18.I "0"
+
+new std:GetVectorDoubleElement Box19
+ set Box19.I "1"
+
+new std:GetVectorDoubleElement Box21
+ set Box21.I "2"
+
connect Box09.Components Box10.In
connect Box09.MinMax Box26.In
connect Box22.Widget Box11.Widget5
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 Box13.BoxExecute
connect Box14.BoxChange Box09.BoxExecute
connect Box14.Out Box26.BoxExecute
+connect Box13.Widget Box11.Widget9
+connect Box15.Widget Box11.Widget7
+connect Box14.Out Box15.BoxExecute
+connect Box09.Origin Box18.In
+connect Box09.Origin Box19.In
+connect Box09.Origin Box21.In
+connect Box21.Out Box16.In5
+connect Box18.Out Box16.In1
+connect Box19.Out Box16.In3
+connect Box16.Out Box15.In
# Complex input ports
input in Box09.In " "
output Size Box09.Size " "
output Spacing Box09.Spacing " "
output TypeName Box09.TypeName " "
+output origin Box09.Origin " "
endefine
// * TYPE is the C++ type of the input/output
// (the one provided in the attribute 'type' of the tag 'input')
- double spc[3];
int dim[3];
- int outputformat = VTK_UNSIGNED_SHORT;
-
- if (bbGetInputOutputFormat()=="VTK_BIT") outputformat = VTK_BIT; // 1
- else if (bbGetInputOutputFormat()=="VTK_CHAR") outputformat = VTK_CHAR; // 2
- else if (bbGetInputOutputFormat()=="MET_CHAR") outputformat = VTK_CHAR; // 2
- else if (bbGetInputOutputFormat()=="VTK_SIGNED_CHAR") outputformat = VTK_SIGNED_CHAR; // 15
- else if (bbGetInputOutputFormat()=="MET_UCHAR") outputformat = VTK_UNSIGNED_CHAR; // 3
- else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_CHAR") outputformat = VTK_UNSIGNED_CHAR; // 3
- else if (bbGetInputOutputFormat()=="VTK_SHORT") outputformat = VTK_SHORT; // 4
- else if (bbGetInputOutputFormat()=="MET_SHORT") outputformat = VTK_SHORT; // 4
- else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_SHORT") outputformat = VTK_UNSIGNED_SHORT; // 5
- else if (bbGetInputOutputFormat()=="MET_USHORT") outputformat = VTK_UNSIGNED_SHORT; // 5
- else if (bbGetInputOutputFormat()=="VTK_INT") outputformat = VTK_INT; // 6
- else if (bbGetInputOutputFormat()=="MET_INT") outputformat = VTK_INT; // 6
- else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_INT") outputformat = VTK_UNSIGNED_INT; // 7
- else if (bbGetInputOutputFormat()=="MEY_UINT") outputformat = VTK_UNSIGNED_INT; // 7
- else if (bbGetInputOutputFormat()=="VTK_LONG") outputformat = VTK_LONG; // 8
- else if (bbGetInputOutputFormat()=="MET_LONG") outputformat = VTK_LONG; // 8
- else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_LONG") outputformat = VTK_UNSIGNED_LONG; // 9
- else if (bbGetInputOutputFormat()=="MET_ULONG") outputformat = VTK_UNSIGNED_LONG; // 9
- else if (bbGetInputOutputFormat()=="VTK_FLOAT") outputformat = VTK_FLOAT; // 10
- else if (bbGetInputOutputFormat()=="MET_FLOAT") outputformat = VTK_FLOAT; // 10
- else if (bbGetInputOutputFormat()=="VTK_DOUBLE") outputformat = VTK_DOUBLE; // 11
- else if (bbGetInputOutputFormat()=="MET_DOUBLE") outputformat = VTK_DOUBLE; // 11
-
- spc[0] = bbGetInputSpacing()[0];
- spc[1] = bbGetInputSpacing()[1];
- spc[2] = bbGetInputSpacing()[2];
- dim[0] = bbGetInputDimensions()[0];
- dim[1] = bbGetInputDimensions()[1];
- dim[2] = bbGetInputDimensions()[2];
- if ((dim[0]<=0)||(dim[1]<=0)||(dim[2]<=0))
- {
- dim[0]=1;
- dim[1]=1;
- dim[2]=1;
- }
- if ((spc[0]<=0)||(spc[1]<=0)||(spc[2]<=0))
- {
- spc[0]=1;
- spc[1]=1;
- spc[2]=1;
- }
-//EED 2017-12-7
- if (imageoutput!=NULL) {imageoutput->Delete();}
- imageoutput = vtkImageData::New();
- imageoutput->Initialize();
- imageoutput->SetSpacing( spc );
- imageoutput->SetDimensions( dim[0], dim[1], dim[2] );
-
-//EED 2017-01-01 Migration VTK7
-#if (VTK_MAJOR_VERSION <= 5)
- imageoutput->SetScalarType( outputformat );
- imageoutput->AllocateScalars();
-#endif
-#if (VTK_MAJOR_VERSION >= 6)
- imageoutput->AllocateScalars( outputformat,1 );
-#endif
-
- int i,j,k;
- long sizeBlock;
+ dim[0] = bbGetInputDimensions()[0];
+ dim[1] = bbGetInputDimensions()[1];
+ dim[2] = bbGetInputDimensions()[2];
- for (i=0; i<dim[0]; i++)
+ if (imageoutput!=NULL)
{
- imageoutput->SetScalarComponentFromDouble(i,0,0, 0, bbGetInputInitialValue() );
- } // for i
-
- sizeBlock= dim[0] * imageoutput->GetScalarSize();
- for (j=1; j<dim[1]; j++)
- {
- memcpy( imageoutput->GetScalarPointer(0,j,0), imageoutput->GetScalarPointer() , sizeBlock );
- } // for j
+ imageoutput->Delete();
+ imageoutput = NULL;
+ } // if imageoutput
- sizeBlock= dim[0] * dim[1] * imageoutput->GetScalarSize();
- for (k=0; k<dim[2]; k++)
+ if ( !((dim[0]<=0)||(dim[1]<=0)||(dim[2]<=0)) )
{
- memcpy( imageoutput->GetScalarPointer(0,0,k) ,imageoutput->GetScalarPointer() , sizeBlock );
- } // for k
-
-
-//EED 2017-01-01 Migration VTK7
-#if (VTK_MAJOR_VERSION <= 5)
- imageoutput->Update();
-#endif
-#if (VTK_MAJOR_VERSION >= 6)
- // ..
-#endif
+ double spc[3];
+ int outputformat = VTK_UNSIGNED_SHORT;
+ spc[0] = bbGetInputSpacing()[0];
+ spc[1] = bbGetInputSpacing()[1];
+ spc[2] = bbGetInputSpacing()[2];
+ if (bbGetInputOutputFormat()=="VTK_BIT") outputformat = VTK_BIT; // 1
+ else if (bbGetInputOutputFormat()=="VTK_CHAR") outputformat = VTK_CHAR; // 2
+ else if (bbGetInputOutputFormat()=="MET_CHAR") outputformat = VTK_CHAR; // 2
+ else if (bbGetInputOutputFormat()=="VTK_SIGNED_CHAR") outputformat = VTK_SIGNED_CHAR; // 15
+ else if (bbGetInputOutputFormat()=="MET_UCHAR") outputformat = VTK_UNSIGNED_CHAR; // 3
+ else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_CHAR") outputformat = VTK_UNSIGNED_CHAR; // 3
+ else if (bbGetInputOutputFormat()=="VTK_SHORT") outputformat = VTK_SHORT; // 4
+ else if (bbGetInputOutputFormat()=="MET_SHORT") outputformat = VTK_SHORT; // 4
+ else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_SHORT") outputformat = VTK_UNSIGNED_SHORT; // 5
+ else if (bbGetInputOutputFormat()=="MET_USHORT") outputformat = VTK_UNSIGNED_SHORT; // 5
+ else if (bbGetInputOutputFormat()=="VTK_INT") outputformat = VTK_INT; // 6
+ else if (bbGetInputOutputFormat()=="MET_INT") outputformat = VTK_INT; // 6
+ else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_INT") outputformat = VTK_UNSIGNED_INT; // 7
+ else if (bbGetInputOutputFormat()=="MEY_UINT") outputformat = VTK_UNSIGNED_INT; // 7
+ else if (bbGetInputOutputFormat()=="VTK_LONG") outputformat = VTK_LONG; // 8
+ else if (bbGetInputOutputFormat()=="MET_LONG") outputformat = VTK_LONG; // 8
+ else if (bbGetInputOutputFormat()=="VTK_UNSIGNED_LONG") outputformat = VTK_UNSIGNED_LONG; // 9
+ else if (bbGetInputOutputFormat()=="MET_ULONG") outputformat = VTK_UNSIGNED_LONG; // 9
+ else if (bbGetInputOutputFormat()=="VTK_FLOAT") outputformat = VTK_FLOAT; // 10
+ else if (bbGetInputOutputFormat()=="MET_FLOAT") outputformat = VTK_FLOAT; // 10
+ else if (bbGetInputOutputFormat()=="VTK_DOUBLE") outputformat = VTK_DOUBLE; // 11
+ else if (bbGetInputOutputFormat()=="MET_DOUBLE") outputformat = VTK_DOUBLE; // 11
+
+ if ((dim[0]<=0)||(dim[1]<=0)||(dim[2]<=0))
+ {
+ dim[0]=1;
+ dim[1]=1;
+ dim[2]=1;
+ }
+ if ((spc[0]<=0)||(spc[1]<=0)||(spc[2]<=0))
+ {
+ spc[0]=1;
+ spc[1]=1;
+ spc[2]=1;
+ }
+ imageoutput = vtkImageData::New();
+ imageoutput->Initialize();
+ imageoutput->SetSpacing( spc );
+ imageoutput->SetDimensions( dim[0], dim[1], dim[2] );
+
+ //EED 2017-01-01 Migration VTK7
+ #if (VTK_MAJOR_VERSION <= 5)
+ imageoutput->SetScalarType( outputformat );
+ imageoutput->AllocateScalars();
+ #endif
+ #if (VTK_MAJOR_VERSION >= 6)
+ imageoutput->AllocateScalars( outputformat,1 );
+ #endif
+
+ int i,j,k;
+ long sizeBlock;
+
+ for (i=0; i<dim[0]; i++)
+ {
+ imageoutput->SetScalarComponentFromDouble(i,0,0, 0, bbGetInputInitialValue() );
+ } // for i
+
+ sizeBlock= dim[0] * imageoutput->GetScalarSize();
+ for (j=1; j<dim[1]; j++)
+ {
+ memcpy( imageoutput->GetScalarPointer(0,j,0), imageoutput->GetScalarPointer() , sizeBlock );
+ } // for j
+
+ sizeBlock= dim[0] * dim[1] * imageoutput->GetScalarSize();
+ for (k=0; k<dim[2]; k++)
+ {
+ memcpy( imageoutput->GetScalarPointer(0,0,k) ,imageoutput->GetScalarPointer() , sizeBlock );
+ } // for k
+
+
+ //EED 2017-01-01 Migration VTK7
+ #if (VTK_MAJOR_VERSION <= 5)
+ imageoutput->Update();
+ #endif
+ #if (VTK_MAJOR_VERSION >= 6)
+ // ..
+ #endif
+ imageoutput->Modified();
+ } // if dim = 0
- imageoutput->Modified();
bbSetOutputOut(imageoutput);
}
BBTK_DESCRIPTION("Gets the i-th element from the input vector ("+bbtk::TypeName<std::vector<T> >());
typedef std::vector<T> Tvector;
BBTK_TEMPLATE_INPUT(GetVectorElement, In,"Input",Tvector);
- BBTK_TEMPLATE_INPUT(GetVectorElement, I, "Input",int);
+ BBTK_TEMPLATE_INPUT(GetVectorElement, I, "iElement (default 0)",int);
BBTK_TEMPLATE_INPUT(GetVectorElement, ErrorValue, "ErrorValue",T);
BBTK_TEMPLATE_OUTPUT(GetVectorElement,Out,"Output",T);
BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX(GetVectorElement);
template <class T>
void GetVectorElement<T>::bbUserSetDefaultValues()
{
-
+ bbSetInputI(0);
}
//=================================================================
//=================================================================
_imageoutput=bbGetInputImageFix();
}
-
-
// Copy the Move Image
int j,k;
int px,py,pz;
int dimMoveX = ext[1]-ext[0]+1;
int dimMoveY = ext[3]-ext[2]+1;
int dimMoveZ = ext[5]-ext[4]+1;
-
int spxM = 0; // start px MoveImage
int sizeXM = 0; // sizeX MoveImage
-
px = bbGetInputOrigin()[0];
spxM = 0;
if (px<0)
{
- spxM=px*(-1);
- px=0;
+ spxM = px*(-1);
+ px = 0;
}
sizeXM = dimMoveX-spxM;
if (px+sizeXM>=dim[0]) sizeXM=dim[0]-px;
- sizeXM=sizeXM*bbGetInputImageFix()->GetScalarSize();
+ sizeXM = sizeXM * bbGetInputImageFix()->GetScalarSize();
for (k=0; k<dimMoveZ; k++)
{
for (j=0; j<dimMoveY; j++)
{
- py=j+bbGetInputOrigin()[1];
- pz=k+bbGetInputOrigin()[2];
+ py = j+bbGetInputOrigin()[1];
+ pz = k+bbGetInputOrigin()[2];
if ( (py<dim[1]) && (pz<dim[2]) &&
(py>=0) && (pz>=0) &&
(sizeXM>0) )
} // for j
} // for k
_imageoutput->Modified();
- } // If Image Fixe Move the same GetScalarType
- else {
+ } else { // If Image Fixe Move the same GetScalarType
printf ("ERROR: InversCrop both ImageFixe and ImageMove need the same format.\n");
printf (" type ImageFix:%d type ImageMove:%d\n", bbGetInputImageFix()->GetScalarType(), bbGetInputImageMove()->GetScalarType() );
}
- } // If Image Fixe Move != NULL
- else {
- printf ("ERROR: InversCrop need ImageFixe and ImageMove to run.\n");
- }
- bbSetOutputOut(_imageoutput);
+ } else { // If Image Fixe Move != NULL
+ printf ("ERROR: InversCrop need ImageFixe and ImageMove to run.\n");
+ }
+ bbSetOutputOut(_imageoutput);
} // if Active
mBox(box),
mTypeForm(typeForm)
{
- wxPanel *panel = this;
itemcontainer = NULL;
- int i;
-
+ wxPanel *panel = this;
+ int i;
//---------------------------------------------------------------------
// 2) Insertion of the components in the window
wxChoice *wxchoice = new wxChoice ( panel , -1, wxDefaultPosition,wxSize(sizeX,sizeY));
itemcontainer=wxchoice;
sizer->Add( wxchoice,1,wxGROW );
-
Connect( wxchoice->GetId(),
wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (void (wxPanel::*)(wxEvent&))&ComboBoxWidget::OnComboBox );
}
mBox->bbSetOutputOut( iSelection );
mBox->bbSetOutputOutString( bbtk::wx2std( itemcontainer->GetString(iSelection) ) );
mBox->bbSignalOutputModification();
-
VerifyDeselect(iSelection);
-
if (mTypeForm==0)
{
wxChoice *wxchoise=(wxChoice *)itemcontainer;
} // if iSelection
}
- //--------------------------------------------------------------------------
- void ComboBoxWidget::OnComboBox(wxEvent& event)
- {
+//--------------------------------------------------------------------------
+void ComboBoxWidget::OnComboBox(wxEvent& event)
+{
OnComboBoxSelection( itemcontainer->GetSelection() );
- }
+}
+
//--------------------------------------------------------------------------
- void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn )
+void ComboBoxWidget::FillItems( int iSelection, std::vector< std::string > lstIn )
+{
+ int i;
+ itemcontainer->Clear();
+ for (i=0;i<lstIn.size(); i++)
{
- int i;
- itemcontainer->Clear();
- for (i=0;i<lstIn.size(); i++)
- {
- itemcontainer->Append( bbtk::std2wx( lstIn[i] ) );
- } // for i
- if (iSelection>=0) itemcontainer->SetSelection(iSelection);
- }
+ itemcontainer->Append( bbtk::std2wx( lstIn[i] ) );
+ } // for i
+ if (iSelection>=0) itemcontainer->SetSelection(iSelection);
+}
BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx,ComboBox)
BBTK_BLACK_BOX_IMPLEMENTATION(ComboBox,bbtk::WxBlackBox);
+
//=====
// 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)
//=====
{
bbSetOutputOutString( bbGetInputIn()[ iSelection ] );
} // if iSelection
-
w->VerifyDeselect(iSelection);
}
//=====
bbGetInputForm(),
bbGetInputWinWidth(), bbGetInputWinHeight() );
bbSetOutputOut( bbGetInputSelection() );
- bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
+ if (bbGetInputIn().size()> bbGetInputSelection() )
+ {
+ bbSetOutputOutString( bbGetInputIn()[ bbGetInputSelection() ] );
+ } // if InputIn size
bbSetOutputWidget( w );
}
//=====
BBTK_DECLARE_INPUT(In,std::vector< std::string >);
BBTK_DECLARE_INPUT(Form, int );
BBTK_DECLARE_INPUT(Deselect, bool );
+
BBTK_DECLARE_OUTPUT(Out, int );
BBTK_DECLARE_OUTPUT(OutString, std::string );
+
BBTK_PROCESS(Process);
void Process();
BBTK_CREATE_WIDGET(CreateWidget);
{
// If no executer : create a totally independant interpreter
I = bbtk::Interpreter::New();
- }
- else
- {
+ } else {
// If executer : create an interpreter using E
I = bbtk::Interpreter::New(E);
}
{
ok=false;
ccommand=commandstr.substr(pos1,commandstr.length()-pos1 );
- }
- else
- {
+ } else {
ccommand=commandstr.substr(pos1,pos2-pos1);
}
for ( i=0 ; i < ccommand.length() ; i++)
{
if (ccommand[i]==39) // '
- {
- ccommand[i]=34; // "
- }
+ {
+ ccommand[i]=34; // "
+ }
}
I->InterpretLine( ccommand );
pos1=pos2+1;
void LayoutLine::CreateWidget(wxWindow* parent)
{
wxBoxSizer *sizer;
- wxPanel *w=new wxPanel(parent, //bbGetWxParent(),
- -1);
+ wxPanel *w=new wxPanel(parent, -1, wxDefaultPosition, wxSize(20,20) );
w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
int style=0;
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
- "0|H|HORIZONTAL")==true)
- { style=wxHORIZONTAL; }
- if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
- "1|V|VERTICAL")==true)
- { style=wxVERTICAL; }
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(), "0|H|HORIZONTAL")==true)
+ {
+ style=wxHORIZONTAL;
+ } // if
+ if (bbtk::Utilities::loosematch(bbGetInputOrientation(), "1|V|VERTICAL")==true)
+ {
+ style=wxVERTICAL;
+ } // if
sizer = new wxBoxSizer(style);
- wxWindow* cw;
+ wxWindow* cw;
if ((cw=bbCreateWidgetOfInput("Widget1",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
if ((cw=bbCreateWidgetOfInput("Widget2",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
if ((cw=bbCreateWidgetOfInput("Widget3",w)) != 0) sizer->Add(cw, 1, wxGROW, 0);
namespace bbwx
{
- BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
+
+
+ //--------------------------------------------------------------------------
+ class TabWidget : public wxPanel
+ {
+ public:
+ TabWidget(LayoutTab* box, wxWindow *parent, long style);
+ ~TabWidget();
+ void OnTabChange( wxEvent& );
+ wxNotebook* GetmwxNotebook();
+ private:
+ LayoutTab *mBox;
+ wxNotebook *mwxNotebook;
+ };
+
+
+ TabWidget::TabWidget(LayoutTab* box,
+ wxWindow *parent,long style )
+ : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
+ mBox(box)
+ {
+ wxPanel *panel = this;
+ mwxNotebook = new wxNotebook(panel, //bbGetWxParent(),
+ -1,
+ wxDefaultPosition,
+ wxDefaultSize,
+ style );
+ Connect( mwxNotebook->GetId(), wxEVT_NOTEBOOK_PAGE_CHANGED ,
+ (wxObjectEventFunction)
+ (void (wxPanel::*)(wxEvent&))
+ &TabWidget::OnTabChange );
+ wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
+ sizer -> Add( mwxNotebook,1,wxGROW,0 );
+ panel -> SetSizer(sizer);
+ panel -> SetAutoLayout(true);
+ panel -> Layout();
+ }
+ TabWidget::~TabWidget()
+ {
+ }
+
+ void TabWidget::OnTabChange( wxEvent& )
+ {
+ mBox->bbSetOutputSelection( mwxNotebook->GetSelection() );
+ mBox->bbSignalOutputModification();
+ }
+wxNotebook* TabWidget::GetmwxNotebook()
+{
+ return mwxNotebook;
+}
+
+
+
+ BBTK_ADD_BLACK_BOX_TO_PACKAGE(wx , LayoutTab);
BBTK_BLACK_BOX_IMPLEMENTATION(LayoutTab,bbtk::WxBlackBox);
//-----------------------------------------------------------------
//-----------------------------------------------------------------
void LayoutTab::TryInsertWindow(wxNotebook *book, const std::string& input )
{
- wxWindow* w = bbCreateWidgetOfInput(input,book); //panel);
+ wxWindow* w = bbCreateWidgetOfInput(input,book);
if (w!=NULL)
{
book->AddPage(w,w->GetName());
- }
+ } // if w
}
- void LayoutTab::SetTitleTabs()
- {
-
+void LayoutTab::SetTitleTabs()
+{
std::vector<std::string> vecTitle;
std::vector<std::string> vecInputNameWidget;
vecInputNameWidget.push_back("Widget1");
} // if c
} // for iWidget
-
- wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
- if (w!=NULL)
+//EED2020-04-06
+// wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+ TabWidget *tabwidget=(TabWidget*)bbGetOutputWidget();
+ if (tabwidget!=NULL)
{
- int i,size=vecTitle.size();
- for (i=0; i<size; i++)
+ wxNotebook *w = tabwidget->GetmwxNotebook();
+ if (w!=NULL)
{
- w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) );
- } // for i
- } //w
+ int i,size=vecTitle.size();
+ for (i=0; i<size; i++)
+ {
+ w->SetPageText(i, wxString( vecTitle[i].c_str(),wxConvUTF8 ) );
+ } // for i
+ } //w
+ } // if tabwidget
}
-
void LayoutTab::Process()
{
PutWinTitle();
SetTitleTabs();
}
-
-
+
void LayoutTab::CreateWidget(wxWindow* parent)
{
long style = wxNB_TOP;
{ style=wxNB_BOTTOM; }
if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"3|L|LEFT")==true)
{ style=wxNB_LEFT; }
- wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
- -1,
- wxDefaultPosition,
- wxDefaultSize,
- style );
- w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
-
+
+//EED2020-04-06
+// wxNotebook *w = new wxNotebook(parent, //bbGetWxParent(),
+// -1,
+// wxDefaultPosition,
+// wxDefaultSize,
+// style );
+//
+ TabWidget *tabwidget = new TabWidget (this, parent, style );
+ tabwidget->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+ wxNotebook *w = tabwidget->GetmwxNotebook();
+
+//EED2020-04-06
+// w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
TryInsertWindow(w,"Widget1");
TryInsertWindow(w,"Widget2");
TryInsertWindow(w,"Widget3");
TryInsertWindow(w,"Widget7");
TryInsertWindow(w,"Widget8");
TryInsertWindow(w,"Widget9");
-
- bbSetOutputWidget( w );
+
+//EED2020-04-06
+// bbSetOutputWidget( w );
+ bbSetOutputWidget( tabwidget );
}
- // This callback is necessary to get actual processing of the view
- // when window is shown
- void LayoutTab::OnShowWidget()
- {
- wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
- if (w)
- {
- if (w->GetPageCount()>0)
- {
- w->SetSelection(0);
- for (unsigned int i=0; i<w->GetPageCount(); ++i) w->AdvanceSelection();
- }
- }
-
-
- }
+ // This callback is necessary to get actual processing of the view
+// when window is shown
+void LayoutTab::OnShowWidget()
+{
+//EED2020-04-06
+// wxNotebook* w = (wxNotebook*)bbGetOutputWidget();
+ wxNotebook* w = ((TabWidget*)bbGetOutputWidget())->GetmwxNotebook();
+ if (w)
+ {
+ if (w->GetPageCount()>0)
+ {
+ w->SetSelection(0);
+ for (unsigned int i=0; i<w->GetPageCount(); ++i)
+ {
+ w->AdvanceSelection();
+ } // for
+ } // if PageCount
+ } // if w
+}
}//namespace bbwx
BBTK_DECLARE_INPUT(Widget8,wxWindow*);
BBTK_DECLARE_INPUT(Widget9,wxWindow*);
BBTK_DECLARE_INPUT(Orientation,std::string);
+
+ BBTK_DECLARE_OUTPUT(Selection,int);
+
BBTK_PROCESS(Process);
BBTK_CREATE_WIDGET(CreateWidget);
BBTK_ON_SHOW_WIDGET(OnShowWidget);
BBTK_INPUT(LayoutTab,Orientation,
"Orientation (default T), 0=T=TOP , 1=R=RIGHT , 2=B=BOTTON , 3=L=LEFT "
,std::string,"");
+ BBTK_OUTPUT(LayoutTab,Selection,"Tab selection",int,"");
+
BBTK_END_DESCRIBE_BLACK_BOX(LayoutTab);
//=================================================================