]> Creatis software - creaMaracasVisu.git/commitdiff
#3481 wxVtkBaseView_Info add events mouse observer
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 13 Jan 2022 10:19:06 +0000 (11:19 +0100)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Thu, 13 Jan 2022 10:19:06 +0000 (11:19 +0100)
bbtk/src/bbcreaMaracasVisuChInfo3Dto2DRuler.cxx
bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx
bbtk/src/bbcreaMaracasVisuwxPopupMenu.h
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx
bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h
bbtk/src/bbmaracasvisuViewerNV.cxx

index 95a565294b6da76789229114c63a618557598c75..276d6f1053ac32956f1990206e56e7574b9bf33c 100644 (file)
@@ -69,7 +69,7 @@ void ChInfo3Dto2DRuler::Process()
                centerpoint.push_back( bbGetInputCenterPointIn()[1] );
                centerpoint.push_back( bbGetInputCenterPointIn()[2] );
        } // if direction 1
-
+    
        if (bbGetInputDirection() == 2) 
        {
                rotationvector.push_back(0);  // vx
@@ -90,55 +90,47 @@ void ChInfo3Dto2DRuler::Process()
        bbSetOutputOutPointX(outpointX);
        bbSetOutputOutPointY(outpointY);
        bbSetOutputOutPointZ(outpointZ);
-
 }
+
 //===== 
 // 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 ChInfo3Dto2DRuler::bbUserSetDefaultValues()
 {
-
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
-
-
    std::vector<double> tmp;
    tmp.push_back( 0 );
    tmp.push_back( 0 );
    tmp.push_back( 0 );
-   bbSetInputCenterPointIn(tmp);   
-
+   bbSetInputCenterPointIn(tmp);
    bbSetInputDirection(2);
    bbSetInputAngle(0);
    bbSetInputSize(10);
-  
 }
+
 //===== 
 // 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 ChInfo3Dto2DRuler::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 ChInfo3Dto2DRuler::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 026a89c9ed10fbd6d2754f47b1e76ee4d422c2da..4e844ff41cdd7dd2950aca251901218f2984e679 100644 (file)
 namespace bbcreaMaracasVisu
 {
 
-
-class PopupMenuInteractor : public InteractorStyleMaracas
+class PopupMenuInteractor : public InteractorStyleMaracas , wxEvtHandler
 {
-public:
-    PopupMenuInteractor( wxPopupMenu *box, wxVtkBaseView *wxvtkbaseview );
-    ~PopupMenuInteractor();
-//    virtual bool  OnLeftButtonDown();
-//    virtual bool  OnLeftButtonUp();
-//    virtual bool  OnMouseMove();
-//        virtual bool  OnRightButtonDown();
-    virtual bool  OnRightButtonUp();
-//    virtual bool  OnLeftDClick();
-    void OnPopupClick(wxCommandEvent &evt);
-
-private:
-    wxVtkBaseView   *_wxvtkbaseview;
-    wxPopupMenu     *_box;
+    public:
+        PopupMenuInteractor( );
+        PopupMenuInteractor( wxPopupMenu *box, wxVtkBaseView *wxvtkbaseview );
+        ~PopupMenuInteractor();
+//      virtual bool    OnLeftButtonDown();
+//      virtual bool    OnLeftButtonUp();
+//      virtual bool    OnMouseMove();
+//      virtual bool    OnRightButtonDown();
+        virtual bool    OnRightButtonUp();
+//      virtual bool    OnLeftDClick();
+//      virtual bool    OnRightDClick();
+                void    OnPopupClick(wxCommandEvent &evt);
+    private:
+        wxVtkBaseView   *_wxvtkbaseview;
+        wxPopupMenu     *_box;
 };
 
+PopupMenuInteractor::PopupMenuInteractor(  )
+{
+    _wxvtkbaseview = NULL;
+    _box           = NULL;
+}
+
 PopupMenuInteractor::PopupMenuInteractor( wxPopupMenu *box , wxVtkBaseView *wxvtkbaseview )
 {
     _wxvtkbaseview = wxvtkbaseview;
@@ -49,38 +55,41 @@ void PopupMenuInteractor::OnPopupClick(wxCommandEvent &evt)
 //        case ID_SOMETHING_ELSE:
 //            break;
 //    }
-    
-    printf("EED PopupMenuInteractor::OnPopupClick %d\n", evt.GetId() );
-    
+    int id=evt.GetId()-1000;
+    _box->bbSetOutputOut( id );
+    std::vector<std::string>    lstItems    = _box->bbGetInputIn();
+    int                         size        = lstItems.size();
+    if ((id>=0) && (id<size))
+    {
+        _box->bbSetOutputSimpleText( lstItems[id] );
+    } else {
+        _box->bbSetOutputSimpleText( "void" );
+    }
+    _box->bbSignalOutputModification();
 }
 
 bool PopupMenuInteractor::OnRightButtonUp()
 {
     if (_wxvtkbaseview!=NULL)
     {
-        wxWindow* window = _wxvtkbaseview->GetWxVTKRenderWindowInteractor();
-        const wxPoint pt = wxGetMousePosition();
-        int x = pt.x - window->GetScreenPosition().x;
-        int y = pt.y - window->GetScreenPosition().y;
-        wxMenu  menu;
-        std::vector<std::string> lstItems = _box->bbGetInputIn();
-        int i,size = lstItems.size();
+        wxWindow                    *window     = _wxvtkbaseview->GetWxVTKRenderWindowInteractor();
+        const wxPoint               pt          = wxGetMousePosition();
+        int                         xWindow     = pt.x - window->GetScreenPosition().x;
+        int                         yWindow     = pt.y - window->GetScreenPosition().y;
+        std::vector<std::string>    lstItems    = _box->bbGetInputIn();
+        int                         size        = lstItems.size();
+        int                         i;
+        wxMenu                      menu;
         for (i=0;i<size;i++)
         {
-            menu.Append(i+1000, lstItems[i] );
+            wxString itemString( lstItems[i].c_str() , wxConvUTF8 );
+            wxMenuItem *item = menu.Append(i+1000, itemString  );
         } // for
-//      menu.Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(PopupMenuInteractor::OnPopupClick), NULL, this);
-//      Connect( mwxCommandButton->GetId(),   wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction)  (void (wxPanel::*)(wxEvent&)) &CommandButtonWidget::OnCommandButton );
-        menu.Connect(   wxEVT_COMMAND_MENU_SELECTED , (wxObjectEventFunction)  (void (wxPanel::*)(wxEvent&)) &PopupMenuInteractor::OnPopupClick );
-
-        
-        window->PopupMenu(&menu,x,y);
+        menu.Connect( wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxCommandEventFunction) &PopupMenuInteractor::OnPopupClick,NULL,this );
+        window->PopupMenu(&menu,xWindow,yWindow);
     } // if _vtkbaseview
 }
 
-
-
-
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,wxPopupMenu)
 BBTK_BLACK_BOX_IMPLEMENTATION(wxPopupMenu,bbtk::AtomicBlackBox);
 //===== 
@@ -100,15 +109,11 @@ void wxPopupMenu::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')
-    
 //    bbSetOutputOut( bbGetInputIn() );
 //    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-      
-    
     if (firsttime==true)
     {
         firsttime=false;
-        
         if (bbGetInputwxVtkBaseView()!=NULL)
         {
             PopupMenuInteractor* popupmenuinteractor = new PopupMenuInteractor( this, bbGetInputwxVtkBaseView()  );
@@ -116,21 +121,20 @@ void wxPopupMenu::Process()
             vtkinteractorstylebaseview->AddInteractorStyleMaracas( popupmenuinteractor );
         } // if wxVtkBaseView
     } // if firsttime
-    
 }
+
 //===== 
 // 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::bbUserSetDefaultValues()
 {
-
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
-
     firsttime=true;
     bbSetInputwxVtkBaseView(NULL);
-  
+    bbSetOutputOut(-1);
 }
+
 //===== 
 // 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)
 //===== 
index bb862c5ff55920dc18ea1fe53f1e72c638c1b53e..1c3bb02265f4b722deeab214097391ae3e05874c 100644 (file)
@@ -13,7 +13,6 @@
 #include "wx/wxprec.h"
 #include <wx/datetime.h>
 
-
 #ifdef __BORLANDC__
 #pragma hdrstop
 #endif
@@ -29,8 +28,6 @@
 
 #include "wxVtkBaseView.h"
 
-
-
 namespace bbcreaMaracasVisu
 {
 
index 1c92d3b581849be9a63c6752fb736058c61cc0a9..afbdaaafad8a17159394d7dba998e2141f932e20 100644 (file)
 //===== 
 #include "bbcreaMaracasVisuwxVtkBaseView_Info.h"
 #include "bbcreaMaracasVisuPackage.h"
+#include "InteractorStyleMaracas.h"
+#include <vtkInteractorStyleBaseView.h>
+
 namespace bbcreaMaracasVisu
 {
 
+
+class InteractorwxVtkBaseView : public InteractorStyleMaracas
+{
+    public:
+        InteractorwxVtkBaseView( );
+        InteractorwxVtkBaseView( wxVtkBaseView_Info *box, wxVtkBaseView *wxvtkbaseview );
+        ~InteractorwxVtkBaseView();
+        virtual bool    OnLeftButtonDown();
+        virtual bool    OnLeftButtonUp();
+        virtual bool    OnMouseMove();
+        virtual bool    OnRightButtonDown();
+        virtual bool    OnRightButtonUp();
+        virtual bool    OnLeftDClick();
+        virtual bool    OnRightDClick();
+
+private:
+        wxVtkBaseView           *_wxvtkbaseview;
+        wxVtkBaseView_Info      *_box;
+        bool                    flagDrag;
+};
+
+InteractorwxVtkBaseView::InteractorwxVtkBaseView(  )
+{
+    _wxvtkbaseview  = NULL;
+    _box            = NULL;
+    flagDrag        = false;
+}
+
+InteractorwxVtkBaseView::InteractorwxVtkBaseView( wxVtkBaseView_Info *box , wxVtkBaseView *wxvtkbaseview )
+{
+    _box            = box;
+    flagDrag        = false;
+    _wxvtkbaseview  = wxvtkbaseview;
+}
+
+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) )
+    {
+        _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
+        _box->bbSignalOutputModification();
+        return false;
+    } // if _vtkbaseview
+    return true;
+}
+
+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) )
+    {
+        _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
+        _box->bbSignalOutputModification();
+        return false;
+    } // if _vtkbaseview
+    return true;
+}
+
+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) )
+    {
+        ok=true;
+    } // if InteractionType 3
+    if (( _box->bbGetInputInteractionType()==8 ) && (flagDrag==true) )
+    {
+        ok=true;
+    } // if InteractionType 8
+    if (( _box->bbGetInputInteractionType()==9 ) && (flagDrag==true) )
+    {
+        ok=true;
+    } // 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;
+}
+
+bool InteractorwxVtkBaseView::OnRightButtonDown()
+{
+    if ( _box->bbGetInputInteractionType()==9 )
+    {
+        flagDrag=true;
+    }
+    if ( (_box->bbGetInputInteractionType()==4 ) && (_wxvtkbaseview!=NULL) )
+    {
+        _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
+        _box->bbSignalOutputModification();
+        return false;
+    } // if _vtkbaseview
+    return true;
+}
+
+bool InteractorwxVtkBaseView::OnRightButtonUp()
+{
+    if ( _box->bbGetInputInteractionType()==9 )
+    {
+        flagDrag=false;
+    }
+    if ( (_box->bbGetInputInteractionType()==5 ) && (_wxvtkbaseview!=NULL) )
+    {
+        _box->SetwxVtkBaseViewOutputs( _wxvtkbaseview );
+        _box->bbSignalOutputModification();
+        return false;
+    } // if _vtkbaseview
+    return true;
+}
+
+
+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;
+    } // if _vtkbaseview
+    return true;
+}
+
+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;
+    } // if _vtkbaseview
+    return true;
+}
+
+
 BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,wxVtkBaseView_Info)
 BBTK_BLACK_BOX_IMPLEMENTATION(wxVtkBaseView_Info,bbtk::AtomicBlackBox);
+
+
+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();
+        if (vtkbasedata!=NULL)
+        {
+            marImageData *marimagedata = vtkbasedata->GetMarImageData();
+            if (marimagedata!=NULL)
+            {
+                bbSetOutputImage( marimagedata->GetImageData() );
+            } // MarImageData
+            std::vector<double> LstWindowColorLevel;
+            LstWindowColorLevel.push_back( vtkbasedata->GetColorWindow() );
+            LstWindowColorLevel.push_back( vtkbasedata->GetColorLevel() );
+            bbSetOutputWindowColorLevel( LstWindowColorLevel );
+            
+            std::vector<double> lstPoint;
+            lstPoint.push_back( vtkbasedata->GetX() );
+            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] );
+
+            double normal[3];
+            std::vector<double> lstNormal;
+            wxvtkbaseview->GetNormal( normal );
+            lstNormal.push_back( normal[0] );
+            lstNormal.push_back( normal[1] );
+            lstNormal.push_back( normal[2] );
+            bbSetOutputNormal( lstNormal );
+            
+            bbSetOutputInterpolation( vtkbasedata->GetInterpolate() );
+        }  // BaseData
+    } // if wxvtkbaseview
+}
+
 //===== 
 // 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 wxVtkBaseView_Info::Process()
 {
-
 // THE MAIN PROCESSING METHOD BODY
 //   Here we simply set the input 'In' value to the output 'Out'
 //   And print out the output value
@@ -25,45 +230,48 @@ 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()  );
+                vtkInteractorStyleBaseView  *vtkinteractorstylebaseview = (vtkInteractorStyleBaseView*) (bbGetInputwxVtkBaseView()->GetInteractorStyleBaseView() );
+                vtkinteractorstylebaseview->AddInteractorStyleMaracas( interactorwxvtkbaseview );
+            } // if wxVtkBaseView
+            if (bbGetInputwxVtkBaseView2()!=NULL)
+            {
+                InteractorwxVtkBaseView     *interactorwxvtkbaseview    = new InteractorwxVtkBaseView( this, bbGetInputwxVtkBaseView2()  );
+                vtkInteractorStyleBaseView  *vtkinteractorstylebaseview = (vtkInteractorStyleBaseView*) (bbGetInputwxVtkBaseView2()->GetInteractorStyleBaseView() );
+                vtkinteractorstylebaseview->AddInteractorStyleMaracas( interactorwxvtkbaseview );
+            } // if wxVtkBaseView2
+            if (bbGetInputwxVtkBaseView3()!=NULL)
+            {
+                InteractorwxVtkBaseView     *interactorwxvtkbaseview    = new InteractorwxVtkBaseView( this, bbGetInputwxVtkBaseView3()  );
+                vtkInteractorStyleBaseView  *vtkinteractorstylebaseview = (vtkInteractorStyleBaseView*) (bbGetInputwxVtkBaseView3()->GetInteractorStyleBaseView() );
+                vtkinteractorstylebaseview->AddInteractorStyleMaracas( interactorwxvtkbaseview );
+            } // if wxVtkBaseView3
+        } // if InteractionType !=0
+    } // if firsttime
+
+    printf("EED wxVtkBaseView_Info::Process end\n");
 
-//    bbSetOutputOut( bbGetInputIn() );
-//    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
-  
-       if (bbGetInputwxVtkBaseView()!=NULL)
-       {
-               bbSetOutputvtkRenderer( bbGetInputwxVtkBaseView()->GetRenderer() );
-               bbSetOutputDirection( bbGetInputwxVtkBaseView()->GetDirection() );
-               vtkBaseData *vtkbasedata = bbGetInputwxVtkBaseView()->GetVtkBaseData();
-               if (vtkbasedata!=NULL)
-               {
-                       marImageData *marimagedata = vtkbasedata->GetMarImageData();
-                       if (marimagedata!=NULL)
-                       {
-                               bbSetOutputImage( marimagedata->GetImageData() );                               
-                       } // MarImageData
-                       std::vector<double> LstWindowColorLevel;
-                       LstWindowColorLevel.push_back( vtkbasedata->GetColorWindow() );
-                       LstWindowColorLevel.push_back( vtkbasedata->GetColorLevel() );
-                       bbSetOutputWindowColorLevel( LstWindowColorLevel );
-                       
-                       std::vector<double> lstPoint;
-                       lstPoint.push_back( vtkbasedata->GetX() );
-                       lstPoint.push_back( vtkbasedata->GetY() );
-                       lstPoint.push_back( vtkbasedata->GetZ() );
-                       bbSetOutputPoint( lstPoint );
-
-                       double normal[3];
-                       std::vector<double> lstNormal;
-                       bbGetInputwxVtkBaseView()->GetNormal( normal );
-                       lstNormal.push_back( normal[0] );
-                       lstNormal.push_back( normal[1] );
-                       lstNormal.push_back( normal[2] );
-                       bbSetOutputNormal( lstNormal );
-                       
-                       bbSetOutputInterpolation( vtkbasedata->GetInterpolate() );                      
-               }  // BaseData
-       }
 }
+
 //===== 
 // 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)
 //===== 
@@ -71,40 +279,42 @@ void wxVtkBaseView_Info::bbUserSetDefaultValues()
 {
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
+    firsttime=true;
        std::vector<double> LstWindowColorLevel;
        LstWindowColorLevel.push_back( 1000 );
        LstWindowColorLevel.push_back( 500 );
-       bbSetOutputWindowColorLevel( LstWindowColorLevel );
+    bbSetInputwxVtkBaseView( NULL );
+    bbSetInputwxVtkBaseView2( NULL );
+    bbSetInputwxVtkBaseView3( NULL );
+    bbSetInputInteractionType(0);
+    bbSetOutputWindowColorLevel( LstWindowColorLevel );
     bbSetOutputDirection(2);
     bbSetOutputInterpolation(true);
     bbSetOutputvtkRenderer(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 wxVtkBaseView_Info::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 wxVtkBaseView_Info::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 4a32c0fa3ded1b974b6a3e73ac8f5a3e9d63a502..5f97e8a9d7e009623654dbac605361ba15bc9b66 100644 (file)
@@ -21,17 +21,23 @@ class bbcreaMaracasVisu_EXPORT wxVtkBaseView_Info
 //===== 
 // 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(wxVtkBaseView,wxVtkBaseView*);
-  BBTK_DECLARE_OUTPUT(vtkRenderer,vtkRenderer*);
-  BBTK_DECLARE_OUTPUT(Direction,int);
-  BBTK_DECLARE_OUTPUT(Image,vtkImageData*);
-  BBTK_DECLARE_OUTPUT(WindowColorLevel,std::vector<double>);
-  BBTK_DECLARE_OUTPUT(Interpolation,bool);
-  BBTK_DECLARE_OUTPUT(Point,std::vector<double>);
-  BBTK_DECLARE_OUTPUT(Normal,std::vector<double>);
+    BBTK_DECLARE_INPUT(wxVtkBaseView,wxVtkBaseView*);
+    BBTK_DECLARE_INPUT(wxVtkBaseView2,wxVtkBaseView*);
+    BBTK_DECLARE_INPUT(wxVtkBaseView3,wxVtkBaseView*);
+    BBTK_DECLARE_INPUT(InteractionType,int);
+    BBTK_DECLARE_OUTPUT(vtkRenderer,vtkRenderer*);
+    BBTK_DECLARE_OUTPUT(Direction,int);
+    BBTK_DECLARE_OUTPUT(Image,vtkImageData*);
+    BBTK_DECLARE_OUTPUT(WindowColorLevel,std::vector<double>);
+    BBTK_DECLARE_OUTPUT(Interpolation,bool);
+    BBTK_DECLARE_OUTPUT(Point,std::vector<double>);
+    BBTK_DECLARE_OUTPUT(Normal,std::vector<double>);
   
-  BBTK_PROCESS(Process);
-  void Process();
+    BBTK_PROCESS(Process);
+    void Process();
+    bool firsttime;
+    void SetwxVtkBaseViewOutputs(wxVtkBaseView *wxvtkbaseview );
+
 //===== 
 // 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)
 //===== 
@@ -43,7 +49,10 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(wxVtkBaseView_Info,bbtk::AtomicBlackBox);
   BBTK_DESCRIPTION("No Description.");
   BBTK_CATEGORY("empty");
 
-  BBTK_INPUT(wxVtkBaseView_Info,wxVtkBaseView,"wxVtkBaseView",wxVtkBaseView*,"");
+  BBTK_INPUT(wxVtkBaseView_Info,wxVtkBaseView,"wxVtkBaseView Used for the principal output. Used in case of InteractionType!=0",wxVtkBaseView*,"");
+  BBTK_INPUT(wxVtkBaseView_Info,wxVtkBaseView2,"Used in case of InteractionType!=0",wxVtkBaseView*,"");
+  BBTK_INPUT(wxVtkBaseView_Info,wxVtkBaseView3,"Used in case of InteractionType!=0",wxVtkBaseView*,"");
+  BBTK_INPUT(wxVtkBaseView_Info,InteractionType,"(default 0) 0:Nothing 1:LeftButtonDown 2:LeftButtonUp 3:MouseMove 4:RightButtonDown 5:RightButtonUp 6:LeftDClick 7:RightDClick 8:DragLeft 9:DragRight",int,"");
 
   BBTK_OUTPUT(wxVtkBaseView_Info,Direction,"Direction -1=3D 0=YZ  1=XZ  2=XY(default)",int,"");
   BBTK_OUTPUT(wxVtkBaseView_Info,vtkRenderer,"vtkRenderer default=NULL",vtkRenderer*,"");
index 2dcd98950f71a29c6c30e89fafb8d606d29086ce..b1845ab925c2a486a922f4fb13d25711e65e8985 100644 (file)
@@ -68,7 +68,9 @@ void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event)
                mbbViewerNV->_point.push_back( (int)GetY() );
                mbbViewerNV->_point.push_back( (int)GetZ() );
                mbbViewerNV->bbSetOutputPoint( mbbViewerNV->_point );
+    printf("EED bbwxMaracas_N_ViewersWidget::OnRefreshView Point 1\n");
                mbbViewerNV->bbSignalOutputModification(std::string("Point"));
+    printf("EED bbwxMaracas_N_ViewersWidget::OnRefreshView Point 2\n");
        } // if
        wxMaracas_N_ViewersWidget::OnRefreshView(event);
 }
@@ -76,8 +78,11 @@ void bbwxMaracas_N_ViewersWidget::OnRefreshView(wxCommandEvent & event)
 //-------------------------------------------------------------
 void bbwxMaracas_N_ViewersWidget::OnDClickLeft(wxCommandEvent & event)
 {
+    printf("EED bbwxMaracas_N_ViewersWidget::OnDClickLeft 1\n");
        wxMaracas_N_ViewersWidget::OnDClickLeft(event);
+    printf("EED bbwxMaracas_N_ViewersWidget::OnDClickLeft 2\n");
        mbbViewerNV->bbSignalOutputModification(std::string("Point"));
+    printf("EED bbwxMaracas_N_ViewersWidget::OnDClickLeft 3\n");
 }
 
 //-------------------------------------------------------------