]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsKernelEditorGraphic/GPortModel.cxx
Organizing code, the state now is in the view and the general render was simplified...
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsKernelEditorGraphic / GPortModel.cxx
index 8672eedafa918db517bcf5bbbcdf57f08269982a..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;
                }
 
-               //Variable 'pos' starts with value 0 and it represents the position of the port in the box from left to right
-               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);