]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h
no message
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / bbtkwxGUIEditorGraphicBBS.h
1 /*=========================================================================
2   Program:   bbtk
3   Module:    $RCSfile$
4   Language:  C++
5   Date:      $Date$
6   Version:   $Revision$
7 =========================================================================*/
8
9 /* ---------------------------------------------------------------------
10
11 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
12 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
13 *
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.
20 *
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
25 *  liability.
26 *
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 * ------------------------------------------------------------------------ */
30
31
32
33 /**
34  *  \file
35  *  \brief Class bbtk::BlackBox : abstract black-box interface.
36  */
37
38 /****
39 * Design and Developpement of BBTK GEditor
40 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
41 * RaC - 2010
42 ****/
43
44 #ifndef __WxGUIEditorGraphicBBS_h__
45 #define __WxGUIEditorGraphicBBS_h__
46
47 //Includes same project
48 #include "wxTabPanelsManager.h"
49 #include "wxBlackBoxEditionDialog.h"
50 #include "wxVtkSceneManager.h"
51 #include "GlobalConstants.h"
52
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"
64
65 //Includes creaMaracasVisu
66
67 //Includes bbtk
68 #include <bbtkWxGUIPackageBrowser2.h>
69 #include <bbtkWxGUIHtmlBrowser.h>
70 #include <bbtkBlackBoxDescriptor.h>
71 #include <bbtkConfigurationFile.h>
72
73 //Includes vtk
74
75 //Includes wxWidgets
76 #include <wx/frame.h>
77 #include <wx/aui/aui.h>
78 #include <wx/aui/auibook.h>
79 #include <wx/panel.h>
80 #include <wx/toolbar.h>
81 #include <wx/bitmap.h>
82 #include <wx/menu.h>
83 #include <wx/dnd.h>
84 #include <wx/grid.h>
85
86 //Includes std
87 #include <iostream>
88 #include <fstream>
89
90 namespace bbtk
91 {
92         //RaC: It is important if it exists a double relation
93         //e.g. wxTabPanelsManager includes wxGUIEditorGraphicBBS, and wxGUIEditorGraphicBBS includes wxTabPanelsManager
94         class wxTabPanelsManager;
95         class wxVtkSceneManager;
96
97         class  wxGUIEditorGraphicBBS : public wxFrame
98         {
99                 public:
100                         wxGUIEditorGraphicBBS(wxFrame *parent);
101                         ~wxGUIEditorGraphicBBS();
102
103                         void initToolbar();
104                         void initMenu();
105                         void initTabPanelsManager();
106                         void initPackageBrowser();
107                         void initHelpHTMLBrowser();
108                         wxAuiNotebook* getAuiNotebook();
109
110                         // Display the info of the black box highlighted in the PackageBrowser
111                         void displayBlackBoxInfo(std::string packageName, std::string boxName);
112
113                         // Shows the textStatus in the wxFrame status bar
114                         void updateStatusBar(std::string textStatus);
115
116                         // Executes the BBS script in parameter
117                         void executeScript(std::string script);
118
119                         // Shows the dialog to change the parameters and values of the black box
120                         void editBlackBox(GBlackBoxModel *bbmodel);
121
122                         // Method that can be used to refresh the help and package browser
123                         // RaC TOFIX!!!
124                         void RegenerateAll();
125                         void DoRegeneratePackageDoc(const std::string& pack);
126                         void DoRegenerateBoxesLists();
127
128                         // Refresh the state of buttons and menus when changing for example the mode to edit complex box
129                         void refreshGUIControls();
130                         
131             void SaveActualBBS(std::string filename);
132             void AskComplexBoxConfiguration();
133             void SaveActualComplexBox(std::string filename);
134             void SaveActualDiagram(std::string filename);
135                         void SaveCurrentDiagramAs( ); //DFCH
136
137
138                         // File menu and toolbar events
139                         void OnCreateNewTab(wxCommandEvent& event);
140                         void OnOpenDiagram(wxCommandEvent& event);
141                         void OnSaveActualDiagram(wxCommandEvent& event); //DFCH
142                         void OnSaveAsActualDiagram(wxCommandEvent& event); //DFCH
143                         void OnOpenBBS(wxCommandEvent& event);
144                         void OnSaveActualBBS(wxCommandEvent& event);
145                         void OnSaveActualComplexBox(wxCommandEvent& event);
146                         void OnExecuteActualDiagram(wxCommandEvent& event);
147                         void OnClickBtnExecutableBox(wxCommandEvent& event);
148                         void OnDeleteAllBoxesActualDiagram(wxCommandEvent& event);
149                         void OnCenterViewActualDiagram(wxCommandEvent& event);
150                         void OnClickBtnBox(wxCommandEvent& event);
151                         void OnClickBtnComplexBox(wxCommandEvent& event);
152                         void OnAddComplexBoxInput(wxCommandEvent& event);
153                         void OnAddComplexBoxOutput(wxCommandEvent& event);
154                         void OnExit(wxCommandEvent& event);
155                         void OnHelpBBeditor(wxCommandEvent& event);
156
157                         // Edit menu events
158                         void OnCopySelectedToComplexDiagram(wxCommandEvent& event);
159
160                         // Tool menu events
161                         void OnCreatePackage(wxCommandEvent& event);
162                         void OnCreateBlackBox(wxCommandEvent& event);
163                         void OnPlugPackage(wxCommandEvent& event);
164                         void OnEditConfig(wxCommandEvent& event);
165                         void OnShowHTMLDoc(wxCommandEvent& event);
166                         void OnCreateIndex(wxCommandEvent& event);
167                 
168                 
169                 
170                 
171                 private:
172
173                         //AuiManager for the wxWindow
174                         wxAuiManager                                            *_frameAUIMgr;
175
176                         //Class that manages all the tabs in the window
177                         wxTabPanelsManager                                      *_tabsMgr;
178
179                         //Notebook managed by the wxTabPanelsManager
180                         wxAuiNotebook                                           *_notebook;
181
182                         //Instance to the BBTK Package Browser
183                         WxGUIPackageBrowser2                            *_pkgBrowser;
184
185                         //Instance to the BBTK Help Browser
186                         WxGUIHtmlBrowser                                        *_helpHtmlBrowser;
187
188                         //Name of the box and its package that is shown in the browser
189                         std::string                         _actualPkgBrowserBoxName;
190                         std::string                         _actualPkgBrowserPkgName;
191
192                 protected:
193
194
195  };
196
197
198 }
199 // namespace bbtk
200 #endif
201