KiCad PCB EDA Suite
connectivity_data.cpp File Reference
#include <algorithm>
#include <future>
#include <initializer_list>
#include <connectivity/connectivity_data.h>
#include <connectivity/connectivity_algo.h>
#include <connectivity/from_to_cache.h>
#include <project/net_settings.h>
#include <board_design_settings.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_circle.h>
#include <ratsnest/ratsnest_data.h>
#include <progress_reporter.h>
#include <thread_pool.h>
#include <trigo.h>
#include <drc/drc_rtree.h>

Go to the source code of this file.


static int getMinDist (BOARD_CONNECTED_ITEM *aItem, const VECTOR2I &aPoint)

Function Documentation

◆ getMinDist()

static int getMinDist ( BOARD_CONNECTED_ITEM aItem,
const VECTOR2I aPoint 

Definition at line 689 of file connectivity_data.cpp.

691 switch( aItem->Type() )
692 {
693 case PCB_TRACE_T:
694 case PCB_ARC_T:
695 {
696 PCB_TRACK* track = static_cast<PCB_TRACK*>( aItem );
698 return std::min( GetLineLength( track->GetStart(), aPoint ),
699 GetLineLength( track->GetEnd(), aPoint ) );
700 }
702 default:
703 return GetLineLength( aItem->GetPosition(), aPoint );
704 }
virtual VECTOR2I GetPosition() const
Definition: eda_item.h:249
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
const VECTOR2I & GetStart() const
Definition: pcb_track.h:113
const VECTOR2I & GetEnd() const
Definition: pcb_track.h:110
double GetLineLength(const VECTOR2I &aPointA, const VECTOR2I &aPointB)
Return the length of a line segment defined by aPointA and aPointB.
Definition: trigo.h:188
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:103
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:101

References PCB_TRACK::GetEnd(), GetLineLength(), EDA_ITEM::GetPosition(), PCB_TRACK::GetStart(), PCB_ARC_T, PCB_TRACE_T, and EDA_ITEM::Type().

Referenced by CONNECTIVITY_DATA::TestTrackEndpointDangling().