#include <wx/menu.h>
#include "InteractorStyleMaracas.h"
#include <vtkInteractorStyleBaseView.h>
+#include "wxVtk2DBaseView.h"
namespace bbcreaMaracasVisu
{
class PopupMenuInteractor : public InteractorStyleMaracas , wxEvtHandler
{
public:
- PopupMenuInteractor( );
+// PopupMenuInteractor( );
PopupMenuInteractor( wxPopupMenu *box, wxVtkBaseView *wxvtkbaseview );
~PopupMenuInteractor();
// virtual bool OnLeftButtonDown();
// 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()
} else {
_box->bbSetOutputSimpleText( "void" );
}
+ _box->bbSetOutputPoint( lstPoint );
_box->bbSignalOutputModification();
}
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 );
//=====
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
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
//=====
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