]> Creatis software - bbtkGEditor.git/commitdiff
2396 bbGEditor Feature New Normal Feature Show Tree 2014-06-18 15:29
authorctorres <carlos.torres@creatis.insa-lyon.fr>
Wed, 18 Jun 2014 13:29:29 +0000 (15:29 +0200)
committerctorres <carlos.torres@creatis.insa-lyon.fr>
Wed, 18 Jun 2014 13:29:29 +0000 (15:29 +0200)
12 files changed:
data/icons/wxart_showTree.xpm [new file with mode: 0644]
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxDiagramPropertiesEditionDialog.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxDiagramPropertiesEditionDialog.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h

diff --git a/data/icons/wxart_showTree.xpm b/data/icons/wxart_showTree.xpm
new file mode 100644 (file)
index 0000000..b38738a
--- /dev/null
@@ -0,0 +1,27 @@
+/* XPM */
+static char * showTree_xpm[] = {
+"16 16 8 1",
+"      c None",
+".     c #0EE555",
+"+     c #0DE454",
+"@     c #0DE153",
+"#     c #0DE354",
+"$     c #000000",
+"%     c #077E2E",
+"&     c #066726",
+"      .    .    ",
+" ..   .  ...    ",
+"  ..  .. ...    ",
+"  ... ...... ...",
+"   ............ ",
+".   ........... ",
+"..............  ",
+".......+.....   ",
+"     ..+@#....  ",
+"      $%&    ...",
+"      $$$$      ",
+"      $$$$      ",
+"      $$$$      ",
+"      $$$$$     ",
+"    $$$$$$$$    ",
+"    $$$$$$$$    "};
index fc4838faecbb77dfaf81b7573de8dbedc2ae1b18..41fb8674575605de664d9768df862c4de442f4e4 100644 (file)
@@ -226,6 +226,7 @@ namespace bbtk {
        const int ID_CHANGENAME                                                         =   1027;
 
        const int ID_EDITPROPERTIES                                                                     =       1028;  // RaC 2nd HackFest
+       const int ID_SHOWTREE                                                                   =       1029;  // CFT
 }
 // namespace bbtk
 #endif
index c764296793200dfb68f9b2edfe258c903cf9121a..c53529c0af34e17f98e8303549d020368382666f 100644 (file)
@@ -141,6 +141,7 @@ void wxGUIEditorGraphicBBS::initToolbar() {
        wxBitmap bmp_undo(undo_xpm);
        wxBitmap bmp_redo(redo_xpm);
        wxBitmap bmp_editProperties(editProperties_xpm);
+       wxBitmap bmp_showTree(showTree_xpm);
        wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
 
        //Adds a tool btn to the toolbar
@@ -192,6 +193,8 @@ void wxGUIEditorGraphicBBS::initToolbar() {
        toolbar->AddSeparator();
        toolbar->AddTool(ID_EDITPROPERTIES, _T("Edit diagram properties"),bmp_editProperties, wxNullBitmap, wxITEM_NORMAL,      _T("Edit diagram properties"), _T("Edit diagram properties"));
        toolbar->EnableTool(ID_EDITPROPERTIES, false);
+
+       toolbar->AddTool(ID_SHOWTREE, _T("Show tree"),bmp_showTree, wxNullBitmap, wxITEM_NORMAL,        _T("Show tree"), _T("Show tree"));
        
        toolbar->EnableTool(ID_UNDO, false);
        toolbar->EnableTool(ID_REDO, false);
@@ -238,6 +241,7 @@ void wxGUIEditorGraphicBBS::initToolbar() {
        Connect(ID_REDO,wxEVT_COMMAND_TOOL_CLICKED,     wxCommandEventHandler(wxGUIEditorGraphicBBS::OnRedo));
        Connect(ID_CHANGENAME, wxEVT_COMMAND_RIGHT_CLICK, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnChangeName));
        Connect(ID_EDITPROPERTIES,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnEditDiagramProperties));
+       Connect(ID_SHOWTREE,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(wxGUIEditorGraphicBBS::OnShowTree));
 
 }
 //=========================================================================
@@ -453,6 +457,7 @@ void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName, std::st
 {
        if (_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName != boxName) 
        {
+
                _actualPkgBrowserPkgName = packageName;
                _actualPkgBrowserBoxName = boxName;
 
@@ -463,30 +468,24 @@ void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName, std::st
                BlackBoxDescriptor::Pointer descriptor;
 
                std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
-               k                       = _pkgBrowser->GetFactory()->GetPackage(packageName);
+               k                       = _pkgBrowser->GetFactory()->GetPackage(_actualPkgBrowserPkgName);
                mapDesc         = k->GetDescriptorMap();                
-               descriptor      = mapDesc[boxName];
-               std::vector<std::string> temp;
-               descriptor->GetBoxesInside(tree,temp,1);
-
-
+               descriptor      = mapDesc[_actualPkgBrowserBoxName];
+/*
+               tree.treeTour(0);               
 
-/*CFT
-               for(int i = 0 ; i < temp.size() ; i++){
-                                       std::cout<< "  "<< temp[i] << std::endl;
-               }       
+               tree.deleteTree();
 
+               descriptor->GetBoxesInside(tree, 0);
 
-               if(temp.size()>=1){
-                               std::cout<< "CAJAS # " << (temp.size()- 3) << std::endl;                        
-                               for(int i = 0 ; i < temp.size()-1 ; i++){
-                                       if(i<3){std::cout<< "  "<< temp[i] << std::endl;}
-                                       else{std::cout<< i+1 << "  "<< temp[i] << " " <<temp[i+1] << std::endl;}
-                               }       
-                       }               
-               if (temp.size()==0){
-                               std::cout<< " Not Complex " << std::endl;
-                       }
+               //tree.treeTour(0);
+               //std::vector<std::string> boxesDiagram = _sceneM->boxesDiagram;
+               //for(int i=0;i<boxesDiagram.size();i++){
+               //      std::cout<<"caja: "<<boxesDiagram[i]<<std::endl;
+               //}             
+               
+               _actualPkgBrowserPkgName = "";
+               _actualPkgBrowserBoxName = "";
 */
                /*
                Package::Pointer k;
@@ -627,6 +626,35 @@ void wxGUIEditorGraphicBBS::OnRedo(wxCommandEvent& event) {
 
 void wxGUIEditorGraphicBBS::OnChangeName(wxCommandEvent& event){
 }
+//=========================================================================
+
+void wxGUIEditorGraphicBBS::OnShowTree(wxCommandEvent& event){
+               std::cout <<  "wxGUIEditorGraphicBBS::OnShowTree"<<std::endl;
+if (_actualPkgBrowserPkgName !="" || _actualPkgBrowserBoxName != "") 
+       {
+               Package::Pointer k;
+//EED          ComplexBlackBoxDescriptor::Pointer descriptor;
+               BlackBoxDescriptor::Pointer descriptor;
+
+               std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
+               k                       = _pkgBrowser->GetFactory()->GetPackage(_actualPkgBrowserPkgName);
+               mapDesc         = k->GetDescriptorMap();                
+               descriptor      = mapDesc[_actualPkgBrowserBoxName];
+
+               tree.treeTour(0);               
+
+               tree.deleteTree();
+
+               descriptor->GetBoxesInside(tree, 0);
+               
+               _actualPkgBrowserPkgName = "";
+               _actualPkgBrowserBoxName = "";
+       }
+else
+       {
+               std::cout<<"Select a Box"<<std::endl;
+       }
+}
 
 //=========================================================================
 
@@ -1085,6 +1113,7 @@ void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event)
 //=========================================================================
 void wxGUIEditorGraphicBBS::OnClickBtnBox(wxCommandEvent& event) 
 {
+       std::cout<<"wxGUIEditorGraphicBBS::OnClickBtnBox"<<std::endl;
        BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected();
        if (bbDes != NULL) {
                std::string typeName = bbDes->GetTypeName();
@@ -1121,6 +1150,7 @@ void wxGUIEditorGraphicBBS::OnClickBtnExecutableBox(wxCommandEvent& event)
 //=========================================================================
 void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event) 
 {
+       std::cout<<"wxGUIEditorGraphicBBS::OnClickBtnComplexBox"<<std::endl;
        wxToolBar* toolbar = GetToolBar();
        bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
        if (temp) {
@@ -1372,6 +1402,16 @@ void wxGUIEditorGraphicBBS::setCurrentDiagramCategory(std::string category)
        _tabsMgr->SetCategory(category);
 }
 
+//=========================================================================
+void wxGUIEditorGraphicBBS::setCurrentDiagramMessageKind(std::string kind){
+       _tabsMgr->SetMessageKind(kind); 
+}
+
+//=========================================================================
+void wxGUIEditorGraphicBBS::setCurrentDiagramMessageLevel(std::string level){
+       _tabsMgr->SetMessageLevel(level);       
+}
+
 //=========================================================================
 std::string wxGUIEditorGraphicBBS::getCurrentDiagramDescription()
 {
@@ -1390,7 +1430,16 @@ std::string wxGUIEditorGraphicBBS::getCurrentDiagramCategory()
        return _tabsMgr->GetCategory();
 }
 
-       
+//=========================================================================
+std::string wxGUIEditorGraphicBBS::getCurrentDiagramMessageKind(){
+       return _tabsMgr->GetMessageKind();
+}
+
+//=========================================================================
+std::string wxGUIEditorGraphicBBS::getCurrentDiagramMessageLevel(){
+       return _tabsMgr->GetMessageLevel();
+}
+
 //=========================================================================
 bool wxGUIEditorGraphicBBS::isCurrentDiagramComplexBox()
 {
index 0c070faf73535ff9d2de056735f9d71987c77b5e..ef9dc2f09c702e4f271f0687f9fc091957b2e20a 100644 (file)
@@ -91,6 +91,7 @@
 #include "wxart_undo.xpm"
 #include "wxart_redo.xpm"
 #include "wxart_editProperties.xpm"
+#include "wxart_showTree.xpm"
 
 //Includes creaMaracasVisu
 
@@ -201,6 +202,7 @@ namespace bbtk
                        void OnRedo(wxCommandEvent& event);
                        void OnChangeName(wxCommandEvent& event);
                        void OnEditDiagramProperties(wxCommandEvent& event);
+                       void OnShowTree(wxCommandEvent& event); //CFT
                        void OnEditComplexBoxScript(wxCommandEvent& event);
 
                
@@ -232,11 +234,14 @@ namespace bbtk
                        void setCurrentDiagramDescription(std::string description);
                        void setCurrentDiagramAuthor(std::string author);
                        void setCurrentDiagramCategory(std::string category);
+                       void setCurrentDiagramMessageKind(std::string kind);
+                       void setCurrentDiagramMessageLevel(std::string level);
 
                        std::string getCurrentDiagramDescription();
                        std::string getCurrentDiagramAuthor();
                        std::string getCurrentDiagramCategory();
-               
+                       std::string getCurrentDiagramMessageKind();
+                       std::string getCurrentDiagramMessageLevel();
                
                private:
 
@@ -264,6 +269,7 @@ namespace bbtk
                        std::string                                             _currentBBGversion;
                        
                        NodeTreeC tree;
+                       wxVtkSceneManager *_sceneM;
                protected:
 
 
index 0e07133068d03096239d982956617ac8ace71a51..282a48bede834d97ca4998bc323bd270dcc6c9d4 100755 (executable)
@@ -66,7 +66,7 @@ namespace bbtk
 {
        //=========================================================================
 
-       wxDiagramPropertiesEditionDialog::wxDiagramPropertiesEditionDialog(wxGUIEditorGraphicBBS *parent, NodeTreeC tree):wxDialog(parent,wxID_ANY,_T("Diagram Properties"), wxDefaultPosition, wxSize(450, 580),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+       wxDiagramPropertiesEditionDialog::wxDiagramPropertiesEditionDialog(wxGUIEditorGraphicBBS *parent, NodeTreeC tree):wxDialog(parent,wxID_ANY,_T("Diagram Properties"), wxDefaultPosition, wxSize(500, 650),wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
        {
                _parent = parent;
                _tree = tree;
@@ -118,10 +118,76 @@ namespace bbtk
                wxTreeItemId itemId = _treeBox->AddRoot(p, -1,-1,NULL);
                
                constructBoxTree(_tree, itemId);
-               _treeBox->ExpandAll();          
-               _tree.treeTour();
-               //CFT end
+               _treeBox->ExpandAll();  
+               //_tree.treeTour(0);
+               //CFT END
 
+//CFT
+//COMBOBOX OF MESSAGE
+/*
+Kind         Level  Nature
+Interpreter  0 Messages of the interpreter
+all          0 Minimum level for all kind of messages
+change       0 Box i/o changes related messages
+code         0 If positive then codes of the messages are displayed
+config       0 Configuration related messages
+connection   0 Connections related messages
+data         0 Data related messages
+debug        0 Debug messages
+echo         1 Level>0 : Prints the output of the 'print' commands of the user.
+       Level>1 : Prints the command being interpreted
+error        0 Error messages
+gui          0 Graphical user interface related messages
+help         1 Help messages
+kernel       0 Messages generated by the core classes of the lib
+max          9 Maximum level for all kind of messages
+object       0 object memory related messages
+output       1 Output messages
+package      0 Packages related messages
+process      0 Messages related to box processing
+qt           0 Qt related messages
+warning      1 Warning messages
+widget       0 Widgets related messages
+wx   
+*/
+               _diagramMessageKind = new wxComboBox(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(100,-1) );
+               _diagramMessageKind->Append (wxT("Interpreter"));
+               _diagramMessageKind->Append (wxT("all"));
+               _diagramMessageKind->Append (wxT("change"));
+               _diagramMessageKind->Append (wxT("code"));
+               _diagramMessageKind->Append (wxT("config"));
+               _diagramMessageKind->Append (wxT("connection"));
+               _diagramMessageKind->Append (wxT("data"));
+               _diagramMessageKind->Append (wxT("debug"));
+               _diagramMessageKind->Append (wxT("echo"));
+               _diagramMessageKind->Append (wxT("error"));
+               _diagramMessageKind->Append (wxT("help"));
+               _diagramMessageKind->Append (wxT("kernel"));
+               _diagramMessageKind->Append (wxT("max"));
+               _diagramMessageKind->Append (wxT("object"));
+               _diagramMessageKind->Append (wxT("output"));
+               _diagramMessageKind->Append (wxT("package"));
+               _diagramMessageKind->Append (wxT("process"));
+               _diagramMessageKind->Append (wxT("qt"));
+               _diagramMessageKind->Append (wxT("warning"));
+               _diagramMessageKind->Append (wxT("widget"));
+               _diagramMessageKind->Append (wxT("wx"));
+               _diagramMessageKind->SetEditable(false);
+
+               _diagramMessageLevel = new wxComboBox(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(100,-1) );
+               _diagramMessageLevel->Append (wxT("0"));
+               _diagramMessageLevel->Append (wxT("1"));
+               _diagramMessageLevel->Append (wxT("2"));
+               _diagramMessageLevel->Append (wxT("3"));
+               _diagramMessageLevel->Append (wxT("4"));
+               _diagramMessageLevel->Append (wxT("5"));
+               _diagramMessageLevel->Append (wxT("6"));
+               _diagramMessageLevel->Append (wxT("7"));
+               _diagramMessageLevel->Append (wxT("8"));
+               _diagramMessageLevel->Append (wxT("9"));
+               _diagramMessageLevel->SetEditable(false);
+
+//CFT END
 
                // SELECTION CONSTANTS
                // 0 - Application
@@ -137,11 +203,15 @@ namespace bbtk
 
                int currentType = (_parent->isCurrentDiagramComplexBox()==false)? 0 : 1;
                _diagramType->Select(currentType);
+               _diagramMessageKind->Select(currentType);
+               _diagramMessageLevel->Select(currentType);
 
                wxStaticText *type = new wxStaticText(panel, -1, wxT("Type"));
                wxStaticText *author = new wxStaticText(panel, -1, wxT("Author"));
                wxStaticText *category = new wxStaticText(panel, -1, wxT("Categories"));
                wxStaticText *description = new wxStaticText(panel, -1, wxT("Description"));
+               wxStaticText *messageKind = new wxStaticText(panel, -1, wxT("Message kind"));
+               wxStaticText *messageLevel = new wxStaticText(panel, -1, wxT("Message level"));
 
                _txtAuthor = new wxTextCtrl(panel, -1);
                _txtCategory = new wxTextCtrl(panel, -1);
@@ -168,10 +238,14 @@ namespace bbtk
                fgsizer->Add(description, 1, wxEXPAND);
                fgsizer->Add(_txtDescription, 1, wxEXPAND);
 //cft
+               fgsizer->Add(messageKind);
+               fgsizer->Add(_diagramMessageKind, 1, wxEXPAND);
+               fgsizer->Add(messageLevel);
+               fgsizer->Add(_diagramMessageLevel, 1, wxEXPAND);
                fgsizer->Add(tree);
                fgsizer->Add(_treeBox, 1, wxEXPAND);
 //cft end              
-       fgsizer->Add(okButton, 1, wxEXPAND);
+               fgsizer->Add(okButton, 1, wxEXPAND);
                fgsizer->Add(closeButton, 1, wxEXPAND);
 
                fgsizer->AddGrowableRow(3, 1);
@@ -194,7 +268,7 @@ namespace bbtk
 
        void wxDiagramPropertiesEditionDialog::onClickOk(wxCommandEvent& event)
        {
-
+               printf("RaC wxDiagramPropertiesEditionDialog::onClickOk\n");
                std::string txtAuthor = wx2std(_txtAuthor->GetValue());
                std::string txtCategory = wx2std(_txtCategory->GetValue());
                std::string txtDescription = wx2std(_txtDescription->GetValue());
@@ -211,6 +285,12 @@ namespace bbtk
                else if (selection == 1)
                        _parent->enableComplexBox();
 
+
+               //Message
+               std::string kindSelected = wx2std(_diagramMessageKind->GetStringSelection());
+               std::string levelSelected = wx2std(_diagramMessageLevel->GetStringSelection());
+               _parent->setCurrentDiagramMessageKind(kindSelected);
+               _parent->setCurrentDiagramMessageLevel(levelSelected);
                Close(true);
        }
 
index ceebbf5bb48b0dcd7ac576a609874fa71da27254..025c79fcbe4e12815eafffd4dbf3e389031c9f2f 100755 (executable)
@@ -115,6 +115,8 @@ namespace bbtk
                wxTextCtrl *_txtCategory;
                wxTextCtrl *_txtDescription;
                wxComboBox *_diagramType;
+               wxComboBox *_diagramMessageKind;
+               wxComboBox *_diagramMessageLevel;
                wxTreeCtrl *_treeBox;
                NodeTreeC _tree;
        protected:
index a941a94c79c9df46ca330810107895c0653a31e8..42f0f580d87e398bcc1de7efea11e1a788404b6a 100644 (file)
@@ -521,6 +521,16 @@ namespace bbtk
        {
            return _sceneManager->GetCategory();
        }
+       //=========================================================================
+               std::string wxGEditorTabPanel::GetMessageKind()
+               {
+           return _sceneManager->GetMessageKind();
+               }
+       //=========================================================================
+     std::string wxGEditorTabPanel::GetMessageLevel()
+               {
+           return _sceneManager->GetMessageLevel();
+               }
 
        //=========================================================================
     void wxGEditorTabPanel::SetCbName(std::string cbName)
@@ -554,6 +564,18 @@ namespace bbtk
     {
         _sceneManager->SetDescription( description );
     }
+
+       //=========================================================================
+               void wxGEditorTabPanel::SetMessageKind(std::string kind)
+               {
+        _sceneManager->SetMessageKind( kind );
+    }
+
+       //=========================================================================    
+    void wxGEditorTabPanel::SetMessageLevel(std::string level)
+               {
+        _sceneManager->SetMessageLevel( level );
+    }
     //=========================================================================
        //DFCH
        void wxGEditorTabPanel::SetFullPath( const std::string& fullpath )
index dc625a2f55185d379550c07facd2479cf9fc1c1a..9415e26131c12b4031c198593594f402289b4860 100644 (file)
@@ -183,6 +183,8 @@ namespace bbtk
         void SetAuthor(std::string author);
         void SetCategory(std::string category);
         void SetDescription(std::string description);
+                               void SetMessageKind(std::string kind);
+        void SetMessageLevel(std::string level);
         //Getters
         std::string GetFullPath( );
         std::string GetFileName( );
@@ -192,6 +194,8 @@ namespace bbtk
         std::string GetAuthor();
         std::string GetDescription();
         std::string GetCategory();
+                               std::string GetMessageKind();
+        std::string GetMessageLevel();
 
        //=========================================================================
 
index 12f9bb66dcb72f63c52ebac2552c3f71b3795113..9e6fa1550d8c3a3221d1082799032b8df1131c3e 100644 (file)
@@ -375,6 +375,18 @@ printf("wxTabPanelsManager::VerifyActualTabPanel  %d \n", this->_notebook->GetPa
            return _actual->GetCategory();
        }
 
+       //=========================================================================
+               std::string wxTabPanelsManager::GetMessageKind()
+               {
+                       return _actual->GetMessageKind();
+               }
+
+       //=========================================================================
+               std::string wxTabPanelsManager::GetMessageLevel()
+               {
+                       return _actual->GetMessageLevel();
+               }
+
        //=========================================================================
     void wxTabPanelsManager::SetCbName(std::string cbName)
     {
@@ -407,6 +419,18 @@ printf("wxTabPanelsManager::VerifyActualTabPanel  %d \n", this->_notebook->GetPa
         _actual->SetDescription( description );
     }
 
+
+       //=========================================================================
+               void wxTabPanelsManager::SetMessageKind(std::string kind){
+                               _actual->SetMessageKind(kind);          
+               }
+
+
+       //=========================================================================
+               void wxTabPanelsManager::SetMessageLevel(std::string level){
+                               _actual->SetMessageLevel(level);        
+               }
+
        //=========================================================================
        bool wxTabPanelsManager::TryToOpenScriptApplication(std::string packageName ,std::string boxType)
     {
index 976201a6ff2a005e50e954957b9107648036ae1e..5e4428d50a432539a02b5c7eef271d268d4e2498 100644 (file)
@@ -141,11 +141,15 @@ namespace bbtk
         void SetAuthor(std::string author);
         void SetCategory(std::string category);
         void SetDescription(std::string description);
+                               void SetMessageKind(std::string kind);
+                               void SetMessageLevel(std::string level);
         std::string GetCbName();
         std::string GetCbPackageName();
         std::string GetAuthor();
         std::string GetDescription();
         std::string GetCategory();
+                               std::string GetMessageKind();
+                               std::string GetMessageLevel();
 
            void SetNameTabPanel(wxString tabpanelname);
                std::string GetNameTabPanel();
index 7c2ff2df3823ff29006145257918127a15abf9ef..a4214980e5c2d6c1cd31917fe8115fff0cfc9817 100644 (file)
@@ -78,6 +78,8 @@ wxVtkSceneManager::wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView
        _Author                 = "Author ??";
        _Category               = "<VOID>";
        _Description            = "Description ??";
+       _MessageKind = " ";
+       _MessageLevel = " ";
 
        _bugTextActor_text      = "void";
        _bugTextActor_status    = 0;
@@ -1352,6 +1354,7 @@ bool wxVtkSceneManager::MakeBoxExecutable() {
 //=========================================================================
 
 std::string wxVtkSceneManager::getDiagramBBS(bool wln) {
+       std::cout << "wxVtkSceneManager::getDiagramBBS" << std::endl;
        bool existsExec = false;
 
        std::vector<std::string> packages;
@@ -1409,7 +1412,7 @@ std::string wxVtkSceneManager::getDiagramBBS(bool wln) {
                script += "\n";
 
                //ups2
-
+               
                script += LineNumber(wln, lnNmbr);
                script += "author \"";
                script += _Author;
@@ -1525,6 +1528,13 @@ std::string wxVtkSceneManager::getDiagramBBS(bool wln) {
                script += "# Complex input ports\n";
                script += complexInputs;
 
+               script += LineNumber(wln, lnNmbr);
+               script += "message ";
+               script += _MessageKind;
+               script += " ";
+               script += _MessageLevel;
+               script += "\n";
+
                for (i = 0; i < (int) execBoxes.size(); i++) {
                        script += LineNumber(wln, lnNmbr);
                        script += "exec ";
@@ -1544,6 +1554,7 @@ std::string wxVtkSceneManager::getDiagramBBS(bool wln) {
 //=========================================================================
 
 std::string wxVtkSceneManager::saveComplexBoxBBS() {
+       std::cout<<"wxVtkSceneManager::saveComplexBoxBBS"<<std::endl;
        std::vector<std::string> packages;
        std::vector<int> boxes;
        std::vector<int> connections;
@@ -1710,6 +1721,12 @@ std::string wxVtkSceneManager::saveComplexBoxBBS() {
 
        script += "\n";
 
+       script += "message ";
+       script += _MessageKind;
+       script += " ";
+       script += _MessageLevel;
+       script += "\n";
+
        for (i = 0; i < (int) execBoxes.size(); i++) {
                script += "exec ";
                int id = execBoxes[i];
@@ -1849,10 +1866,17 @@ void wxVtkSceneManager::saveDiagram(std::string &content) {
        sprintf(buffer, "%d", bsize);
        content += buffer;
        content += "\n";
-
+       
        for (int i = 0; i < bsize; i++) {
                int id = boxes[i];
+               std::cout<<"id "<<id<<std::endl;//CFT
                GObjectController *cont = _controllers[id];
+               std::cout<<"nombre: "<<cont->getStatusText()<<std::endl;//CFT
+               std::cout<<"tipo: "<<cont->getModel()->getBBTKType()<<std::endl;//CFT
+               //boxesDiagram[i] = cont->getModel()->getBBTKType();//CFT
+               std::cout<<"nname: "<<cont->getModel()->getBBTKName()<<std::endl;//CFT
+               std::cout<<"categorie: "<<GetCategory()<<std::endl;//CFT
+               std::cout<<"type: "<<cont->getModel()->getGObjectType()<<std::endl;//CFT
                cont->getModel()->save(content);
        }
 
@@ -2933,6 +2957,31 @@ std::string wxVtkSceneManager::GetDescription() {
 
 //=========================================================================
 
+void wxVtkSceneManager::SetMessageKind(std::string kind) {
+               _MessageKind = kind;
+       
+}
+                               
+//=========================================================================
+
+std::string wxVtkSceneManager::GetMessageKind(){
+               return _MessageKind;
+}
+
+//=========================================================================
+
+void wxVtkSceneManager::SetMessageLevel(std::string Level){
+               _MessageLevel = Level;
+}
+
+//=========================================================================
+
+std::string wxVtkSceneManager::GetMessageLevel(){
+               return _MessageLevel;
+}
+
+//=========================================================================
+
 std::vector< std::string> wxVtkSceneManager::GetExternalInputsNames()
 {
 
index 31c974d1204a41ddb2243580f47ecf9ac23bbaf9..4bad6682421d5113b925e6efae088a18e430370f 100644 (file)
@@ -229,12 +229,16 @@ namespace bbtk
         void SetAuthor(std::string author);
         void SetCategory(std::string category);
         void SetDescription(std::string description);
+                               void SetMessageKind(std::string kind);
+                               void SetMessageLevel(std::string Level);
 
         std::string GetCbName();
         std::string GetCbPackageName();
         std::string GetAuthor();
         std::string GetCategory();
         std::string GetDescription();
+                               std::string GetMessageKind();
+        std::string GetMessageLevel();
   
         // RaC2012 2nd HackFest
         // External Inputs was the complex inputs in previous versions
@@ -246,7 +250,8 @@ namespace bbtk
         void printAll( int com, int sta );
 
                
-               
+               std::vector<std::string> boxesDiagram;//CFT
+
        private:
 
         std::string                         _cbName;
@@ -254,6 +259,8 @@ namespace bbtk
         std::string                         _Author;
         std::string                         _Category;
         std::string                         _Description;
+                               std::string                         _MessageKind;
+                               std::string                         _MessageLevel;
 
                //wxPanel that uses the manager
                wxGEditorTabPanel                                       *_parent;