X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsKernelEditorGraphic%2FGConnectorModel.cxx;h=7be647f13f8797d20cb12d80de3a43e72434d3f6;hb=8d5cce101d80ada2ddc1db310c59574c7b3b5a06;hp=4b722db4889a55ad029ef170183d0e97deced97a;hpb=638f2cd85948ec10d3b30e1f68805ee0153c8813;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GConnectorModel.cxx index 4b722db..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,6 +156,38 @@ namespace bbtk //========================================================================= + void GConnectorModel::save(std::string &content) + { + char buffer[50]; + + content+="CONNECTION\n"; + + // Connection info + content+=_startPort->getParentBox()->getBBTKName(); + content+=":"; + content+=_startPort->getBBTKName(); + content+=":"; + content+=_endPort->getParentBox()->getBBTKName(); + 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; + } + } + + //========================================================================= + } // EO namespace bbtk // EOF