* \brief Class bbtk::GObjectsMVCFactory : abstract black-box interface.
*/
-/**
-* \class bbtk::GObjectsMVCFactory
-* \brief
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
#ifndef __GObjectsMVCFactory_h__
#define __GObjectsMVCFactory_h__
#include "GComplexBoxPortModel.h"
-
//Includes creaMaracasVisu
//Includes std
~GObjectsMVCFactory();
//Public methods
+
+ // Singleton to access to the Factory
static GObjectsMVCFactory* getInstance();
static void destroyInstance();
+ // Access to the BBTK library to get the descriptor of a box with the package and box names
BlackBoxDescriptor::Pointer getBlackBoxDescriptor(std::string packageName, std::string boxName);
+ // Creates the MVC of the graphical objects depending on the object type
vtkGObjectView* createGObjectView(int type);
GObjectController* createGObjectController(int type);
GObjectModel* createGObjectModel(int type);
//=========================================================================
- void wxGUIEditorGraphicBBS::editDiagramParameters(wxVtkSceneManager* scene)
- {
- wxBlackBoxEditionDialog* dialog = new wxBlackBoxEditionDialog(this,scene);
- dialog->Show();
- }
-
- //=========================================================================
-
void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus)
{
SetStatusText(crea::std2wx(textStatus));
}
if(!cbName.empty())
- {
- wxFileDialog * saveFileDialog = new wxFileDialog( this , _T("Save Complex Box BBS") ,_T(""), wxString( cbName.c_str(), wxConvUTF8),_T(""), wxSAVE | wxOVERWRITE_PROMPT);
+ {
+ wxFileDialog * saveFileDialog = new wxFileDialog(this ,wxT("Save Complex Box BBS") ,wxEmptyString, wxString( cbName.c_str(), wxConvUTF8),wxT("*.bbs"), wxSAVE | wxOVERWRITE_PROMPT);
if (saveFileDialog->ShowModal() == wxID_OK)
{
wxString fileName = saveFileDialog->GetPath();
* \brief Class bbtk::BlackBox : abstract black-box interface.
*/
-/**
- * \class bbtk::WxGUIEditorGraphicBBS
- * \brief
- */
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
#ifndef __WxGUIEditorGraphicBBS_h__
#define __WxGUIEditorGraphicBBS_h__
void initHelpHTMLBrowser();
wxAuiNotebook* getAuiNotebook();
+
+ // Display the info of the black box highlighted in the PackageBrowser
void displayBlackBoxInfo(std::string packageName, std::string boxName);
+
+ // Shows the textStatus in the wxFrame status bar
void updateStatusBar(std::string textStatus);
+
+ // Executes the BBS script in parameter
void executeScript(std::string script);
+ // Shows the dialog to change the parameters and values of the black box
void editBlackBox(GBlackBoxModel *bbmodel);
- void editDiagramParameters(wxVtkSceneManager* scene);
+ // Method that can be used to refresh the help and package browser
+ // RaC TOFIX!!!
void RegenerateAll();
void DoRegeneratePackageDoc(const std::string& pack);
void DoRegenerateBoxesLists();
+ // Refresh the state of buttons and menus when changing for example the mode to edit complex box
void refreshGUIControls();
// File menu and toolbar events
//=========================================================================
- wxBlackBoxEditionDialog::wxBlackBoxEditionDialog(wxGUIEditorGraphicBBS *parent,wxVtkSceneManager* scene):wxDialog(parent, wxID_ANY, _T(""), wxDefaultPosition, wxSize(300, 300))
- {
-
- }
-
- //=========================================================================
-
+
wxBlackBoxEditionDialog::~wxBlackBoxEditionDialog()
{
* \brief Class bbtk::wxBlackBoxEditionDialog : abstract black-box interface.
*/
-/**
-* \class bbtk::wxBlackBoxEditionDialog
-* \brief
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
#ifndef __wxBlackBoxEditionDialog_h__
#define __wxBlackBoxEditionDialog_h__
namespace bbtk
{
+ //RaC: It is important if it exists a double relation
+ //e.g. wxBlackBoxEditionDialog includes wxGUIEditorGraphicBBS, and wxGUIEditorGraphicBBS includes wxBlackBoxEditionDialog
class wxGUIEditorGraphicBBS;
-
class wxVtkSceneManager;
class wxBlackBoxEditionDialog : public wxDialog
{
public:
- wxBlackBoxEditionDialog(wxGUIEditorGraphicBBS *parent,wxVtkSceneManager* scene);
wxBlackBoxEditionDialog(wxGUIEditorGraphicBBS *parent,GBlackBoxModel *model);
~wxBlackBoxEditionDialog();
void constructBlackBoxEditionDialog();
+
void onClickOk(wxCommandEvent& event);
void onClickClose(wxCommandEvent& event);
private:
wxAuiManager *_dialogAUIMgr;
wxPanel *_panel;
+
std::vector<wxTextCtrl*> _lstValues;
std::vector<wxStaticText*> _lstTypes;
std::vector<wxStaticText*> _lstNames;
+
GBlackBoxModel *_model;
protected:
_panelsManager->editBlackBox(bbmodel);
}
- //=========================================================================
-
- void wxGEditorTabPanel::editDiagramParameters(wxVtkSceneManager* scene)
- {
- _panelsManager->editDiagramParameters(scene);
- }
-
//=========================================================================
void wxGEditorTabPanel::deleteAllBoxes()
* \brief Class bbtk::BlackBox : abstract black-box interface.
*/
-/**
-* \class bbtk::wxGEditorTabPanel
-* \brief
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
#ifndef __wxGEditorTabPanel_h__
#define __wxGEditorTabPanel_h__
};
-
+ //RaC: It is important if it exists a double relation
+ //e.g. wxGEditorTabPanel includes wxVtkSceneManager, and wxVtkSceneManager includes wxGEditorTabPanel
class wxVtkSceneManager;
-
class wxTabPanelsManager;
+ // RaC Be careful with the double heritance
class wxGEditorTabPanel : public wxPanel, public wxTextDropTarget
{
public:
~wxGEditorTabPanel();
void initWxVtkCanvas();
- virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
+
+ // Sets the parent manager
void setPanelsManager(wxTabPanelsManager* panelsManager);
- void displayBlackBoxInfo(std::string packageName, std::string boxName);
- void updateStatusBar(std::string textStatus);
+ // Get the BBS script of the pipeline diagram included in the panel
std::string getDiagramBBS();
+
+ // Saves the actual BBS as complex box
+ // RaC TOFIX It must be included the package of the complex box
std::string saveComplexBoxBBS(std::string cbName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+
+ // Shows the dialog to edit black box parameters
void editBlackBox(GBlackBoxModel *bbmodel);
- void editDiagramParameters(wxVtkSceneManager* scene);
- void deleteAllBoxes();
- void centerView();
+
+ // Save diagram as BBG
void saveDiagram(std::string &content);
+
+ // Load BBG diagram
void loadDiagram(ifstream &inputStream);
+
+ // Add a new complex input object to the scene
+ void addComplexInputPort(std::string portName);
+
+ // Add a new complex output object to the scene
+ void addComplexOutputPort(std::string portName);
+
+ // Delete all boxes in the diagram
+ void deleteAllBoxes();
+
+ // Center the camera in the initial position
+ void centerView();
+
+ // Display feedback info in the GUI
+ void displayBlackBoxInfo(std::string packageName, std::string boxName);
+ void updateStatusBar(std::string textStatus);
+
int getPanelId();
bool isComplexBox();
void setComplexBox(bool val);
- void addComplexInputPort(std::string portName);
- void addComplexOutputPort(std::string portName);
+
+ // Returns a map with the id,controller of all the objects selected
std::map<int,GObjectController*> getSelectedObjects();
+
void addObjects(std::map<int,GObjectController*> objectsMap);
int getNumSelectedObjects();
+ // Receives the string from a drag and drop source as for example the BBTK Package Browser
+ virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
+
//=========================================================================
private:
//=========================================================================
- void wxTabPanelsManager::editDiagramParameters(wxVtkSceneManager* scene)
- {
- _parent->editDiagramParameters(scene);
- }
-
- //=========================================================================
-
void wxTabPanelsManager::deleteAllBoxesActualDiagram()
{
_actual->deleteAllBoxes();
* \brief Class bbtk::BlackBox : abstract black-box interface.
*/
-/**
-* \class bbtk::wxTabPanelsManager
-* \brief
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
#ifndef __wxTabPanelsManager_h__
#define __wxTabPanelsManager_h__
class wxTabPanelsManager : public wxEvtHandler
{
+
public:
+
wxTabPanelsManager(wxGUIEditorGraphicBBS *parent);
~wxTabPanelsManager();
- virtual void addNewTab();
+ void addNewTab();
wxAuiNotebook* getAuiNotebook();
wxGEditorTabPanel* getActualTabPanel();
void displayBlackBoxInfo(std::string packageName, std::string boxName);
void updateStatusBar(std::string textStatus);
+
std::string getActualDiagramBBS();
std::string getActualComplexBoxBBS(std::string cbName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+
void editBlackBox(GBlackBoxModel *bbmodel);
- void editDiagramParameters(wxVtkSceneManager* scene);
void deleteAllBoxesActualDiagram();
void centerViewActualDiagram();
void saveActualDiagram(std::string &content);
private:
- /**
- ** The map
- */
+ // Private Attributes
wxGUIEditorGraphicBBS *_parent;
map<int, wxGEditorTabPanel*> _panels;
wxGEditorTabPanel* _actual;
* \brief Class bbtk::BlackBox : abstract black-box interface.
*/
-/**
-* \class bbtk::wxVtkSceneManager
-* \brief
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
#ifndef __wxVtkSceneManager_h__
#define __wxVtkSceneManager_h__