]> Creatis software - bbtkGEditor.git/commitdiff
New wx and kernel classes
authorcorredor <>
Mon, 22 Mar 2010 14:47:57 +0000 (14:47 +0000)
committercorredor <>
Mon, 22 Mar 2010 14:47:57 +0000 (14:47 +0000)
16 files changed:
CMakeLists.txt
appli/bbEditor/CMakeLists.txt
appli/bbEditor/bbEditor.cxx
data/CMakeLists.txt [new file with mode: 0644]
data/icons/wxart_new.xpm [new file with mode: 0644]
install/CMakeLists.txt
lib/EditorGraphicBBS/bbsKernelEditorGraphic/CMakeLists.txt
lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/CMakeLists.txt
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h [new file with mode: 0644]
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx [new file with mode: 0644]
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h [new file with mode: 0644]

index 2f979a9c64a1642720c55fa251d65967e2e77e10..851614f26329e9052e4b7343f6ff1e0383b0276b 100644 (file)
@@ -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)
 #==================================
index 481592852015317e89ead02f84836c8c915d593f..56b590c821cc2b58ad717d0113691c295c2ef8df 100644 (file)
@@ -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} 
index c135924ee6b14052b3fb89fa773aca60a240ba43..4bdc42383d3ae83c56dd1ca70b9d2bd6fa319cfd 100644 (file)
 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 (file)
index 0000000..4137193
--- /dev/null
@@ -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 (file)
index 0000000..d46e270
--- /dev/null
@@ -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 ",
+"   ............ "
+};
index 5f300f357111a57916965addafce71e7626890a4..6a9c435ac5e02ab29a3a0865f1d35f85e547628f 100644 (file)
@@ -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
 #-----------------------------------------------------------------------------
index 4287ca8617970fa8fc025b75cb319c7032706910..a10999e8d616ee768bc3add5d984cf5d1aa977b5 100644 (file)
@@ -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 (file)
index 0000000..e867b9b
--- /dev/null
@@ -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 <vtkInteractorStyleBaseView2D.h>
+
+#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 (file)
index 0000000..7a0a541
--- /dev/null
@@ -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 <wxVtk3DBaseView.h>
+#include <InteractorStyleMaracas.h>
+
+//Includes std
+#include <iostream>
+
+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
+
index 642b0a384e5c1dd58bd807d845fc5b4da476c0d6..034af95e95a3a2804f8351e898d22c13877ede97 100644 (file)
@@ -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  )
index 05d50997f4e099a3427ae1006042e451ffb14747..3d761d467899bdc55cdef30204d2a9fedbe8ea3b 100644 (file)
@@ -1,9 +1,9 @@
 /*=========================================================================                                                                               
-  Program:   bbtk
-  Module:    $RCSfile$
-  Language:  C++
-  Date:      $Date$
-  Version:   $Revision$
+Program:   bbtk
+Module:    $RCSfile$
+Language:  C++
+Date:      $Date$
+Version:   $Revision$
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
 * ------------------------------------------------------------------------ */                                                                         
 
 /**
- *  \file 
- *  \brief Class bbtk::WxInterfaceEditorGraphicBBS . 
- */
-
-
+*  \file 
+*  \brief Class bbtk::WxInterfaceEditorGraphicBBS . 
+*/
 
 #include "bbtkwxGUIEditorGraphicBBS.h"
-#include "bbtkwxGUIEditorGraphicContainer.h"
-
-#include <bbtkWxGUIPackageBrowser2.h>
-
 
 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 //------------------"<<endl;
+               cout<<"RaC //TODO wxGUIEditorGraphicBBS constructor.Initialize datadir with  crea::System::GetExecutablePath() ."<<endl;
+               cout<<"RaC //------------------"<<endl;
+
+           #ifdef LINUX /* assume this is OSX */
+                  datadir=datadir+"/../share/creaContours";
+           #endif // MACOSX    
        
-  }
+               #ifdef MACOSX /* assume this is OSX */
+                       datadir=datadir+"/../../../../share/creaContours";
+               #endif // MACOSX        
+
+               _dataDir = datadir;
+
+               initMenu();
+               initToolbar();
+               initPackageBrowser();
+               initTabPanelsManager();
+
+               CreateStatusBar();
+               _frameAUIMgr->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"<<std::endl;
+                       _tabsMgr->addNewTab();
+                       break;
+               case wxID_NEW+1 :
+                       //BlackBoxDescriptor* desc = _pkgBrowser->GetActualSelected();
+                       //cout<<"RaC GetActualSelected desc:"<<desc->GetAuthor()<<endl;
+               }
+       }
 
 
 }  // EO namespace bbtk
index eccbb09b263281fcf86c817f497ed035907bcdef..725d3f10716986d2d2b13d53abd1f57b3e3bdd66 100644 (file)
 
 #include <wx/frame.h>
 #include <wx/aui/aui.h>
+#include <wx/aui/auibook.h>
+#include <bbtkWxGUIPackageBrowser2.h>
+#include <wx/panel.h>
+#include <wx/toolbar.h>
+#include <wx/bitmap.h>
+#include <wx/menu.h>
+#include "wxart_new.xpm"
 
+#include <bbtkBlackBoxDescriptor.h>
+
+#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 (file)
index 0000000..9365306
--- /dev/null
@@ -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:"<<data<<" x:"<<x<<" y:"<<y<<endl;
+         return true;
+
+       }
+
+       //=========================================================================
+
+}  // EO namespace bbtk
+
+// EOF
+
diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h
new file mode 100644 (file)
index 0000000..98a9ead
--- /dev/null
@@ -0,0 +1,83 @@
+/*=========================================================================                                                                               
+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::wxGEditorTabPanel
+* \brief 
+*/
+
+#ifndef __wxGEditorTabPanel_h__
+#define __wxGEditorTabPanel_h__
+
+#include <wx/panel.h>
+#include <wx/aui/aui.h>
+#include <wx/dnd.h>
+
+#include <wxVtk3DBaseView.h>
+
+#include <iostream>
+
+#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 (file)
index 0000000..0dc9e42
--- /dev/null
@@ -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 (file)
index 0000000..6d4b90a
--- /dev/null
@@ -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 <wx/aui/auibook.h>
+#include <wx/panel.h>
+#include <map>
+#include <iostream>
+
+#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<int, wxPanel*> _panels;
+               wxPanel* _actual;
+               wxAuiNotebook  *_notebook;
+               int _lastId;
+               
+       protected:
+
+       };
+
+
+}
+// namespace bbtk
+#endif
+