]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/wxVtkSceneManager.h
The buttons and the objects to create input and output complex box ports were added...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / wxVtkSceneManager.h
index 7d1c7d0b9c55cb1c7fadf90510cb056f061c3404..118d136d2a9fec85a709ff4ab993e4ae252f5310 100644 (file)
@@ -45,10 +45,28 @@ 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 <bbtkBlackBoxInputDescriptor.h>
+#include <bbtkBlackBoxDescriptor.h>
 
 //Includes creaMaracasVisu
 #include <wxVtk3DBaseView.h>
 #include <InteractorStyleMaracas.h>
+#include <vtkInteractorStyleBaseView2D.h>
+#include <manualContourControler.h>
+#include <manualContourModel.h>
 
 //Includes vtk
 #include <vtkRenderWindow.h>
@@ -56,34 +74,89 @@ Version:   $Revision$
 #include <vtkRenderer.h>
 #include <vtkInteractorStyleImage.h>
 
+
 //Includes std
 #include <iostream>
+#include <map>
+
 
 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);
+               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 getDiagramScript();
+               void deleteObject(int id);
+               void deleteAllBoxes();
+               void saveDiagram(std::string &content);
+               void loadDiagram(ifstream &inputStream);
+               void centerView();
+
+               void refreshScene();
+               std::vector<int> getBoxes();
+               std::vector<int> getConnections();
+
+               bool isComplexBox();
+               void setComplexBox(bool val);
 
                
        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;
 
-               void refreshRenderWindow();
+               int _worldState;
+
+               std::map<int,GObjectController*> _controllers;
+
+               //Saves the id's of the selected objects in the controllers map
+               std::vector<int> _selectedObjects;
+
+               bool _isComplexBox;
+
        protected:
 
        };