X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGPortModel.h;h=d82b8850deae461c2b2f131c37db73757d8b83d7;hb=61a38c679e47c9f102d2834c835c3c6eac487a9b;hp=474ebb3e109fe60cec33348411f498c66566d6a0;hpb=31dee6ade406b4b04ea61b9e6527b663e9ed6540;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h index 474ebb3..d82b885 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h @@ -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 +* RaC - 2010 +****/ #ifndef __GPortModel_h__ #define __GPortModel_h__ @@ -57,6 +58,7 @@ Version: $Revision$ namespace bbtk { + // Mandatory when exists a bidirectional relation: GPortModel includes GBoxModel and viceversa class GBoxModel; class GPortModel : public GObjectModel @@ -68,29 +70,48 @@ namespace bbtk GPortModel(); virtual ~GPortModel(); - //Public methods + //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(); + GBoxModel* getParentBox(); - virtual std::string getStatusText(); + + // 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); - int getPosInBox(); + private: - //Attributes + //Private Attributes 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;