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 __wxTabPanelsManager_h__
45 #define __wxTabPanelsManager_h__
47 #include <wx/aui/auibook.h>
49 #include <wx/string.h>
54 #include "wxGEditorTabPanel.h"
55 #include "wxVtkSceneManager.h"
56 #include "bbtkwxGUIEditorGraphicBBS.h"
64 class wxVtkSceneManager;
65 class wxGEditorTabPanel;
66 class wxGUIEditorGraphicBBS;
68 class wxTabPanelsManager : public wxEvtHandler
73 wxTabPanelsManager(wxGUIEditorGraphicBBS *parent);
74 ~wxTabPanelsManager();
76 void addNewTab(wxString tabName=_T("new_tab"));
77 wxAuiNotebook* getAuiNotebook();
78 wxGEditorTabPanel* getActualTabPanel();
80 void displayBlackBoxInfo(std::string packageName, std::string boxName);
81 void updateStatusBar(std::string textStatus);
83 std::string getActualDiagramBBS(bool wln=false);
84 std::string getActualComplexBoxBBS();
86 void editBlackBox(GBlackBoxModel *bbmodel);
87 void deleteAllBoxesActualDiagram();
88 void centerViewActualDiagram();
89 void saveActualDiagram(std::string &content, const std::string &path); //DFCH
90 void loadDiagram(ifstream &inputStream, const std::string &path); //DFCH
92 void saveTempActualDiagram(const std::string &); //FCY
93 void saveTempandUpdate(const std::string &);
94 void loadTempDiagram(unsigned short un); //FCY
95 unsigned short getUndoState(std::string &);
96 unsigned short getRedoState(std::string &);
97 bool isActualDiagramComplexBox();
98 void setActualDiagramComplexBox(bool val);
99 void addActualDiagramComplexInputPort(std::string portName);
100 void addActualDiagramComplexOutputPort(std::string portName);
101 void copySelectedBBoxesToComplexDiagram();
102 int getNumActualSelectedObjects();
104 void OnTabChanged(wxAuiNotebookEvent& event);
106 // Event handler. Runs in the moment of closing but not closed yet (for that exists the CLOSED event, but not working at all)
107 void OnTabClose(wxAuiNotebookEvent& event);
109 void VerifyLastTabPanel();
111 // Getters and Setters of current diagram
112 void SetCbName(std::string cbName);
113 void SetCbPackageName(std::string packagename);
114 void SetAuthor(std::string author);
115 void SetCategory(std::string category);
116 void SetDescription(std::string description);
117 std::string GetCbName();
118 std::string GetCbPackageName();
119 std::string GetAuthor();
120 std::string GetDescription();
121 std::string GetCategory();
123 void SetNameTabPanel(wxString tabpanelname);
124 std::string GetNameTabPanel();
125 std::string GetCurrentTabPanelPath( ); //DFCH
126 int FindTab(std::string filename);
127 bool TryToOpenScriptApplication(std::string packageName ,std::string boxType);
131 // Private Attributes
132 wxGUIEditorGraphicBBS *_parent;
133 map<int, wxGEditorTabPanel*> _panels;
134 wxGEditorTabPanel *_actual;
135 wxAuiNotebook *_notebook;