]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h
Feature 1367 - Hint for possible connections. Bug 1352 - Show errors with inconsisten...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GPortModel.h
index 5d12b911e2a18392b0ec96d87429de17b45fdac4..d82b8850deae461c2b2f131c37db73757d8b83d7 100644 (file)
@@ -35,10 +35,11 @@ Version:   $Revision$
 *  \brief Class bbtk::GPortModel : abstract black-box interface. 
 */
 
-/**
-* \class bbtk::GPortModel
-* \brief 
-*/
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
 
 #ifndef __GPortModel_h__
 #define __GPortModel_h__
@@ -46,7 +47,7 @@ Version:   $Revision$
 //Includes same project
 #include "GlobalConstants.h"
 #include "GObjectModel.h"
-#include "GBlackBoxModel.h"
+#include "GBoxModel.h"
 
 //Includes creaMaracasVisu
 
@@ -57,7 +58,8 @@ Version:   $Revision$
 namespace bbtk
 {
 
-       class GBlackBoxModel;
+       // Mandatory when exists a bidirectional relation: GPortModel includes GBoxModel and viceversa
+       class GBoxModel;
 
        class GPortModel : public GObjectModel 
        {
@@ -66,29 +68,50 @@ namespace bbtk
 
                //Constructors
                GPortModel();
-               ~GPortModel();
+               virtual ~GPortModel();
                
-               //Public methods                
-               void registerInBox(GBlackBoxModel *blackBox,int portType, int pos);
+               //Public methods
+
+               // Register the input or output in a position of the black box, depending in the portType(INPUT/OUTPUT).
+               void registerInBox(GBoxModel *blackBox,int portType, int pos);
+
+               // Update the port position based in the parent box initial point
                void updatePortPosition();
+
+               // Port type (INPUT/OUTPUT)
                int getPortType();
-               GBlackBoxModel* getParentBox();
-               virtual std::string getStatusText();
+
+               GBoxModel* getParentBox();
+
+               // Returns the position of the port in the box
+               int getPosInBox();
+
                bool isConnected();
                void setConnected(bool value);
+
                bool isValueSet();
                void setValue(std::string value);
+
                std::string getValue();
 
+               virtual std::string getStatusText();
+               virtual void save(std::string &content);
+               
+
        private:
 
-               //Attributes
+               //Private Attributes
                
-               GBlackBoxModel *_parentBox;
-
+               GBoxModel *_parentBox;
+               
+               // Port type (INPUT/OUTPUT)
                int _portType;
+
+               // The position of the port in the box
                int _posInBox;
+
                bool _isConnected;
+
                std::string _value;
                bool _isValueSet;