From 1910361932998533c37b53ea81d580bba29f0ee1 Mon Sep 17 00:00:00 2001 From: corredor <> Date: Mon, 22 Mar 2010 14:47:57 +0000 Subject: [PATCH] New wx and kernel classes --- CMakeLists.txt | 3 +- appli/bbEditor/CMakeLists.txt | 6 +- appli/bbEditor/bbEditor.cxx | 9 +- data/CMakeLists.txt | 16 ++ data/icons/wxart_new.xpm | 50 +++++ install/CMakeLists.txt | 24 +++ .../bbsKernelEditorGraphic/CMakeLists.txt | 13 +- .../wxVtkSceneManager.cxx | 96 +++++++++ .../wxVtkSceneManager.h | 78 +++++++ .../bbsWxGUIEditorGraphic/CMakeLists.txt | 2 +- .../bbtkwxGUIEditorGraphicBBS.cxx | 200 ++++++++++++------ .../bbtkwxGUIEditorGraphicBBS.h | 36 +++- .../wxGEditorTabPanel.cxx | 88 ++++++++ .../bbsWxGUIEditorGraphic/wxGEditorTabPanel.h | 83 ++++++++ .../wxTabPanelsManager.cxx | 89 ++++++++ .../wxTabPanelsManager.h | 86 ++++++++ 16 files changed, 793 insertions(+), 86 deletions(-) create mode 100644 data/CMakeLists.txt create mode 100644 data/icons/wxart_new.xpm create mode 100644 lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx create mode 100644 lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h create mode 100644 lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx create mode 100644 lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h create mode 100644 lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx create mode 100644 lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f979a9..851614f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,7 +76,7 @@ SET(USE_WXWIDGETS ON) SET(USE_KWWIDGETS OFF) SET(USE_VTK ON) SET(USE_ITK OFF) -SET(USE_BOOST OFF) +SET(USE_BOOST ON) # Note : Set USE_DOXYGEN to ON # if you think you will ask, some day, @@ -133,5 +133,6 @@ SET(BBTK_DOC_BUILD_PATH SUBDIRS(lib) SUBDIRS(appli) SUBDIRS(doc) +SUBDIRS(data) SUBDIRS(install) #================================== diff --git a/appli/bbEditor/CMakeLists.txt b/appli/bbEditor/CMakeLists.txt index 4815928..56b590c 100644 --- a/appli/bbEditor/CMakeLists.txt +++ b/appli/bbEditor/CMakeLists.txt @@ -10,6 +10,9 @@ SET(SOURCES ) INCLUDE_DIRECTORIES(../../lib/EditorGraphicBBS/bbsWxGUIEditorGraphic) +INCLUDE_DIRECTORIES(../../lib/EditorGraphicBBS/bbsKernelEditorGraphic) +INCLUDE_DIRECTORIES(../../lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic) +INCLUDE_DIRECTORIES(../../data/icons) IF(BBTK_USE_WXWIDGETS AND WIN32) ADD_EXECUTABLE(bbEditor WIN32 ${SOURCES}) @@ -20,7 +23,8 @@ ENDIF(BBTK_USE_WXWIDGETS AND WIN32) TARGET_LINK_LIBRARIES(bbEditor - bbsWxGUIEditorGraphic + bbsWxGUIEditorGraphic + bbsKernelEditorGraphic ${VTK_LIBRARIES} ${WXWIDGETS_LIBRARIES} ${creaMaracasVisu_LIBRARIES} diff --git a/appli/bbEditor/bbEditor.cxx b/appli/bbEditor/bbEditor.cxx index c135924..4bdc423 100644 --- a/appli/bbEditor/bbEditor.cxx +++ b/appli/bbEditor/bbEditor.cxx @@ -13,14 +13,13 @@ class wxBBEditorApp : public wxApp { public: - bool OnInit( ); + bool OnInit( ); int OnExit() { return true; } - + }; - + IMPLEMENT_APP(wxBBEditorApp); - - + // ---------------------------------------------------------------------------- diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt new file mode 100644 index 0000000..4137193 --- /dev/null +++ b/data/CMakeLists.txt @@ -0,0 +1,16 @@ + +SET(INPUT_DATA_DIR ${PROJECT_SOURCE_DIR}/data) + +FILE(GLOB CONFIGURE_DATA_FILES *.*) + +IF(WIN32) + SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/Debug/data) + CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR}) + SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/Release/data) + CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR}) + SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/RelWithDebInfo/data) + CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR}) +ELSE(WIN32) + SET(OUTPUT_DATA_DIR ${PROJECT_BINARY_DIR}/data) + CREA_CPDIR(${INPUT_DATA_DIR} ${OUTPUT_DATA_DIR}) +ENDIF(WIN32) \ No newline at end of file diff --git a/data/icons/wxart_new.xpm b/data/icons/wxart_new.xpm new file mode 100644 index 0000000..d46e270 --- /dev/null +++ b/data/icons/wxart_new.xpm @@ -0,0 +1,50 @@ +/* XPM */ +static const char *new_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 15 29 1", +"* c #97C4E7", +"- c #72A8D2", +": c #FFFFFF", +"9 c #839CB5", +"o c #6B98B8", +"X c #5A89A6", +"# c #3A749C", +", c #D1E5F5", +"0 c #85A7BC", +"$ c #C3DDF1", +"8 c #749BB4", +"; c #5F9BC8", +" c None", +"+ c #538DB3", +"= c #85BBE2", +"3 c #EFF6FC", +"O c #6591AE", +"5 c #F7FBFD", +"7 c #FAFCFE", +"< c #DAEAF7", +"4 c #E9F3FA", +"6 c #FDFDFE", +"1 c #E2EFF8", +". c #8EA9BC", +"% c #B6D5EE", +"& c #A5CCEA", +"> c #ACE95B", +"2 c #F4F9FD", +"@ c #4581AA", +/* pixels */ +" .XoOO+@#. ", +" .$$%&*=O-; ", +" @@@@$%&*O:*o ", +" @>>@$$%&O::*o ", +"@@@>>@@@$%OOoO+ ", +"@>>>>>>@,$%&*=+ ", +"@>>>>>>@<,$%&*+ ", +"@@@>>@@@1<,$%&O ", +" @>>@2341<,$%O ", +" @@@@52341<,$o ", +" .:6752341<,8 ", +" .::6752341<8 ", +" .:::67523419 ", +" .::::6752340 ", +" ............ " +}; diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index 5f300f3..6a9c435 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -1,3 +1,27 @@ +#----------------------------------------------------------------------------- +# INSTALL FILES +#----------------------------------------------------------------------------- +SET(DATA_DIR ${PROJECT_SOURCE_DIR}/data ) +FILE(GLOB DATA_FILES "${DATA_DIR}/*.*") +FOREACH( iLST ${DATA_FILES} ) + INSTALL( + FILES ${iLST} + DESTINATION bin/data + ) +ENDFOREACH(iLST) +SET(DATA_DIR ${PROJECT_SOURCE_DIR}/data/icons ) +FILE(GLOB DATA_FILES "${DATA_DIR}/*.*") +FOREACH( iLST ${DATA_FILES} ) + INSTALL( + FILES ${iLST} + DESTINATION bin/data/icons + ) +ENDFOREACH(iLST) + +#----------------------------------------------------------------------------- + + + #----------------------------------------------------------------------------- # CPACK+NSIS PACKAGING #----------------------------------------------------------------------------- diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt index 4287ca8..a10999e 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt @@ -1 +1,12 @@ -# \ No newline at end of file + + +FILE(GLOB bbsKernelEditorGraphic_CXX_SOURCES "." "*.cxx") +FILE(GLOB bbsKernelEditorGraphic_H_SOURCES "." "*.h") + +INCLUDE_DIRECTORIES(../bbsWxGUIEditorGraphic) +INCLUDE_DIRECTORIES(../bbsVtkGUIEditorGraphic) + +ADD_LIBRARY(bbsKernelEditorGraphic + ${bbsKernelEditorGraphic_CXX_SOURCES} + ${bbsKernelEditorGraphic_H_SOURCES} ) + diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx new file mode 100644 index 0000000..e867b9b --- /dev/null +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx @@ -0,0 +1,96 @@ +/*========================================================================= +Program: bbtk +Module: $RCSfile$ +Language: C++ +Date: $Date$ +Version: $Revision$ +=========================================================================*/ + +/* --------------------------------------------------------------------- + +* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) +* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* +* This software is governed by the CeCILL-B license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL-B +* license as circulated by CEA, CNRS and INRIA at the following URL +* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +* or in the file LICENSE.txt. +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited +* liability. +* +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL-B license and that you accept its terms. +* ------------------------------------------------------------------------ */ + +/** +* \file +* \brief Class bbtk::wxVtkSceneManager . +*/ + + +#include "wxVtkSceneManager.h" +#include + +#include "vtkConeSource.h" +#include "vtkPolyDataMapper.h" +#include "vtkActor.h" +#include "vtkRenderer.h" + +namespace bbtk +{ + + + //========================================================================= + wxVtkSceneManager::wxVtkSceneManager(wxVtk3DBaseView *baseView,int id) + { + _id=id; + _baseView=baseView; + if( _baseView!=NULL ) + { + vtkInteractorStyleBaseView* baseViewControlManager = (vtkInteractorStyleBaseView*)_baseView->GetInteractorStyleBaseView(); + baseViewControlManager->AddInteractorStyleMaracas( this ); + + configureBaseView(); + + vtkRenderer *ren1 =_baseView->GetRenderer(); + vtkConeSource *cone = vtkConeSource::New(); + + cone->SetResolution(8); + + vtkPolyDataMapper *map = vtkPolyDataMapper::New(); + map->SetInput(cone->GetOutput()); + + vtkActor *act = vtkActor::New(); + + act->SetMapper(map); + + ren1->AddActor(act); + + ren1->Render(); + } + } + + //========================================================================= + wxVtkSceneManager::~wxVtkSceneManager() + { + } + //========================================================================= + + void wxVtkSceneManager::configureBaseView() + { + vtkInteractorStyleBaseView2D *temp = new vtkInteractorStyleBaseView2D(); + _baseView->SetInteractorStyleBaseView(temp); + } + + //========================================================================= + +} // EO namespace bbtk + +// EOF + diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h new file mode 100644 index 0000000..7a0a541 --- /dev/null +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h @@ -0,0 +1,78 @@ +/*========================================================================= +Program: bbtk +Module: $RCSfile$ +Language: C++ +Date: $Date$ +Version: $Revision$ +=========================================================================*/ + +/* --------------------------------------------------------------------- + +* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) +* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* +* This software is governed by the CeCILL-B license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL-B +* license as circulated by CEA, CNRS and INRIA at the following URL +* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +* or in the file LICENSE.txt. +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited +* liability. +* +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL-B license and that you accept its terms. +* ------------------------------------------------------------------------ */ + + + +/** +* \file +* \brief Class bbtk::BlackBox : abstract black-box interface. +*/ + +/** +* \class bbtk::wxVtkSceneManager +* \brief +*/ + +#ifndef __wxVtkSceneManager_h__ +#define __wxVtkSceneManager_h__ + +//Includes creaMaracasVisu +#include +#include + +//Includes std +#include + +namespace bbtk +{ + + class wxVtkSceneManager : public InteractorStyleMaracas + { + public: + wxVtkSceneManager(wxVtk3DBaseView *baseView, int id); + ~wxVtkSceneManager(); + + void configureBaseView(); + //void addGBox(double x=0, double y=0); + + private: + + int _id; + wxVtk3DBaseView *_baseView; + + protected: + + }; + + +} +// namespace bbtk +#endif + diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt index 642b0a3..034af95 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt @@ -5,9 +5,9 @@ FILE(GLOB bbsWxGUIEditorGraphic_H_SOURCES "." "*.h") INCLUDE_DIRECTORIES(../bbsKernelEditorGraphic) INCLUDE_DIRECTORIES(../bbsVtkGUIEditorGraphic) +INCLUDE_DIRECTORIES(../../../data/icons) ADD_LIBRARY(bbsWxGUIEditorGraphic ${bbsWxGUIEditorGraphic_CXX_SOURCES} ${bbsWxGUIEditorGraphic_H_SOURCES} ) -#TARGET_LINK_LIBRARIES(bbsWxGUIEditorGraphic bbtk ) diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index 05d5099..3d761d4 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -1,9 +1,9 @@ /*========================================================================= - Program: bbtk - Module: $RCSfile$ - Language: C++ - Date: $Date$ - Version: $Revision$ +Program: bbtk +Module: $RCSfile$ +Language: C++ +Date: $Date$ +Version: $Revision$ =========================================================================*/ /* --------------------------------------------------------------------- @@ -29,82 +29,142 @@ * ------------------------------------------------------------------------ */ /** - * \file - * \brief Class bbtk::WxInterfaceEditorGraphicBBS . - */ - - +* \file +* \brief Class bbtk::WxInterfaceEditorGraphicBBS . +*/ #include "bbtkwxGUIEditorGraphicBBS.h" -#include "bbtkwxGUIEditorGraphicContainer.h" - -#include - namespace bbtk { - //========================================================================= + //========================================================================= wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent) - : wxFrame(parent, -1, _T("bbEditor"),wxDefaultPosition, wxSize(1200,800)) - { - m_mgr.SetManagedWindow(this); - editorgraphiccontainer = new wxGUIEditorGraphicContainer(this); - - wxPanel *mWxGUIGrapphicEditorPanel = new wxPanel(this,-1); - wxPanel *mWxGUIBoxBrowserPanel = new wxPanel(this,-1); - wxPanel *mWxGUIConfigurationGraphicEditorPanel = new wxPanel(this,-1); - - mWxGUIGrapphicEditorPanel->SetBackgroundColour( wxColor(255,0,0) ); - mWxGUIBoxBrowserPanel->SetBackgroundColour( wxColor(0,255,0) ); - mWxGUIConfigurationGraphicEditorPanel->SetBackgroundColour( wxColor(255,0,255) ); - - // - m_mgr.AddPane(mWxGUIGrapphicEditorPanel, - wxAuiPaneInfo().Name(wxT("graphic_editor_content")) - .Caption(wxT("Graphic editor")) - .MinimizeButton(true) - .MaximizeButton(true) - .Center() - .MinSize(wxSize(100,100)) - ); - - m_mgr.AddPane(mWxGUIBoxBrowserPanel, - wxAuiPaneInfo().Name(wxT("box_browser_content")) - .Caption(wxT("Box browser")) - .MinimizeButton(true) - .MaximizeButton(true) - .Right() - .Layer(2) - .MinSize(wxSize(400,100)) - ); - - m_mgr.AddPane(mWxGUIConfigurationGraphicEditorPanel, - wxAuiPaneInfo().Name(wxT("configuration_graphic_editor_content")) - .Caption(wxT("Messages")) - .MinimizeButton(true) - .MaximizeButton(true) - .Bottom() - .MinSize(wxSize(100,100)) - ); - - SetAutoLayout(true); - Layout(); - m_mgr.Update(); - - WxGUIPackageBrowser2 *bb= new WxGUIPackageBrowser2(this); + : wxFrame(parent, -1, _T("bbtkGEditor"),wxDefaultPosition, wxSize(1200,800)) + { + _frameAUIMgr = new wxAuiManager(this); + + + //std::string datadir( crea::System::GetExecutablePath() ); + std::string datadir ("."); + cout<<"RaC //------------------"<Update(); + } + + + //========================================================================= + wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS() + { + _frameAUIMgr->UnInit(); + } + + //========================================================================= + void wxGUIEditorGraphicBBS::initToolbar() + { + //std::string filename= _dataDir + "/data/icons/wxart_new.xpm"; + wxBitmap bmp_new(new_xpm); + + wxToolBar *_toolbar = new wxToolBar(this, wxID_ANY); + + //Adds a tool btn to the toolbar + _toolbar->AddTool(wxID_NEW,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab")); - //========================================================================= - wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS() - { - delete editorgraphiccontainer; - m_mgr.UnInit(); - } - //========================================================================= + //////////////////// + // 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->SetMargins( 2, 2 ); + _toolbar->Realize(); + SetToolBar(_toolbar); + + // connect command event handlers + Connect(wxID_NEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); + + } + + //========================================================================= + void wxGUIEditorGraphicBBS::initMenu() + { + // create a menu bar + wxMenu *fileMenu = new wxMenu; + + // the "About" item should be in the help menu + wxMenu *helpMenu = new wxMenu; + helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About")); + fileMenu->Append(wxID_EXIT, _T("E&xit"), _T("Exit")); + + // now append the freshly created menu to the menu bar... + wxMenuBar *menuBar = new wxMenuBar(); + menuBar->Append(fileMenu, _T("&File")); + menuBar->Append(helpMenu, _T("&Help")); + + // attach this menu bar to the frame + SetMenuBar(menuBar); + } + + //========================================================================= + void wxGUIEditorGraphicBBS::initTabPanelsManager() + { + wxAuiNotebook *notebook = new wxAuiNotebook(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON); + _tabsMgr = new wxTabPanelsManager(notebook); + _frameAUIMgr->AddPane(notebook,wxAuiPaneInfo().CenterPane()); + + } + + //========================================================================= + void wxGUIEditorGraphicBBS::initPackageBrowser() + { + _pkgBrowser = new WxGUIPackageBrowser2(this); + _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()); + } + + /***************************************************** + /* HANDLERS + /*****************************************************/ + + void wxGUIEditorGraphicBBS::OnToolLeftClick(wxCommandEvent& event) + { + switch (event.GetId()) + { + case wxID_NEW : + std::cout<<"RaC New"<addNewTab(); + break; + case wxID_NEW+1 : + //BlackBoxDescriptor* desc = _pkgBrowser->GetActualSelected(); + //cout<<"RaC GetActualSelected desc:"<GetAuthor()< #include +#include +#include +#include +#include +#include +#include +#include "wxart_new.xpm" +#include + +#include "wxTabPanelsManager.h" namespace bbtk { - - class wxGUIEditorGraphicContainer; class wxGUIEditorGraphicBBS : public wxFrame { public: wxGUIEditorGraphicBBS(wxFrame *parent ); ~wxGUIEditorGraphicBBS(); - private: - wxAuiManager m_mgr; - wxGUIEditorGraphicContainer *editorgraphiccontainer; - - protected: + + void initToolbar(); + void initMenu(); + void initTabPanelsManager(); + void initPackageBrowser(); + + void OnToolLeftClick(wxCommandEvent& event); + + + private: + wxAuiManager *_frameAUIMgr; + wxTabPanelsManager *_tabsMgr; + wxAuiNotebook *_notebook; + WxGUIPackageBrowser2 *_pkgBrowser; + + std::string _dataDir; + + protected: + }; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx new file mode 100644 index 0000000..9365306 --- /dev/null +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx @@ -0,0 +1,88 @@ +/*========================================================================= +Program: bbtk +Module: $RCSfile$ +Language: C++ +Date: $Date$ +Version: $Revision$ +=========================================================================*/ + +/* --------------------------------------------------------------------- + +* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) +* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* +* This software is governed by the CeCILL-B license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL-B +* license as circulated by CEA, CNRS and INRIA at the following URL +* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +* or in the file LICENSE.txt. +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited +* liability. +* +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL-B license and that you accept its terms. +* ------------------------------------------------------------------------ */ + +/** +* \file +* \brief Class bbtk::wxGEditorTabPanel . +*/ + + +#include "wxGEditorTabPanel.h" + + +namespace bbtk +{ + //========================================================================= + wxGEditorTabPanel::wxGEditorTabPanel() + { + } + + //========================================================================= + wxGEditorTabPanel::wxGEditorTabPanel(wxWindow *parent,int id):wxPanel(parent) + { + _id=id; + _panelAUIMgr = new wxAuiManager(this); + _sceneManager = NULL; + + initWxVtkCanvas(); + } + + //========================================================================= + wxGEditorTabPanel::~wxGEditorTabPanel() + { + } + + //========================================================================= + void wxGEditorTabPanel::initWxVtkCanvas() + { + wxVtk3DBaseView *baseview = new wxVtk3DBaseView(this); + baseview->Configure(); + _sceneManager=new wxVtkSceneManager(baseview,_id); + + _panelAUIMgr->AddPane((wxWindow*)baseview->GetWxVTKRenderWindowInteractor(),wxAuiPaneInfo().Fixed().CenterPane()); + _panelAUIMgr->Update(); + } + + //========================================================================= + + bool wxGEditorTabPanel::OnDropText(wxCoord x, wxCoord y, const wxString& data) + { + + cout<<"RaC DyD:"< +#include +#include + +#include + +#include + +#include "wxVtkSceneManager.h" + +namespace bbtk +{ + + class wxGEditorTabPanel : public wxTextDropTarget, public wxPanel + { + public: + wxGEditorTabPanel(); + wxGEditorTabPanel(wxWindow *parent, int id); + ~wxGEditorTabPanel(); + + void initWxVtkCanvas(); + virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data); + + private: + + int _id; + wxAuiManager *_panelAUIMgr; + wxVtkSceneManager *_sceneManager; + + protected: + + }; + + +} +// namespace bbtk +#endif + diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx new file mode 100644 index 0000000..0dc9e42 --- /dev/null +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx @@ -0,0 +1,89 @@ +/*========================================================================= +Program: bbtk +Module: $RCSfile$ +Language: C++ +Date: $Date$ +Version: $Revision$ +=========================================================================*/ + +/* --------------------------------------------------------------------- + +* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) +* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* +* This software is governed by the CeCILL-B license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL-B +* license as circulated by CEA, CNRS and INRIA at the following URL +* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +* or in the file LICENSE.txt. +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited +* liability. +* +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL-B license and that you accept its terms. +* ------------------------------------------------------------------------ */ + +/** +* \file +* \brief Class bbtk::wxTabPanelsManager . +*/ + + +#include "wxTabPanelsManager.h" + + +namespace bbtk +{ + + + //========================================================================= + wxTabPanelsManager::wxTabPanelsManager(wxAuiNotebook *notebook) + { + _lastId = 0; + _notebook = notebook; + addNewTab(); + } + + //========================================================================= + wxTabPanelsManager::~wxTabPanelsManager() + { + } + + //========================================================================= + void wxTabPanelsManager::addNewTab() + { + _lastId++; + + wxPanel *newPanel = new wxGEditorTabPanel(_notebook,_lastId); + _panels[_lastId]=newPanel; + _actual = newPanel; + + _notebook->AddPage(newPanel,_T("Diagram"),true); + } + + //========================================================================= + wxAuiNotebook* wxTabPanelsManager::getAuiNotebook() + { + return _notebook; + } + + //========================================================================= + wxPanel* wxTabPanelsManager::getActualTabPanel() + { + return _actual; + } + + /***************************************************** + /* HANDLERS + /*****************************************************/ + + +} // EO namespace bbtk + +// EOF + diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h new file mode 100644 index 0000000..6d4b90a --- /dev/null +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h @@ -0,0 +1,86 @@ +/*========================================================================= +Program: bbtk +Module: $RCSfile$ +Language: C++ +Date: $Date$ +Version: $Revision$ +=========================================================================*/ + +/* --------------------------------------------------------------------- + +* Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) +* Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux +* +* This software is governed by the CeCILL-B license under French law and +* abiding by the rules of distribution of free software. You can use, +* modify and/ or redistribute the software under the terms of the CeCILL-B +* license as circulated by CEA, CNRS and INRIA at the following URL +* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +* or in the file LICENSE.txt. +* +* As a counterpart to the access to the source code and rights to copy, +* modify and redistribute granted by the license, users are provided only +* with a limited warranty and the software's author, the holder of the +* economic rights, and the successive licensors have only limited +* liability. +* +* The fact that you are presently reading this means that you have had +* knowledge of the CeCILL-B license and that you accept its terms. +* ------------------------------------------------------------------------ */ + + + +/** +* \file +* \brief Class bbtk::BlackBox : abstract black-box interface. +*/ + +/** +* \class bbtk::wxTabPanelsManager +* \brief +*/ + +#ifndef __wxTabPanelsManager_h__ +#define __wxTabPanelsManager_h__ + +#include +#include +#include +#include + +#include "wxGEditorTabPanel.h" + +using namespace std; + +namespace bbtk +{ + + class wxTabPanelsManager + { + public: + wxTabPanelsManager(wxAuiNotebook *notebook); + ~wxTabPanelsManager(); + + virtual void addNewTab(); + wxAuiNotebook* getAuiNotebook(); + wxPanel* getActualTabPanel(); + + private: + + /** + ** The map + */ + map _panels; + wxPanel* _actual; + wxAuiNotebook *_notebook; + int _lastId; + + protected: + + }; + + +} +// namespace bbtk +#endif + -- 2.45.1