本文整理汇总了C++中TRACK::SetDrill方法的典型用法代码示例。如果您正苦于以下问题:C++ TRACK::SetDrill方法的具体用法?C++ TRACK::SetDrill怎么用?C++ TRACK::SetDrill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRACK
的用法示例。
在下文中一共展示了TRACK::SetDrill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SwapData
/**
* Function SwapData
* Used in undo / redo command:
* swap data between Item and a copy
* swapped data is data modified by edition, mainly sizes and texts
* so ONLY FEW values are swapped
* @param aItem = the item
* @param aImage = a copy of the item
*/
void SwapData( BOARD_ITEM* aItem, BOARD_ITEM* aImage )
{
if( aItem == NULL || aImage == NULL )
{
wxMessageBox( wxT( "SwapData error: NULL pointer" ) );
return;
}
// Swap layers:
if( aItem->Type() != PCB_MODULE_T && aItem->Type() != PCB_ZONE_AREA_T )
{
// These items have a global swap function.
int layer, layerimg;
layer = aItem->GetLayer();
layerimg = aImage->GetLayer();
aItem->SetLayer( layerimg );
aImage->SetLayer( layer );
}
switch( aItem->Type() )
{
case PCB_MODULE_T:
{
MODULE* tmp = (MODULE*) aImage->Clone();
( (MODULE*) aImage )->Copy( (MODULE*) aItem );
( (MODULE*) aItem )->Copy( tmp );
delete tmp;
}
break;
case PCB_ZONE_AREA_T:
{
ZONE_CONTAINER* tmp = (ZONE_CONTAINER*) aImage->Clone();
( (ZONE_CONTAINER*) aImage )->Copy( (ZONE_CONTAINER*) aItem );
( (ZONE_CONTAINER*) aItem )->Copy( tmp );
delete tmp;
}
break;
case PCB_LINE_T:
#if 0
EXCHG( ( (DRAWSEGMENT*) aItem )->m_Start, ( (DRAWSEGMENT*) aImage )->m_Start );
EXCHG( ( (DRAWSEGMENT*) aItem )->m_End, ( (DRAWSEGMENT*) aImage )->m_End );
EXCHG( ( (DRAWSEGMENT*) aItem )->m_Width, ( (DRAWSEGMENT*) aImage )->m_Width );
EXCHG( ( (DRAWSEGMENT*) aItem )->m_Shape, ( (DRAWSEGMENT*) aImage )->m_Shape );
#else
{
DRAWSEGMENT tmp = *(DRAWSEGMENT*) aImage;
*aImage = *aItem;
*aItem = tmp;
}
#endif
break;
case PCB_TRACE_T:
case PCB_VIA_T:
{
TRACK* track = (TRACK*) aItem;
TRACK* image = (TRACK*) aImage;
// swap start, end, width and shape for track and image.
wxPoint exchp = track->GetStart(); track->SetStart( image->GetStart() ); image->SetStart( exchp );
exchp = track->GetEnd(); track->SetEnd( image->GetEnd() ); image->SetEnd( exchp );
int atmp = track->GetWidth(); track->SetWidth( image->GetWidth() ); image->SetWidth( atmp );
atmp = track->GetShape(); track->SetShape( image->GetShape() ); image->SetShape( atmp );
atmp = track->GetDrillValue();
if( track->IsDrillDefault() )
atmp = -1;
int itmp = image->GetDrillValue();
if( image->IsDrillDefault() )
itmp = -1;
EXCHG(itmp, atmp );
if( atmp > 0 )
track->SetDrill( atmp );
else
track->SetDrillDefault();
if( itmp > 0 )
image->SetDrill( itmp );
else
image->SetDrillDefault();
}
break;
case PCB_TEXT_T:
//.........这里部分代码省略.........