ADD_EXECUTABLE(bbEditor MACOSX_BUNDLE ${SOURCES} )
ENDIF(BBTK_USE_WXWIDGETS AND WIN32)
-
+
TARGET_LINK_LIBRARIES(bbEditor
bbsWxGUIEditorGraphic
bbsKernelEditorGraphic
+ bbsVtkGUIEditorGraphic
${VTK_LIBRARIES}
${WXWIDGETS_LIBRARIES}
${creaMaracasVisu_LIBRARIES}
#include <wx/cmdline.h>
#include <wx/app.h>
-
+
class wxBBEditorApp : public wxApp
{
IMPLEMENT_APP(wxBBEditorApp);
-
+
// ----------------------------------------------------------------------------
// The `main program' equivalent, creating the windows and returning the
//=========================================================================
- wxVtkSceneManager::wxVtkSceneManager(wxVtk3DBaseView *baseView,int id)
+ wxVtkSceneManager::wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView,int id)
{
_id=id;
_baseView=baseView;
if( _baseView!=NULL )
{
- vtkInteractorStyleBaseView* baseViewControlManager = (vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView();
- baseViewControlManager->AddInteractorStyleMaracas( this );
+
+ _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(parent);
+ registerController(this);
configureBaseView();
vtkRenderer *ren1 =_baseView->GetRenderer();
//=========================================================================
wxVtkSceneManager::~wxVtkSceneManager()
{
+ //_baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(NULL);
}
//=========================================================================
//=========================================================================
+ void wxVtkSceneManager::createGBlackBox()
+ {
+ InteractorStyleMaracas *toAdd = VTKGObjectsFactory::getInstance()->createGBlackBox(_baseView);
+ registerController(toAdd);
+ }
+
+ //=========================================================================
+
+ void wxVtkSceneManager::registerController(InteractorStyleMaracas *param)
+ {
+ vtkInteractorStyleBaseView* baseViewControlManager = (vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView();
+ baseViewControlManager->AddInteractorStyleMaracas( param );
+ }
+
+ //=========================================================================
+
+ vtkRenderer* wxVtkSceneManager::getRenderer()
+ {
+ return _baseView->GetRenderer();
+ }
+
+ //=========================================================================
+
+ vtkRenderWindow* wxVtkSceneManager::getRenderWindow()
+ {
+ return _baseView->GetRenWin();
+ }
+ //=========================================================================
+
+
+ //=========================================================================
} // EO namespace bbtk
// EOF
#ifndef __wxVtkSceneManager_h__
#define __wxVtkSceneManager_h__
+//Includes Same project
+#include "VTKGObjectsFactory.h"
+
//Includes creaMaracasVisu
#include <wxVtk3DBaseView.h>
#include <InteractorStyleMaracas.h>
+//Includes vtk
+#include <vtkRenderWindow.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkRenderer.h>
+
//Includes std
#include <iostream>
class wxVtkSceneManager : public InteractorStyleMaracas
{
public:
- wxVtkSceneManager(wxVtk3DBaseView *baseView, int id);
+ wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView, int id);
~wxVtkSceneManager();
void configureBaseView();
- //void addGBox(double x=0, double y=0);
+ void createGBlackBox();
+ void registerController(InteractorStyleMaracas *param);
+
+ vtkRenderWindow* getRenderWindow();
+ vtkRenderer* getRenderer();
private:
-#
\ No newline at end of file
+
+
+FILE(GLOB bbsVtkGUIEditorGraphic_CXX_SOURCES "." "*.cxx")
+FILE(GLOB bbsVtkGUIEditorGraphic_H_SOURCES "." "*.h")
+
+INCLUDE_DIRECTORIES(../bbsWxGUIEditorGraphic)
+INCLUDE_DIRECTORIES(../bbsKernelEditorGraphic)
+
+ADD_LIBRARY(bbsVtkGUIEditorGraphic
+ ${bbsVtkGUIEditorGraphic_CXX_SOURCES}
+ ${bbsVtkGUIEditorGraphic_H_SOURCES} )
+
initMenu();
initToolbar();
- initPackageBrowser();
initTabPanelsManager();
+ initPackageBrowser();
+
CreateStatusBar();
_frameAUIMgr->Update();
////////////////////
// TEMP to avoid drag and drop
- _toolbar->AddTool(wxID_NEW+1,_T("New Box"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New Box"), _T("Create a new Box"));
+ _toolbar->AddTool(15,_T("New Box"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New Box"), _T("Create a new Box"));
//
// connect command event handlers
Connect(wxID_NEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick));
+ Connect(15,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick));
}
_pkgBrowser->IncludeAll();
_frameAUIMgr->AddPane(_pkgBrowser,wxAuiPaneInfo().Left().MinSize(200,200).CloseButton(false));
- //FIXME - Just the first tab with drop target event
- //_pkgBrowser->SetBoxListDropTarget((wxDropTarget*)_tabsMgr->getActualTabPanel());
}
/*****************************************************
std::cout<<"RaC New"<<std::endl;
_tabsMgr->addNewTab();
break;
- case wxID_NEW+1 :
- //BlackBoxDescriptor* desc = _pkgBrowser->GetActualSelected();
- //cout<<"RaC GetActualSelected desc:"<<desc->GetAuthor()<<endl;
+ case 15 :
+ BlackBoxDescriptor* desc = _pkgBrowser->GetActualSelected();
+ cout<<"RaC GetActualSelected desc:"<<desc->GetAuthor()<<endl;
+
}
}
#include <wx/bitmap.h>
#include <wx/menu.h>
#include "wxart_new.xpm"
+#include <wx/dnd.h>
#include <bbtkBlackBoxDescriptor.h>
}
//=========================================================================
- wxGEditorTabPanel::wxGEditorTabPanel(wxWindow *parent,int id):wxPanel(parent)
+ wxGEditorTabPanel::wxGEditorTabPanel(wxWindow *parent,int id):wxPanel(parent),wxTextDropTarget()
{
_id=id;
_panelAUIMgr = new wxAuiManager(this);
//=========================================================================
wxGEditorTabPanel::~wxGEditorTabPanel()
{
+ delete _sceneManager;
}
//=========================================================================
{
wxVtk3DBaseView *baseview = new wxVtk3DBaseView(this);
baseview->Configure();
- _sceneManager=new wxVtkSceneManager(baseview,_id);
+
+ _sceneManager=new wxVtkSceneManager(this,baseview,_id);
_panelAUIMgr->AddPane((wxWindow*)baseview->GetWxVTKRenderWindowInteractor(),wxAuiPaneInfo().Fixed().CenterPane());
_panelAUIMgr->Update();
bool wxGEditorTabPanel::OnDropText(wxCoord x, wxCoord y, const wxString& data)
{
-
+ _sceneManager->createGBlackBox();
cout<<"RaC DyD:"<<data<<" x:"<<x<<" y:"<<y<<endl;
return true;
#include <iostream>
#include "wxVtkSceneManager.h"
+#include "VTKGObjectsFactory.h"
namespace bbtk
{
{
_lastId++;
- wxPanel *newPanel = new wxGEditorTabPanel(_notebook,_lastId);
+ wxGEditorTabPanel *newPanel = new wxGEditorTabPanel(_notebook,_lastId);
_panels[_lastId]=newPanel;
_actual = newPanel;
}
//=========================================================================
- wxPanel* wxTabPanelsManager::getActualTabPanel()
+ wxGEditorTabPanel* wxTabPanelsManager::getActualTabPanel()
{
return _actual;
}
#include <wx/aui/auibook.h>
#include <wx/panel.h>
+#include <wx/string.h>
#include <map>
#include <iostream>
virtual void addNewTab();
wxAuiNotebook* getAuiNotebook();
- wxPanel* getActualTabPanel();
+ wxGEditorTabPanel* getActualTabPanel();
private:
** The map
*/
map<int, wxPanel*> _panels;
- wxPanel* _actual;
+ wxGEditorTabPanel* _actual;
wxAuiNotebook *_notebook;
int _lastId;