KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcb_tool_utils.h File Reference

Utility functions that can be shared by PCB tools. More...

#include <optional>

Go to the source code of this file.

Functions

std::optional< int > GetBoardItemWidth (const BOARD_ITEM &aItem)
 Gets the width of a BOARD_ITEM, for items that have a meaningful width.
 

Detailed Description

Utility functions that can be shared by PCB tools.

Public-API class operations that are not specific to any one tool.

Definition in file pcb_tool_utils.h.

Function Documentation

◆ GetBoardItemWidth()

std::optional< int > GetBoardItemWidth ( const BOARD_ITEM aItem)

Gets the width of a BOARD_ITEM, for items that have a meaningful width.

(e.g. some graphics, tracks).

Parameters
aItemThe item to get the width of.
Returns
The width of the item, or std::nullopt if the item has no useful width.

Definition at line 30 of file pcb_tool_utils.cpp.

References PCB_TRACK::GetWidth(), PCB_SHAPE::GetWidth(), PCB_SHAPE_T, PCB_TRACE_T, and EDA_ITEM::Type().

Referenced by OUTSET_ROUTINE::ProcessItem().