| 1593 | } |
| 1594 | |
| 1595 | void VPathEditor::renderPath( const RenderType &pRenderType, VPath *pPath, const ColorI &pColor ) |
| 1596 | { |
| 1597 | if ( !pPath ) |
| 1598 | { |
| 1599 | // Sanity! |
| 1600 | return; |
| 1601 | } |
| 1602 | |
| 1603 | switch ( pRenderType ) |
| 1604 | { |
| 1605 | case k_RenderSegments : |
| 1606 | { |
| 1607 | switch ( pPath->mPathType ) |
| 1608 | { |
| 1609 | case VPath::k_PathLinear : |
| 1610 | { |
| 1611 | renderLinearPath( pPath, pColor ); |
| 1612 | |
| 1613 | } break; |
| 1614 | |
| 1615 | case VPath::k_PathBezier : |
| 1616 | { |
| 1617 | renderBezierPath( pPath, pColor ); |
| 1618 | |
| 1619 | } break; |
| 1620 | } |
| 1621 | |
| 1622 | } break; |
| 1623 | |
| 1624 | case k_RenderNodes : |
| 1625 | { |
| 1626 | // Fetch Draw Util. |
| 1627 | GFXDrawUtil *drawUtil = GFX->getDrawUtil(); |
| 1628 | |
| 1629 | // Fetch Bounds. |
| 1630 | RectI bounds = getBounds(); |
| 1631 | |
| 1632 | const Point2I nodeMinHalfSize( 8, 8 ); |
| 1633 | for ( VPathNodeIterator itr = pPath->mNodeList.begin(); itr != pPath->mNodeList.end(); itr++ ) |
| 1634 | { |
| 1635 | // Fetch Node. |
| 1636 | VPathNode *node = ( *itr ); |
| 1637 | |
| 1638 | // Project to Screen. |
| 1639 | Point3F screenPosition; |
| 1640 | project( node->getWorldPosition(), &screenPosition ); |
| 1641 | if ( screenPosition.z > 1.0f ) |
| 1642 | { |
| 1643 | continue; |
| 1644 | } |
| 1645 | |
| 1646 | // Determine the node text information. |
| 1647 | const char *nodeText = avar( "%d", ( itr - pPath->mNodeList.begin() ) ); |
| 1648 | const Point2I nodeTextHalfSize = Point2I( 0.5f * (F32)getControlProfile()->mFont->getStrWidth( nodeText ), |
| 1649 | 0.5f * (F32)getControlProfile()->mFont->getHeight() ); |
| 1650 | |
| 1651 | // Determine the center & size of the node rectangle. |
| 1652 | Point2I nodeCenter = Point2I( screenPosition.x, screenPosition.y ); |
nothing calls this directly
no test coverage detected