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 __wxGEditorTabPanel_h__
45 #define __wxGEditorTabPanel_h__
47 //Includes same project
48 #include "wxVtkSceneManager.h"
49 #include "wxTabPanelsManager.h"
53 #include <wx/aui/aui.h>
56 //Includes creaMaracasVisu
57 #include <wxVtk3DBaseView.h>
65 class tmpClasswxTextDropTarget : public wxTextDropTarget
68 virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data) { return false;}
72 //RaC: It is important if it exists a double relation
73 //e.g. wxGEditorTabPanel includes wxVtkSceneManager, and wxVtkSceneManager includes wxGEditorTabPanel
74 class wxVtkSceneManager;
75 class wxTabPanelsManager;
77 // RaC Be careful with the double heritance
78 class wxGEditorTabPanel : public wxPanel, public wxTextDropTarget
82 wxGEditorTabPanel(wxWindow *parent, int id);
85 void initWxVtkCanvas();
87 // Sets the parent manager
88 void setPanelsManager(wxTabPanelsManager* panelsManager);
90 // Get the BBS script of the pipeline diagram included in the panel
91 std::string getDiagramBBS(bool wln=false);
93 // Saves the actual BBS as complex box
94 // RaC TOFIX It must be included the package of the complex box
95 std::string saveComplexBoxBBS();
97 // Shows the dialog to edit black box parameters
98 void editBlackBox(GBlackBoxModel *bbmodel);
100 // Save diagram as BBG
101 void saveDiagram(std::string &content, const std::string &path); //DFCH
103 // Save temporary diagram as BBG
104 void saveTempDiagram();
107 void loadDiagram(ifstream &inputStream, const std::string &path); //DFCH
109 // Load temporary diagram as BBG
110 void loadTempDiagram(unsigned short un);
112 // evaluate the position in the undo actions list
113 unsigned short getUndoState();
115 // evaluate the position in the redo actions list
116 unsigned short getRedoState();
118 // Add a new complex input object to the scene
119 void addComplexInputPort(std::string portName);
121 // Add a new complex output object to the scene
122 void addComplexOutputPort(std::string portName);
124 // Delete all boxes in the diagram
125 void deleteAllBoxes();
127 // Center the camera in the initial position
130 // Display feedback info in the GUI
131 void displayBlackBoxInfo(std::string packageName, std::string boxName);
132 void updateStatusBar(std::string textStatus);
136 void setComplexBox(bool val);
138 // Returns a map with the id,controller of all the objects selected
139 std::map<int,GObjectController*> getSelectedObjects();
141 void addObjects(std::map<int,GObjectController*> objectsMap);
142 int getNumSelectedObjects();
144 // Receives the string from a drag and drop source as for example the BBTK Package Browser
145 virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
147 wxVtkSceneManager* getSceneManager();
149 void SetFullPath( const std::string& );
150 void SetFileName( const std::string& );
151 void SetCbName(std::string cbName);
152 void SetCbPackageName(std::string packagename);
153 void SetAuthor(std::string author);
154 void SetCategory(std::string category);
155 void SetDescription(std::string description);
157 std::string GetFullPath( );
158 std::string GetFileName( );
160 std::string GetCbName();
161 std::string GetCbPackageName();
162 std::string GetAuthor();
163 std::string GetDescription();
164 std::string GetCategory();
168 //=========================================================================
171 std::vector<std::string> states; // represents each modification of the tab. Maxixum size 100!!
172 std::vector<std::string>::iterator _actualdo; // actual position on modifications vector
175 wxAuiManager *_panelAUIMgr;
176 wxVtkSceneManager *_sceneManager;
177 wxTabPanelsManager *_panelsManager;
178 std::string _fullPath;
179 std::string _fileName;