KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drawing_tool.h File Reference
#include <functional>
#include <stack>
#include <optional>
#include <eda_shape.h>
#include <tool/shape_draw_behavior.h>
#include <tool/tool_menu.h>
#include <tools/pcb_selection.h>
#include <tools/pcb_tool_base.h>
#include <tools/pcb_actions.h>

Go to the source code of this file.

Classes

class  DRAWING_TOOL
 Tool responsible for drawing graphical elements like lines, arcs, circles, etc. More...
 

Namespaces

namespace  KIGFX
 The Cairo implementation of the graphics abstraction layer.
 

Functions

int ComputeWorstViaClearance (PCB_BASE_EDIT_FRAME *aFrame, DRC_ENGINE *aEngine)
 Shared placement DRC checks, used by the plain via tool and the microvia stack tool so both block placement over foreign copper consistently.
 
bool CheckItemDRCViolation (BOARD_CONNECTED_ITEM *aItem, PCB_BASE_EDIT_FRAME *aFrame, DRC_ENGINE *aEngine, int aWorstClearance, int aEpsilon)
 
int ViaSnapRange (PCB_BASE_EDIT_FRAME *aFrame)
 Shared placement snapping, used by the plain via tool and the microvia stack tool.
 
PCB_TRACKFindSnapTrack (PCB_BASE_EDIT_FRAME *aFrame, const PCB_VIA *aVia, const VECTOR2I &aPosition, const LSET &aLayers, int aSnapRange=0)
 
PADFindSnapPad (PCB_BASE_EDIT_FRAME *aFrame, const PCB_VIA *aVia, const VECTOR2I &aPosition, const LSET &aLayers, int aSnapRange=0)
 

Function Documentation

◆ CheckItemDRCViolation()

◆ ComputeWorstViaClearance()

int ComputeWorstViaClearance ( PCB_BASE_EDIT_FRAME * aFrame,
DRC_ENGINE * aEngine )

Shared placement DRC checks, used by the plain via tool and the microvia stack tool so both block placement over foreign copper consistently.

Definition at line 3829 of file drawing_tool.cpp.

References CLEARANCE_CONSTRAINT, BOARD::Footprints(), PCB_BASE_FRAME::GetBoard(), BOARD::GetDesignRulesPath(), DRC_CONSTRAINT::GetValue(), HOLE_CLEARANCE_CONSTRAINT, DRC_ENGINE::InitEngine(), MINOPTMAX< T >::Min(), pad, and DRC_ENGINE::QueryWorstConstraint().

Referenced by DRAWING_TOOL::DrawVia(), and DRAWING_TOOL::PlaceMicroviaStack().

◆ FindSnapPad()

PAD * FindSnapPad ( PCB_BASE_EDIT_FRAME * aFrame,
const PCB_VIA * aVia,
const VECTOR2I & aPosition,
const LSET & aLayers,
int aSnapRange = 0 )

◆ FindSnapTrack()

◆ ViaSnapRange()

int ViaSnapRange ( PCB_BASE_EDIT_FRAME * aFrame)

Shared placement snapping, used by the plain via tool and the microvia stack tool.

aVia gives the reach and the bounding box to search, aLayers which layers may be snapped to, so a stack can offer every layer it spans rather than just the via's own.

Definition at line 4010 of file drawing_tool.cpp.

References PCB_BASE_FRAME::GetCanvas(), KIGFX::VIEW::GetGAL(), PCB_DRAW_PANEL_GAL::GetView(), KIGFX::GAL::GetVisibleGridSize(), KiROUND(), scale, KIGFX::VIEW::ToWorld(), and VECTOR2< T >::x.

Referenced by DRAWING_TOOL::PlaceMicroviaStack().