]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx
Updated Version with the moving of the objects updated and the background doesn't...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GBlackBoxModel.cxx
index 4fc3e6840e725f4546f401060e64cb9419f4da6c..672a4bd622018a3ddf9df4a733fe3034b08ae1e4 100644 (file)
@@ -51,13 +51,82 @@ namespace bbtk
        }
        //=========================================================================
 
-       void GBlackBoxModel::updateBlackBox(BlackBoxDescriptor::Pointer descriptor)//virtual
+       void GBlackBoxModel::setInicPoint(double& x, double& y, double& z)
        {
-               _desc=descriptor;
-               std::cout<<"RaC Box author:"<<_desc->GetAuthor()<<std::endl;
+               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()
+       {
+               return _bbtkPackage;
+       }
+
+       //=========================================================================
+
+       void GBlackBoxModel::setBBTKPackage(std::string obpackage)
+       {
+               _bbtkPackage = obpackage;
        }
 
        //=========================================================================
+
+
+
 }  // EO namespace bbtk
 
 // EOF