X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGConnectorModel.cxx;h=7be647f13f8797d20cb12d80de3a43e72434d3f6;hb=8d5cce101d80ada2ddc1db310c59574c7b3b5a06;hp=84cc58d2e669b06db574dbffd9bd9c59306fe8cc;hpb=e36858ea5937bb1699bc437136718007df27be7b;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx index 84cc58d..7be647f 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,8 +133,10 @@ 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); + } //========================================================================= @@ -152,15 +156,10 @@ namespace bbtk //========================================================================= - bool GConnectorModel::isPointInside(double x,double y, double z)//virtual - { - return false; - } - - //========================================================================= - void GConnectorModel::save(std::string &content) { + char buffer[50]; + content+="CONNECTION\n"; // Connection info @@ -172,6 +171,19 @@ namespace bbtk content+=":"; content+=_endPort->getBBTKName(); content+="\n"; + + int i,sizeLstPoints = _model->GetSizeLstPoints()-2; + content+="NumberOfControlPoints:"; + sprintf (buffer, "%d", sizeLstPoints ); + content+=buffer; + content+="\n"; + + for (i=0;iGetManualPoint(i+1); + sprintf (buffer, "%f:%f:%f\n", (float)mp->GetX(),(float)mp->GetY(),(float)mp->GetZ() ); + content+=buffer; + } } //=========================================================================