X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGPortModel.h;h=5021593d75503c93cda5563062ce4f15b1fc2c74;hb=782cadf1306a646406ed7a089907f73a5f12c4e5;hp=6dcef4dda6b8cae3d5d8ca971374f06448e9411e;hpb=343ecf790a799b8089a6d13fec0192fd9ad71da1;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h index 6dcef4d..5021593 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h @@ -1,3 +1,28 @@ +/* +# --------------------------------------------------------------------- +# +# Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image +# pour la Santé) +# Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton +# +# This software is governed by the CeCILL-B license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL-B +# license as circulated by CEA, CNRS and INRIA at the following URL +# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +# or in the file LICENSE.txt. +# +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. +# +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL-B license and that you accept its terms. +# ------------------------------------------------------------------------ +*/ + /*========================================================================= Program: bbtk Module: $RCSfile$ @@ -35,10 +60,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 +83,7 @@ Version: $Revision$ namespace bbtk { + // Mandatory when exists a bidirectional relation: GPortModel includes GBoxModel and viceversa class GBoxModel; class GPortModel : public GObjectModel @@ -68,28 +95,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); + 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;