X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGBlackBoxModel.cxx;h=bdaf53d5bdd86ff03422a2feb74dec78965c6c83;hb=878ac6ad472bc459f4e364c16890e5026c401944;hp=186c745baf1c189e64f20d7e6c5b23915ad77945;hpb=098558ac7780900858114a8ae01fe93847d67043;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx index 186c745..bdaf53d 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GBlackBoxModel.cxx @@ -51,6 +51,16 @@ 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); @@ -65,6 +75,43 @@ namespace bbtk //========================================================================= + 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(); + } + + } + + //========================================================================= + + + } // EO namespace bbtk // EOF