]> Creatis software - bbtkGEditor.git/blob - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h
2ccf32d3afc57e8f31b93a66380aec33ad84c17f
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxGEditorTabPanel.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 __wxGEditorTabPanel_h__
45 #define __wxGEditorTabPanel_h__
46
47 //Includes same project
48 #include "wxVtkSceneManager.h"
49 #include "wxTabPanelsManager.h"
50
51 //Includes wxWidgets
52 #include <wx/panel.h>
53 #include <wx/aui/aui.h>
54 #include <wx/dnd.h>
55
56 //Includes creaMaracasVisu
57 #include <wxVtk3DBaseView.h>
58
59 //Includes std
60 #include <iostream>
61
62
63
64
65 namespace bbtk
66 {
67
68         class tmpClasswxTextDropTarget :   public wxTextDropTarget
69         {
70                 public:
71                   virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data) { return false;}
72         };
73
74
75         //RaC: It is important if it exists a double relation
76         //e.g. wxGEditorTabPanel includes wxVtkSceneManager, and wxVtkSceneManager includes wxGEditorTabPanel
77         class wxVtkSceneManager;
78         class wxTabPanelsManager;
79
80         // RaC Be careful with the double heritance
81         class wxGEditorTabPanel :  public wxPanel, public wxTextDropTarget
82         {
83         public:
84                 wxGEditorTabPanel();
85                 wxGEditorTabPanel(wxWindow *parent, int id);
86                 ~wxGEditorTabPanel();
87
88                 void initWxVtkCanvas();
89
90                 // Sets the parent manager
91                 void setPanelsManager(wxTabPanelsManager* panelsManager);
92
93                 // Get the BBS script of the pipeline diagram included in the panel
94                 std::string getDiagramBBS(bool wln=false);
95
96                 // Saves the actual BBS as complex box
97                 // RaC TOFIX It must be included the package of the complex box
98                 std::string saveComplexBoxBBS();
99
100                 // Shows the dialog to edit black box parameters
101                 void editBlackBox(GBlackBoxModel *bbmodel);
102
103                 // Save diagram as BBG
104                 void saveDiagram(std::string &content);
105
106                 // Load BBG diagram
107                 void loadDiagram(ifstream &inputStream);
108
109                 // Add a new complex input object to the scene
110                 void addComplexInputPort(std::string portName);
111
112                 // Add a new complex output object to the scene
113                 void addComplexOutputPort(std::string portName);
114
115                 // Delete all boxes in the diagram
116                 void deleteAllBoxes();
117
118                 // Center the camera in the initial position
119                 void centerView();
120
121                 // Display feedback info in the GUI
122                 void displayBlackBoxInfo(std::string packageName, std::string boxName);
123                 void updateStatusBar(std::string textStatus);
124
125                 int getPanelId();
126                 bool isComplexBox();
127                 void setComplexBox(bool val);
128
129                 // Returns a map with the id,controller of all the objects selected
130                 std::map<int,GObjectController*> getSelectedObjects();
131
132                 void addObjects(std::map<int,GObjectController*> objectsMap);
133                 int getNumSelectedObjects();
134
135                 // Receives the string from a drag and drop source as for example the BBTK Package Browser
136                 virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
137
138                 wxVtkSceneManager* getSceneManager();
139
140
141                 void SetCbName(std::string cbName);
142         void SetCbPackageName(std::string packagename);
143         void SetAuthor(std::string author);
144         void SetCategory(std::string category);
145         void SetDescription(std::string description);
146         std::string GetCbName();
147         std::string GetCbPackageName();
148         std::string GetAuthor();
149         std::string GetDescription();
150         std::string GetCategory();
151
152
153
154         //=========================================================================
155
156         private:
157
158                 int                                             _id;
159                 wxAuiManager                    *_panelAUIMgr;
160                 wxVtkSceneManager               *_sceneManager;
161                 wxTabPanelsManager              *_panelsManager;
162
163         protected:
164
165         };
166
167
168 }
169 // namespace bbtk
170 #endif
171