本文整理汇总了C++中PNS_LINE::Net方法的典型用法代码示例。如果您正苦于以下问题:C++ PNS_LINE::Net方法的具体用法?C++ PNS_LINE::Net怎么用?C++ PNS_LINE::Net使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PNS_LINE
的用法示例。
在下文中一共展示了PNS_LINE::Net方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleViaPlacement
bool PNS_LINE_PLACER::handleViaPlacement( PNS_LINE& aHead )
{
if( !m_placingVia )
return true;
PNS_VIA v ( makeVia ( aHead.CPoint( -1 ) ) );
v.SetNet ( aHead.Net() );
VECTOR2I force;
VECTOR2I lead = aHead.CPoint( -1 ) - aHead.CPoint( 0 );
bool solidsOnly = ( m_currentMode != RM_Walkaround );
if( v.PushoutForce( m_currentNode, lead, force, solidsOnly, 40 ) )
{
SHAPE_LINE_CHAIN line = m_direction.BuildInitialTrace(
aHead.CPoint( 0 ),
aHead.CPoint( -1 ) + force );
aHead = PNS_LINE( aHead, line );
v.SetPos( v.Pos() + force );
return true;
}
return false;
}
示例2: buildInitialLine
bool PNS_LINE_PLACER::buildInitialLine( const VECTOR2I& aP, PNS_LINE& aHead )
{
SHAPE_LINE_CHAIN l;
if( m_p_start == aP )
{
l.Clear();
}
else
{
if( Settings().GetFreeAngleMode() && Settings().Mode() == RM_MarkObstacles )
{
l = SHAPE_LINE_CHAIN( m_p_start, aP );
}
else
{
l = m_direction.BuildInitialTrace( m_p_start, aP );
}
if( l.SegmentCount() > 1 && m_orthoMode )
{
VECTOR2I newLast = l.CSegment( 0 ).LineProject( l.CPoint( -1 ) );
l.Remove( -1, -1 );
l.Point( 1 ) = newLast;
}
}
aHead.SetShape( l );
if( !m_placingVia )
return true;
PNS_VIA v( makeVia( aP ) );
v.SetNet( aHead.Net() );
if( m_currentMode == RM_MarkObstacles )
{
aHead.AppendVia( v );
return true;
}
VECTOR2I force;
VECTOR2I lead = aP - m_p_start;
bool solidsOnly = ( m_currentMode != RM_Walkaround );
if( v.PushoutForce( m_currentNode, lead, force, solidsOnly, 40 ) )
{
SHAPE_LINE_CHAIN line = m_direction.BuildInitialTrace( m_p_start, aP + force );
aHead = PNS_LINE( aHead, line );
v.SetPos( v.Pos() + force );
return true;
}
return false; // via placement unsuccessful
}