From: corredor <> Date: Tue, 22 Jun 2010 13:11:53 +0000 (+0000) Subject: Documentation of the wxLibrary and kernelLibrary X-Git-Tag: v1_0_0~57 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=b184acbd5222d80d87287b1de3ef085cfbdd83a3;p=bbtkGEditor.git Documentation of the wxLibrary and kernelLibrary --- diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.h index 3364bb4..b7459dd 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.h @@ -35,10 +35,11 @@ Version: $Revision$ * \brief Class bbtk::GObjectsMVCFactory : abstract black-box interface. */ -/** -* \class bbtk::GObjectsMVCFactory -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __GObjectsMVCFactory_h__ #define __GObjectsMVCFactory_h__ @@ -63,7 +64,6 @@ Version: $Revision$ #include "GComplexBoxPortModel.h" - //Includes creaMaracasVisu //Includes std @@ -87,11 +87,15 @@ namespace bbtk ~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); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index cb3231b..0b97c8d 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -328,14 +328,6 @@ namespace bbtk //========================================================================= - void wxGUIEditorGraphicBBS::editDiagramParameters(wxVtkSceneManager* scene) - { - wxBlackBoxEditionDialog* dialog = new wxBlackBoxEditionDialog(this,scene); - dialog->Show(); - } - - //========================================================================= - void wxGUIEditorGraphicBBS::updateStatusBar(std::string textStatus) { SetStatusText(crea::std2wx(textStatus)); @@ -448,8 +440,8 @@ namespace bbtk } 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(); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h index 48c4243..b5f17a0 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h @@ -35,10 +35,11 @@ * \brief Class bbtk::BlackBox : abstract black-box interface. */ -/** - * \class bbtk::WxGUIEditorGraphicBBS - * \brief - */ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __WxGUIEditorGraphicBBS_h__ #define __WxGUIEditorGraphicBBS_h__ @@ -105,17 +106,26 @@ namespace bbtk 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 diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx index db284eb..e2618fa 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.cxx @@ -56,13 +56,7 @@ namespace bbtk //========================================================================= - wxBlackBoxEditionDialog::wxBlackBoxEditionDialog(wxGUIEditorGraphicBBS *parent,wxVtkSceneManager* scene):wxDialog(parent, wxID_ANY, _T(""), wxDefaultPosition, wxSize(300, 300)) - { - - } - - //========================================================================= - + wxBlackBoxEditionDialog::~wxBlackBoxEditionDialog() { diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.h index b4e79f9..8f3021f 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxBlackBoxEditionDialog.h @@ -35,10 +35,11 @@ Version: $Revision$ * \brief Class bbtk::wxBlackBoxEditionDialog : abstract black-box interface. */ -/** -* \class bbtk::wxBlackBoxEditionDialog -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __wxBlackBoxEditionDialog_h__ #define __wxBlackBoxEditionDialog_h__ @@ -63,27 +64,30 @@ Version: $Revision$ 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 _lstValues; std::vector _lstTypes; std::vector _lstNames; + GBlackBoxModel *_model; protected: diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx index 25eccdf..bf67893 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx @@ -143,13 +143,6 @@ printf ("EED %p ~wxGEditorTabPanel()\n" , this ); _panelsManager->editBlackBox(bbmodel); } - //========================================================================= - - void wxGEditorTabPanel::editDiagramParameters(wxVtkSceneManager* scene) - { - _panelsManager->editDiagramParameters(scene); - } - //========================================================================= void wxGEditorTabPanel::deleteAllBoxes() diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h index 3365523..3e75838 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h @@ -35,10 +35,11 @@ Version: $Revision$ * \brief Class bbtk::BlackBox : abstract black-box interface. */ -/** -* \class bbtk::wxGEditorTabPanel -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __wxGEditorTabPanel_h__ #define __wxGEditorTabPanel_h__ @@ -71,11 +72,12 @@ namespace bbtk }; - + //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: @@ -84,28 +86,55 @@ namespace bbtk ~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 getSelectedObjects(); + void addObjects(std::map 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: diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx index 42b6312..86750fc 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx @@ -118,13 +118,6 @@ namespace bbtk //========================================================================= - void wxTabPanelsManager::editDiagramParameters(wxVtkSceneManager* scene) - { - _parent->editDiagramParameters(scene); - } - - //========================================================================= - void wxTabPanelsManager::deleteAllBoxesActualDiagram() { _actual->deleteAllBoxes(); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h index 126141a..f9ff803 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h @@ -35,10 +35,11 @@ Version: $Revision$ * \brief Class bbtk::BlackBox : abstract black-box interface. */ -/** -* \class bbtk::wxTabPanelsManager -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __wxTabPanelsManager_h__ #define __wxTabPanelsManager_h__ @@ -64,20 +65,23 @@ namespace bbtk 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); @@ -93,9 +97,7 @@ namespace bbtk private: - /** - ** The map - */ + // Private Attributes wxGUIEditorGraphicBBS *_parent; map _panels; wxGEditorTabPanel* _actual; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h index 362c677..47b4e11 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h @@ -35,10 +35,11 @@ Version: $Revision$ * \brief Class bbtk::BlackBox : abstract black-box interface. */ -/** -* \class bbtk::wxVtkSceneManager -* \brief -*/ +/**** +* Design and Developpement of BBTK GEditor +* Ricardo A Corredor J +* RaC - 2010 +****/ #ifndef __wxVtkSceneManager_h__ #define __wxVtkSceneManager_h__