本文整理汇总了C++中Router::routingParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ Router::routingParameter方法的具体用法?C++ Router::routingParameter怎么用?C++ Router::routingParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Router
的用法示例。
在下文中一共展示了Router::routingParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assignPinVisibilityTo
// Assign visibility to a dummy vertex representing all the possible pins
// for this pinClassId.
void ConnEnd::assignPinVisibilityTo(VertInf *dummyConnectionVert,
VertInf *targetVert)
{
unsigned int validPinCount = 0;
COLA_ASSERT(m_anchor_obj);
COLA_ASSERT(m_connection_pin_class_id != CONNECTIONPIN_UNSET);
Router *router = m_anchor_obj->router();
for (ShapeConnectionPinSet::iterator curr =
m_anchor_obj->m_connection_pins.begin();
curr != m_anchor_obj->m_connection_pins.end(); ++curr)
{
ShapeConnectionPin *currPin = *curr;
if ((currPin->m_class_id == m_connection_pin_class_id) &&
(!currPin->m_exclusive || currPin->m_connend_users.empty()))
{
double routingCost = currPin->m_connection_cost;
Point adjTargetPt = targetVert->point - currPin->m_vertex->point;
double angle = rotationalAngle(adjTargetPt);
bool inVisibilityRange = false;
if (angle <= 45 || angle >= 315)
{
if (currPin->directions() & ConnDirRight)
{
inVisibilityRange = true;
}
}
if (angle >= 45 && angle <= 135)
{
if (currPin->directions() & ConnDirDown)
{
inVisibilityRange = true;
}
}
if (angle >= 135 && angle <= 225)
{
if (currPin->directions() & ConnDirLeft)
{
inVisibilityRange = true;
}
}
if (angle >= 225 && angle <= 315)
{
if (currPin->directions() & ConnDirUp)
{
inVisibilityRange = true;
}
}
if (!inVisibilityRange)
{
routingCost += router->routingParameter(portDirectionPenalty);
}
if (router->m_allows_orthogonal_routing)
{
// This has same ID and is either unconnected or not
// exclusive, so give it visibility.
EdgeInf *edge = new EdgeInf(dummyConnectionVert,
currPin->m_vertex, true);
// XXX Can't use a zero cost due to assumptions
// elsewhere in code.
edge->setDist(manhattanDist(dummyConnectionVert->point,
currPin->m_vertex->point) +
std::max(0.001, routingCost));
}
if (router->m_allows_orthogonal_routing)
{
// This has same ID and is either unconnected or not
// exclusive, so give it visibility.
EdgeInf *edge = new EdgeInf(dummyConnectionVert,
currPin->m_vertex, false);
// XXX Can't use a zero cost due to assumptions
// elsewhere in code.
edge->setDist(euclideanDist(dummyConnectionVert->point,
currPin->m_vertex->point) +
std::max(0.001, routingCost));
}
// Increment the number of valid pins for this ConnEnd connection.
validPinCount++;
}
}
if (validPinCount == 0)
{
// There should be at least one pin, otherwise we will have
// problems finding connector routes.
err_printf("Warning: In ConnEnd::assignPinVisibilityTo():\n"
" ConnEnd for connector %d can't connect to shape %d\n"
" since it has no pins with class id of %u.\n",
(int) m_conn_ref->id(), (int) m_anchor_obj->id(),
m_connection_pin_class_id);
}
}