]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx
*** empty log message ***
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxGEditorTabPanel.cxx
index e5c437be980fae4303cf7578d12c805f110a6259..7b9736e259d56fb183f6a5952a1b6b9c840ee1ed 100644 (file)
@@ -35,29 +35,32 @@ Version:   $Revision$
 
 
 #include "wxGEditorTabPanel.h"
-
+#include "creaWx.h"
 
 namespace bbtk
 {
+
        //=========================================================================
        wxGEditorTabPanel::wxGEditorTabPanel()
        {
+               printf ("EED %p wxGEditorTabPanel 1 ()\n" , this );
        }
 
        //=========================================================================
        wxGEditorTabPanel::wxGEditorTabPanel(wxWindow *parent,int id):wxPanel(parent),wxTextDropTarget()
        {
+               printf ("EED %p wxGEditorTabPanel 2 ()\n" , this );
                _id=id;
                _panelAUIMgr = new wxAuiManager(this);
                _sceneManager = NULL;
-
                initWxVtkCanvas();
        }
 
        //=========================================================================
        wxGEditorTabPanel::~wxGEditorTabPanel()
        {
-               delete _sceneManager;
+printf ("EED %p ~wxGEditorTabPanel()\n" , this );
+//ED02JUIN2010         _sceneManager->disconnectDrop();
        }
        
        //=========================================================================
@@ -65,10 +68,10 @@ namespace bbtk
        {
                wxVtk3DBaseView *baseview = new wxVtk3DBaseView(this);
                baseview->Configure();
-
                _sceneManager=new wxVtkSceneManager(this,baseview,_id);
-
                _panelAUIMgr->AddPane((wxWindow*)baseview->GetWxVTKRenderWindowInteractor(),wxAuiPaneInfo().Fixed().CenterPane());
+//EED02JUIN2010
+
                _panelAUIMgr->Update();
        }
 
@@ -76,15 +79,161 @@ namespace bbtk
 
        bool wxGEditorTabPanel::OnDropText(wxCoord x, wxCoord y, const wxString& data)
        {
-               _sceneManager->createGBlackBox();
-               cout<<"RaC DyD:"<<data<<" x:"<<x<<" y:"<<y<<endl;
+               std::string packageName="";
+               std::string boxName="";
+
+               wxString foo( (data) );
+               char str[150];
+               strcpy( str, (const char*)foo.mb_str(wxConvUTF8) );
+
+               char delims[] = ":";
+                char *result = NULL;
+                result = strtok( str, delims );
+                packageName += result;
+                
+                result = strtok( NULL, delims );
+                boxName += result;
+                
+               _sceneManager->createGBlackBox(x,y,packageName, boxName);
+
          return true;
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::setPanelsManager(wxTabPanelsManager* panelsManager)
+       {
+               _panelsManager = panelsManager;
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::displayBlackBoxInfo(std::string packageName, std::string boxName)
+       {
+               _panelsManager->displayBlackBoxInfo(packageName,boxName);
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::updateStatusBar(std::string textStatus)
+       {
+               _panelsManager->updateStatusBar(textStatus);
+       }
+
+       //=========================================================================
+
+       std::string wxGEditorTabPanel::getDiagramBBS()
+       {
+               return _sceneManager->getDiagramBBS();
+       }
+
+       //=========================================================================
+
+       std::string wxGEditorTabPanel::saveComplexBoxBBS(std::string cbName,std::string cbAuthor,std::string cbCategory,std::string cbDescription)
+       {
+               return _sceneManager->saveComplexBoxBBS(cbName,cbAuthor,cbCategory,cbDescription);
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::editBlackBox(GBlackBoxModel *bbmodel)
+       {
+               _panelsManager->editBlackBox(bbmodel);
+       }
+
+       //=========================================================================
+       
+       void wxGEditorTabPanel::editDiagramParameters(wxVtkSceneManager* scene)
+       {
+               _panelsManager->editDiagramParameters(scene);
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::deleteAllBoxes()
+       {
+               _sceneManager->deleteAllBoxes();
+       }
+
+       //=========================================================================
 
+       void wxGEditorTabPanel::centerView()
+       {
+               _sceneManager->centerView();
+       }
+
+       //=========================================================================
+       
+       void wxGEditorTabPanel::saveDiagram(std::string &content)
+       {
+               _sceneManager->saveDiagram(content);
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::loadDiagram(ifstream &inputStream)
+       {
+               _sceneManager->loadDiagram(inputStream);
+       }
+
+       //=========================================================================
+
+       int wxGEditorTabPanel::getPanelId()
+       {
+               return _id;
+       }
+
+       //=========================================================================
+
+       bool wxGEditorTabPanel::isComplexBox()
+       {
+               return _sceneManager->isComplexBox();
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::setComplexBox(bool val)
+       {
+               _sceneManager->setComplexBox(val);
        }
 
        //=========================================================================
 
+       void wxGEditorTabPanel::addComplexInputPort(std::string portName)
+       {
+               _sceneManager->createGComplexBoxInputPort(portName);
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::addComplexOutputPort(std::string portName)
+       {
+               _sceneManager->createGComplexBoxOutputPort(portName);
+       }
+
+       //=========================================================================
+       
+       std::map<int,GObjectController*> wxGEditorTabPanel::getSelectedObjects()
+       {
+               return _sceneManager->getSelectedObjects();
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::addObjects(std::map<int,GObjectController*> objectsMap)
+       {
+               _sceneManager->addObjects(objectsMap);
+       }
+
+       //=========================================================================     
+       
+       int wxGEditorTabPanel::getNumSelectedObjects()
+       {
+               return _sceneManager->getNumSelectedObjects();
+       }
+
+       //=========================================================================     
+
 }  // EO namespace bbtk
 
 // EOF
-