00001 /*========================================================================= 00002 Program: bbtk 00003 Module: $RCSfile: bbtkwxGUIEditorGraphicBBS.h,v $ 00004 Language: C++ 00005 Date: $Date: 2012/05/25 12:55:15 $ 00006 Version: $Revision: 1.43 $ 00007 =========================================================================*/ 00008 00009 /* --------------------------------------------------------------------- 00010 00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) 00012 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux 00013 * 00014 * This software is governed by the CeCILL-B license under French law and 00015 * abiding by the rules of distribution of free software. You can use, 00016 * modify and/ or redistribute the software under the terms of the CeCILL-B 00017 * license as circulated by CEA, CNRS and INRIA at the following URL 00018 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 00019 * or in the file LICENSE.txt. 00020 * 00021 * As a counterpart to the access to the source code and rights to copy, 00022 * modify and redistribute granted by the license, users are provided only 00023 * with a limited warranty and the software's author, the holder of the 00024 * economic rights, and the successive licensors have only limited 00025 * liability. 00026 * 00027 * The fact that you are presently reading this means that you have had 00028 * knowledge of the CeCILL-B license and that you accept its terms. 00029 * ------------------------------------------------------------------------ */ 00030 00031 00032 00038 /**** 00039 * Design and Developpement of BBTK GEditor 00040 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co> 00041 * RaC - 2010 00042 ****/ 00043 00044 #ifndef __WxGUIEditorGraphicBBS_h__ 00045 #define __WxGUIEditorGraphicBBS_h__ 00046 00047 //Includes same project 00048 #include "wxTabPanelsManager.h" 00049 #include "wxBlackBoxEditionDialog.h" 00050 #include "wxVtkSceneManager.h" 00051 #include "GlobalConstants.h" 00052 00053 00054 #include "wxart_new.xpm" // JPR 00055 #include "wxart_open.xpm" 00056 #include "wxart_save.xpm" 00057 #include "wxart_run.xpm" 00058 #include "wxart_delete.xpm" 00059 #include "wxart_centerview.xpm" 00060 #include "wxart_box.xpm" 00061 #include "wxart_executablebox.xpm" 00062 #include "wxart_complexbox.xpm" 00063 #include "wxart_complexinputport.xpm" 00064 #include "wxart_complexoutputport.xpm" 00065 #include "wxart_undo.xpm" 00066 #include "wxart_redo.xpm" 00067 00068 //Includes creaMaracasVisu 00069 00070 //Includes bbtk 00071 #include <bbtkWxGUIPackageBrowser2.h> 00072 #include <bbtkWxGUIHtmlBrowser.h> 00073 #include <bbtkBlackBoxDescriptor.h> 00074 #include <bbtkConfigurationFile.h> 00075 #include <bbtkSystemTools.h> 00076 00077 //Includes vtk 00078 00079 //Includes wxWidgets 00080 #include <wx/frame.h> 00081 #include <wx/aui/aui.h> 00082 #include <wx/aui/auibook.h> 00083 #include <wx/panel.h> 00084 #include <wx/toolbar.h> 00085 #include <wx/bitmap.h> 00086 #include <wx/menu.h> 00087 #include <wx/dnd.h> 00088 #include <wx/grid.h> 00089 00090 //Includes std 00091 #include <iostream> 00092 #include <fstream> 00093 00094 namespace bbtk 00095 { 00096 //RaC: It is important if it exists a double relation 00097 //e.g. wxTabPanelsManager includes wxGUIEditorGraphicBBS, and wxGUIEditorGraphicBBS includes wxTabPanelsManager 00098 class wxTabPanelsManager; 00099 class wxVtkSceneManager; 00100 00101 class wxGUIEditorGraphicBBS : public wxFrame 00102 { 00103 public: 00104 wxGUIEditorGraphicBBS(wxFrame *parent); 00105 ~wxGUIEditorGraphicBBS(); 00106 00107 void initToolbar(); 00108 void initMenu(); 00109 void initTabPanelsManager(); 00110 void initPackageBrowser(); 00111 void initHelpHTMLBrowser(); 00112 wxAuiNotebook* getAuiNotebook(); 00113 00114 // Display the info of the black box highlighted in the PackageBrowser 00115 void displayBlackBoxInfo(std::string packageName, std::string boxName); 00116 00117 // Shows the textStatus in the wxFrame status bar 00118 void updateStatusBar(std::string textStatus); 00119 00120 // Executes the BBS script in parameter 00121 void executeScript(std::string script); 00122 00123 // Shows the dialog to change the parameters and values of the black box 00124 void editBlackBox(GBlackBoxModel *bbmodel); 00125 00126 bool boxNameExists(std::string boxname); 00127 00128 // Checks and adds if necessary the .bbg/.bbs extensions 00129 std::string CheckExtension (std::string filename, std::string extension); 00130 // Method that can be used to refresh the help and package browser 00131 // RaC TOFIX!!! 00132 void RegenerateAll(); 00133 void DoRegeneratePackageDoc(const std::string& pack); 00134 void DoRegenerateBoxesLists(); 00135 00136 // Refresh the state of buttons and menus when changing for example the mode to edit complex box 00137 void refreshGUIControls(); 00138 00139 void SaveActualBBS(std::string filename); 00140 void AskComplexBoxConfiguration(); 00141 void SaveActualComplexBox(std::string filename); 00142 void SaveActualDiagram(std::string filename); 00143 void SaveCurrentDiagramAs( ); //DFCH 00144 void SaveTempActualDiagram(const std::string &);//FCY 00145 00146 00147 // File menu and toolbar events 00148 void OnCreateNewTab(wxCommandEvent& event); 00149 void OnOpenDiagram(wxCommandEvent& event); 00150 void OnSaveActualDiagram(wxCommandEvent& event); //DFCH 00151 void OnSaveAsActualDiagram(wxCommandEvent& event); //DFCH 00152 void OnOpenBBS(wxCommandEvent& event); 00153 void OnSaveActualBBS(wxCommandEvent& event); 00154 void OnSaveActualComplexBox(wxCommandEvent& event); 00155 void OnExecuteActualDiagram(wxCommandEvent& event); 00156 void OnClickBtnExecutableBox(wxCommandEvent& event); 00157 void OnDeleteAllBoxesActualDiagram(wxCommandEvent& event); 00158 void OnCenterViewActualDiagram(wxCommandEvent& event); 00159 void OnClickBtnBox(wxCommandEvent& event); 00160 void OnClickBtnComplexBox(wxCommandEvent& event); 00161 void OnAddComplexBoxInput(wxCommandEvent& event); 00162 void OnAddComplexBoxOutput(wxCommandEvent& event); 00163 void OnExit(wxCommandEvent& event); 00164 void OnHelpBBeditor(wxCommandEvent& event); 00165 void OnUndo(wxCommandEvent& event); 00166 void OnRedo(wxCommandEvent& event); 00167 void OnChangeName(wxCommandEvent& event); 00168 00169 // Edit menu events 00170 void OnCopySelectedToComplexDiagram(wxCommandEvent& event); 00171 00172 00173 // Tool menu events 00174 void OnCreatePackage(wxCommandEvent& event); 00175 void OnCreateBlackBox(wxCommandEvent& event); 00176 void OnPlugPackage(wxCommandEvent& event); 00177 void OnEditConfig(wxCommandEvent& event); 00178 void OnShowHTMLDoc(wxCommandEvent& event); 00179 void OnCreateIndex(wxCommandEvent& event); 00180 00181 00182 00183 00184 private: 00185 00186 //AuiManager for the wxWindow 00187 wxAuiManager *_frameAUIMgr; 00188 00189 //Class that manages all the tabs in the window 00190 wxTabPanelsManager *_tabsMgr; 00191 00192 //Notebook managed by the wxTabPanelsManager 00193 wxAuiNotebook *_notebook; 00194 00195 //Instance to the BBTK Package Browser 00196 WxGUIPackageBrowser2 *_pkgBrowser; 00197 00198 //Instance to the BBTK Help Browser 00199 WxGUIHtmlBrowser *_helpHtmlBrowser; 00200 00201 //Name of the box and its package that is shown in the browser 00202 std::string _actualPkgBrowserBoxName; 00203 std::string _actualPkgBrowserPkgName; 00204 00205 protected: 00206 00207 00208 }; 00209 00210 00211 } 00212 // namespace bbtk 00213 #endif 00214