X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGBlackBoxModel.cxx;h=672a4bd622018a3ddf9df4a733fe3034b08ae1e4;hb=50851761f4216d932217db8e8fe56dd5aac6b0fb;hp=aa3675e35b46b8d5ca7e56c936af2c1092fc49ef;hpb=64fc9f949ff91d6e9d448ca0567e6205ee4d5be4;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx index aa3675e..672a4bd 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx @@ -42,18 +42,91 @@ namespace bbtk //========================================================================= GBlackBoxModel::GBlackBoxModel() + { + } + + //========================================================================= + GBlackBoxModel::~GBlackBoxModel() + { + } + //========================================================================= + + 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() + { + return _bbtkPackage; } //========================================================================= - GBlackBoxModel::~GBlackBoxModel() + + void GBlackBoxModel::setBBTKPackage(std::string obpackage) { + _bbtkPackage = obpackage; } + //========================================================================= + } // EO namespace bbtk // EOF