KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER Class Referenceabstract

Handlers for receiving changes from the tool. More...

#include <item_modification_routine.h>

Inheritance diagram for ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER:
ITEM_MODIFICATION_ROUTINE::CALLABLE_BASED_HANDLER

Public Member Functions

virtual ~CHANGE_HANDLER ()=default
 
virtual void AddNewItem (std::unique_ptr< BOARD_ITEM > aItem)=0
 Report that the tools wants to add a new item to the board.
 
virtual void MarkItemModified (BOARD_ITEM &aItem)=0
 Report that the tool has modified an item on the board.
 
virtual void DeleteItem (BOARD_ITEM &aItem)=0
 Report that the tool has deleted an item on the board.
 

Detailed Description

Handlers for receiving changes from the tool.

These are used to allow the tool's caller to make changes to affected board items using extra information that the tool does not have access to (e.g. is this an FP editor, was the line created from a rectangle and needs to be added, not modified, etc).

We can't store them up until the end, because modifications need the old state to be known, so this allows the caller to inject the dependencies for how to handle the changes.

Definition at line 58 of file item_modification_routine.h.

Constructor & Destructor Documentation

◆ ~CHANGE_HANDLER()

virtual ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::~CHANGE_HANDLER ( )
virtualdefault

Member Function Documentation

◆ AddNewItem()

virtual void ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::AddNewItem ( std::unique_ptr< BOARD_ITEM > aItem)
pure virtual

◆ DeleteItem()

virtual void ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::DeleteItem ( BOARD_ITEM & aItem)
pure virtual

Report that the tool has deleted an item on the board.

Parameters
aItemthe deleted item

Implemented in ITEM_MODIFICATION_ROUTINE::CALLABLE_BASED_HANDLER.

Referenced by ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength(), OUTSET_ROUTINE::ProcessItem(), and POLYGON_BOOLEAN_ROUTINE::ProcessShape().

◆ MarkItemModified()

virtual void ITEM_MODIFICATION_ROUTINE::CHANGE_HANDLER::MarkItemModified ( BOARD_ITEM & aItem)
pure virtual

Report that the tool has modified an item on the board.

Parameters
aItemthe modified item

Implemented in ITEM_MODIFICATION_ROUTINE::CALLABLE_BASED_HANDLER.

Referenced by ITEM_MODIFICATION_ROUTINE::ModifyLineOrDeleteIfZeroLength(), and LINE_EXTENSION_ROUTINE::ProcessLinePair().


The documentation for this class was generated from the following file: