1 /*=========================================================================
7 =========================================================================*/
9 /* ---------------------------------------------------------------------
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
14 * This software is governed by the CeCILL-B license under French law and
15 * abiding by the rules of distribution of free software. You can use,
16 * modify and/ or redistribute the software under the terms of the CeCILL-B
17 * license as circulated by CEA, CNRS and INRIA at the following URL
18 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
19 * or in the file LICENSE.txt.
21 * As a counterpart to the access to the source code and rights to copy,
22 * modify and redistribute granted by the license, users are provided only
23 * with a limited warranty and the software's author, the holder of the
24 * economic rights, and the successive licensors have only limited
27 * The fact that you are presently reading this means that you have had
28 * knowledge of the CeCILL-B license and that you accept its terms.
29 * ------------------------------------------------------------------------ */
35 * \brief Class bbtk::BlackBox : abstract black-box interface.
39 * Design and Developpement of BBTK GEditor
40 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
44 #ifndef __WxGUIEditorGraphicBBS_h__
45 #define __WxGUIEditorGraphicBBS_h__
47 //Includes same project
48 #include "wxTabPanelsManager.h"
49 #include "wxBlackBoxEditionDialog.h"
50 #include "wxVtkSceneManager.h"
51 #include "GlobalConstants.h"
54 #include "wxart_new.xpm" // JPR
55 #include "wxart_open.xpm"
56 #include "wxart_save.xpm"
57 #include "wxart_run.xpm"
58 #include "wxart_delete.xpm"
59 #include "wxart_centerview.xpm"
60 #include "wxart_box.xpm"
61 #include "wxart_executablebox.xpm"
62 #include "wxart_complexbox.xpm"
63 #include "wxart_complexinputport.xpm"
64 #include "wxart_complexoutputport.xpm"
65 #include "wxart_undo.xpm"
66 #include "wxart_redo.xpm"
68 //Includes creaMaracasVisu
71 #include <bbtkWxGUIPackageBrowser2.h>
72 #include <bbtkWxGUIHtmlBrowser.h>
73 #include <bbtkBlackBoxDescriptor.h>
74 #include <bbtkUtilities.h>
75 #include <bbtkConfigurationFile.h>
76 #include <bbtkSystemTools.h>
82 #include <wx/aui/aui.h>
83 #include <wx/aui/auibook.h>
85 #include <wx/toolbar.h>
86 #include <wx/bitmap.h>
97 //RaC: It is important if it exists a double relation
98 //e.g. wxTabPanelsManager includes wxGUIEditorGraphicBBS, and wxGUIEditorGraphicBBS includes wxTabPanelsManager
99 class wxTabPanelsManager;
100 class wxVtkSceneManager;
102 class wxGUIEditorGraphicBBS : public wxFrame
105 wxGUIEditorGraphicBBS(wxFrame *parent);
106 ~wxGUIEditorGraphicBBS();
110 void initTabPanelsManager();
111 void initPackageBrowser();
112 void initHelpHTMLBrowser();
113 wxAuiNotebook* getAuiNotebook();
115 // Display the info of the black box highlighted in the PackageBrowser
116 void displayBlackBoxInfo(std::string packageName, std::string boxName);
118 // Shows the textStatus in the wxFrame status bar
119 void updateStatusBar(std::string textStatus);
121 // Executes the BBS script in parameter
122 void executeScript(std::string script);
124 // Shows the dialog to change the parameters and values of the black box
125 void editBlackBox(GBlackBoxModel *bbmodel);
127 bool boxNameExists(std::string boxname);
129 // Checks and adds if necessary the .bbg/.bbs extensions
130 std::string CheckExtension (std::string filename, std::string extension);
131 // Method that can be used to refresh the help and package browser
133 void RegenerateAll();
134 void DoRegeneratePackageDoc(const std::string& pack);
135 void DoRegenerateBoxesLists();
137 // Refresh the state of buttons and menus when changing for example the mode to edit complex box
138 void refreshGUIControls();
140 void SaveActualBBS(std::string filename);
141 void AskComplexBoxConfiguration();
142 void SaveActualComplexBox(std::string filename);
143 void SaveActualDiagram(std::string filename);
144 void SaveCurrentDiagramAs( ); //DFCH
145 void SaveTempActualDiagram(const std::string &);//FCY
148 // File menu and toolbar events
149 void OnCreateNewTab(wxCommandEvent& event);
150 void OnOpenDiagram(wxCommandEvent& event);
151 void OnSaveActualDiagram(wxCommandEvent& event); //DFCH
152 void OnSaveAsActualDiagram(wxCommandEvent& event); //DFCH
153 void OnOpenBBS(wxCommandEvent& event);
154 void OnSaveActualBBS(wxCommandEvent& event);
155 void OnSaveActualComplexBox(wxCommandEvent& event);
156 void OnExecuteActualDiagram(wxCommandEvent& event);
157 void OnClickBtnExecutableBox(wxCommandEvent& event);
158 void OnDeleteAllBoxesActualDiagram(wxCommandEvent& event);
159 void OnCenterViewActualDiagram(wxCommandEvent& event);
160 void OnClickBtnBox(wxCommandEvent& event);
161 void OnClickBtnComplexBox(wxCommandEvent& event);
162 void OnAddComplexBoxInput(wxCommandEvent& event);
163 void OnAddComplexBoxOutput(wxCommandEvent& event);
164 void OnExit(wxCommandEvent& event);
165 void OnHelpBBeditor(wxCommandEvent& event);
166 void OnUndo(wxCommandEvent& event);
167 void OnRedo(wxCommandEvent& event);
168 void OnChangeName(wxCommandEvent& event);
171 void OnCopySelectedToComplexDiagram(wxCommandEvent& event);
175 void OnCreatePackage(wxCommandEvent& event);
176 void OnCreateBlackBox(wxCommandEvent& event);
177 void OnPlugPackage(wxCommandEvent& event);
178 void OnEditConfig(wxCommandEvent& event);
179 void OnShowHTMLDoc(wxCommandEvent& event);
180 void OnCreateIndex(wxCommandEvent& event);
187 //AuiManager for the wxWindow
188 wxAuiManager *_frameAUIMgr;
190 //Class that manages all the tabs in the window
191 wxTabPanelsManager *_tabsMgr;
193 //Notebook managed by the wxTabPanelsManager
194 wxAuiNotebook *_notebook;
196 //Instance to the BBTK Package Browser
197 WxGUIPackageBrowser2 *_pkgBrowser;
199 //Instance to the BBTK Help Browser
200 WxGUIHtmlBrowser *_helpHtmlBrowser;
202 //Name of the box and its package that is shown in the browser
203 std::string _actualPkgBrowserBoxName;
204 std::string _actualPkgBrowserPkgName;