]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx
v1.1.0
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GBlackBoxModel.cxx
index 5351493e280e2ac0459b6aae2469b26acd683d3d..7eb35180731366b3fb4463de71192b919f300561 100644 (file)
@@ -28,12 +28,14 @@ Version:   $Revision$
 *  knowledge of the CeCILL-B license and that you accept its terms.
 * ------------------------------------------------------------------------ */                                                                         
 
-/**
-*  \file 
-*  \brief Class bbtk::GBlackBox 
-*/
 
 
+/****
+* Design and Developpement of BBTK GEditor
+* Ricardo A Corredor J <ra.corredor67@uniandes.edu.co>
+* RaC - 2010
+****/
+
 #include "GBlackBoxModel.h"
 
 namespace bbtk
@@ -147,7 +149,7 @@ namespace bbtk
                content+="\n";
 
                //Ports with a value
-               for(int i = 0; i<_inputs.size();i++)
+               for(int i = 0; i<(int)_inputs.size();i++)
                {
                        if(_inputs[i]->isValueSet())
                        {
@@ -162,7 +164,7 @@ namespace bbtk
 
        void GBlackBoxModel::setValueToInput(std::string name,std::string value)
        {
-               for(int i = 0; i<_inputs.size();i++)
+               for(int i = 0; i<(int)_inputs.size();i++)
                {
                        if(_inputs[i]->getBBTKName()==name)
                        {
@@ -173,7 +175,58 @@ namespace bbtk
 
        //=========================================================================
 
-}  // EO namespace bbtk
+       std::string GBlackBoxModel::getValueInputPort(int pos)
+       {
+               std::string text = _inputs[pos]->getValue();
+               return text;
+       }
+
+       //=========================================================================
+
+       std::string GBlackBoxModel::getValueInput(std::string name)
+       {
+               for(int i = 0; i<(int)_inputs.size();i++)
+               {
+                       if(_inputs[i]->getBBTKName()==name)
+                       {
+                               return _inputs[i]->getValue();
+                       }
+               }
+               return NULL;
+       }
+
+       //=========================================================================
+
+       std::vector<int> GBlackBoxModel::getConnectedInputs()
+       {
+               std::vector<int> connected;
+               for(int i = 0; i<(int)_inputs.size();i++)
+               {
+                       if(_inputs[i]->isConnected())
+                       {
+                               connected.push_back(i);
+                       }
+               }
+               return connected;
+       }
+
+       //=========================================================================
+
+       std::vector<int> GBlackBoxModel::getConnectedOutputs()
+       {
+               std::vector<int> connected;
+               for(int i = 0; i<(int)_outputs.size();i++)
+               {
+                       if(_outputs[i]->isConnected())
+                       {
+                               connected.push_back(i);
+                       }
+               }
+               return connected;
+       }
+
+       //=========================================================================
+}   // EO namespace bbtk
 
 // EOF