* \brief Class bbtk::BlackBox : abstract black-box interface.
*/
-/**
-* \class bbtk::wxVtkSceneManager
-* \brief
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
#ifndef __wxVtkSceneManager_h__
#define __wxVtkSceneManager_h__
class wxVtkSceneManager : public InteractorStyleMaracas , public Observer
{
public:
+
wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView *baseView, int idManager);
~wxVtkSceneManager();
+ void disconnectDrop();
+ //-------
void configureBaseView();
- 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 OnRightButtonUp();
virtual bool OnLeftDClick();
+ //-------
+ 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);
+
+ vtkRenderWindow* getRenderWindow();
+ vtkRenderer* getRenderer();
+
virtual void update(int idController,int command);
+ void refreshScene();
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();
+ //-------
+ //Get a collection of object ids
std::vector<int> getBlackBoxes();
std::vector<int> getConnections();
std::vector<int> getComplexInputPorts();
std::vector<int> getComplexOutputPorts();
+ //Get the map of selected objects (id, controller)
std::map<int,GObjectController*> getSelectedObjects();
+
+ //Get size of selected objects map
int getNumSelectedObjects();
+ //Complex box edition mode
bool isComplexBox();
void setComplexBox(bool val);
+ //-------
+ //Add an object to the list of controllers
int addObjectController(GObjectController* objController);
+
+ //Add a map of object controllers
void addObjects(std::map<int,GObjectController*> objectsMap);
+
+ //-------
+ //Returns a string with the BBS script of the current diagram.
+ std::string getDiagramBBS();
+
+ //Returns a string with the BBS script of the complex box.
+ std::string saveComplexBoxBBS(std::string cbName,std::string cbAuthor="",std::string cbCategory="",std::string cbDescription="");
+
+ //Delete the object in the list of controllers with the id given by parameter.
+ void deleteObject(int id);
+
+ //Clear list of controllers and refresh
+ void deleteAllBoxes();
+
+ //Save the diagram in the BBG format, in the string given by param.
+ void saveDiagram(std::string &content);
+
+ //Load the diagram
+ void loadDiagram(ifstream &inputStream);
+
+ //Center the view of the camera in the initial position
+ void centerView();
+
+ //-------
+
private:
+ //wxPanel that uses the manager
wxGEditorTabPanel *_parent;
// Id of the manager, the same of the panel
// StartDragging
bool _startDragging;
+ // creaMaracasVisu viewer
wxVtk3DBaseView *_baseView;
+ // State of the 3D Scene or the virtual world
int _worldState;
+ //Map of id - objectController
std::map<int,GObjectController*> _controllers;
//Saves the id's of the selected objects in the controllers map
std::vector<int> _selectedObjects;
+ //Is the diagram in state complex box
bool _isComplexBox;
+ int _idConnectionInCreation;
+
+ int _contLastId;
+
protected:
};