]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx
Actual Version : It is possible to define, to create and to save a complex box ....
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GBlackBoxModel.cxx
index 7c7bebbcd3da6bde6dc992a7cbbe8b621f80b987..5351493e280e2ac0459b6aae2469b26acd683d3d 100644 (file)
@@ -51,65 +51,6 @@ namespace bbtk
        {
        }
 
-       //=========================================================================
-
-       void GBlackBoxModel::setInicPoint(double& x, double& y, double& z)
-       {
-               GObjectModel::setInicPoint(x,y,z);
-
-               double xFin=x+BOX_WIDTH,yFin=y-BOX_HEIGHT;
-               setFinalPoint(xFin,yFin,z);
-       }
-
-       //=========================================================================
-
-       void GBlackBoxModel::addInputPort(GPortModel *inputport)
-       {
-               _inputs.push_back(inputport);
-       }
-
-       //=========================================================================
-
-       void GBlackBoxModel::addOutputPort(GPortModel *outputport)
-       {
-               _outputs.push_back(outputport);
-       }
-
-       //=========================================================================
-
-       int GBlackBoxModel::getNumInputPorts()
-       {
-               return _inputs.size();
-       }
-
-       //=========================================================================
-
-       int GBlackBoxModel::getNumOutputPorts()
-       {
-               return _outputs.size();
-       }
-
-       //=========================================================================
-
-       void GBlackBoxModel::move(double xx,double yy,double zz)
-       {
-               setInicPoint(xx,yy,zz);
-
-               //Refresh inputs position
-               int i;
-               for(i=0;i<_inputs.size();i++)
-               {
-                       _inputs[i]->updatePortPosition();
-               }
-               
-               //Refresh outputs position
-               for(i=0;i<_outputs.size();i++)
-               {
-                       _outputs[i]->updatePortPosition();
-               }
-
-       }
-       
        //=========================================================================
        
        std::string GBlackBoxModel::getBBTKPackage()
@@ -154,20 +95,6 @@ namespace bbtk
 
        //=========================================================================
 
-       std::vector<GPortModel*> GBlackBoxModel::getInputPorts()
-       {
-               return _inputs;
-       }
-
-       //=========================================================================
-
-       std::vector<GPortModel*> GBlackBoxModel::getOutputPorts()
-       {
-               return _outputs;
-       }
-
-       //=========================================================================
-
        void GBlackBoxModel::setValueToInputPort(int pos,std::string value)
        {
                _inputs[pos]->setValue(value);
@@ -185,6 +112,17 @@ namespace bbtk
                content+=":";
                content+=_bbtkName;
                content+="\n";
+               content+="ISEXEC:";
+               if(_isExecutable)
+               {
+                       content+="TRUE";
+               }
+               else
+               {
+                       content+="FALSE";
+               }
+               content+="\n";
+
 
                //Box Position
                char buffer [50];
@@ -216,11 +154,24 @@ namespace bbtk
                                _inputs[i]->save(content);
                        }
                }
+               content+="FIN_BOX\n";
 
        }
        
        //=========================================================================
 
+       void GBlackBoxModel::setValueToInput(std::string name,std::string value)
+       {
+               for(int i = 0; i<_inputs.size();i++)
+               {
+                       if(_inputs[i]->getBBTKName()==name)
+                       {
+                               _inputs[i]->setValue(value);
+                       }
+               }
+       }
+
+       //=========================================================================
 
 }  // EO namespace bbtk