]> Creatis software - bbtkGEditor.git/commitdiff
Cleaning code and documenting
authorcorredor <>
Fri, 18 Jun 2010 14:29:24 +0000 (14:29 +0000)
committercorredor <>
Fri, 18 Jun 2010 14:29:24 +0000 (14:29 +0000)
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/GObjectsMVCFactory.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h

index 606b0952ead28a06e4514ad432a5a476d6685687..3364bb4253cdc1c6cedc9b287d9ead448e859bdd 100644 (file)
@@ -89,21 +89,23 @@ namespace bbtk
                //Public methods
                static GObjectsMVCFactory* getInstance();
                static void destroyInstance();
+
                BlackBoxDescriptor::Pointer getBlackBoxDescriptor(std::string packageName, std::string boxName);
+
                vtkGObjectView* createGObjectView(int type);
                GObjectController* createGObjectController(int type);
                GObjectModel* createGObjectModel(int type);
 
+               //Public attributes
                Interpreter::Pointer _interpreter;
 
        private:
 
-               //Attributes
-               static GObjectsMVCFactory* instance;
-               
-
                //Private Methods
 
+               //Private Attributes
+               static GObjectsMVCFactory* instance;
+
 
        protected:
 
index 86f24fdfab050a282ee3d0191117a56fd71c92da..8e8a7aa67355e955380c1955a0b415dcc3d72cb6 100644 (file)
@@ -87,26 +87,16 @@ namespace bbtk
        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(); 
@@ -114,36 +104,93 @@ namespace bbtk
                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);
+
+               //-------
+               //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();
 
-               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);
 
-               int addObjectController(GObjectController* objController);
-               void addObjects(std::map<int,GObjectController*> objectsMap);
 
-               
+
        private:
 
+               //wxPanel that uses the manager
                wxGEditorTabPanel *_parent;
 
                // Id of the manager, the same of the panel
@@ -155,15 +202,19 @@ namespace bbtk
                // 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;
 
        protected: