]> Creatis software - creaMaracasVisu.git/commitdiff
3151 creaMaracasVisu Feature New Normal - SetPosition box for the viewer NV
authorEduardo DAVILA <davila@localhost.localdomain>
Fri, 24 Nov 2017 10:26:15 +0000 (11:26 +0100)
committerEduardo DAVILA <davila@localhost.localdomain>
Fri, 24 Nov 2017 10:26:15 +0000 (11:26 +0100)
bbtk/bbs/appli/exampleSetPosition.bbg [new file with mode: 0644]
bbtk/bbs/appli/exampleSetPosition.bbs [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuSetPosition.cxx [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuSetPosition.h [new file with mode: 0644]

diff --git a/bbtk/bbs/appli/exampleSetPosition.bbg b/bbtk/bbs/appli/exampleSetPosition.bbg
new file mode 100644 (file)
index 0000000..6f13124
--- /dev/null
@@ -0,0 +1,131 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleSetPosition.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:10
+BOX
+creaMaracasVisu:SetPosition:Box00
+ISEXEC:FALSE
+20.289184:-10.820898:-900.000000
+65.864184:-20.820898:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box01
+ISEXEC:FALSE
+4.658998:70.936999:-900.000000
+68.378998:60.936999:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:Box02
+ISEXEC:TRUE
+-49.746073:-53.202749:-900.000000
+-4.171073:-63.202749:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:LayoutLine:Box03
+ISEXEC:FALSE
+-87.619217:-5.410449:-900.000000
+-30.059217:-15.410449:-900.000000
+FIN_BOX
+BOX
+wx:Slider:Box04
+ISEXEC:FALSE
+-111.966238:58.613198:-900.000000
+-60.566238:48.613198:-900.000000
+PORT
+ReactiveOnTrack:"true"
+FIN_BOX
+BOX
+wx:Slider:Box05
+ISEXEC:FALSE
+-91.966238:78.613198:-900.000000
+-40.566238:68.613198:-900.000000
+PORT
+ReactiveOnTrack:"true"
+FIN_BOX
+BOX
+wx:Slider:Box06
+ISEXEC:FALSE
+-71.966238:98.613198:-900.000000
+-20.566238:88.613198:-900.000000
+PORT
+ReactiveOnTrack:"true"
+FIN_BOX
+BOX
+vtk:LoadHola:Box07
+ISEXEC:FALSE
+12.023220:112.597457:-900.000000
+57.598220:102.597457:-900.000000
+FIN_BOX
+BOX
+std:ConcatStrings:Box08
+ISEXEC:FALSE
+-39.526336:44.185334:-900.000000
+6.048664:34.185334:-900.000000
+PORT
+In2:" "
+PORT
+In4:" "
+FIN_BOX
+BOX
+std:MultipleInputs:Box09
+ISEXEC:FALSE
+-50.647815:22.543538:-900.000000
+-5.072815:12.543538:-900.000000
+FIN_BOX
+CONNECTIONS:15
+CONNECTION
+Box01:wxVtkBaseView1:Box00:wxVtkBaseView
+NumberOfControlPoints:0
+CONNECTION
+Box01:Widget:Box02:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box04:Widget:Box03:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box05:Widget:Box03:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box03:Widget3
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box02:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box01:In
+NumberOfControlPoints:0
+CONNECTION
+Box04:Out:Box08:In1
+NumberOfControlPoints:0
+CONNECTION
+Box05:Out:Box08:In3
+NumberOfControlPoints:0
+CONNECTION
+Box06:Out:Box08:In5
+NumberOfControlPoints:0
+CONNECTION
+Box08:Out:Box00:Point
+NumberOfControlPoints:0
+CONNECTION
+Box04:BoxChange:Box09:In1
+NumberOfControlPoints:0
+CONNECTION
+Box05:BoxChange:Box09:In2
+NumberOfControlPoints:0
+CONNECTION
+Box06:BoxChange:Box09:In3
+NumberOfControlPoints:0
+CONNECTION
+Box09:BoxChange:Box00:BoxExecute
+NumberOfControlPoints:0
+APP_END
diff --git a/bbtk/bbs/appli/exampleSetPosition.bbs b/bbtk/bbs/appli/exampleSetPosition.bbs
new file mode 100644 (file)
index 0000000..1bf56a8
--- /dev/null
@@ -0,0 +1,80 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleSetPosition.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include creaMaracasVisu
+include wx
+include vtk
+include std
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new creaMaracasVisu:SetPosition Box00
+
+new creaMaracasVisu:ViewerNV Box01
+
+new wx:LayoutSplit Box02
+  set Box02.Orientation "H"
+
+new wx:LayoutLine Box03
+
+new wx:Slider Box04
+  set Box04.ReactiveOnTrack "true"
+
+new wx:Slider Box05
+  set Box05.ReactiveOnTrack "true"
+
+new wx:Slider Box06
+  set Box06.ReactiveOnTrack "true"
+
+new vtk:LoadHola Box07
+
+new std:ConcatStrings Box08
+  set Box08.In2 " "
+  set Box08.In4 " "
+
+new std:MultipleInputs Box09
+
+
+connect Box01.wxVtkBaseView1 Box00.wxVtkBaseView
+
+connect Box01.Widget Box02.Widget2
+
+connect Box04.Widget Box03.Widget1
+
+connect Box05.Widget Box03.Widget2
+
+connect Box06.Widget Box03.Widget3
+
+connect Box03.Widget Box02.Widget1
+
+connect Box07.Out Box01.In
+
+connect Box04.Out Box08.In1
+
+connect Box05.Out Box08.In3
+
+connect Box06.Out Box08.In5
+
+connect Box08.Out Box00.Point
+
+connect Box04.BoxChange Box09.In1
+
+connect Box05.BoxChange Box09.In2
+
+connect Box06.BoxChange Box09.In3
+
+connect Box09.BoxChange Box00.BoxExecute
+
+
+
+# Complex input ports
+exec Box02
diff --git a/bbtk/src/bbcreaMaracasVisuSetPosition.cxx b/bbtk/src/bbcreaMaracasVisuSetPosition.cxx
new file mode 100644 (file)
index 0000000..79379df
--- /dev/null
@@ -0,0 +1,87 @@
+//===== 
+// 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)
+//===== 
+#include "bbcreaMaracasVisuSetPosition.h"
+#include "bbcreaMaracasVisuPackage.h"
+
+#include <wxMPRBaseData.h>
+
+namespace bbcreaMaracasVisu
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,SetPosition)
+BBTK_BLACK_BOX_IMPLEMENTATION(SetPosition,bbtk::AtomicBlackBox);
+//===== 
+// 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)
+//===== 
+void SetPosition::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (the one provided in the attribute 'name' of the tag 'input')
+//    * TYPE is the C++ type of the input/output
+//      (the one provided in the attribute 'type' of the tag 'input')
+
+//    bbSetOutputOut( bbGetInputIn() );
+//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+
+       if (bbGetInputwxVtkBaseView()!=NULL)
+       {
+               vtkMPRBaseData* vtkmprbasedata = (vtkMPRBaseData*) (bbGetInputwxVtkBaseView()->GetVtkBaseData());
+               if (bbGetInputPoint().size()==3)
+               {
+                       vtkmprbasedata->SetX( bbGetInputPoint()[0] );
+                       vtkmprbasedata->SetY( bbGetInputPoint()[1] );
+                       vtkmprbasedata->SetZ( bbGetInputPoint()[2] );
+                       wxCommandEvent newevent(wxEVT_COMMAND_MENU_SELECTED,12121);  // Refres
+                       bbGetInputwxVtkBaseView()->GetWxVTKRenderWindowInteractor ()->GetParent()->ProcessEvent( newevent );
+               } // if bbGetInputPosition
+       } // bbGetInputwxVtkBaseView
+
+}
+//===== 
+// 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)
+//===== 
+void SetPosition::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputwxVtkBaseView( NULL ) ;
+}
+//===== 
+// 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)
+//===== 
+void SetPosition::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// 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)
+//===== 
+void SetPosition::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaMaracasVisu
+
+
diff --git a/bbtk/src/bbcreaMaracasVisuSetPosition.h b/bbtk/src/bbcreaMaracasVisuSetPosition.h
new file mode 100644 (file)
index 0000000..40badd9
--- /dev/null
@@ -0,0 +1,49 @@
+//===== 
+// 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)
+//===== 
+#ifndef __bbcreaMaracasVisuSetPosition_h_INCLUDED__
+#define __bbcreaMaracasVisuSetPosition_h_INCLUDED__
+#include "bbcreaMaracasVisu_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+#include "wxVtkBaseView.h"
+
+namespace bbcreaMaracasVisu
+{
+
+class bbcreaMaracasVisu_EXPORT SetPosition
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(SetPosition,bbtk::AtomicBlackBox);
+//===== 
+// 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(Point,std::vector<int>);
+  BBTK_DECLARE_INPUT(wxVtkBaseView,wxVtkBaseView*);
+//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// 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_BEGIN_DESCRIBE_BLACK_BOX(SetPosition,bbtk::AtomicBlackBox);
+  BBTK_NAME("SetPosition");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+  BBTK_INPUT(SetPosition,Point,"vector with point to be set [X Y Z]",std::vector<int>,"");
+  BBTK_INPUT(SetPosition,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,"");
+//  BBTK_OUTPUT(SetPosition,Out,"First output",double,"");
+BBTK_END_DESCRIBE_BLACK_BOX(SetPosition);
+//===== 
+// 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)
+//===== 
+}
+// EO namespace bbcreaMaracasVisu
+
+#endif // __bbcreaMaracasVisuSetPosition_h_INCLUDED__
+