Logo Search packages:      
Sourcecode: ktechlab version File versions

void Connector::setRoutePoints ( QPointList  pointList,
bool  setManual,
bool  checkEndPoints = false 
) [inherited]

Sets the canvas points that the connector should route itself along. This is used for manual routing. The cells points are absolute positions (unlike the points stored internally in this class, which are the cell poisition

Parameters:
setManual if true then the connector will change to a manual route one
checkEndPoints if true then will check to see if the end points are at the nodes, and adds them if not

Definition at line 318 of file connector.cpp.

References Connector::endNode(), Connector::pointsAreReverse(), ConRouter::setPoints(), Connector::startNode(), and Connector::updateConnectorPoints().

Referenced by FlowICNDocument::createConnector(), CircuitICNDocument::createConnector(), FlowICNDocument::joinConnectors(), CircuitICNDocument::joinConnectors(), and NodeGroup::updateRoutes().

                                                                                        {
      if (!canvas())    return;

      updateConnectorPoints(false);

      bool reversed = pointsAreReverse(pointList);
      
      // a little performance boost: don't call (start|end)Node 4 times
      Node* l_endNode = endNode();
      Node* l_startNode = startNode();

      if (checkEndPoints) {
            if (reversed) {
                  pointList.prepend(QPoint(int(l_endNode->x()),  int(l_endNode->y())));
                  pointList.append(QPoint(int(l_startNode->x()), int(l_startNode->y())));
            } else {
                  pointList.prepend(QPoint(int(l_startNode->x()), int(l_startNode->y())));
                  pointList.append(QPoint(int(l_endNode->x()),    int(l_endNode->y())));
            }
      }

      m_conRouter->setPoints(pointList, reversed);

      b_manualPoints = setManual;
      updateConnectorPoints(true);
}


Generated by  Doxygen 1.6.0   Back to index