X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGConnectorModel.cxx;h=ebdf3715aeb5d46cc7854e77ed81c671fb2ded28;hb=aa99bb93c420e8cbd5ed491a3a4480e4b9e4e919;hp=95f1b15e8d0bc96e3cef9cce381f4e8ee66f9f48;hpb=062ee1e352a911991a120c5bf95ba836a6b0871b;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx index 95f1b15..ebdf371 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx @@ -82,6 +82,7 @@ namespace bbtk setFinalPoint(xCenter,yIport,zCenter); + // Sets the last point of the contour model in the position of the end input port manualPoint* point = _model->GetManualPoint(_model->GetSizeLstPoints()-1); point->SetPoint(xCenter,yIport,zCenter); } @@ -124,6 +125,7 @@ namespace bbtk double xport,yport,zport; _startPort->getFinalPoint(xport,yport,zport); + // Refresh the position of the contourModel first point with the data of the connector model manualPoint* point = _model->GetManualPoint(0); point->SetPoint(xCenter,yport,zCenter); @@ -131,10 +133,45 @@ namespace bbtk _endPort->getCenter(xCenter,yCenter,zCenter); _endPort->getInicPoint(xport,yport,zport); + // Refresh the position of the contourModel last point with the data of the connector model point = _model->GetManualPoint(_model->GetSizeLstPoints()-1); point->SetPoint(xCenter,yport,zCenter); } + //========================================================================= + + void GConnectorModel::disconnectConnection() + { + if(_startPort!=NULL) + { + _startPort->setConnected(false); + } + + if(_endPort!=NULL) + { + _endPort->setConnected(false); + } + } + + //========================================================================= + + void GConnectorModel::save(std::string &content) + { + content+="CONNECTION\n"; + + // Connection info + content+=_startPort->getParentBox()->getBBTKName(); + content+=":"; + content+=_startPort->getBBTKName(); + content+=":"; + content+=_endPort->getParentBox()->getBBTKName(); + content+=":"; + content+=_endPort->getBBTKName(); + content+="\n"; + } + + //========================================================================= + } // EO namespace bbtk // EOF