2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
8 # This software is governed by the CeCILL-B license under French law and
9 # abiding by the rules of distribution of free software. You can use,
10 # modify and/ or redistribute the software under the terms of the CeCILL-B
11 # license as circulated by CEA, CNRS and INRIA at the following URL
12 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
13 # or in the file LICENSE.txt.
15 # As a counterpart to the access to the source code and rights to copy,
16 # modify and redistribute granted by the license, users are provided only
17 # with a limited warranty and the software's author, the holder of the
18 # economic rights, and the successive licensors have only limited
21 # The fact that you are presently reading this means that you have had
22 # knowledge of the CeCILL-B license and that you accept its terms.
23 # ------------------------------------------------------------------------
26 /*=========================================================================
32 =========================================================================*/
34 /* ---------------------------------------------------------------------
36 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale)
37 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux
39 * This software is governed by the CeCILL-B license under French law and
40 * abiding by the rules of distribution of free software. You can use,
41 * modify and/ or redistribute the software under the terms of the CeCILL-B
42 * license as circulated by CEA, CNRS and INRIA at the following URL
43 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
44 * or in the file LICENSE.txt.
46 * As a counterpart to the access to the source code and rights to copy,
47 * modify and redistribute granted by the license, users are provided only
48 * with a limited warranty and the software's author, the holder of the
49 * economic rights, and the successive licensors have only limited
52 * The fact that you are presently reading this means that you have had
53 * knowledge of the CeCILL-B license and that you accept its terms.
54 * ------------------------------------------------------------------------ */
60 * \brief Class bbtk::BlackBox : abstract black-box interface.
64 * Design and Developpement of BBTK GEditor
65 * Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
69 #ifndef __wxGEditorTabPanel_h__
70 #define __wxGEditorTabPanel_h__
72 //Includes same project
73 #include "wxVtkSceneManager.h"
74 #include "wxTabPanelsManager.h"
78 #include <wx/aui/aui.h>
81 //Includes creaMaracasVisu
82 #include <wxVtk3DBaseView.h>
90 class tmpClasswxTextDropTarget : public wxTextDropTarget
93 virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data) { return false;}
97 //RaC: It is important if it exists a double relation
98 //e.g. wxGEditorTabPanel includes wxVtkSceneManager, and wxVtkSceneManager includes wxGEditorTabPanel
99 class wxVtkSceneManager;
100 class wxTabPanelsManager;
102 // RaC Be careful with the double heritance
103 class wxGEditorTabPanel : public wxPanel, public wxTextDropTarget
107 wxGEditorTabPanel(wxWindow *parent, int id, Factory::Pointer bbtkfactory);
108 ~wxGEditorTabPanel();
110 void initWxVtkCanvas();
112 // Sets the parent manager
113 void setPanelsManager(wxTabPanelsManager* panelsManager);
115 // Get the BBS script of the pipeline diagram included in the panel
116 std::string getDiagramBBS(bool wln=false);
118 // Saves the actual BBS as complex box
119 // RaC TOFIX It must be included the package of the complex box
120 std::string saveComplexBoxBBS();
122 // Shows the dialog to edit black box parameters
123 void editBlackBox(GBlackBoxModel *bbmodel);
125 // Save diagram as BBG
126 void saveDiagram(std::string &content, const std::string &path); //DFCH
128 // Save temporary diagram as BBG
129 void saveTempDiagram(const std::string &);
131 // Save temporary diagram as BBG and update buttons
132 void saveTempandUpdate(const std::string &);
135 void loadDiagram(std::ifstream &inputStream, const std::string &path); //DFCH
137 void saveStringAction(const std::string &action);
139 // Load temporary diagram as BBG
140 void loadTempDiagram(unsigned short un);
142 // evaluate the position in the undo actions list
143 unsigned short getUndoState(std::string &);
145 // evaluate the position in the redo actions list
146 unsigned short getRedoState(std::string &);
148 // Add a new complex input object to the scene
149 void addComplexInputPort(std::string portName);
151 // Add a new complex output object to the scene
152 void addComplexOutputPort(std::string portName);
154 // Delete all boxes in the diagram
155 void deleteAllBoxes();
157 // Center the camera in the initial position
160 // Display feedback info in the GUI
161 void displayBlackBoxInfo(std::string packageName, std::string boxName);
162 void updateStatusBar(std::string textStatus);
166 void setComplexBox(bool val);
168 // Returns a map with the id,controller of all the objects selected
169 std::map<int,GObjectController*> getSelectedObjects();
171 void addObjects(std::map<int,GObjectController*> objectsMap);
172 int getNumSelectedObjects();
174 // Receives the string from a drag and drop source as for example the BBTK Package Browser
175 virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
177 wxVtkSceneManager* getSceneManager();
179 void SetFullPath( const std::string& );
180 void SetFileName( const std::string& );
181 void SetCbName(std::string cbName);
182 void SetCbPackageName(std::string packagename);
183 void SetAuthor(std::string author);
184 void SetCategory(std::string category);
185 void SetDescription(std::string description);
186 void SetMessageKind(std::string kind);
187 void SetMessageLevel(std::string level);
189 std::string GetFullPath( );
190 std::string GetFileName( );
191 std::string GetCbName();
192 std::string GetCbPackageName();
193 std::string GetAuthor();
194 std::string GetDescription();
195 std::string GetCategory();
196 std::string GetMessageKind();
197 std::string GetMessageLevel();
199 void SelectBoxWithPossibleName(std::string nameFilter );
201 //=========================================================================
204 std::vector<std::string> states; // represents each modification of the tab. Maxixum size 100!!
205 std::vector<std::string>::iterator _actualdo; // actual position on modifications vector
206 std::vector<std::string> sstates; // represents string of each modification of the tab. Maxixum size 100!!
207 std::vector<std::string>::iterator _sactualdo; // actual position onstring modifications vector
209 wxAuiManager *_panelAUIMgr;
210 wxVtkSceneManager *_sceneManager;
211 wxTabPanelsManager *_panelsManager;
212 std::string _fullPath;
213 std::string _fileName;
215 Factory::Pointer _bbtkfactory;