X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGPortModel.h;h=5021593d75503c93cda5563062ce4f15b1fc2c74;hb=782cadf1306a646406ed7a089907f73a5f12c4e5;hp=c18e225d0b277d63a0e1cb9d479e099bf5504b48;hpb=3babfd57a9b4b3cffba34415e928239592e7d4a1;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h index c18e225..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__ @@ -46,7 +72,7 @@ Version: $Revision$ //Includes same project #include "GlobalConstants.h" #include "GObjectModel.h" -#include "GBlackBoxModel.h" +#include "GBoxModel.h" //Includes creaMaracasVisu @@ -57,7 +83,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,23 +93,53 @@ 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(); + + 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; + //Private Methods protected: