KiCad PCB EDA Suite
drc_test_provider_hole_to_hole.cpp File Reference
#include <common.h>
#include <board_design_settings.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_circle.h>
#include <drc/drc_engine.h>
#include <drc/drc_item.h>
#include <drc/drc_rule.h>
#include <drc/drc_test_provider_clearance_base.h>
#include "drc_rtree.h"

Go to the source code of this file.

Classes

class  DRC_TEST_PROVIDER_HOLE_TO_HOLE
 

Namespaces

namespace  detail
 

Functions

static std::shared_ptr< SHAPE_CIRCLEgetDrilledHoleShape (BOARD_ITEM *aItem)
 

Variables

static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_HOLE_TO_HOLEdetail::dummy
 

Function Documentation

◆ getDrilledHoleShape()

static std::shared_ptr< SHAPE_CIRCLE > getDrilledHoleShape ( BOARD_ITEM aItem)
static

Definition at line 79 of file drc_test_provider_hole_to_hole.cpp.

80{
81 if( aItem->Type() == PCB_VIA_T )
82 {
83 PCB_VIA* via = static_cast<PCB_VIA*>( aItem );
84 return std::make_shared<SHAPE_CIRCLE>( via->GetCenter(), via->GetDrillValue() / 2 );
85 }
86 else if( aItem->Type() == PCB_PAD_T )
87 {
88 PAD* pad = static_cast<PAD*>( aItem );
89 return std::make_shared<SHAPE_CIRCLE>( pad->GetPosition(), pad->GetDrillSize().x / 2 );
90 }
91
92 return std::make_shared<SHAPE_CIRCLE>( VECTOR2I( 0, 0 ), 0 );
93}
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112
Definition: pad.h:59
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:104
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:89
VECTOR2< int > VECTOR2I
Definition: vector2d.h:607

References pad, PCB_PAD_T, PCB_VIA_T, EDA_ITEM::Type(), and via.

Referenced by DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run(), and DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole().