]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.h
Feature #1771 Add licence terms for all files.
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GPortModel.h
index 8df71bf9fe6aa85baf5b4eaee15d3beb69bf4f5e..5021593d75503c93cda5563062ce4f15b1fc2c74 100644 (file)
@@ -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 <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
 
 #ifndef __GPortModel_h__
 #define __GPortModel_h__
@@ -46,6 +72,7 @@ Version:   $Revision$
 //Includes same project
 #include "GlobalConstants.h"
 #include "GObjectModel.h"
+#include "GBoxModel.h"
 
 //Includes creaMaracasVisu
 
@@ -56,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 
        {
@@ -65,15 +93,52 @@ namespace bbtk
 
                //Constructors
                GPortModel();
-               ~GPortModel();
+               virtual ~GPortModel();
                
-               //Public methods                
-               void registerInBox(GBlackBoxModel *blackBox);
+               //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