本文整理汇总了C++中BOARD_ITEM::Next方法的典型用法代码示例。如果您正苦于以下问题:C++ BOARD_ITEM::Next方法的具体用法?C++ BOARD_ITEM::Next怎么用?C++ BOARD_ITEM::Next使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BOARD_ITEM
的用法示例。
在下文中一共展示了BOARD_ITEM::Next方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Edit_Edge_Width
void FOOTPRINT_EDIT_FRAME::Edit_Edge_Width( EDGE_MODULE* aEdge )
{
MODULE* module = GetBoard()->m_Modules;
SaveCopyInUndoList( module, UR_CHANGED );
if( aEdge == NULL )
{
for( BOARD_ITEM *item = module->GraphicalItemsList(); item; item = item->Next() )
{
aEdge = dyn_cast<EDGE_MODULE*>( item );
if( aEdge )
aEdge->SetWidth( GetDesignSettings().GetLineThickness( aEdge->GetLayer() ) );
}
}
else
{
aEdge->SetWidth( GetDesignSettings().GetLineThickness( aEdge->GetLayer() ) );
}
OnModify();
module->CalculateBoundingBox();
module->SetLastEditTime();
}
示例2: CopyMarkedItems
/* Copy marked items, at new position = old position + offset
*/
void CopyMarkedItems( MODULE* module, wxPoint offset )
{
if( module == NULL )
return;
for( D_PAD* pad = module->Pads(); pad; pad = pad->Next() )
{
if( !pad->IsSelected() )
continue;
pad->ClearFlags( SELECTED );
D_PAD* NewPad = new D_PAD( *pad );
NewPad->SetParent( module );
NewPad->SetFlags( SELECTED );
module->Pads().PushFront( NewPad );
}
BOARD_ITEM* newItem;
for( BOARD_ITEM* item = module->GraphicalItems(); item; item = item->Next() )
{
if( !item->IsSelected() )
continue;
item->ClearFlags( SELECTED );
newItem = (BOARD_ITEM*)item->Clone();
newItem->SetParent( module );
newItem->SetFlags( SELECTED );
module->GraphicalItems().PushFront( newItem );
}
MoveMarkedItems( module, offset );
}
示例3: SetOrientation
void MODULE::SetOrientation( double newangle )
{
double angleChange = newangle - m_Orient; // change in rotation
NORMALIZE_ANGLE_POS( newangle );
m_Orient = newangle;
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
{
pad->SetOrientation( pad->GetOrientation() + angleChange );
pad->SetDrawCoord();
}
// Update of the reference and value.
m_Reference->SetDrawCoord();
m_Value->SetDrawCoord();
// Displace contours and text of the footprint.
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
if( item->Type() == PCB_MODULE_EDGE_T )
{
static_cast<EDGE_MODULE*>( item )->SetDrawCoord();
}
else if( item->Type() == PCB_MODULE_TEXT_T )
{
static_cast<TEXTE_MODULE*>( item )->SetDrawCoord();
}
}
CalculateBoundingBox();
}
示例4: DeleteMarkedItems
/* Delete marked items
*/
void DeleteMarkedItems( MODULE* module )
{
BOARD_ITEM* item;
BOARD_ITEM* next_item;
D_PAD* pad;
D_PAD* next_pad;
if( module == NULL )
return;
pad = module->Pads();
for( ; pad != NULL; pad = next_pad )
{
next_pad = pad->Next();
if( !pad->IsSelected() )
continue;
pad->DeleteStructure();
}
item = module->GraphicalItems();
for( ; item != NULL; item = next_item )
{
next_item = item->Next();
if( !item->IsSelected() )
continue;
item->DeleteStructure();
}
}
示例5: PlotBoardGraphicItems
// plot items like text and graphics, but not tracks and module
void BRDITEMS_PLOTTER::PlotBoardGraphicItems()
{
for( BOARD_ITEM* item = m_board->m_Drawings; item; item = item->Next() )
{
switch( item->Type() )
{
case PCB_LINE_T:
PlotDrawSegment( (DRAWSEGMENT*) item);
break;
case PCB_TEXT_T:
PlotTextePcb( (TEXTE_PCB*) item );
break;
case PCB_DIMENSION_T:
PlotDimension( (DIMENSION*) item );
break;
case PCB_TARGET_T:
PlotPcbTarget( (PCB_TARGET*) item );
break;
case PCB_MARKER_T:
default:
break;
}
}
}
示例6: Edit_Edge_Layer
void FOOTPRINT_EDIT_FRAME::Edit_Edge_Layer( EDGE_MODULE* aEdge )
{
// note: if aEdge == NULL, all outline segments will be modified
MODULE* module = GetBoard()->m_Modules;
PCB_LAYER_ID layer = F_SilkS;
bool modified = false;
if( aEdge )
layer = aEdge->GetLayer();
// Ask for the new layer
PCB_LAYER_ID new_layer = SelectLayer( layer, Edge_Cuts );
if( layer < 0 )
return;
if( IsCopperLayer( new_layer ) )
{
// an edge is put on a copper layer, and it is very dangerous.
// A confirmation is requested
if( !IsOK( this,
_( "The graphic item will be on a copper layer.\n"
"This is very dangerous. Are you sure?" ) ) )
return;
}
if( !aEdge )
{
for( BOARD_ITEM *item = module->GraphicalItemsList() ; item != NULL;
item = item->Next() )
{
aEdge = dyn_cast<EDGE_MODULE*>( item );
if( aEdge && (aEdge->GetLayer() != new_layer) )
{
if( ! modified ) // save only once
SaveCopyInUndoList( module, UR_CHANGED );
aEdge->SetLayer( new_layer );
modified = true;
}
}
}
else if( aEdge->GetLayer() != new_layer )
{
SaveCopyInUndoList( module, UR_CHANGED );
aEdge->SetLayer( new_layer );
modified = true;
}
if( modified )
{
module->CalculateBoundingBox();
module->SetLastEditTime();
}
}
示例7: Delete_Drawings_All_Layer
void PCB_EDIT_FRAME::Delete_Drawings_All_Layer( LAYER_ID aLayer )
{
if( IsCopperLayer( aLayer ) )
{
DisplayError( this, _( "Copper layer global delete not allowed!" ) );
return;
}
wxString msg = wxString::Format(
_( "Delete everything on layer %s?" ),
GetChars( GetBoard()->GetLayerName( aLayer ) ) );
if( !IsOK( this, msg ) )
return;
PICKED_ITEMS_LIST pickList;
ITEM_PICKER picker( NULL, UR_DELETED );
BOARD_ITEM* PtNext;
for( BOARD_ITEM* item = GetBoard()->m_Drawings; item; item = PtNext )
{
PtNext = item->Next();
switch( item->Type() )
{
case PCB_LINE_T:
case PCB_TEXT_T:
case PCB_DIMENSION_T:
case PCB_TARGET_T:
if( item->GetLayer() == aLayer )
{
item->UnLink();
picker.SetItem( item );
pickList.PushItem( picker );
}
break;
default:
{
wxString msg;
msg.Printf( wxT("Delete_Drawings_All_Layer() error: unknown type %d"),
item->Type() );
wxMessageBox( msg );
break;
}
}
}
if( pickList.GetCount() )
{
OnModify();
SaveCopyInUndoList(pickList, UR_DELETED);
}
}
示例8: Draw
void MODULE::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset )
{
if( (m_Flags & DO_NOT_DRAW) || (IsMoving()) )
return;
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
{
if( pad->IsMoving() )
continue;
pad->Draw( aPanel, aDC, aDrawMode, aOffset );
}
BOARD* brd = GetBoard();
// Draws footprint anchor
DrawAncre( aPanel, aDC, aOffset, DIM_ANCRE_MODULE, aDrawMode );
// Draw graphic items
if( brd->IsElementVisible( MOD_REFERENCES_VISIBLE ) )
{
if( !(m_Reference->IsMoving()) )
m_Reference->Draw( aPanel, aDC, aDrawMode, aOffset );
}
if( brd->IsElementVisible( MOD_VALUES_VISIBLE ) )
{
if( !(m_Value->IsMoving()) )
m_Value->Draw( aPanel, aDC, aDrawMode, aOffset );
}
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
if( item->IsMoving() )
continue;
switch( item->Type() )
{
case PCB_MODULE_TEXT_T:
case PCB_MODULE_EDGE_T:
item->Draw( aPanel, aDC, aDrawMode, aOffset );
break;
default:
break;
}
}
// Enable these line to draw m_BoundaryBox (debug tests purposes only)
#if 0
GRRect( aPanel->GetClipBox(), aDC, m_BoundaryBox, 0, BROWN );
#endif
}
示例9: RunOnChildren
void MODULE::RunOnChildren( boost::function<void (BOARD_ITEM*)> aFunction )
{
for( D_PAD* pad = m_Pads.GetFirst(); pad; pad = pad->Next() )
aFunction( static_cast<BOARD_ITEM*>( pad ) );
for( BOARD_ITEM* drawing = m_Drawings.GetFirst(); drawing; drawing = drawing->Next() )
aFunction( drawing );
aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
}
示例10: TestForExistingItem
static bool TestForExistingItem( BOARD* aPcb, BOARD_ITEM* aItem )
{
static std::list<BOARD_ITEM*> itemsList;
if( aItem == NULL ) // Build list
{
// Count items to store in itemsList:
BOARD_ITEM* item;
itemsList.clear();
// Store items in list:
// Append tracks:
for( item = aPcb->m_Track; item != NULL; item = item->Next() )
itemsList.push_back( item );
// Append modules:
for( item = aPcb->m_Modules; item != NULL; item = item->Next() )
itemsList.push_back( item );
// Append drawings
for( auto ditem : aPcb->Drawings() )
itemsList.push_back( ditem );
// Append zones outlines
for( int ii = 0; ii < aPcb->GetAreaCount(); ii++ )
itemsList.push_back( aPcb->GetArea( ii ) );
NETINFO_LIST& netInfo = aPcb->GetNetInfo();
for( NETINFO_LIST::iterator i = netInfo.begin(); i != netInfo.end(); ++i )
itemsList.push_back( *i );
// Sort list
itemsList.sort();
return false;
}
// search in list:
return std::binary_search( itemsList.begin(), itemsList.end(), aItem );
}
示例11: DisplayBoard
void PCB_DRAW_PANEL_GAL::DisplayBoard( const BOARD* aBoard )
{
m_view->Clear();
// Load zones
for( int i = 0; i < aBoard->GetAreaCount(); ++i )
m_view->Add( (KIGFX::VIEW_ITEM*) ( aBoard->GetArea( i ) ) );
// Load drawings
for( BOARD_ITEM* drawing = aBoard->m_Drawings; drawing; drawing = drawing->Next() )
m_view->Add( drawing );
// Load tracks
for( TRACK* track = aBoard->m_Track; track; track = track->Next() )
m_view->Add( track );
// Load modules and its additional elements
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, m_view, _1 ) );
m_view->Add( module );
}
// Segzones (equivalent of ZONE_CONTAINER for legacy boards)
for( SEGZONE* zone = aBoard->m_Zone; zone; zone = zone->Next() )
m_view->Add( zone );
// Ratsnest
if( m_ratsnest )
{
m_view->Remove( m_ratsnest );
delete m_ratsnest;
}
m_ratsnest = new KIGFX::RATSNEST_VIEWITEM( aBoard->GetRatsnest() );
m_view->Add( m_ratsnest );
// Display settings
UseColorScheme( aBoard->GetColorsSettings() );
PCB_BASE_FRAME* frame = dynamic_cast<PCB_BASE_FRAME*>( GetParent() );
if( frame )
{
SetTopLayer( frame->GetActiveLayer() );
DISPLAY_OPTIONS* displ_opts = (DISPLAY_OPTIONS*) frame->GetDisplayOptions();
static_cast<KIGFX::PCB_RENDER_SETTINGS*>(
m_view->GetPainter()->GetSettings() )->LoadDisplayOptions( displ_opts );
}
m_view->RecacheAllItems( true );
}
示例12: ConvertBrdLayerToPolygonalContours
void BOARD::ConvertBrdLayerToPolygonalContours( PCB_LAYER_ID aLayer, SHAPE_POLY_SET& aOutlines )
{
// convert tracks and vias:
for( TRACK* track = m_Track; track != NULL; track = track->Next() )
{
if( !track->IsOnLayer( aLayer ) )
continue;
track->TransformShapeWithClearanceToPolygon( aOutlines, 0 );
}
// convert pads
for( MODULE* module = m_Modules; module != NULL; module = module->Next() )
{
module->TransformPadsShapesWithClearanceToPolygon( aLayer, aOutlines, 0 );
// Micro-wave modules may have items on copper layers
module->TransformGraphicShapesWithClearanceToPolygonSet( aLayer, aOutlines, 0 );
}
// convert copper zones
for( int ii = 0; ii < GetAreaCount(); ii++ )
{
ZONE_CONTAINER* zone = GetArea( ii );
PCB_LAYER_ID zonelayer = zone->GetLayer();
if( zonelayer == aLayer )
zone->TransformSolidAreasShapesToPolygonSet( aOutlines );
}
// convert graphic items on copper layers (texts)
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
if( !item->IsOnLayer( aLayer ) )
continue;
switch( item->Type() )
{
case PCB_LINE_T:
( (DRAWSEGMENT*) item )->TransformShapeWithClearanceToPolygon( aOutlines, 0 );
break;
case PCB_TEXT_T:
( (TEXTE_PCB*) item )->TransformShapeWithClearanceToPolygonSet( aOutlines, 0 );
break;
default:
break;
}
}
}
示例13: Plot_Edges_Modules
// Plot footprints graphic items (outlines)
void BRDITEMS_PLOTTER::Plot_Edges_Modules()
{
for( MODULE* module = m_board->m_Modules; module; module = module->Next() )
{
for( BOARD_ITEM* item = module->GraphicalItems().GetFirst(); item; item = item->Next() )
{
EDGE_MODULE* edge = dyn_cast<EDGE_MODULE*>( item );
if( !edge || !m_layerMask[edge->GetLayer()] )
continue;
Plot_1_EdgeModule( edge );
}
}
}
示例14: DrawEdgesOnly
void MODULE::DrawEdgesOnly( EDA_DRAW_PANEL* panel, wxDC* DC, const wxPoint& offset,
GR_DRAWMODE draw_mode )
{
for( BOARD_ITEM* item = m_Drawings; item; item = item->Next() )
{
switch( item->Type() )
{
case PCB_MODULE_EDGE_T:
item->Draw( panel, DC, draw_mode, offset );
break;
default:
break;
}
}
}
示例15: RunOnChildren
void MODULE::RunOnChildren( std::function<void (BOARD_ITEM*)> aFunction )
{
try
{
for( D_PAD* pad = m_Pads; pad; pad = pad->Next() )
aFunction( static_cast<BOARD_ITEM*>( pad ) );
for( BOARD_ITEM* drawing = m_Drawings; drawing; drawing = drawing->Next() )
aFunction( drawing );
aFunction( static_cast<BOARD_ITEM*>( m_Reference ) );
aFunction( static_cast<BOARD_ITEM*>( m_Value ) );
}
catch( std::bad_function_call& e )
{
DisplayError( NULL, wxT( "Error running MODULE::RunOnChildren" ) );
}
}