+/*
+# ---------------------------------------------------------------------
+#
+# 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$
* \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__
//Includes same project
#include "GlobalConstants.h"
#include "GObjectModel.h"
-#include "GBlackBoxModel.h"
+#include "GBoxModel.h"
//Includes creaMaracasVisu
namespace bbtk
{
- class GBlackBoxModel;
+ // Mandatory when exists a bidirectional relation: GPortModel includes GBoxModel and viceversa
+ class GBoxModel;
class GPortModel : public GObjectModel
{
//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();
- private:
+ GBoxModel* getParentBox();
- //Attributes
-
- GBlackBoxModel *_parentBox;
+ // 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:
+ //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;
//Private Methods
-
protected:
//Protected methods
-
};
-
-
}
// namespace bbtk
#endif