]> Creatis software - creaMaracasVisu.git/commitdiff
#3481 wxVtkBaseView_Info add events mouse observer
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 28 Jan 2022 14:43:53 +0000 (15:43 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Fri, 28 Jan 2022 14:43:53 +0000 (15:43 +0100)
bbtk/bbs/boxes/ManualPaint2.bbg
bbtk/bbs/boxes/ManualPaint2.bbs
bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx
bbtk/src/bbcreaMaracasVisuwxPopupMenu.h
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkBaseData.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkInfoTextImageInteractor.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRBaseData.cxx

index 292899739152bc8eee0dfe10cf1b98472b29ccf4..44e236f390cb7dcf5baf1e49d8f5434f123f3653 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
-# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
-# - /home/davila/Creatis/C10/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbg
+# - BBTKGEditor v 1.5 BBG BlackBox Diagram file
+# - /Users/davila/Creatis/C11/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbg
 # ----------------------------------
 
 APP_START
@@ -13,79 +13,79 @@ PACKAGENAME:creaMaracasVisu
 COMPLEXOUTPUTS:2
 COMPLEX_PORT
 widgetOut
--94.963421:-185.755112:-900.000000
+-66.474395:-55.726534:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 boxChange
--13.009667:-180.316926:-900.000000
+-9.106767:-54.095078:-900.000000
 FIN_COMPLEX_PORT
 COMPLEXINPUTS:15
 COMPLEX_PORT
 TitleOptions
--73.069454:181.258523:-900.000000
+-51.148618:54.377557:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Active_ManualPaint_Model
--20.792521:183.001745:-900.000000
+-14.554765:54.900523:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 SizeDistance_ManualPaint_Model
--6.908988:183.290985:-900.000000
+-4.836292:54.987296:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 GrayLevel_ManualPaint_Model
-6.974544:183.580225:-900.000000
+4.882181:55.074068:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 MinRange_ManualPaint_Model
-20.858077:183.580225:-900.000000
+14.600654:55.074068:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 MaxRange_ManualPaint_Model
-32.427687:184.158706:-900.000000
+22.699381:55.247612:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Point_ManualPaint_Model
-103.762209:183.383830:-900.000000
+72.633546:55.015149:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Image_ManualPaint_Model
-73.334197:183.855234:-900.000000
+51.333938:55.156570:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Image2_ManualPaint_Model
-90.081231:183.956721:-900.000000
+63.056862:55.187016:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 BoxExecute_ManualPaint_Model
--201.995645:178.771315:-900.000000
+-141.396952:53.631394:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 wxvtkbaseview1
-159.923711:180.378598:-900.000000
+111.946598:54.113579:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 wxvtkbaseview2
-169.240197:179.955122:-900.000000
+118.468138:53.986537:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 wxvtkbaseview3
-180.250591:180.378598:-900.000000
+126.175414:54.113579:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 Tolerance_Fill_ManualPaint_Model
-46.490178:184.420162:-900.000000
+32.543125:55.326049:-900.000000
 FIN_COMPLEX_PORT
 COMPLEX_PORT
 colorBarPosition
--180.034675:180.795982:-900.000000
+-126.024272:54.238795:-900.000000
 FIN_COMPLEX_PORT
 BOXES:34
 BOX
 creaMaracasVisu:ManualPaint_Model:Box00
 ISEXEC:FALSE
--95.174180:-58.098371:-900.000000
--34.534180:-68.098371:-900.000000
+-66.621926:-17.429511:-900.000000
+-31.541926:-19.929511:-900.000000
 PORT
 2D3D:"1"
 PORT
@@ -106,8 +106,8 @@ FIN_BOX
 BOX
 wx:RadioButton:Box01
 ISEXEC:FALSE
--123.860487:103.376983:-900.000000
--60.140487:93.376983:-900.000000
+-86.702341:31.013095:-900.000000
+-49.862341:28.513095:-900.000000
 PORT
 In0:"Deselect"
 PORT
@@ -122,14 +122,14 @@ FIN_BOX
 BOX
 std:StringSelect:Box02
 ISEXEC:FALSE
--37.673227:82.948986:-900.000000
-4.486773:72.948986:-900.000000
+-26.371259:24.884696:-900.000000
+-1.851259:22.384696:-900.000000
 FIN_BOX
 BOX
 creaMaracasVisu:ColorLayerImageView:Box03
 ISEXEC:FALSE
-64.897021:-66.295426:-900.000000
-134.777021:-76.295426:-900.000000
+45.427915:-19.888628:-900.000000
+85.787915:-22.388628:-900.000000
 PORT
 TypeControlsInterface:"2"
 PORT
@@ -138,8 +138,8 @@ FIN_BOX
 BOX
 std:TransposeVectorVectorString:Box04
 ISEXEC:FALSE
--31.305556:125.161505:-900.000000
-22.919444:115.161505:-900.000000
+-21.913889:37.548451:-900.000000
+1.521111:35.048451:-900.000000
 PORT
 In0:"Desactivate Big-Blue Small-Blue Big-Clean Small-Clean"
 PORT
@@ -156,70 +156,70 @@ FIN_BOX
 BOX
 std:GetVectorStringElement:Box05
 ISEXEC:FALSE
--86.200317:53.438683:-900.000000
--36.800317:43.438683:-900.000000
+-60.340222:16.031605:-900.000000
+-37.385222:13.531605:-900.000000
 PORT
 I:"1"
 FIN_BOX
 BOX
 wx:LayoutLine:Box09
 ISEXEC:FALSE
--100.059182:-162.443123:-900.000000
--42.499182:-172.443123:-900.000000
+-70.041427:-48.732937:-900.000000
+-36.721427:-51.232937:-900.000000
 FIN_BOX
 BOX
 std:GetVectorStringElement:Box11
 ISEXEC:FALSE
--71.696483:40.964713:-900.000000
--22.296483:30.964713:-900.000000
+-50.187538:12.289414:-900.000000
+-27.232538:9.789414:-900.000000
 PORT
 I:"2"
 FIN_BOX
 BOX
 std:GetVectorStringElement:Box12
 ISEXEC:FALSE
--58.354926:28.065688:-900.000000
--8.954926:18.065688:-900.000000
+-40.848448:8.419706:-900.000000
+-17.893448:5.919706:-900.000000
 PORT
 I:"3"
 FIN_BOX
 BOX
 std:ConcatStrings:Box13
 ISEXEC:FALSE
--37.058068:-18.986769:-900.000000
-2.666932:-28.986769:-900.000000
+-25.940648:-5.696031:-900.000000
+-3.180648:-8.196031:-900.000000
 PORT
 In2:" "
 FIN_BOX
 BOX
 std:GetVectorStringElement:Box14
 ISEXEC:FALSE
--22.770985:-0.972910:-900.000000
-26.629015:-10.972910:-900.000000
+-15.939689:-0.291873:-900.000000
+7.015311:-2.791873:-900.000000
 PORT
 I:"5"
 FIN_BOX
 BOX
 std:GetVectorStringElement:Box15
 ISEXEC:FALSE
--40.934702:12.586010:-900.000000
-8.465298:2.586010:-900.000000
+-28.654291:3.775803:-900.000000
+-5.699291:1.275803:-900.000000
 PORT
 I:"4"
 FIN_BOX
 BOX
 std:TransposeVectorVectorString:Box17
 ISEXEC:FALSE
--117.618980:121.580114:-900.000000
--63.393980:111.580114:-900.000000
+-82.333286:36.474034:-900.000000
+-58.898286:33.974034:-900.000000
 PORT
 In0:"Desactivate Big-Blue Small-Blue Big-Clean Small-Clean"
 FIN_BOX
 BOX
 wx:RadioButton:Box18
 ISEXEC:FALSE
--327.358460:96.434379:-900.000000
--263.638460:86.434379:-900.000000
+-229.150922:28.930314:-900.000000
+-192.310922:26.430314:-900.000000
 PORT
 In:"1"
 PORT
@@ -230,136 +230,136 @@ FIN_BOX
 BOX
 wx:LayoutLine:Box19
 ISEXEC:FALSE
--137.264220:-139.449705:-900.000000
--79.704220:-149.449705:-900.000000
+-96.084954:-41.834911:-900.000000
+-62.764954:-44.334911:-900.000000
 PORT
 Orientation:"H"
 FIN_BOX
 BOX
 std:MagicBox:Box20
 ISEXEC:FALSE
--82.351641:163.241009:-900.000000
--46.276641:153.241009:-900.000000
+-57.646149:48.972303:-900.000000
+-36.046149:46.472303:-900.000000
 FIN_BOX
 BOX
 std:GetVectorStringElement:Box21
 ISEXEC:FALSE
--1.581707:-33.301126:-900.000000
-47.818293:-43.301126:-900.000000
+-1.107195:-9.990338:-900.000000
+21.847805:-12.490338:-900.000000
 PORT
 I:"6"
 FIN_BOX
 BOX
 vtk:vtkImageDataPointerRelay:Box22
 ISEXEC:FALSE
-174.217065:39.039232:-900.000000
-226.392065:29.039232:-900.000000
+121.951945:11.711770:-900.000000
+145.161945:9.211770:-900.000000
 FIN_BOX
 BOX
 vtk:UpdateRender:Box23
 ISEXEC:FALSE
-39.953010:-129.847284:-900.000000
-80.278010:-139.847284:-900.000000
+27.967107:-38.954185:-900.000000
+49.992107:-41.454185:-900.000000
 PORT
 Active:"true"
 FIN_BOX
 BOX
 std:MagicBox:Box24
 ISEXEC:FALSE
-66.284148:73.033149:-900.000000
-102.359148:63.033149:-900.000000
+46.398904:21.909945:-900.000000
+67.998904:19.409945:-900.000000
 FIN_BOX
 BOX
 std:MagicBox:Box25
 ISEXEC:FALSE
-105.814564:70.785341:-900.000000
-141.889564:60.785341:-900.000000
+74.070195:21.235602:-900.000000
+95.670195:18.735602:-900.000000
 FIN_BOX
 BOX
 std:MagicBox:Box26
 ISEXEC:FALSE
-130.034953:54.490000:-900.000000
-166.109953:44.490000:-900.000000
+91.024467:16.347000:-900.000000
+112.624467:13.847000:-900.000000
 FIN_BOX
 BOX
 vtk:UpdateRender:Box27
 ISEXEC:FALSE
-90.902525:-130.949226:-900.000000
-131.227525:-140.949226:-900.000000
+63.631767:-39.284768:-900.000000
+85.656768:-41.784768:-900.000000
 PORT
 Active:"true"
 FIN_BOX
 BOX
 vtk:UpdateRender:Box28
 ISEXEC:FALSE
-141.007963:-130.644372:-900.000000
-181.332963:-140.644372:-900.000000
+98.705574:-39.193312:-900.000000
+120.730574:-41.693312:-900.000000
 PORT
 Active:"true"
 FIN_BOX
 BOX
 wx:LayoutLine:Box29
 ISEXEC:FALSE
--234.010495:-17.027092:-900.000000
--176.450495:-27.027092:-900.000000
+-150.508630:-5.278624:-900.000000
+-117.188630:-7.778624:-900.000000
 FIN_BOX
 BOX
 wx:CommandButton:Box30
 ISEXEC:FALSE
--220.568054:36.966713:-900.000000
--177.793054:26.966713:-900.000000
+-168.207844:3.758670:-900.000000
+-145.932844:1.258670:-900.000000
 PORT
 Label:"Undo"
 FIN_BOX
 BOX
 wx:CommandButton:Box31
 ISEXEC:FALSE
--211.322007:17.087471:-900.000000
--168.547007:7.087471:-900.000000
+-143.662996:4.444256:-900.000000
+-121.387996:1.944256:-900.000000
 PORT
 Label:"Redo"
 FIN_BOX
 BOX
 creaMaracasVisu:ManualPaint_UndoRedo:Box32
 ISEXEC:FALSE
--230.089322:-131.265167:-900.000000
--180.614322:-141.265167:-900.000000
+-159.698554:-43.812456:-900.000000
+-136.758554:-46.312456:-900.000000
 PORT
 Type:"2"
 FIN_BOX
 BOX
 creaMaracasVisu:ManualPaint_UndoRedo:Box33
 ISEXEC:FALSE
--295.989026:-131.212587:-900.000000
--246.514026:-141.212587:-900.000000
+-194.405090:-42.773704:-900.000000
+-171.465090:-45.273704:-900.000000
 PORT
 Type:"1"
 FIN_BOX
 BOX
 vtk:UpdateRender:Box34
 ISEXEC:FALSE
--245.364374:-89.573260:-900.000000
--205.039374:-99.573260:-900.000000
+-171.755062:-26.871978:-900.000000
+-149.730062:-29.371978:-900.000000
 FIN_BOX
 BOX
 std:MagicBox:Box38
 ISEXEC:FALSE
-49.639480:114.047399:-900.000000
-85.714480:104.047399:-900.000000
+34.747636:34.214220:-900.000000
+56.347636:31.714220:-900.000000
 FIN_BOX
 BOX
 wx:LayoutLine:Box36
 ISEXEC:FALSE
--294.584648:43.407556:-900.000000
--237.024648:33.407556:-900.000000
+-206.209254:13.022267:-900.000000
+-172.889254:10.522267:-900.000000
 PORT
 Orientation:"H"
 FIN_BOX
 BOX
 wx:RadioButton:Box37
 ISEXEC:FALSE
--251.576354:94.888910:-900.000000
--187.856354:84.888910:-900.000000
+-176.103448:28.466673:-900.000000
+-139.263448:25.966673:-900.000000
 PORT
 In:"1"
 PORT
@@ -370,8 +370,8 @@ FIN_BOX
 BOX
 wx:RadioButton:Box39
 ISEXEC:FALSE
--216.228897:75.929979:-900.000000
--152.508897:65.929979:-900.000000
+-151.360228:22.778994:-900.000000
+-114.520228:20.278994:-900.000000
 PORT
 In:"1"
 PORT
@@ -584,9 +584,6 @@ CONNECTION
 Box00:BoxChange:Box28:BoxExecute
 NumberOfControlPoints:0
 CONNECTION
-Box29:Widget:Box19:Widget1
-NumberOfControlPoints:0
-CONNECTION
 Box30:Widget:Box29:Widget2
 NumberOfControlPoints:0
 CONNECTION
@@ -617,9 +614,6 @@ CONNECTION
 Box24:Out:Box32:wxvtkbaseview
 NumberOfControlPoints:0
 CONNECTION
-Box36:Widget:Box29:Widget1
-NumberOfControlPoints:0
-CONNECTION
 Box18:Widget:Box36:Widget1
 NumberOfControlPoints:0
 CONNECTION
@@ -637,4 +631,10 @@ NumberOfControlPoints:0
 CONNECTION
 Box01:BoxChange:boxChange:boxChange
 NumberOfControlPoints:0
+CONNECTION
+Box29:Widget:Box19:Widget6
+NumberOfControlPoints:0
+CONNECTION
+Box36:Widget:Box19:Widget1
+NumberOfControlPoints:0
 APP_END
index 1301012e8f7ee1a83c871d52aff8e7a957ef473b..af4e442340bd9a3e907652471a256253275b9d7f 100644 (file)
@@ -1,6 +1,6 @@
 # ----------------------------------
-# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box)
-# - /home/davila/Creatis/C10/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbs
+# - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box)
+# - /Users/davila/Creatis/C11/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/ManualPaint2.bbs
 # ----------------------------------
 
 include std
@@ -186,7 +186,6 @@ connect Box25.Out Box27.Renderer
 connect Box26.Out Box28.Renderer
 connect Box00.BoxChange Box27.BoxExecute
 connect Box00.BoxChange Box28.BoxExecute
-connect Box29.Widget Box19.Widget1
 connect Box30.Widget Box29.Widget2
 connect Box31.Widget Box29.Widget3
 connect Box00.Manualpaintmodel Box32.Manualpaintmodel
@@ -196,12 +195,13 @@ connect Box00.Manualpaintmodel Box33.Manualpaintmodel
 connect Box38.Out Box00.Point
 connect Box24.Out Box33.wxvtkbaseview
 connect Box24.Out Box32.wxvtkbaseview
-connect Box36.Widget Box29.Widget1
 connect Box18.Widget Box36.Widget1
 connect Box37.Widget Box36.Widget2
 connect Box37.Out Box00.2D3D
 connect Box39.Widget Box36.Widget4
 connect Box39.Out Box00.Direction
+connect Box29.Widget Box19.Widget6
+connect Box36.Widget Box19.Widget1
 
 # Complex input ports
 input TitleOptions Box20.In " "
index 4e844ff41cdd7dd2950aca251901218f2984e679..6a0792c6b76f0cf55f6f2b3feedbd4b9e4fee049 100644 (file)
@@ -7,6 +7,7 @@
 #include <wx/menu.h>
 #include "InteractorStyleMaracas.h"
 #include <vtkInteractorStyleBaseView.h>
+#include "wxVtk2DBaseView.h"
 
 namespace bbcreaMaracasVisu
 {
@@ -14,7 +15,7 @@ namespace bbcreaMaracasVisu
 class PopupMenuInteractor : public InteractorStyleMaracas , wxEvtHandler
 {
     public:
-        PopupMenuInteractor( );
+//        PopupMenuInteractor( );
         PopupMenuInteractor( wxPopupMenu *box, wxVtkBaseView *wxvtkbaseview );
         ~PopupMenuInteractor();
 //      virtual bool    OnLeftButtonDown();
@@ -26,20 +27,22 @@ class PopupMenuInteractor : public InteractorStyleMaracas , wxEvtHandler
 //      virtual bool    OnRightDClick();
                 void    OnPopupClick(wxCommandEvent &evt);
     private:
-        wxVtkBaseView   *_wxvtkbaseview;
-        wxPopupMenu     *_box;
+        wxVtkBaseView       *_wxvtkbaseview;
+        wxPopupMenu         *_box;
+        std::vector<double> lstPoint;
 };
 
+/*
 PopupMenuInteractor::PopupMenuInteractor(  )
 {
-    _wxvtkbaseview = NULL;
-    _box           = NULL;
+    _wxvtkbaseview  = NULL;
+    _box            = NULL;
 }
-
+*/
 PopupMenuInteractor::PopupMenuInteractor( wxPopupMenu *box , wxVtkBaseView *wxvtkbaseview )
 {
-    _wxvtkbaseview = wxvtkbaseview;
-    _box           = box;
+    _wxvtkbaseview  = wxvtkbaseview;
+    _box            = box;
 }
 
 PopupMenuInteractor::~PopupMenuInteractor()
@@ -65,6 +68,7 @@ void PopupMenuInteractor::OnPopupClick(wxCommandEvent &evt)
     } else {
         _box->bbSetOutputSimpleText( "void" );
     }
+    _box->bbSetOutputPoint( lstPoint );
     _box->bbSignalOutputModification();
 }
 
@@ -80,6 +84,28 @@ bool PopupMenuInteractor::OnRightButtonUp()
         int                         size        = lstItems.size();
         int                         i;
         wxMenu                      menu;
+
+        /*
+        int X,Y,Z;
+        crea::wxVTKRenderWindowInteractor *wxVTKiren;
+        wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->GetWxVTKRenderWindowInteractor();
+        wxVTKiren->GetEventPosition(X,Y);
+        Z = (int)((wxVtk2DBaseView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()))->GetVtkBaseData()->GetZ();
+        double dxx     = X;
+        double dyy     = Y;
+        double dzz     = Z;
+        _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->TransFromCoordScreenToWorld(dxx,dyy,dzz,true);
+        _px    = (int)(dxx+0.5);
+        _py    = (int)(dyy+0.5);
+        _pz    = (int)(dzz+0.0);
+        */
+        int x,y,z;
+        ((wxVtk2DBaseView*)(_vtkInteractorStyleBaseView->GetWxVtk2DBaseView()))->GetVtkBaseData()->GetPointMouse(x,y,z);
+        lstPoint.clear();
+        lstPoint.push_back(x);
+        lstPoint.push_back(y);
+        lstPoint.push_back(z);
+
         for (i=0;i<size;i++)
         {
             wxString itemString( lstItems[i].c_str() , wxConvUTF8 );
@@ -97,7 +123,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(wxPopupMenu,bbtk::AtomicBlackBox);
 //===== 
 void wxPopupMenu::Process()
 {
-
 // THE MAIN PROCESSING METHOD BODY
 //   Here we simply set the input 'In' value to the output 'Out'
 //   And print out the output value
@@ -116,8 +141,8 @@ void wxPopupMenu::Process()
         firsttime=false;
         if (bbGetInputwxVtkBaseView()!=NULL)
         {
-            PopupMenuInteractor* popupmenuinteractor = new PopupMenuInteractor( this, bbGetInputwxVtkBaseView()  );
-            vtkInteractorStyleBaseView *vtkinteractorstylebaseview = (vtkInteractorStyleBaseView*) (bbGetInputwxVtkBaseView()->GetInteractorStyleBaseView() );
+            PopupMenuInteractor* popupmenuinteractor                = new PopupMenuInteractor( this, bbGetInputwxVtkBaseView()  );
+            vtkInteractorStyleBaseView *vtkinteractorstylebaseview  = (vtkInteractorStyleBaseView*) (bbGetInputwxVtkBaseView()->GetInteractorStyleBaseView() );
             vtkinteractorstylebaseview->AddInteractorStyleMaracas( popupmenuinteractor );
         } // if wxVtkBaseView
     } // if firsttime
@@ -140,27 +165,23 @@ void wxPopupMenu::bbUserSetDefaultValues()
 //===== 
 void wxPopupMenu::bbUserInitializeProcessing()
 {
-
 //  THE INITIALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should allocate the internal/output pointers 
-//    if any 
-
-  
+//    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 wxPopupMenu::bbUserFinalizeProcessing()
 {
-
 //  THE FINALIZATION METHOD BODY :
 //    Here does nothing 
 //    but this is where you should desallocate the internal/output pointers 
 //    if any
-  
 }
-}
-// EO namespace bbcreaMaracasVisu
+
+}// EO namespace bbcreaMaracasVisu
 
 
index 1c3bb02265f4b722deeab214097391ae3e05874c..aad15dd2b1e832d0f79fcd809ed7b0face4c91fa 100644 (file)
@@ -43,6 +43,7 @@ class bbcreaMaracasVisu_EXPORT wxPopupMenu
     BBTK_DECLARE_INPUT(wxVtkBaseView,wxVtkBaseView*);
 //    BBTK_DECLARE_INPUT(Position,std::vector< int >);
     BBTK_DECLARE_OUTPUT(Out,int);
+    BBTK_DECLARE_OUTPUT(Point,std::vector<double>);
     BBTK_DECLARE_OUTPUT(SimpleText,std::string);
     BBTK_PROCESS(Process);
     void Process();
@@ -60,6 +61,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(wxPopupMenu,bbtk::AtomicBlackBox);
     BBTK_INPUT(wxPopupMenu,In,"Vector of items",std::vector< std::string >,"");
 //    BBTK_INPUT(wxPopupMenu,Position,"Window position",std::vector< int >,"");
     BBTK_INPUT(wxPopupMenu,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,"");
+    BBTK_OUTPUT(wxPopupMenu,Point,"click point in the image",std::vector<double>,"");
     BBTK_OUTPUT(wxPopupMenu,Out,"Sected item",int,"");
     BBTK_OUTPUT(wxPopupMenu,SimpleText,"Text selected item",std::string,"");
 BBTK_END_DESCRIBE_BLACK_BOX(wxPopupMenu);
index afbdaaafad8a17159394d7dba998e2141f932e20..6e1f6cd0cd32ca22393c2f19584b01ddf1723f45 100644 (file)
@@ -50,10 +50,8 @@ InteractorwxVtkBaseView::~InteractorwxVtkBaseView()
 
 bool InteractorwxVtkBaseView::OnLeftButtonDown()
 {
-    printf("EED InteractorwxVtkBaseView::OnLeftButtonDown \n");
     if ( _box->bbGetInputInteractionType()==8 )
     {
-        printf("EED InteractorwxVtkBaseView::OnLeftButtonDown 1\n");
         flagDrag=true;
     }
     if ( (_box->bbGetInputInteractionType()==1 ) && (_wxvtkbaseview!=NULL) )
@@ -67,10 +65,8 @@ bool InteractorwxVtkBaseView::OnLeftButtonDown()
 
 bool InteractorwxVtkBaseView::OnLeftButtonUp()
 {
-    printf("EED InteractorwxVtkBaseView::OnLeftButtonUp \n");
     if ( _box->bbGetInputInteractionType()==8 )
     {
-        printf("EED InteractorwxVtkBaseView::OnLeftButtonUp 1\n");
         flagDrag=false;
     }
     if ( (_box->bbGetInputInteractionType()==2 ) && (_wxvtkbaseview!=NULL) )
@@ -86,7 +82,6 @@ bool InteractorwxVtkBaseView::OnMouseMove()
 {
     int intFlag;
     if (flagDrag==true) intFlag=1; else intFlag=0;
-    printf("EED InteractorwxVtkBaseView::OnMouseMove Start this=%p  type=%d  flag=%d\n", this, _box->bbGetInputInteractionType() ,intFlag);
     bool ok=false;
     if ( (_box->bbGetInputInteractionType()==3 ) && (_wxvtkbaseview!=NULL) )
     {
@@ -102,12 +97,10 @@ bool InteractorwxVtkBaseView::OnMouseMove()
     } // if InteractionType 9
     if (ok==true)
     {
-        printf("EED InteractorwxVtkBaseView::OnMouseMove 1\n");
         _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
         _box->bbSignalOutputModification();
         return false;
     } // if ok
-    printf("EED InteractorwxVtkBaseView::OnMouseMove End\n");
     return true;
 }
 
@@ -144,10 +137,8 @@ bool InteractorwxVtkBaseView::OnRightButtonUp()
 
 bool InteractorwxVtkBaseView::OnLeftDClick()
 {
-    printf("EED InteractorwxVtkBaseView::OnLeftDClick Start this=%p\n", this);
     if ( (_box->bbGetInputInteractionType()==6 ) && (_wxvtkbaseview!=NULL) )
     {
-        printf("EED InteractorwxVtkBaseView::OnLeftDClick 1\n");
         _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
         _box->bbSignalOutputModification();
         return false;
@@ -157,10 +148,8 @@ bool InteractorwxVtkBaseView::OnLeftDClick()
 
 bool InteractorwxVtkBaseView::OnRightDClick()
 {
-    printf("EED InteractorwxVtkBaseView::OnRightDClick Start\n");
     if ( (_box->bbGetInputInteractionType()==7 ) && (_wxvtkbaseview!=NULL) )
     {
-        printf("EED InteractorwxVtkBaseView::OnRightDClick 1\n");
         _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
         _box->bbSignalOutputModification();
         return false;
@@ -177,8 +166,6 @@ void wxVtkBaseView_Info::SetwxVtkBaseViewOutputs(wxVtkBaseView *wxvtkbaseview )
 {
     if (wxvtkbaseview!=NULL)
     {
-        printf("EED wxVtkBaseView_Info::SetwxVtkBaseViewOutputs this=%p\n",this);
-        printf("EED wxVtkBaseView_Info::SetwxVtkBaseViewOutputs %s \n", bbGetFullName().c_str() );
         bbSetOutputvtkRenderer( wxvtkbaseview->GetRenderer() );
         bbSetOutputDirection( wxvtkbaseview->GetDirection() );
         vtkBaseData *vtkbasedata = wxvtkbaseview->GetVtkBaseData();
@@ -199,7 +186,14 @@ void wxVtkBaseView_Info::SetwxVtkBaseViewOutputs(wxVtkBaseView *wxvtkbaseview )
             lstPoint.push_back( vtkbasedata->GetY() );
             lstPoint.push_back( vtkbasedata->GetZ() );
             bbSetOutputPoint( lstPoint );
-            printf("EED wxVtkBaseView_Info::SetwxVtkBaseViewOutputs point = %f %f %f\n",lstPoint[0],lstPoint[1],lstPoint[2] );
+
+            int pointMouseX,pointMouseY,pointMouseZ;
+            vtkbasedata->GetPointMouse(pointMouseX,pointMouseY,pointMouseZ); 
+            std::vector<double> lstPointMouse;
+            lstPointMouse.push_back( pointMouseX );
+            lstPointMouse.push_back( pointMouseY );
+            lstPointMouse.push_back( pointMouseZ );
+            bbSetOutputPointMouse( lstPointMouse );
 
             double normal[3];
             std::vector<double> lstNormal;
@@ -230,23 +224,16 @@ void wxVtkBaseView_Info::Process()
 //      (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')
-    
-    
-   
-    printf("EED wxVtkBaseView_Info::Process Start\n");
-
     if (bbGetInputInteractionType()==0)
     {
         SetwxVtkBaseViewOutputs( bbGetInputwxVtkBaseView() );
     }
-    
     if (firsttime==true)
     {
         firsttime=false;
         if (bbGetInputInteractionType()!=0)
         {
             SetwxVtkBaseViewOutputs( bbGetInputwxVtkBaseView() );
-
             if (bbGetInputwxVtkBaseView()!=NULL)
             {
                 InteractorwxVtkBaseView     *interactorwxvtkbaseview    = new InteractorwxVtkBaseView( this, bbGetInputwxVtkBaseView()  );
@@ -267,9 +254,6 @@ void wxVtkBaseView_Info::Process()
             } // if wxVtkBaseView3
         } // if InteractionType !=0
     } // if firsttime
-
-    printf("EED wxVtkBaseView_Info::Process end\n");
-
 }
 
 //===== 
index 5f97e8a9d7e009623654dbac605361ba15bc9b66..448995b354baf76fa6340aeb2d731fcfefdcf188 100644 (file)
@@ -31,6 +31,7 @@ class bbcreaMaracasVisu_EXPORT wxVtkBaseView_Info
     BBTK_DECLARE_OUTPUT(WindowColorLevel,std::vector<double>);
     BBTK_DECLARE_OUTPUT(Interpolation,bool);
     BBTK_DECLARE_OUTPUT(Point,std::vector<double>);
+    BBTK_DECLARE_OUTPUT(PointMouse,std::vector<double>);
     BBTK_DECLARE_OUTPUT(Normal,std::vector<double>);
   
     BBTK_PROCESS(Process);
@@ -60,6 +61,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(wxVtkBaseView_Info,bbtk::AtomicBlackBox);
   BBTK_OUTPUT(wxVtkBaseView_Info,WindowColorLevel,"List [Window, Level]",std::vector<double>,"");
   BBTK_OUTPUT(wxVtkBaseView_Info,Interpolation,"(default true) true/false",bool,"");
   BBTK_OUTPUT(wxVtkBaseView_Info,Point,"Axis positon of the viewer",std::vector<double>,"");
+  BBTK_OUTPUT(wxVtkBaseView_Info,PointMouse,"Actual Point Mouse",std::vector<double>,"");
   BBTK_OUTPUT(wxVtkBaseView_Info,Normal,"Normal of plane viewe",std::vector<double>,"");
 
 BBTK_END_DESCRIBE_BLACK_BOX(wxVtkBaseView_Info);
index 3fdede1c3321314b05106ab65e8687c7c9ee42a4..6d8ac9aefb93e83a53b8fd80633c5ce71defe62e 100644 (file)
@@ -36,6 +36,9 @@ vtkBaseData::vtkBaseData()
        _opacityAxis                    = 1.0;
        _observable                     = vtkObject::New();
        _cameraparallelScale    = 100.0;
+    _pointMouseX            = 0;
+    _pointMouseY            = 0;
+    _pointMouseZ            = 0;
 }
 
 //-------------------------------------------------------------------
@@ -258,5 +261,19 @@ void vtkBaseData::SetCameraParallelScale(double value)
        _cameraparallelScale=value;
 }
 
+//-------------------------------------------------------------------
+void vtkBaseData::SetPointMouse(int x, int y , int z)
+{
+    _pointMouseX = x;
+    _pointMouseY = y;
+    _pointMouseZ = z;
+}
 
+//-------------------------------------------------------------------
+void vtkBaseData::GetPointMouse(int &x, int &y , int &z)
+{
+    x = _pointMouseX;
+    y = _pointMouseY;
+    z = _pointMouseZ;
+}
 
index de5b86cf3560cfdc5d3d4bede2e5854748bd4c9b..211ade4ecebb432049fe38803b49c82f5ec1cf45 100644 (file)
@@ -59,7 +59,8 @@ public:
        void                    SetOpacityAxis(double value);   
        double                  GetCameraParallelScale();
        void                    SetCameraParallelScale(double value);
-
+    void            SetPointMouse( int x, int y, int z);
+    void            GetPointMouse( int &x, int &y, int &z);
 
 protected:
        marImageData    *_marImageData;
@@ -72,6 +73,9 @@ protected:
        double                  _opacityAxis;
        vtkObject*              _observable;
        double                  _cameraparallelScale;
+    int             _pointMouseX;
+    int             _pointMouseY;
+    int             _pointMouseZ;
 private:
 
 };
index ecff31a32554fea3de5783d35dd60de2bb1c4be6..a26ff4e1b2589639eba820b53ce853294e4626ce 100644 (file)
@@ -61,10 +61,10 @@ bool vtkInfoTextImageInteractor::OnMouseMove()
        double dxx,dyy,dzz;
        double ixx,iyy,izz;
 
-               int z = (int)((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->GetZ();
-               dxx=X;
-               dyy=Y;
-               dzz=z;
+    int z   = (int)((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->GetZ();
+        dxx = X;
+               dyy = Y;
+               dzz = z;
        
        _vtkInteractorStyleBaseView->GetWxVtk2DBaseView()->TransFromCoordScreenToWorld(dxx,dyy,dzz,true);
 
@@ -81,6 +81,10 @@ bool vtkInfoTextImageInteractor::OnMouseMove()
                ixx=(int)(dxx+0.5);
                iyy=(int)(dyy+0.5);
                izz=(int)(dzz+0.0);
+    
+//EED 2022-01-24
+        ((wxVtk2DBaseView*)_vtkInteractorStyleBaseView->GetWxVtk2DBaseView())->GetVtkBaseData()->SetPointMouse(ixx,iyy,izz);
+    
                GetVtkInfoTextImage()->PutPosition( ixx , iyy , izz );
                GetVtkInfoTextImage()->PutPixelIntensity( ixx , iyy , izz );
        }
index feb2f74282b21457dac7a573bb21e26fc7679fac..baf7d816a92e73c65433d38e8737a35d1564bbdf 100644 (file)
 //-------------------------------------------------------------------
 vtkMPRBaseData::vtkMPRBaseData()
 {
-  _x=0;
-  _y=0;
-  _z=0;
-  _x1 = 0;
-  _x2 = 0;
-  _y1 = 0;
-  _y2 = 0;
-  _z1 = 0;
-  _z2 = 0;
+  _x    = 0;
+  _y    = 0;
+  _z    = 0;
+  _x1   = 0;
+  _x2   = 0;
+  _y1   = 0;
+  _y2   = 0;
+  _z1   = 0;
+  _z2   = 0;
   _transformOrientation = NULL;
-  _marImageData = NULL;
+  _marImageData         = NULL;
 }
 
 //-------------------------------------------------------------------
@@ -137,9 +137,9 @@ double      vtkMPRBaseData::GetY()
 void vtkMPRBaseData::SetX(double x)
 {
        //int dim[3];
-       int ext[6];
-       doubleorigin;
-       vtkImageDataimg = _marImageData->GetImageData();
+       int             ext[6];
+       double          *origin;
+       vtkImageData    *img = _marImageData->GetImageData();
        if(img!=NULL){
                /*img->GetDimensions(dim);
                if (x<0)