]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx
Now the contour is created from the center of the initial port
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GPortModel.cxx
index abb6945db8c7bc903b5a513c5a5951570f06424d..50b0fd6c39c8aa4abc1ef6bd4900adde01ddb594 100644 (file)
@@ -45,6 +45,7 @@ namespace bbtk
        {               
                _parentBox = NULL;
                _portType=-1;
+               _posInBox=0;
        }
 
        //=========================================================================
@@ -57,14 +58,15 @@ namespace bbtk
        {
                _parentBox = blackBox;
                _portType = portType;
+               _posInBox = pos;
 
-               updatePortPosition(pos);
+               updatePortPosition();
 
        }
 
        //=========================================================================
 
-       void GPortModel::updatePortPosition(int pos)
+       void GPortModel::updatePortPosition()
        {
                double xInic, yInic,zInic,xFin,yFin,zFin;
                _parentBox->getInicPoint(xInic,yInic,zInic);
@@ -80,8 +82,8 @@ namespace bbtk
                        posY = yFin;
                }
 
-               //Usually pos begins in 0
-               posX = xInic + PORT_WIDTH + pos*2*PORT_WIDTH;
+               //Attribute '_posInBox' starts with value 0 and it represents the position of the port in the box from left to right
+               posX = xInic + PORT_WIDTH + _posInBox*2*PORT_WIDTH;
                
                setInicPoint(posX,posY,posZ);