X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FwxVtkSceneManager.h;h=36a2168b5fb62139c311b7c5328d3066886bf6b1;hb=10186ea739d6c453d607c7a13c45c43167b39cb5;hp=f3383ed5600286c079a76898e64bcba9a93a76dc;hpb=ac7e88cf5991d996435b15c7d731b67078f8b2c9;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h index f3383ed..36a2168 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h @@ -43,42 +43,111 @@ Version: $Revision$ #ifndef __wxVtkSceneManager_h__ #define __wxVtkSceneManager_h__ -//Includes Same project -#include "VTKGObjectsFactory.h" +//Includes same project +#include "GObjectsMVCFactory.h" +#include "Observer.h" +#include "GPortModel.h" +#include "vtkGConnectorView.h" +#include "GConnectorModel.h" +#include "GConnectorController.h" +#include "vtkGPortView.h" +#include "manualConnectorContourView.h" +#include "manualConnectorContourController.h" +#include "wxGEditorTabPanel.h" + +//Includes bbtk +#include +#include //Includes creaMaracasVisu #include #include +#include +#include +#include //Includes vtk #include #include #include +#include + //Includes std #include +#include + namespace bbtk { + class wxGEditorTabPanel; - class wxVtkSceneManager : public InteractorStyleMaracas + class wxVtkSceneManager : public InteractorStyleMaracas , public Observer { public: - wxVtkSceneManager(wxDropTarget *parent, wxVtk3DBaseView *baseView, int id); + wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView, int idManager); ~wxVtkSceneManager(); void configureBaseView(); - void createGBlackBox(); + int createGBlackBox(int x, int y,std::string packageName, std::string boxType); + GPortController* createGPort(int portType, std::string bbtkName, std::string bbtkType, int posinBox,GBlackBoxModel *blackBox); + int createGInputPort(int portType, int posinBox,GBlackBoxModel *blackBox, BlackBoxInputDescriptor *desc); + int createGOutputPort(int portType, int posinBox,GBlackBoxModel *blackBox, BlackBoxOutputDescriptor *desc); + int createGConnector(GPortModel* startPort); + void registerController(InteractorStyleMaracas *param); + void unregisterController(InteractorStyleMaracas *param); vtkRenderWindow* getRenderWindow(); vtkRenderer* getRenderer(); + + void disconnectDrop(); + + virtual bool OnChar(); + virtual bool OnMouseMove(); + virtual bool OnLeftButtonDown(); + virtual bool OnLeftButtonUp(); + virtual bool OnRightButtonUp(); + virtual bool OnLeftDClick(); + + virtual void update(int idController,int command); + + void displayBlackBoxInfo(std::string packageName, std::string boxName); + void updateStatusBar(std::string textStatus); + std::string getDiagramScript(); + void deleteObject(int id); + void deleteAllBoxes(); + void saveDiagram(std::string &content); + void loadDiagram(ifstream &inputStream); + void centerView(); + + void refreshScene(); + std::vector getBoxes(); + std::vector getConnections(); + private: - int _id; + wxGEditorTabPanel *_parent; + + // Id of the manager, the same of the panel + int _idManager; + + // Boxes number in the scene + int _numBoxes; + + // StartDragging + bool _startDragging; + wxVtk3DBaseView *_baseView; + int _worldState; + + std::map _controllers; + + //Saves the id's of the selected objects in the controllers map + std::vector _selectedObjects; + protected: };