X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FwxVtkSceneManager.h;h=86f24fdfab050a282ee3d0191117a56fd71c92da;hb=31dee6ade406b4b04ea61b9e6527b663e9ed6540;hp=d272f60ac5e2a37ee22782eb2fd78c5f0b0efc86;hpb=cef73d418644dcb545c7731df11c54146fe82174;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h index d272f60..86f24fd 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h @@ -45,6 +45,17 @@ Version: $Revision$ //Includes same project #include "GObjectsMVCFactory.h" +#include "Observer.h" +#include "GBoxModel.h" +#include "GComplexBoxPortModel.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 @@ -54,6 +65,8 @@ Version: $Revision$ #include #include #include +#include +#include //Includes vtk #include @@ -61,6 +74,7 @@ Version: $Revision$ #include #include + //Includes std #include #include @@ -68,36 +82,90 @@ Version: $Revision$ 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 x, int y,std::string packageName, std::string boxName); - void createGInputPort(BlackBoxInputDescriptor *desc,GBlackBoxModel *blackBox); - void createGOutputPort(BlackBoxOutputDescriptor *desc,GBlackBoxModel *blackBox); + int createGBlackBox(int x, int y,std::string packageName, std::string boxType); + int createGComplexBoxInputPort(std::string inputName); + int createGComplexBoxOutputPort(std::string outputName); + GPortController* createGPort(int portType, std::string bbtkName, std::string bbtkType, int posinBox,GBoxModel *blackBox); + int createGInputPort(int portType, int posinBox,GBoxModel *blackBox, BlackBoxInputDescriptor *desc); + int createGOutputPort(int portType, int posinBox,GBoxModel *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 getDiagramBBS(); + std::string saveComplexBoxBBS(std::string cbName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription=""); + void deleteObject(int id); + void deleteAllBoxes(); + void saveDiagram(std::string &content); + void loadDiagram(ifstream &inputStream); + void centerView(); + + void refreshScene(); + std::vector getBlackBoxes(); + std::vector getConnections(); + std::vector getComplexInputPorts(); + std::vector getComplexOutputPorts(); + + std::map getSelectedObjects(); + int getNumSelectedObjects(); + + bool isComplexBox(); + void setComplexBox(bool val); + + int addObjectController(GObjectController* objController); + void addObjects(std::map objectsMap); 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; - std::vector objects; - std::vector selectedObjects; - void refreshRenderWindow(); + int _worldState; + + std::map _controllers; + + //Saves the id's of the selected objects in the controllers map + std::vector _selectedObjects; + + bool _isComplexBox; - //ERASE - int cantTemp; protected: };