本文整理汇总了C++中COLOR4D::Brightened方法的典型用法代码示例。如果您正苦于以下问题:C++ COLOR4D::Brightened方法的具体用法?C++ COLOR4D::Brightened怎么用?C++ COLOR4D::Brightened使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COLOR4D
的用法示例。
在下文中一共展示了COLOR4D::Brightened方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ViewDraw
void RATSNEST_VIEWITEM::ViewDraw( int aLayer, GAL* aGal ) const
{
aGal->SetIsStroke( true );
aGal->SetIsFill( false );
aGal->SetLineWidth( 1.0 );
RENDER_SETTINGS* rs = m_view->GetPainter()->GetSettings();
COLOR4D color = rs->GetColor( NULL, ITEM_GAL_LAYER( RATSNEST_VISIBLE ) );
int highlightedNet = rs->GetHighlightNetCode();
for( int i = 1; i < m_data->GetNetCount(); ++i )
{
RN_NET& net = m_data->GetNet( i );
if( !net.IsVisible() )
continue;
// Set brighter color for the temporary ratsnest
aGal->SetStrokeColor( color.Brightened( 0.8 ) );
// Draw the "dynamic" ratsnest (i.e. for objects that may be currently being moved)
BOOST_FOREACH( const RN_NODE_PTR& node, net.GetSimpleNodes() )
{
RN_NODE_PTR dest = net.GetClosestNode( node, WITHOUT_FLAG() &&
DIFFERENT_TAG( RN_NODE::TAG_UNCONNECTED ) );
if( dest )
{
VECTOR2D origin( node->GetX(), node->GetY() );
VECTOR2D end( dest->GetX(), dest->GetY() );
aGal->DrawLine( origin, end );
// Avoid duplicate destinations for ratsnest lines by storing already used nodes
net.AddBlockedNode( dest );
}
}
// Draw the "static" ratsnest
if( i != highlightedNet )
aGal->SetStrokeColor( color ); // using the default ratsnest color for not highlighted
const std::vector<RN_EDGE_MST_PTR>* edges = net.GetUnconnected();
if( edges == NULL )
continue;
BOOST_FOREACH( const RN_EDGE_MST_PTR& edge, *edges )
{
const RN_NODE_PTR& sourceNode = edge->GetSourceNode();
const RN_NODE_PTR& targetNode = edge->GetTargetNode();
VECTOR2D source( sourceNode->GetX(), sourceNode->GetY() );
VECTOR2D target( targetNode->GetX(), targetNode->GetY() );
aGal->DrawLine( source, target );
}
}
}