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"
53 #include "wxart_new.xpm" // JPR
54 #include "wxart_open.xpm"
55 #include "wxart_save.xpm"
56 #include "wxart_run.xpm"
57 #include "wxart_delete.xpm"
58 #include "wxart_centerview.xpm"
59 #include "wxart_box.xpm"
60 #include "wxart_executablebox.xpm"
61 #include "wxart_complexbox.xpm"
62 #include "wxart_complexinputport.xpm"
63 #include "wxart_complexoutputport.xpm"
65 //Includes creaMaracasVisu
68 #include <bbtkWxGUIPackageBrowser2.h>
69 #include <bbtkWxGUIHtmlBrowser.h>
70 #include <bbtkBlackBoxDescriptor.h>
71 #include <bbtkConfigurationFile.h>
72 #include <bbtkSystemTools.h>
78 #include <wx/aui/aui.h>
79 #include <wx/aui/auibook.h>
81 #include <wx/toolbar.h>
82 #include <wx/bitmap.h>
93 //RaC: It is important if it exists a double relation
94 //e.g. wxTabPanelsManager includes wxGUIEditorGraphicBBS, and wxGUIEditorGraphicBBS includes wxTabPanelsManager
95 class wxTabPanelsManager;
96 class wxVtkSceneManager;
98 class wxGUIEditorGraphicBBS : public wxFrame
101 wxGUIEditorGraphicBBS(wxFrame *parent);
102 ~wxGUIEditorGraphicBBS();
106 void initTabPanelsManager();
107 void initPackageBrowser();
108 void initHelpHTMLBrowser();
109 wxAuiNotebook* getAuiNotebook();
111 // Display the info of the black box highlighted in the PackageBrowser
112 void displayBlackBoxInfo(std::string packageName, std::string boxName);
114 // Shows the textStatus in the wxFrame status bar
115 void updateStatusBar(std::string textStatus);
117 // Executes the BBS script in parameter
118 void executeScript(std::string script);
120 // Shows the dialog to change the parameters and values of the black box
121 void editBlackBox(GBlackBoxModel *bbmodel);
123 // Method that can be used to refresh the help and package browser
125 void RegenerateAll();
126 void DoRegeneratePackageDoc(const std::string& pack);
127 void DoRegenerateBoxesLists();
129 // Refresh the state of buttons and menus when changing for example the mode to edit complex box
130 void refreshGUIControls();
132 void SaveActualBBS(std::string filename);
133 void AskComplexBoxConfiguration();
134 void SaveActualComplexBox(std::string filename);
135 void SaveActualDiagram(std::string filename);
136 void SaveCurrentDiagramAs( ); //DFCH
139 // File menu and toolbar events
140 void OnCreateNewTab(wxCommandEvent& event);
141 void OnOpenDiagram(wxCommandEvent& event);
142 void OnSaveActualDiagram(wxCommandEvent& event); //DFCH
143 void OnSaveAsActualDiagram(wxCommandEvent& event); //DFCH
144 void OnOpenBBS(wxCommandEvent& event);
145 void OnSaveActualBBS(wxCommandEvent& event);
146 void OnSaveActualComplexBox(wxCommandEvent& event);
147 void OnExecuteActualDiagram(wxCommandEvent& event);
148 void OnClickBtnExecutableBox(wxCommandEvent& event);
149 void OnDeleteAllBoxesActualDiagram(wxCommandEvent& event);
150 void OnCenterViewActualDiagram(wxCommandEvent& event);
151 void OnClickBtnBox(wxCommandEvent& event);
152 void OnClickBtnComplexBox(wxCommandEvent& event);
153 void OnAddComplexBoxInput(wxCommandEvent& event);
154 void OnAddComplexBoxOutput(wxCommandEvent& event);
155 void OnExit(wxCommandEvent& event);
156 void OnHelpBBeditor(wxCommandEvent& event);
159 void OnCopySelectedToComplexDiagram(wxCommandEvent& event);
162 void OnCreatePackage(wxCommandEvent& event);
163 void OnCreateBlackBox(wxCommandEvent& event);
164 void OnPlugPackage(wxCommandEvent& event);
165 void OnEditConfig(wxCommandEvent& event);
166 void OnShowHTMLDoc(wxCommandEvent& event);
167 void OnCreateIndex(wxCommandEvent& event);
174 //AuiManager for the wxWindow
175 wxAuiManager *_frameAUIMgr;
177 //Class that manages all the tabs in the window
178 wxTabPanelsManager *_tabsMgr;
180 //Notebook managed by the wxTabPanelsManager
181 wxAuiNotebook *_notebook;
183 //Instance to the BBTK Package Browser
184 WxGUIPackageBrowser2 *_pkgBrowser;
186 //Instance to the BBTK Help Browser
187 WxGUIHtmlBrowser *_helpHtmlBrowser;
189 //Name of the box and its package that is shown in the browser
190 std::string _actualPkgBrowserBoxName;
191 std::string _actualPkgBrowserPkgName;