KiCad PCB EDA Suite
dialog_swap_layers.cpp File Reference
#include <pcb_edit_frame.h>
#include <class_board.h>
#include <grid_layer_box_helpers.h>
#include <board_commit.h>
#include <class_drawsegment.h>
#include <class_drawpanel.h>
#include <class_track.h>
#include <view/view.h>
#include <widgets/wx_grid.h>
#include <class_zone.h>
#include "dialog_swap_layers_base.h"

Go to the source code of this file.

Classes

class  LAYER_GRID_TABLE
 
class  DIALOG_SWAP_LAYERS
 

Functions

bool processBoardItem (PCB_EDIT_FRAME *aFrame, BOARD_COMMIT &commit, BOARD_ITEM *aItem, PCB_LAYER_ID *new_layer)
 

Function Documentation

bool processBoardItem ( PCB_EDIT_FRAME aFrame,
BOARD_COMMIT commit,
BOARD_ITEM aItem,
PCB_LAYER_ID new_layer 
)

Definition at line 189 of file dialog_swap_layers.cpp.

References KIGFX::GEOMETRY, EDA_DRAW_FRAME::GetGalCanvas(), BOARD_ITEM::GetLayer(), EDA_DRAW_PANEL_GAL::GetView(), COMMIT::Modify(), BOARD_ITEM::SetLayer(), and KIGFX::VIEW::Update().

Referenced by PCB_EDIT_FRAME::Swap_Layers().

191 {
192  if( new_layer[ aItem->GetLayer() ] != aItem->GetLayer() )
193  {
194  commit.Modify( aItem );
195  aItem->SetLayer( new_layer[ aItem->GetLayer() ] );
196  aFrame->GetGalCanvas()->GetView()->Update( aItem, KIGFX::GEOMETRY );
197  return true;
198  }
199 
200  return false;
201 }
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
Definition: commit.h:103
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
KIGFX::VIEW * GetView() const
Function GetView() Returns a pointer to the VIEW instance used in the panel.
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1521
EDA_DRAW_PANEL_GAL * GetGalCanvas() const
Return a pointer to GAL-based canvas of given EDA draw frame.
Definition: draw_frame.h:918
Color has changed.
Definition: view_item.h:57