From 6f4ac31353f8bfcbbb3ccc49942e384e4ebeb36c Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 13 Jan 2022 11:19:06 +0100 Subject: [PATCH] #3481 wxVtkBaseView_Info add events mouse observer --- .../bbcreaMaracasVisuChInfo3Dto2DRuler.cxx | 26 +- bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx | 92 +++--- bbtk/src/bbcreaMaracasVisuwxPopupMenu.h | 3 - .../bbcreaMaracasVisuwxVtkBaseView_Info.cxx | 304 +++++++++++++++--- .../src/bbcreaMaracasVisuwxVtkBaseView_Info.h | 31 +- bbtk/src/bbmaracasvisuViewerNV.cxx | 5 + 6 files changed, 339 insertions(+), 122 deletions(-) diff --git a/bbtk/src/bbcreaMaracasVisuChInfo3Dto2DRuler.cxx b/bbtk/src/bbcreaMaracasVisuChInfo3Dto2DRuler.cxx index 95a5652..276d6f1 100644 --- a/bbtk/src/bbcreaMaracasVisuChInfo3Dto2DRuler.cxx +++ b/bbtk/src/bbcreaMaracasVisuChInfo3Dto2DRuler.cxx @@ -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 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 diff --git a/bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx b/bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx index 026a89c..4e844ff 100644 --- a/bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx +++ b/bbtk/src/bbcreaMaracasVisuwxPopupMenu.cxx @@ -11,25 +11,31 @@ 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 lstItems = _box->bbGetInputIn(); + int size = lstItems.size(); + if ((id>=0) && (idbbSetOutputSimpleText( 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 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 lstItems = _box->bbGetInputIn(); + int size = lstItems.size(); + int i; + wxMenu menu; for (i=0;iGetId(), 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 = " <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) //===== diff --git a/bbtk/src/bbcreaMaracasVisuwxPopupMenu.h b/bbtk/src/bbcreaMaracasVisuwxPopupMenu.h index bb862c5..1c3bb02 100644 --- a/bbtk/src/bbcreaMaracasVisuwxPopupMenu.h +++ b/bbtk/src/bbcreaMaracasVisuwxPopupMenu.h @@ -13,7 +13,6 @@ #include "wx/wxprec.h" #include - #ifdef __BORLANDC__ #pragma hdrstop #endif @@ -29,8 +28,6 @@ #include "wxVtkBaseView.h" - - namespace bbcreaMaracasVisu { diff --git a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx index 1c92d3b..afbdaaa 100644 --- a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx +++ b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.cxx @@ -3,17 +3,222 @@ //===== #include "bbcreaMaracasVisuwxVtkBaseView_Info.h" #include "bbcreaMaracasVisuPackage.h" +#include "InteractorStyleMaracas.h" +#include + 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 LstWindowColorLevel; + LstWindowColorLevel.push_back( vtkbasedata->GetColorWindow() ); + LstWindowColorLevel.push_back( vtkbasedata->GetColorLevel() ); + bbSetOutputWindowColorLevel( LstWindowColorLevel ); + + std::vector 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 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 = " <GetRenderer() ); - bbSetOutputDirection( bbGetInputwxVtkBaseView()->GetDirection() ); - vtkBaseData *vtkbasedata = bbGetInputwxVtkBaseView()->GetVtkBaseData(); - if (vtkbasedata!=NULL) - { - marImageData *marimagedata = vtkbasedata->GetMarImageData(); - if (marimagedata!=NULL) - { - bbSetOutputImage( marimagedata->GetImageData() ); - } // MarImageData - std::vector LstWindowColorLevel; - LstWindowColorLevel.push_back( vtkbasedata->GetColorWindow() ); - LstWindowColorLevel.push_back( vtkbasedata->GetColorLevel() ); - bbSetOutputWindowColorLevel( LstWindowColorLevel ); - - std::vector lstPoint; - lstPoint.push_back( vtkbasedata->GetX() ); - lstPoint.push_back( vtkbasedata->GetY() ); - lstPoint.push_back( vtkbasedata->GetZ() ); - bbSetOutputPoint( lstPoint ); - - double normal[3]; - std::vector 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 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 diff --git a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h index 4a32c0f..5f97e8a 100644 --- a/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h +++ b/bbtk/src/bbcreaMaracasVisuwxVtkBaseView_Info.h @@ -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); - BBTK_DECLARE_OUTPUT(Interpolation,bool); - BBTK_DECLARE_OUTPUT(Point,std::vector); - BBTK_DECLARE_OUTPUT(Normal,std::vector); + 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); + BBTK_DECLARE_OUTPUT(Interpolation,bool); + BBTK_DECLARE_OUTPUT(Point,std::vector); + BBTK_DECLARE_OUTPUT(Normal,std::vector); - 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*,""); diff --git a/bbtk/src/bbmaracasvisuViewerNV.cxx b/bbtk/src/bbmaracasvisuViewerNV.cxx index 2dcd989..b1845ab 100644 --- a/bbtk/src/bbmaracasvisuViewerNV.cxx +++ b/bbtk/src/bbmaracasvisuViewerNV.cxx @@ -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"); } //------------------------------------------------------------- -- 2.45.1