]> Creatis software - bbtkGEditor.git/commitdiff
Updated Version with the moving of the objects updated and the background doesn't...
authorcorredor <>
Fri, 23 Apr 2010 14:15:30 +0000 (14:15 +0000)
committercorredor <>
Fri, 23 Apr 2010 14:15:30 +0000 (14:15 +0000)
27 files changed:
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.h
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.h
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GObjectModel.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h
lib/EditorGraphicBBS/bbsKernelEditorGraphic/Observable.h
lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.cxx
lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GBlackBoxController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GConnectorView.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GObjectController.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GPortController.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/GPortController.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGBlackBoxView.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.cxx
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGObjectView.h
lib/EditorGraphicBBS/bbsVtkGUIEditorGraphic/vtkGPortView.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxTabPanelsManager.h

index bdaf53d5bdd86ff03422a2feb74dec78965c6c83..672a4bd622018a3ddf9df4a733fe3034b08ae1e4 100644 (file)
@@ -110,6 +110,21 @@ namespace bbtk
        
        //=========================================================================
 
+       
+       std::string GBlackBoxModel::getBBTKPackage()
+       {
+               return _bbtkPackage;
+       }
+
+       //=========================================================================
+
+       void GBlackBoxModel::setBBTKPackage(std::string obpackage)
+       {
+               _bbtkPackage = obpackage;
+       }
+
+       //=========================================================================
+
 
 
 }  // EO namespace bbtk
index 160ac37cd32a7ba3ce023333fdb8f6769bd30203..5da5e84019f3711813ea9d6095c7bd3c8c5dcda5 100644 (file)
@@ -77,16 +77,21 @@ namespace bbtk
                virtual void move(double xx,double yy,double zz);
                GPortModel* getStartOutputPort();
 
+               std::string getBBTKPackage();
+               void setBBTKPackage(std::string obpackage);
 
        private:
 
-               //Attributes
+               //Private Attributes
                std::vector<GPortModel*> _inputs;
                std::vector<GPortModel*> _outputs;
 
                //Private Methods
 
        protected:
+               //Protected Attributes
+               std::string _bbtkPackage;
+
                //Protected methods
                
        };
index 58f601bd1baabaff5b15955351e85b73eeb876b8..f4ba5f4e1ceb9f46fb5a036002b6d3da3ecb5041 100644 (file)
@@ -82,7 +82,6 @@ namespace bbtk
 
                manualPoint* point = _model->GetManualPoint(_model->GetSizeLstPoints()-1);
                point->SetPoint(xCenter,yIport,zCenter);
-               cout<<"RaC GConnectorModel::setEndPort size:"<<_model->GetSizeLstPoints()<<endl;
        }
 
        //=========================================================================
@@ -115,6 +114,25 @@ namespace bbtk
 
        //=========================================================================
 
+       void GConnectorModel::updateStartEndPoints()
+       {
+               //Start Point
+               double xCenter,yCenter,zCenter;         
+               _startPort->getCenter(xCenter,yCenter,zCenter);
+               double xIport,yIport,zIport;
+               _startPort->getInicPoint(xIport,yIport,zIport);
+
+               manualPoint* point = _model->GetManualPoint(0);
+               point->SetPoint(xCenter,yIport,zCenter);
+
+               //End Point     
+               _endPort->getCenter(xCenter,yCenter,zCenter);
+               _endPort->getInicPoint(xIport,yIport,zIport);
+
+               point = _model->GetManualPoint(_model->GetSizeLstPoints()-1);
+               point->SetPoint(xCenter,yIport,zCenter);
+       }
+
 }  // EO namespace bbtk
 
 // EOF
index b6495c3270eb8acb3b296346581f323bee556f7d..65426a70131e8bcea2ee2cb0b8285458723ba9bf 100644 (file)
@@ -75,6 +75,7 @@ namespace bbtk
                GPortModel* getStartPort();
                GPortModel* getEndPort();               
                manualContourModel* getManualContourModel();
+               void updateStartEndPoints();
                
        private:
 
index bd863cc2e686b836f123cc3bf2b52a51514d06c0..b33bb80e65f94a3350c81ca0cec9b027f57f2838 100644 (file)
@@ -168,6 +168,7 @@ namespace bbtk
 
        //=========================================================================
 
+
 }  // EO namespace bbtk
 
 // EOF
index 50770b858c72168febd332690011ff3b3e1528ba..2e6605b62f8f54af740049f35efe3d84ef35b020 100644 (file)
@@ -65,9 +65,15 @@ namespace bbtk
        const double PORT_WIDTH         =       2.5;
 
        // Commands
-       const int REPAINT = 201;
+       const int NO_COMMAND = 201;
        const int INIT_CREATION_CONTOUR= 202;
        const int FIN_CREATION_CONTOUR= 203;
+       const int ADD_TO_SELECTED = 204;
+       const int DRAG_OBJECTS = 205;
+
+       // World states
+       //const int NOTHING_HAPPENS = 101;
+
        
        // Colors (object_state_(R|G|B))
        const double BOXCONTOUR_NH_R=0.0;
index c00e754814f4e76f59dc1c0900327dbcc9afa27a..7adc257324cdefa61408c1c0d48f814a7ab40d4b 100644 (file)
@@ -69,7 +69,7 @@ namespace bbtk
                //Public methods
                void addObserver(Observer *observer);
 
-               void notifyObservers(int idCaller,int command=REPAINT);
+               void notifyObservers(int idCaller,int command=NO_COMMAND);
 
        private:
 
index daa6327c157cceea4e7cd481750fa60fa7654e82..78ece891bb13c29bcdf5cd1ba7c2fc752074978e 100644 (file)
@@ -41,32 +41,32 @@ namespace bbtk
 
 
        //=========================================================================
-       wxVtkSceneManager::wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView,int idManager)
+       wxVtkSceneManager::wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView,int idManager)
        {
+               _parent = parent;
                _numBoxes=0;
                _idManager=idManager;
                _baseView=baseView;
                _idLastController=0;
+               _startDragging=false;
 
                if( _baseView!=NULL )
                {
-                       _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(parent);
-                       registerController(this);
+                       _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget((wxDropTarget*)parent);                      
                        configureBaseView();
                        _worldState=NOTHING_HAPPENS;
+                       registerController(this);
                        
                }
 
-               
        }
 
-
        //=========================================================================
 
        void wxVtkSceneManager::disconnectDrop()
        {
                _baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(NULL);
-       }
+       }
 
        //=========================================================================
 
@@ -141,6 +141,7 @@ namespace bbtk
 
                model->setBBTKName(arraystring);
                model->setBBTKType(boxName);
+               model->setBBTKPackage(packageName);
                                
                model->addObserver(view);
                model->addObserver(this);
@@ -300,6 +301,7 @@ namespace bbtk
                connectorcontroller->setManualContourController(manContourControl);             
                connectorModel->setManualContourModel(manContourModel);
                connectorView->setManualContourView(manContourView);
+               connectorView->setModel(connectorModel);
                connectorcontroller->setModelAndView(connectorModel,connectorView);
 
                int newId = _controllers.size();
@@ -333,6 +335,58 @@ namespace bbtk
 
        bool wxVtkSceneManager::OnMouseMove()
        {
+               int X,Y;
+               wxVTKRenderWindowInteractor *wxVTKiren;
+               wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+               wxVTKiren->GetEventPosition(X,Y);
+       
+               
+               if(_worldState == DRAG_OBJECTS)
+               {                       
+                       for (int i=0; i<_selectedObjects.size(); i++)
+                       {
+                               int id = _selectedObjects[i];
+                               GObjectController* cont = _controllers[id];
+                               if(_startDragging)
+                               {
+                                       cont->getView()->setStartDragging(true);
+                               }
+                               cont->getView()->moveObject(X,Y);
+                               cont->getView()->setState(DRAG);
+                               cont->getModel()->notifyObservers(_idManager);
+                       }
+
+                       std::map<int, GObjectController*>::iterator it;
+
+                       for(it = _controllers.begin(); it != _controllers.end(); ++it)
+                       {
+                               GObjectController *desc = it->second;
+                               if(desc->getGObjectType()==GCONNECTOR)
+                               {
+                                       GConnectorView* vconn = (GConnectorView*)desc->getView();
+                                       vconn->updateStartEndPoints();
+                               }
+                       }
+                       
+                       _startDragging=false;
+
+               }
+               else if(_worldState == NOTHING_HAPPENS)
+               {
+                       std::map<int, GObjectController*>::iterator it;
+
+                       for(it = _controllers.begin(); it != _controllers.end(); ++it)
+                       {
+                               GObjectController *desc = it->second;
+                               if(desc->getGObjectType()==GBLACKBOX && desc->getView()->getState() == HIGHLIGHTED)
+                               {
+                                       GBlackBoxModel *mod = (GBlackBoxModel*)desc->getModel();
+                                       _parent->displayBlackBoxInfo(mod->getBBTKPackage(),mod->getBBTKType());
+                               }
+                       }
+               }
+
+
                return true;
        }
 
@@ -340,71 +394,167 @@ namespace bbtk
        
        void wxVtkSceneManager::update(int idController,int command)
        {
-               
-               if(command == INIT_CREATION_CONTOUR)
-               {       
-                       GObjectController* cont = _controllers[idController];
-                       GPortModel* startOutputPort = (GPortModel*)cont->getModel();
-                       createGConnector(startOutputPort);
-
-                       // The last one is the controller of the connector
-                       for(int i=0;i<_controllers.size()-1;i++)
+               if(command != NO_COMMAND)
+               {
+                       if(command == ADD_TO_SELECTED)
                        {
-                               GObjectController* cont = _controllers[i];
-                               if(cont->getGObjectType() == GPORT )
+                               GObjectController* cont = _controllers[idController];
+
+                               bool foundID=false;
+                               for (int i=0; i<_selectedObjects.size() && foundID==false; i++)
                                {
-                                       GPortModel* port = (GPortModel*)cont->getModel();
-                                       if(port->getPortType()==GINPUTPORT)
+                                       int id = _selectedObjects[i];
+                                       if(id==idController)
                                        {
-                                               cont->SetActive(true);
+                                               foundID = true;
+                                       }
+                               }
+                               if(!foundID)
+                               {
+                                       int id = idController;
+                                       _selectedObjects.push_back(id);
+                               }
+
+                       }
+                       else if(command == INIT_CREATION_CONTOUR)
+                       {       
+                               _worldState = INIT_CREATION_CONTOUR;
+                               GObjectController* cont = _controllers[idController];
+                               GPortModel* startOutputPort = (GPortModel*)cont->getModel();
+                               
+
+                               // The last one is the controller of the connector
+                               for(int i=0;i<_controllers.size();i++)
+                               {
+                                       GObjectController* cont = _controllers[i];
+                                       if(cont->getGObjectType() == GPORT )
+                                       {
+                                               GPortModel* port = (GPortModel*)cont->getModel();
+                                               if(port->getPortType()==GINPUTPORT)
+                                               {
+                                                       cont->SetActive(true);
+                                               }
+                                               else
+                                               {
+                                                       cont->getView()->setState(NOTHING_HAPPENS);
+                                                       cont->getModel()->notifyObservers(_idManager);
+                                                       cont->SetActive(false);
+                                               }
                                        }
                                        else
                                        {
                                                cont->getView()->setState(NOTHING_HAPPENS);
+                                               cont->getModel()->notifyObservers(_idManager);
                                                cont->SetActive(false);
-                                       }
+                                       }                               
                                }
-                               else
+
+                               _selectedObjects.clear();
+
+                               createGConnector(startOutputPort);
+
+                       }
+                       else if(command == FIN_CREATION_CONTOUR && _worldState == INIT_CREATION_CONTOUR)
+                       {                               
+                               _worldState = NOTHING_HAPPENS;
+                               int id = _controllers.size()-1;
+                               GObjectController* cont = _controllers[id];                     
+                               GConnectorModel* modelContour = (GConnectorModel*)cont->getModel();
+
+                               GObjectController* finPort = _controllers[idController];
+                               if(finPort->getGObjectType() == GPORT)
+                               {
+                                       GPortModel* modelPort = (GPortModel*)finPort->getModel();
+                                       modelContour->setEndPort(modelPort);
+                               }                       
+
+                               manualConnectorContourController* manCont = ((GConnectorController*)cont)->getManualContourController();                        
+                               manualConnectorContourView* connView = (manualConnectorContourView*)manCont->GetManualViewBaseContour();
+                               connView->Refresh();
+
+                               for(int i=0;i<_controllers.size();i++)
                                {
-                                       cont->getView()->setState(NOTHING_HAPPENS);
-                                       cont->SetActive(false);
-                               }                               
+                                       GObjectController* cont = _controllers[i];
+                                       if(cont->getView()!=NULL)
+                                       {
+                                               cont->getView()->setState(NOTHING_HAPPENS);
+                                               cont->getModel()->notifyObservers(_idManager);
+                                       }
+                                       cont->SetActive(true);                                                          
+                               }
                        }
-                       _worldState = CREATING_CONTOUR;
                }
-               else if(command == FIN_CREATION_CONTOUR && _worldState == CREATING_CONTOUR)
+       }
+
+       //=========================================================================
+
+       
+       bool wxVtkSceneManager::OnLeftButtonDown()
+       {
+               
+               if(_selectedObjects.size()!=0)
                {
-                       
-                       _worldState = NOTHING_HAPPENS;
-                       int id = _controllers.size()-1;
-                       GObjectController* cont = _controllers[id];                     
-                       GConnectorModel* modelContour = (GConnectorModel*)cont->getModel();
+                       _worldState = DRAG_OBJECTS;
+                       _startDragging = true;
 
-                       GObjectController* finPort = _controllers[idController];
-                       if(finPort->getGObjectType() == GPORT)
+                       for (int i = 0; i < _selectedObjects.size(); i++)
                        {
-                               GPortModel* modelPort = (GPortModel*)finPort->getModel();
-                               modelContour->setEndPort(modelPort);
-                       }                       
+                               int id = _selectedObjects[i];
+                               GObjectController* cont = _controllers[id];
+                               cont->getView()->setState(DRAG);
+                               cont->getModel()->notifyObservers(_idManager);
+                       }
+               }
+               
+               
+               
+               return true;
+       }
 
-                       manualConnectorContourController* manCont = ((GConnectorController*)cont)->getManualContourController();                        
-                       manualConnectorContourView* connView = (manualConnectorContourView*)manCont->GetManualViewBaseContour();
-                       connView->Refresh();
+       //=========================================================================
+       
+       bool wxVtkSceneManager::OnLeftButtonUp()
+       {
+               if(_worldState == DRAG_OBJECTS)
+               {
+                       _worldState = NOTHING_HAPPENS;
 
-                       for(int i=0;i<_controllers.size();i++)
+                       for (int i = 0; i < _selectedObjects.size(); i++)
                        {
-                               GObjectController* cont = _controllers[i];
-                               if(cont->getView()!=NULL)
-                               {
-                                       cont->getView()->setState(NOTHING_HAPPENS);
-                               }
-                               cont->SetActive(true);                                                          
+                               int id = _selectedObjects[i];
+                               GObjectController* cont = _controllers[id];
+                               cont->getView()->setState(SELECTED);
+                               cont->getModel()->notifyObservers(_idManager);
                        }
                }
+               return true;
+       }
+
+       //=========================================================================
+
+       bool wxVtkSceneManager::OnRightButtonUp()
+       {
+               for (int i = 0; i < _selectedObjects.size(); i++)
+               {
+                       int id = _selectedObjects[i];
+                       GObjectController* cont = _controllers[id];
+                       cont->SetActive(true);
+                       cont->getView()->setState(NOTHING_HAPPENS);
+                       cont->getModel()->notifyObservers(_idManager);
+               }
+
+               _selectedObjects.clear();
+
+               return true;
        }
 
        //=========================================================================
 
+       void wxVtkSceneManager::displayBlackBoxInfo(std::string packageName, std::string boxName)
+       {
+               _parent->displayBlackBoxInfo(packageName,boxName);
+       }
+
 }  // EO namespace bbtk
 
 // EOF
index 4a3f7e1a090320646cb33313b6bb03d9af1075e8..c6f7a6b11468719bec613bf3d7e03722b71d654b 100644 (file)
@@ -53,6 +53,7 @@ Version:   $Revision$
 #include "vtkGPortView.h"
 #include "manualConnectorContourView.h"
 #include "manualConnectorContourController.h"
+#include "wxGEditorTabPanel.h"
 
 //Includes bbtk
 #include <bbtkBlackBoxInputDescriptor.h>
@@ -79,11 +80,12 @@ Version:   $Revision$
 
 namespace bbtk
 {
+       class wxGEditorTabPanel;
 
        class wxVtkSceneManager : public InteractorStyleMaracas , public Observer
        {
        public: 
-               wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView, int idManager);
+               wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView, int idManager);
                ~wxVtkSceneManager();
 
                void configureBaseView();
@@ -101,11 +103,18 @@ namespace bbtk
                void disconnectDrop();
                
                virtual bool OnMouseMove();
+               virtual bool  OnLeftButtonDown(); 
+               virtual bool  OnLeftButtonUp();
+               virtual bool OnRightButtonUp();
 
                virtual void update(int idController,int command);
+
+               void displayBlackBoxInfo(std::string packageName, std::string boxName);
                
        private:
 
+               wxGEditorTabPanel *_parent;
+
                // Last controller created
                int _idLastController;
 
@@ -115,12 +124,18 @@ namespace bbtk
                // Boxes number in the scene
                int _numBoxes;
 
+               // StartDragging
+               bool _startDragging;
+
                wxVtk3DBaseView *_baseView;
 
                int _worldState;
 
                std::map<int,GObjectController*> _controllers;
 
+               //Saves the id's of the selected objects in the controllers map
+               std::vector<int> _selectedObjects;
+
        protected:
 
        };
index 4554e541c77c02809c61f285c1b748d57b230f97..bafa37f019402b0de5a36bc0c19179e6334afe1a 100644 (file)
@@ -65,16 +65,12 @@ namespace bbtk
                        int state  = _view->getState();
                        
                        //Evaluate new state
-                       if( state == DRAG)
-                       {
-                               moveObject(X,Y);
-                       }
-
+                       
                        if(state == NOTHING_HAPPENS)
                        {
                                if(_view->isPointInside(X,Y))
                                {
-                                       _view->setState(HIGHLIGHTED);           
+                                       _view->setState(HIGHLIGHTED);   
                                }                       
                        }
                        if( state==HIGHLIGHTED)
@@ -95,80 +91,50 @@ namespace bbtk
        
        bool GBlackBoxController::OnLeftButtonDown()
        {
-               
-               if ( _vtkInteractorStyleBaseView!=NULL )
-               {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X,Y);
-
-                       int state  = _view->getState();
-                       
-                       //Evaluate new state
-                       if( state==HIGHLIGHTED)
-                       {
-                               _view->isStartDragging(true);
-                               _view->setState(DRAG);
-                       }
-
-                       if(  state == SELECTED)
-                       {
-                               if(_view->isPointInside(X,Y))
-                               {
-                                       _view->isStartDragging(true);
-                                       _view->setState(DRAG);
-                               }       
-                       }
+               int state  = _view->getState();
                        
-                       _model->notifyObservers(_id);
+               //Evaluate new state
+               if(state == HIGHLIGHTED)
+               {
+                       _isLeftClickDown=true;
+                       _view->setState(SELECTED);
+                       _model->notifyObservers(_id,ADD_TO_SELECTED);
                }
                return true;
+
        }
 
        //=========================================================================
        
        bool GBlackBoxController::OnLeftButtonUp()
        {
-               if ( _vtkInteractorStyleBaseView!=NULL )
-               {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X,Y);
+               int X,Y;
+               wxVTKRenderWindowInteractor *wxVTKiren;
+               wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+               wxVTKiren->GetEventPosition(X,Y);
 
-                       int state  = _view->getState();
+               int state  = _view->getState();
                        
-                       //Evaluate new state
-                       if(state==CLICKED)
-                       {
-                               _view->setState(SELECTED);
-                       }
-
-                       if( state == DRAG)
+               //Evaluate new state
+               if(_isLeftClickDown)
+               {
+                       _isLeftClickDown=false;
+                       if(_view->isPointInside(X,Y))
                        {
+                               // It is supposed that I'm always inside even if the box is in drag
                                _view->setState(SELECTED);
+                               _model->notifyObservers(_id);
                        }
-
-                       _model->notifyObservers(_id);
-
                }
                return true;
+               
        }
        
        //=========================================================================
        
        bool GBlackBoxController::OnLeftDClick()
        {
-               if ( _vtkInteractorStyleBaseView!=NULL )
-               {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X,Y);
-
-                       _model->notifyObservers(_id);
-               }
+               
                return true;
        }
        
@@ -176,23 +142,6 @@ namespace bbtk
        
        bool GBlackBoxController::OnRightButtonDown()
        {
-               if( _vtkInteractorStyleBaseView!= NULL )
-               {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X, Y);
-                       
-                       int state  = _view->getState();
-                       
-                       //Evaluate new state
-                       if(  state == SELECTED)
-                       {
-                               _view->setState(NOTHING_HAPPENS);
-                       }
-
-                       _model->notifyObservers(_id);
-               }
                return true;
        }
 
index 6617b1f67f69b18fba0b8dfb0ee149e4daba8f58..574de5b2cc303a0f7402b5130f760db259a4b44d 100644 (file)
@@ -66,6 +66,15 @@ namespace bbtk
                return manViewContour;
        }
 
+       //=========================================================================
+       
+       void GConnectorView::updateStartEndPoints()
+       {
+               GConnectorModel* mod=(GConnectorModel*)_model;
+               mod->updateStartEndPoints();
+               manViewContour->RefreshContour();
+       }
+
 }  // EO namespace bbtk
 
 // EOF
index ade0a5046ff9d125d41bc9b847a4135e288e15e2..b5d4dc851259c247de89f9e3158c5fce0fe03ee4 100644 (file)
@@ -45,6 +45,7 @@ Version:   $Revision$
 
 //Includes same project
 #include "vtkGObjectView.h"
+#include "GConnectorModel.h"
 
 //Includes creaMaracasVisu
 #include <manualViewContour.h>
@@ -68,6 +69,7 @@ namespace bbtk
                //Public methods
                void setManualContourView(manualViewContour* viewContour);
                manualViewContour* getManualContourView();
+               void updateStartEndPoints();
 
        private:
 
index 2c90897a2a4bebb8fdfdaf6c6c60f1d678fa9b6c..689d3beb76a9788ec0bb47a693ece33117ebd1ca 100644 (file)
@@ -64,170 +64,64 @@ namespace bbtk
 
        bool GObjectController::OnMouseMove()
        {
+               int X,Y;
+               wxVTKRenderWindowInteractor *_wxVTKiren;
+               _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
+               _wxVTKiren->GetEventPosition( X , Y );
+               int state  = _view->getState();
                
-               /**********************   VIRTUAL *************************/
-
-               if ( _vtkInteractorStyleBaseView!=NULL)
+               //Evaluate new state
+               if( state == NOTHING_HAPPENS)
                {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *_wxVTKiren;
-                       _wxVTKiren= _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       _wxVTKiren->GetEventPosition( X , Y );
-
-                       int state  = _view->getState();
-                       
-                       //Evaluate new state
-                       if( state == DRAG)
-                       {
-                               moveObject(X,Y);
-                       }
-
-                       if( state == NOTHING_HAPPENS)
-                       {
-                               if(_view->isPointInside(X,Y))
-                               {
-                                       _view->setState(HIGHLIGHTED);   
-                               }                       
-                       }
-                       if( state==HIGHLIGHTED)
+                       if(_view->isPointInside(X,Y))
                        {
-                               if(!_view->isPointInside(X,Y))
-                               {
-                                       _view->setState(NOTHING_HAPPENS);
-                               }
-                       }
-                       
-                       _model->notifyObservers(_id);
-                       
+                               _view->setState(HIGHLIGHTED);   
+                       }                       
                }
-
-               /**/
-
-               return true;
-       }
-
-       //=========================================================================
-       
-       bool GObjectController::OnLeftButtonDown()
-       {
-               /**********************   VIRTUAL *************************
-               
-               if ( _vtkInteractorStyleBaseView!=NULL )
+               if( state==HIGHLIGHTED)
                {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X,Y);
-
-                       int state  = _model->getState();
-                       
-                       //Evaluate new state
-                       if(!_model->hasChanged() && state==HIGHLIGHTED)
+                       if(!_view->isPointInside(X,Y))
                        {
-                               _view->isStartDragging(true);
-                               _model->setState(DRAG);
-                       }
-
-                       if( !_model->hasChanged() && state == SELECTED)
-                       {
-                               if(_view->isPointInside(X,Y))
-                               {
-                                       _view->isStartDragging(true);
-                                       _model->setState(DRAG);
-                               }       
+                               _view->setState(NOTHING_HAPPENS);
                        }
-                       
-                       _model->notifyObservers();
                }
-
-               */
+               
+               _model->notifyObservers(_id);
+                       
 
                return true;
        }
 
        //=========================================================================
        
-       bool GObjectController::OnLeftButtonUp()
+       bool GObjectController::OnLeftButtonDown()//virtual
        {
-
-               /**********************   VIRTUAL *************************
-
-               if ( _vtkInteractorStyleBaseView!=NULL )
-               {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X,Y);
-
-                       int state  = _model->getState();
+               int state  = _view->getState();
                        
-                       //Evaluate new state
-                       if(!_model->hasChanged() && state==CLICKED)
-                       {
-                               _model->setState(SELECTED);
-                       }
-
-                       if( !_model->hasChanged() && state == DRAG)
-                       {
-                               _model->setState(SELECTED);
-                       }
-
-                       _model->notifyObservers();
-
+               //Evaluate new state
+               if(state == HIGHLIGHTED)
+               {
+                       _isLeftClickDown=true;
+                       _view->setState(SELECTED);
+                       //_model->notifyObservers(_id,
                }
-
-               */
                return true;
        }
 
        //=========================================================================
        
-       bool GObjectController::OnLeftDClick()
+       bool GObjectController::OnLeftButtonUp()//virtual
        {
-               /**********************   VIRTUAL *************************
-
-               if ( _vtkInteractorStyleBaseView!=NULL )
-               {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X,Y);
 
-                       _model->notifyObservers();
-               }
-
-               */
                return true;
        }
 
        //=========================================================================
-
-       bool GObjectController::OnRightButtonDown()
+       
+       bool GObjectController::OnLeftDClick()//virtual
        {
-               /**********************   VIRTUAL *************************/
-
-               if( _vtkInteractorStyleBaseView!= NULL )
-               {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X, Y);
-                       
-                       int state  = _view->getState();
-                       
-                       //Evaluate new state
-                       if( state == SELECTED)
-                       {
-                               _view->setState(NOTHING_HAPPENS);
-                       }
-
-                       _model->notifyObservers(_id);
-               }
-               
-               /**/
 
                return true;
-
        }
 
        //=========================================================================
index 873396e762f2f09cc939838652c5c3e34fbd13d5..664ad9afe6666c37302622d48c64c854072a78f3 100644 (file)
@@ -90,13 +90,13 @@ namespace bbtk
                GObjectModel* _model;
                vtkGObjectView* _view;
                int _id;
+               bool _isLeftClickDown;
 
                //Protected Methods
                virtual bool  OnMouseMove();
                virtual bool  OnLeftButtonDown(); 
                virtual bool  OnLeftButtonUp();
                virtual bool  OnLeftDClick();
-               virtual bool  OnRightButtonDown();
 
                virtual void moveObject(int X,int Y);
 
index e2203ce8fd09136b278347d8de868a9f7244496b..e7d1ce7c1c218db4d8dcc18d8e7d3cae969d18d1 100644 (file)
@@ -55,21 +55,12 @@ namespace bbtk
        bool GPortController::OnLeftButtonDown()
        {
                
-               if ( _vtkInteractorStyleBaseView!=NULL )
-               {
-                       int X,Y;
-                       wxVTKRenderWindowInteractor *wxVTKiren;
-                       wxVTKiren = _vtkInteractorStyleBaseView->GetWxVtk3DBaseView()->GetWxVTKRenderWindowInteractor();
-                       wxVTKiren->GetEventPosition(X,Y);
-
-                       int state  = _view->getState();
+               int state  = _view->getState();
                        
-                       //Evaluate new state
-                       if(state == HIGHLIGHTED)
-                       {
-                               _isLeftClickDown=true;
-                       }
-
+               //Evaluate new state
+               if(state == HIGHLIGHTED)
+               {
+                       _isLeftClickDown=true;
                }
                return true;
        }
index de343eab45c947e53b368e7c96dccb572fb28b28..e3911b1d988586ff19f60653ca84e47218f05a69 100644 (file)
@@ -74,7 +74,7 @@ namespace bbtk
        private:
 
                //Attributes
-               bool _isLeftClickDown;
+               
 
                //Private Methods
 
index 65dbf1ae932fa757d2678ad53e9aee7f8dc524a4..0d56863b88862885877f021e6b74df342dda2c3d 100644 (file)
@@ -53,7 +53,6 @@ namespace bbtk
        //=========================================================================
        void vtkGBlackBoxView::update(int idController,int command)
        {
-
                updateColors();
                
                double xInic, yInic,zInic,xFin, yFin,zFin;
@@ -67,6 +66,13 @@ namespace bbtk
                _pts->SetPoint(2, xFin, yFin, zFin );
                _pts->SetPoint(3, xFin, yInic, zFin );
 
+
+               _ptsFill->SetPoint(0, xInic, yInic, zInic-0.01 );
+               _ptsFill->SetPoint(1, xInic, yFin, zInic-0.01 );
+               _ptsFill->SetPoint(2, xFin, yFin, zFin-0.01 );
+               _ptsFill->SetPoint(3, xFin, yInic, zFin-0.01 );
+
+
                //-----------
 
                updatePositionTextActors(xInic, yInic,zInic);
@@ -85,8 +91,8 @@ namespace bbtk
                vtkCellArray *lines = vtkCellArray::New();
                vtkPolyData *_pd = vtkPolyData::New();
                vtkPolyDataMapper* _bboxMapper=vtkPolyDataMapper::New();
-               _objectActor=vtkActor::New();
-               
+               _objectBorderActor=vtkActor::New();
+                               
                _pts->SetNumberOfPoints(4);
 
                double xInic, yInic,zInic,xFin, yFin,zFin;
@@ -111,9 +117,43 @@ namespace bbtk
                _pd->SetLines( lines );
 
                _bboxMapper->SetInput(_pd);
-               _objectActor->SetMapper(_bboxMapper);
+               _objectBorderActor->SetMapper(_bboxMapper);
+
+               _objectBorderActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+
+               
+               ///************************* FILL *************************
+
+               _ptsFill = vtkPoints::New();
+               vtkCellArray *strip = vtkCellArray::New();
+               vtkPolyData *pdFill = vtkPolyData::New();
+               vtkPolyDataMapper* bboxMapperFill=vtkPolyDataMapper::New();
+               _fillBorderActor=vtkActor::New();
+
+               _ptsFill->SetNumberOfPoints(4);
+
+               // RaC In the actual version, zInic=zFin=900
+
+               _ptsFill->SetPoint(0, xInic, yInic, zInic-0.01 );
+               _ptsFill->SetPoint(1, xInic, yFin, zInic-0.01 );
+               _ptsFill->SetPoint(2, xFin, yFin, zFin-0.01 );
+               _ptsFill->SetPoint(3, xFin, yInic, zFin-0.01 );
+
+               strip->InsertNextCell(5);
+               strip->InsertCellPoint(0);
+               strip->InsertCellPoint(1);
+               strip->InsertCellPoint(2);
+               strip->InsertCellPoint(0);
+               strip->InsertCellPoint(3);
+                       
+               pdFill->SetPoints( _pts );
+               pdFill->SetStrips( strip );
+
+               bboxMapperFill->SetInput(pdFill);
+               _fillBorderActor->SetMapper(bboxMapperFill);
+               _fillBorderActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
 
-               _objectActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+               ///************************* FILL *************************
 
                //------------
 
@@ -162,35 +202,36 @@ namespace bbtk
 
        void vtkGBlackBoxView::updateColors()
        {
-               _objectActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+               _objectBorderActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
                _nameActor->GetTextProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
                _typeActor->GetTextProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+               _fillBorderActor->GetProperty()->SetColor(1,.5,.3);
 
                if(_state==NOTHING_HAPPENS)
                {
-                       _objectActor->GetProperty()->SetLineWidth(1);
-                       _objectActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+                       _objectBorderActor->GetProperty()->SetLineWidth(1);
+                       _objectBorderActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
                        _nameActor->GetTextProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
                        _typeActor->GetTextProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
                }
                else if(_state==HIGHLIGHTED)
                {
-                       _objectActor->GetProperty()->SetLineWidth(2);
-                       _objectActor->GetProperty()->SetColor(BOXCONTOUR_HIGHLIGHTED_R,BOXCONTOUR_HIGHLIGHTED_G,BOXCONTOUR_HIGHLIGHTED_B);
+                       _objectBorderActor->GetProperty()->SetLineWidth(2);
+                       _objectBorderActor->GetProperty()->SetColor(BOXCONTOUR_HIGHLIGHTED_R,BOXCONTOUR_HIGHLIGHTED_G,BOXCONTOUR_HIGHLIGHTED_B);
                        _nameActor->GetTextProperty()->SetColor(BOXCONTOUR_HIGHLIGHTED_R,BOXCONTOUR_HIGHLIGHTED_G,BOXCONTOUR_HIGHLIGHTED_B);
                        _typeActor->GetTextProperty()->SetColor(BOXCONTOUR_HIGHLIGHTED_R,BOXCONTOUR_HIGHLIGHTED_G,BOXCONTOUR_HIGHLIGHTED_B);
                }
                else if(_state==DRAG)
                {
-                       _objectActor->GetProperty()->SetLineWidth(1.2);
-                       _objectActor->GetProperty()->SetColor(BOXCONTOUR_DRAG_R,BOXCONTOUR_DRAG_G,BOXCONTOUR_DRAG_B);
+                       _objectBorderActor->GetProperty()->SetLineWidth(1.2);
+                       _objectBorderActor->GetProperty()->SetColor(BOXCONTOUR_DRAG_R,BOXCONTOUR_DRAG_G,BOXCONTOUR_DRAG_B);
                        _nameActor->GetTextProperty()->SetColor(BOXCONTOUR_DRAG_R,BOXCONTOUR_DRAG_G,BOXCONTOUR_DRAG_B);
                        _typeActor->GetTextProperty()->SetColor(BOXCONTOUR_DRAG_R,BOXCONTOUR_DRAG_G,BOXCONTOUR_DRAG_B);
                }
                else if(_state==SELECTED)
                {
-                       _objectActor->GetProperty()->SetLineWidth(2);
-                       _objectActor->GetProperty()->SetColor(BOXCONTOUR_SELECTED_R,BOXCONTOUR_SELECTED_G,BOXCONTOUR_SELECTED_B);
+                       _objectBorderActor->GetProperty()->SetLineWidth(2);
+                       _objectBorderActor->GetProperty()->SetColor(BOXCONTOUR_SELECTED_R,BOXCONTOUR_SELECTED_G,BOXCONTOUR_SELECTED_B);
                        _nameActor->GetTextProperty()->SetColor(BOXCONTOUR_SELECTED_R,BOXCONTOUR_SELECTED_G,BOXCONTOUR_SELECTED_B);
                        _typeActor->GetTextProperty()->SetColor(BOXCONTOUR_SELECTED_R,BOXCONTOUR_SELECTED_G,BOXCONTOUR_SELECTED_B);
                }
index a38f8f46da984b0882706db2768ddadef8cf4021..aa9ec84fb2c0a67fed6140f73039f251cb8d48be 100644 (file)
@@ -85,6 +85,7 @@ namespace bbtk
 
                //Private Attributes
                vtkPoints *_pts;
+               vtkPoints *_ptsFill;
                vtkTextActor3D* _nameActor;
                vtkTextActor3D* _typeActor;
 
index 85b2616c90b026d100a03569d1a72ec651e39cb2..1c2fd8f8d1e6622f3fb1bab6d619033b61697fb2 100644 (file)
@@ -44,7 +44,8 @@ namespace bbtk
        vtkGObjectView::vtkGObjectView()
        {
                _baseView=NULL;
-               _objectActor=NULL;
+               _objectBorderActor=NULL;
+               _fillBorderActor=NULL;
                _isStartDragging=false;
                
                _state = NOTHING_HAPPENS;
@@ -101,7 +102,8 @@ namespace bbtk
 
        void vtkGObjectView::addVtkActors()//virtual
        {
-               _baseView->GetRenderer()->AddActor(_objectActor);
+               _baseView->GetRenderer()->AddActor(_objectBorderActor);
+               _baseView->GetRenderer()->AddActor(_fillBorderActor);
                _baseView->GetRenderer()->Render();
        }
 
@@ -123,8 +125,6 @@ namespace bbtk
                double xx=X,yy=Y,zz=900;
                _baseView->TransCoordScreenToWorld(xx,yy,zz);
 
-               
-
                if(_isStartDragging)
                {
                        _isStartDragging=false;
@@ -134,14 +134,13 @@ namespace bbtk
                        dragDifX=xx-xInic;
                        dragDifY=yy-yInic;      
                }
-
                _model->move(xx-dragDifX,yy-dragDifY,zz);
 
        }
 
        //=========================================================================
 
-       void vtkGObjectView::isStartDragging(bool param)
+       void vtkGObjectView::setStartDragging(bool param)
        {
                _isStartDragging=param;
                dragDifX=0;
index d07a3fd7def5884e6ed6e2b5241b15009ea07276..3c6908a9605c3dd839a0ef34b8435d8b6aa970cf 100644 (file)
@@ -84,7 +84,7 @@ namespace bbtk
                virtual void moveObject(int X, int Y);
 
                virtual void update(int idController,int command);
-               void isStartDragging(bool param);
+               void setStartDragging(bool param);
 
                void setState(int state);
                int getState();
@@ -105,7 +105,8 @@ namespace bbtk
                //Protected Attributes
                wxVtkBaseView *_baseView;
                GObjectModel *_model;
-               vtkActor *_objectActor;
+               vtkActor *_objectBorderActor;
+               vtkActor *_fillBorderActor;
                int  _state;
                
                //Protected Methods
index b4f631dcd2abdffc8abbfb69494f1d4afc223582..6cf1839fdd013e9b9f6db0b275db93b7e0bf2765 100644 (file)
@@ -79,7 +79,7 @@ namespace bbtk
                vtkCellArray *lines = vtkCellArray::New();
                vtkPolyData *_pd = vtkPolyData::New();
                vtkPolyDataMapper* _bboxMapper=vtkPolyDataMapper::New();
-               _objectActor=vtkActor::New();
+               _objectBorderActor=vtkActor::New();
                
                _pts->SetNumberOfPoints(3);
 
@@ -106,7 +106,7 @@ namespace bbtk
                _pd->SetLines( lines );
 
                _bboxMapper->SetInput(_pd);
-               _objectActor->SetMapper(_bboxMapper);
+               _objectBorderActor->SetMapper(_bboxMapper);
 
                updateColors();
 
@@ -117,15 +117,15 @@ namespace bbtk
 
        void vtkGPortView::updateColors()
        {
-               _objectActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
+               _objectBorderActor->GetProperty()->SetColor(BOXCONTOUR_NH_R,BOXCONTOUR_NH_G,BOXCONTOUR_NH_B);
 
                if(_state==HIGHLIGHTED)
                {
-                       _objectActor->GetProperty()->SetColor(0.8,0.2,0.5);
+                       _objectBorderActor->GetProperty()->SetColor(0.8,0.2,0.5);
                }
                else
                {
-                       _objectActor->GetProperty()->SetColor(0.3,0.2,0.2);
+                       _objectBorderActor->GetProperty()->SetColor(0.3,0.2,0.2);
                }
        }
 
index 34a854210315b1fc3411494e1859cc826d92b5b2..12708e34400425a58447bfa5a7e9e2f95dca78a3 100644 (file)
@@ -71,6 +71,8 @@ namespace bbtk
 
                CreateStatusBar();
                _frameAUIMgr->Update();
+               _actualPkgBrowserBoxName="";
+               _actualPkgBrowserPkgName="";
        }
 
 
@@ -133,9 +135,9 @@ namespace bbtk
        //=========================================================================
        void wxGUIEditorGraphicBBS::initTabPanelsManager()
        {
-               wxAuiNotebook *notebook = new wxAuiNotebook(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON);
-               _tabsMgr = new wxTabPanelsManager(notebook);
-               _frameAUIMgr->AddPane(notebook,wxAuiPaneInfo().CenterPane());   
+               _notebook = new wxAuiNotebook(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON);
+               _tabsMgr = new wxTabPanelsManager(this);
+               _frameAUIMgr->AddPane(_notebook,wxAuiPaneInfo().CenterPane());  
 
        }
        
@@ -251,7 +253,28 @@ namespace bbtk
                DoRegenerateBoxesLists();
        }
 
-  //================================================================
+       //================================================================
+
+       wxAuiNotebook* wxGUIEditorGraphicBBS::getAuiNotebook()
+       {
+               return _notebook;
+       }
+
+       //================================================================
+
+       void wxGUIEditorGraphicBBS::displayBlackBoxInfo(std::string packageName, std::string boxName)
+       {
+               if(_actualPkgBrowserPkgName != packageName || _actualPkgBrowserBoxName != boxName )
+               {
+                       _actualPkgBrowserPkgName = packageName;
+                       _actualPkgBrowserBoxName = boxName;
+
+                       BlackBoxDescriptor::Pointer descriptor = GObjectsMVCFactory::getInstance()->getBlackBoxDescriptor(packageName, boxName);
+                       _pkgBrowser->WxGUIBlackBoxListUserOnSelected(descriptor.get());
+               }
+       }
+
+       //=========================================================================
 
        /*****************************************************
        /* HANDLERS 
index 483d2b4fc502bcad9f7c5333d482139aead76fbb..5771c39271ba8e8d472949ccfab9dd2de8f46d6e 100644 (file)
@@ -46,7 +46,7 @@
 //Includes same project
 #include "wxTabPanelsManager.h"
 #include "wxPropertiesPanel.h"
-#include "wxart_new.xpm"
+#include "C:\RaC\CREATIS\bbtkGEditor\data\icons\wxart_new.xpm"
 
 //Includes creaMaracasVisu
 
@@ -73,6 +73,7 @@
 
 namespace bbtk
 {
+       class wxTabPanelsManager;
   
        class  wxGUIEditorGraphicBBS : public wxFrame
   {
@@ -87,6 +88,9 @@ namespace bbtk
                void initHelpHTMLBrowser();
                void initPropertiesPanel();
 
+               wxAuiNotebook* getAuiNotebook();
+               void displayBlackBoxInfo(std::string packageName, std::string boxName);
+
                void RegenerateAll();
                void DoRegeneratePackageDoc(const std::string& pack);   
                void DoRegenerateBoxesLists();
@@ -105,6 +109,10 @@ namespace bbtk
 
                std::string _dataDir;
 
+               std::string _actualPkgBrowserBoxName;
+
+               std::string _actualPkgBrowserPkgName;
+
        protected:
 
          
index 88b6aaf6a665a415805927bdc73db65d4ea9a7cf..c2f538c5baaddaedd95e0acad8988bc28799cbb8 100644 (file)
@@ -99,6 +99,20 @@ namespace bbtk
 
        //=========================================================================
 
+       void wxGEditorTabPanel::setPanelsManager(wxTabPanelsManager* panelsManager)
+       {
+               _panelsManager = panelsManager;
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::displayBlackBoxInfo(std::string packageName, std::string boxName)
+       {
+               _panelsManager->displayBlackBoxInfo(packageName,boxName);
+       }
+
+       //=========================================================================
+
 }  // EO namespace bbtk
 
 // EOF
index 5f157fec55214bc9f7b762a4a1be91362f38162d..39e0ab06eb2a8696318496fcbb0b09027d22f922 100644 (file)
@@ -45,6 +45,7 @@ Version:   $Revision$
 
 //Includes same project
 #include "wxVtkSceneManager.h"
+#include "wxTabPanelsManager.h"
 
 //Includes wxWidgets
 #include <wx/panel.h>
@@ -63,6 +64,10 @@ Version:   $Revision$
 namespace bbtk
 {
 
+       class wxVtkSceneManager;
+
+       class wxTabPanelsManager;
+
        class wxGEditorTabPanel :  public wxTextDropTarget, public wxPanel
        {
        public: 
@@ -72,12 +77,16 @@ namespace bbtk
 
                void initWxVtkCanvas();
                virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& data);
+               void setPanelsManager(wxTabPanelsManager* panelsManager);
+
+               void displayBlackBoxInfo(std::string packageName, std::string boxName);
                
        private:
 
                int _id;
                wxAuiManager *_panelAUIMgr;
                wxVtkSceneManager *_sceneManager;
+               wxTabPanelsManager* _panelsManager;
 
        protected:
 
index f34682c4533e8d5ba88921b19c4870ea4a9d834d..6f1ee930aafa75ad0575aeedd98c6a2d43c01a4e 100644 (file)
@@ -42,10 +42,11 @@ namespace bbtk
 
 
        //=========================================================================
-       wxTabPanelsManager::wxTabPanelsManager(wxAuiNotebook *notebook)
+       wxTabPanelsManager::wxTabPanelsManager(wxGUIEditorGraphicBBS *parent)
        {
+               _parent = parent;
                _lastId = 0;
-               _notebook = notebook;
+               _notebook = _parent->getAuiNotebook();
                addNewTab();
        }
 
@@ -60,6 +61,7 @@ namespace bbtk
                _lastId++;              
 
                wxGEditorTabPanel *newPanel = new wxGEditorTabPanel(_notebook,_lastId);
+               newPanel->setPanelsManager(this);
                _panels[_lastId]=newPanel;
                _actual = newPanel;
 
@@ -78,6 +80,15 @@ namespace bbtk
                return _actual;
        }
 
+       //=========================================================================
+
+       void wxTabPanelsManager::displayBlackBoxInfo(std::string packageName, std::string boxName)
+       {
+               _parent->displayBlackBoxInfo(packageName,boxName);
+       }
+
+       //=========================================================================
+
        /*****************************************************
        /* HANDLERS 
        /*****************************************************/
index 5f08e601e731a5261e218b5c28f682e18850bea0..b987a9bdd9ca06c8a4d51344c27d11ec6c53873d 100644 (file)
@@ -50,27 +50,37 @@ Version:   $Revision$
 #include <iostream>
 
 #include "wxGEditorTabPanel.h"
+#include "wxVtkSceneManager.h"
+#include "bbtkwxGUIEditorGraphicBBS.h"
 
 using namespace std;
 
 namespace bbtk
 {
 
+       class wxVtkSceneManager;
+       class wxGEditorTabPanel;
+       class wxGUIEditorGraphicBBS;
+
        class wxTabPanelsManager
        {
        public: 
-               wxTabPanelsManager(wxAuiNotebook *notebook);
+               wxTabPanelsManager(wxGUIEditorGraphicBBS *parent);
                ~wxTabPanelsManager();
                
                virtual void addNewTab();
                wxAuiNotebook* getAuiNotebook();
                wxGEditorTabPanel* getActualTabPanel();
 
+               void displayBlackBoxInfo(std::string packageName, std::string boxName);
+               
+
        private:
 
        /**
        ** The map 
        */
+               wxGUIEditorGraphicBBS *_parent;
                map<int, wxPanel*> _panels;
                wxGEditorTabPanel* _actual;
                wxAuiNotebook  *_notebook;