]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx
It saves the diagram and it was added the icon to open a file ..... Now it is necessa...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GBlackBoxModel.cxx
index c7778f3667705f21563641cc50a613daae6e6aeb..7c7bebbcd3da6bde6dc992a7cbbe8b621f80b987 100644 (file)
@@ -38,18 +38,19 @@ Version:   $Revision$
 
 namespace bbtk
 {
-
-
        //=========================================================================
+
        GBlackBoxModel::GBlackBoxModel()
        {               
                _isExecutable = false;
        }
 
        //=========================================================================
+
        GBlackBoxModel::~GBlackBoxModel()
        {
        }
+
        //=========================================================================
 
        void GBlackBoxModel::setInicPoint(double& x, double& y, double& z)
@@ -174,6 +175,52 @@ namespace bbtk
 
        //=========================================================================     
 
+       void GBlackBoxModel::save(std::string &content)
+       {
+               content+="BOX\n";
+               // Box info
+               content+=_bbtkPackage;
+               content+=":";
+               content+=_bbtkType;
+               content+=":";
+               content+=_bbtkName;
+               content+="\n";
+
+               //Box Position
+               char buffer [50];
+               sprintf (buffer, "%f", _xInic);
+               content+=buffer;
+               content+=":";
+               sprintf (buffer, "%f", _yInic);
+               content+=buffer;
+               content+=":";
+               sprintf (buffer, "%f", _zInic);
+               content+=buffer;
+               content+="\n";
+
+               sprintf (buffer, "%f", _xFin);
+               content+=buffer;
+               content+=":";
+               sprintf (buffer, "%f", _yFin);
+               content+=buffer;
+               content+=":";
+               sprintf (buffer, "%f", _zFin);
+               content+=buffer;
+               content+="\n";
+
+               //Ports with a value
+               for(int i = 0; i<_inputs.size();i++)
+               {
+                       if(_inputs[i]->isValueSet())
+                       {
+                               _inputs[i]->save(content);
+                       }
+               }
+
+       }
+       
+       //=========================================================================
+
 
 }  // EO namespace bbtk