本文整理汇总了C++中TRACK::IsPointOnEnds方法的典型用法代码示例。如果您正苦于以下问题:C++ TRACK::IsPointOnEnds方法的具体用法?C++ TRACK::IsPointOnEnds怎么用?C++ TRACK::IsPointOnEnds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRACK
的用法示例。
在下文中一共展示了TRACK::IsPointOnEnds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NeighboringSegmentFilter
void ROUTER_TOOL::NeighboringSegmentFilter( const VECTOR2I& aPt, GENERAL_COLLECTOR& aCollector )
{
/*
* If the collection contains a trivial line corner (two connected segments)
* or a non-fanout-via (a via with no more than two connected segments), then
* trim the collection down to a single item (which one won't matter since
* they're all connected).
*/
// First make sure we've got something that *might* match.
int vias = aCollector.CountType( PCB_VIA_T );
int traces = aCollector.CountType( PCB_TRACE_T );
if( vias > 1 || traces > 2 || vias + traces < 1 )
return;
// Fetch first TRACK (via or trace) as our reference
TRACK* reference = nullptr;
for( int i = 0; !reference && i < aCollector.GetCount(); i++ )
reference = dynamic_cast<TRACK*>( aCollector[i] );
int refNet = reference->GetNetCode();
wxPoint refPoint( aPt.x, aPt.y );
STATUS_FLAGS flags = reference->IsPointOnEnds( refPoint, -1 );
if( flags & STARTPOINT )
refPoint = reference->GetStart();
else if( flags & ENDPOINT )
refPoint = reference->GetEnd();
// Check all items to ensure that any TRACKs are co-terminus with the reference and on
// the same net.
for( int i = 0; i < aCollector.GetCount(); i++ )
{
TRACK* neighbor = dynamic_cast<TRACK*>( aCollector[i] );
if( neighbor && neighbor != reference )
{
if( neighbor->GetNetCode() != refNet )
return;
if( neighbor->GetStart() != refPoint && neighbor->GetEnd() != refPoint )
return;
}
}
// Selection meets criteria; trim it to the reference item.
aCollector.Empty();
aCollector.Append( reference );
}