From 63e0f6940cc4891fbdba5dbc35dc73ec4d8542da Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 21 Jun 2021 16:40:52 +0200 Subject: [PATCH] #3466 FixAxis in SetPosition box --- bbtk/bbs/appli/exampleSetPosition-FixAxis.bbg | 96 +++++++++++++++++++ bbtk/bbs/appli/exampleSetPosition-FixAxis.bbs | 63 ++++++++++++ bbtk/src/bbcreaMaracasVisuSetPosition.cxx | 2 + bbtk/src/bbcreaMaracasVisuSetPosition.h | 2 + 4 files changed, 163 insertions(+) create mode 100644 bbtk/bbs/appli/exampleSetPosition-FixAxis.bbg create mode 100644 bbtk/bbs/appli/exampleSetPosition-FixAxis.bbs diff --git a/bbtk/bbs/appli/exampleSetPosition-FixAxis.bbg b/bbtk/bbs/appli/exampleSetPosition-FixAxis.bbg new file mode 100644 index 0000000..c8a13a1 --- /dev/null +++ b/bbtk/bbs/appli/exampleSetPosition-FixAxis.bbg @@ -0,0 +1,96 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C11/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleSetPosition-FixAxis.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:8 +BOX +vtk:LoadHola:Box00 +ISEXEC:FALSE +-63.694843:55.476154:-900.000000 +-28.144843:45.476154:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box01 +ISEXEC:FALSE +-90.247532:24.814120:-900.000000 +-26.527532:14.814120:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box02 +ISEXEC:FALSE +7.513914:3.088466:-900.000000 +71.233914:-6.911534:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:SetPosition:Box03 +ISEXEC:FALSE +-65.275361:-68.752498:-900.000000 +-28.725361:-78.752498:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box04 +ISEXEC:FALSE +38.722672:-62.746533:-900.000000 +77.802672:-72.746533:-900.000000 +FIN_BOX +BOX +wx:CheckBox:Box05 +ISEXEC:FALSE +1.106362:36.509947:-900.000000 +37.431362:26.509947:-900.000000 +PORT +Title:"Fix Axis for the second viewer" +FIN_BOX +BOX +creaVtk:OutputWindow:Box07 +ISEXEC:TRUE +-25.446327:-108.581532:-900.000000 +15.153673:-118.581532:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box08 +ISEXEC:TRUE +24.267396:-108.179945:-900.000000 +63.347396:-118.179945:-900.000000 +PORT +Orientation:"H" +FIN_BOX +CONNECTIONS:10 +CONNECTION +Box00:Out:Box01:In +NumberOfControlPoints:0 +CONNECTION +Box01:BoxChange:Box03:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box01:Point:Box03:Point +NumberOfControlPoints:0 +CONNECTION +Box02:wxVtkBaseView1:Box03:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box01:Widget:Box04:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box02:Widget:Box04:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box00:Out:Box02:In +NumberOfControlPoints:0 +CONNECTION +Box05:Out:Box03:FixAxis2D +NumberOfControlPoints:0 +CONNECTION +Box04:Widget:Box08:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box05:Widget:Box08:Widget1 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/appli/exampleSetPosition-FixAxis.bbs b/bbtk/bbs/appli/exampleSetPosition-FixAxis.bbs new file mode 100644 index 0000000..0af8760 --- /dev/null +++ b/bbtk/bbs/appli/exampleSetPosition-FixAxis.bbs @@ -0,0 +1,63 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/C11/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleSetPosition-FixAxis.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include vtk +include creaMaracasVisu +include wx +include creaVtk + +author "Author ??" +description "Description ??" +category "" + +new vtk:LoadHola Box00 + +new creaMaracasVisu:ViewerNV Box01 + +new creaMaracasVisu:ViewerNV Box02 + +new creaMaracasVisu:SetPosition Box03 + +new wx:LayoutSplit Box04 + +new wx:CheckBox Box05 + set Box05.Title "Fix Axis for the second viewer" + +new creaVtk:OutputWindow Box07 + +new wx:LayoutSplit Box08 + set Box08.Orientation "H" + + +connect Box00.Out Box01.In + +connect Box01.BoxChange Box03.BoxExecute + +connect Box01.Point Box03.Point + +connect Box02.wxVtkBaseView1 Box03.wxVtkBaseView + +connect Box01.Widget Box04.Widget1 + +connect Box02.Widget Box04.Widget2 + +connect Box00.Out Box02.In + +connect Box05.Out Box03.FixAxis2D + +connect Box04.Widget Box08.Widget2 + +connect Box05.Widget Box08.Widget1 + + + +# Complex input ports +exec Box07 +exec Box08 diff --git a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx index 1a45b0c..c831069 100644 --- a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx +++ b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx @@ -41,6 +41,7 @@ void SetPosition::Process() vtkmprbasedata->SetX( bbGetInputPoint()[0] ); vtkmprbasedata->SetY( bbGetInputPoint()[1] ); vtkmprbasedata->SetZ( bbGetInputPoint()[2] ); + vtkmprbasedata->SetFixAxis2D( bbGetInputFixAxis2D() ); wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121); // Refresh //EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 #if wxMAJOR_VERSION <= 2 @@ -60,6 +61,7 @@ void SetPosition::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputwxVtkBaseView( NULL ) ; + bbSetInputFixAxis2D( false ) ; } //===== // 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) diff --git a/bbtk/src/bbcreaMaracasVisuSetPosition.h b/bbtk/src/bbcreaMaracasVisuSetPosition.h index 40badd9..b1692f0 100644 --- a/bbtk/src/bbcreaMaracasVisuSetPosition.h +++ b/bbtk/src/bbcreaMaracasVisuSetPosition.h @@ -22,6 +22,7 @@ class bbcreaMaracasVisu_EXPORT SetPosition //===== BBTK_DECLARE_INPUT(Point,std::vector); BBTK_DECLARE_INPUT(wxVtkBaseView,wxVtkBaseView*); + BBTK_DECLARE_INPUT(FixAxis2D,bool); // BBTK_DECLARE_OUTPUT(Out,double); BBTK_PROCESS(Process); void Process(); @@ -37,6 +38,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(SetPosition,bbtk::AtomicBlackBox); BBTK_CATEGORY("empty"); BBTK_INPUT(SetPosition,Point,"vector with point to be set [X Y Z]",std::vector,""); BBTK_INPUT(SetPosition,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,""); + BBTK_INPUT(SetPosition,FixAxis2D,"(default false) true/false",bool,""); // BBTK_OUTPUT(SetPosition,Out,"First output",double,""); BBTK_END_DESCRIBE_BLACK_BOX(SetPosition); //===== -- 2.47.1