for(int i=0;i<_selectedObjects.size();i++)
{
int id = _selectedObjects[i];
- removeObject(id);
+ deleteObject(id);
}
_selectedObjects.clear();
}
//=========================================================================
- void wxVtkSceneManager::removeObject(int id)
+ void wxVtkSceneManager::deleteObject(int id)
{
GObjectController *control = _controllers[id];
std::vector<int> controllersToRemove;
//=========================================================================
+ void wxVtkSceneManager::deleteAllBoxes()
+ {
+ std::map<int, GObjectController*>::iterator it;
+ for(it = _controllers.begin(); it != _controllers.end(); ++it)
+ {
+ GObjectController *cont = it->second;
+ cont->removeFromScene();
+ unregisterController((InteractorStyleMaracas*)cont);
+ }
+ _selectedObjects.clear();
+ _controllers.clear();
+ refreshScene();
+ }
+
+ //=========================================================================
+
+ void wxVtkSceneManager::refreshScene()
+ {
+ _baseView->RefreshView();
+ }
+
+ //=========================================================================
+
} // EO namespace bbtk
// EOF
//=========================================================================
void wxGUIEditorGraphicBBS::initToolbar()
- {
- //std::string filename= _dataDir + "/data/icons/wxart_new.xpm";
+ {
wxBitmap bmp_new(new_xpm);
wxBitmap bmp_run(run_xpm);
+ wxBitmap bmp_delete(delete_xpm);
wxToolBar *_toolbar = new wxToolBar(this, wxID_ANY);
//Adds a tool btn to the toolbar
_toolbar->AddTool(1000,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab"));
_toolbar->AddTool(1001,_T("Execute"),bmp_run, wxNullBitmap, wxITEM_NORMAL,_T("Execute actual diagram"), _T("Execute actual diagram"));
+ _toolbar->AddTool(1002,_T("Delete all"),bmp_delete, wxNullBitmap, wxITEM_NORMAL,_T("Delete all boxes"), _T("Delete all boxes"));
_toolbar->SetMargins( 2, 2 );
_toolbar->Realize();
SetToolBar(_toolbar);
// connect command event handlers
- Connect(1000,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick));
- Connect(1001,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick));
+ Connect(1000,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab));
+ Connect(1001,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram));
+ Connect(1002,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram));
}
//=========================================================================
//=========================================================================
- void wxGUIEditorGraphicBBS::executeActualDiagram()
+ void wxGUIEditorGraphicBBS::executeScript(std::string script)
{
- std::string script = _tabsMgr->getActualDiagramScript();
- cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<<endl;
- cout<<script<<endl;
-
-
std::string separator = ConfigurationFile::GetInstance().Get_file_separator ();
std::string dir = ConfigurationFile::GetInstance().Get_default_temp_dir();
std::string filename = dir + separator + "tmp_bbtk.bbs";
command += " & ";
- printf ("RaC wxGUIEditorGraphicBBS::executeActualDiagram %s \n" , command.c_str() );
+ printf ("RaC wxGUIEditorGraphicBBS::executeScript %s \n" , command.c_str() );
system( command.c_str() );
}
+ //=========================================================================
+ // EVENT HANDLERS
//=========================================================================
- /*****************************************************
- /* HANDLERS
- /*****************************************************/
+ void wxGUIEditorGraphicBBS::OnCreateNewTab(wxCommandEvent& event)
+ {
+ _tabsMgr->addNewTab();
+ }
- void wxGUIEditorGraphicBBS::OnToolLeftClick(wxCommandEvent& event)
+ //=========================================================================
+
+ void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event)
{
- switch (event.GetId())
- {
- case 1000 :
- _tabsMgr->addNewTab();
- break;
+ std::string script = _tabsMgr->getActualDiagramScript();
+ cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<<endl;
+ cout<<script<<endl;
- case 1001 :
- executeActualDiagram();
- break;
- }
+ executeScript(script);
}
+ //=========================================================================
+
+ void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event)
+ {
+ _tabsMgr->deleteAllBoxesActualDiagram();
+ }
+
+ //=========================================================================
+
void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event)
{
Close(true);
//#include "C:\RaC\CREATIS\bbtkGEditor\data\icons\wxart_new.xpm" // JPR
#include "wxart_new.xpm" // JPR
#include "wxart_run.xpm"
+#include "wxart_delete.xpm"
//Includes creaMaracasVisu
wxAuiNotebook* getAuiNotebook();
void displayBlackBoxInfo(std::string packageName, std::string boxName);
void updateStatusBar(std::string textStatus);
- void executeActualDiagram();
+ void executeScript(std::string script);
void editBlackBox(GBlackBoxModel *bbmodel);
void editDiagramParameters(wxVtkSceneManager* scene);
void DoRegeneratePackageDoc(const std::string& pack);
void DoRegenerateBoxesLists();
- void OnToolLeftClick(wxCommandEvent& event);
+ void OnCreateNewTab(wxCommandEvent& event);
+ void OnExecuteActualDiagram(wxCommandEvent& event);
+ void OnDeleteAllBoxesActualDiagram(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);