KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_segment_index.cpp File Reference
#include <boost/test/unit_test.hpp>
#include <geometry/segment_index.h>
#include <algorithm>
#include <limits>
#include <vector>

Go to the source code of this file.

Functions

static std::vector< int > candidates (const SEGMENT_INDEX &aIndex, const SEG &aQuery, int aPadding)
 
static bool endpointBoundsOverlap (const SEG &aItem, const SEG &aQuery, int aPadding)
 
 BOOST_AUTO_TEST_CASE (EmptyAndDegenerateSegments)
 
 BOOST_AUTO_TEST_CASE (SaturatesPaddedQueryBounds)
 
 BOOST_AUTO_TEST_CASE (NegativePaddingMatchesZero)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE() [1/3]

BOOST_AUTO_TEST_CASE ( EmptyAndDegenerateSegments )

Definition at line 62 of file test_segment_index.cpp.

References BOOST_CHECK_EQUAL(), candidates(), empty(), and index.

◆ BOOST_AUTO_TEST_CASE() [2/3]

BOOST_AUTO_TEST_CASE ( NegativePaddingMatchesZero )

Definition at line 112 of file test_segment_index.cpp.

References candidates(), and index.

◆ BOOST_AUTO_TEST_CASE() [3/3]

BOOST_AUTO_TEST_CASE ( SaturatesPaddedQueryBounds )

Definition at line 76 of file test_segment_index.cpp.

References candidates(), endpointBoundsOverlap(), expected, and index.

◆ candidates()

static std::vector< int > candidates ( const SEGMENT_INDEX & aIndex,
const SEG & aQuery,
int aPadding )
static

Definition at line 32 of file test_segment_index.cpp.

References candidates(), and result.

Referenced by SCH_CONNECTIVITY::Align(), BACK_ANNOTATE::applyChangelist(), SHAPE_ELLIPSE::BBox(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), EASYPC::SCH_BUILDER::buildWires(), candidates(), SNAP_INFERENCE_PROVIDER::CollectAlignment(), PCB_SELECTION_TOOL::CollectMultiple(), Collide(), ORCAD_CONVERTER::computeJunctions(), connectedBusName(), PCB_VIA_STACK::ExpandMultiHopMicrovias(), DIPTRACE::PCB_PARSER::FindMountHolesInRegion(), GetBoardNetNameMap(), PNS::ROUTER::isStartingPointRoutable(), SCH_CONNECTIVITY::LIBRARY_SYMBOL_FACT::Matches(), matchItemsBySimilarity(), PROJECT_TREE_PANE::onGitAmendCommit(), PROJECT_TREE_PANE::onGitCommit(), PANEL_MOUSE_SETTINGS::OnScrollRadioButton(), ORCAD_CONVERTER::packageFor(), HOVER_PICKER::Pick(), PCB_CONTROL::pickDocumentationLayer(), PNS::HELPERS::PickSegment(), PNS::TOOL_BASE::pickSingleItem(), ORCAD_CONVERTER::placeInstance(), DRAWING_TOOL::PlaceMicroviaStack(), ORCAD_CONVERTER::placeWires(), ORCAD_CONVERTER::prepareSymbols(), SCH_CONNECTIVITY::NETCHAIN_MANAGER::rebuild(), FOOTPRINT_IMPORT_RECONCILER::Reconcile(), KICAD_DIFF::IDENTITY_RECONCILER::Reconcile(), SYMBOL_IMPORT_RECONCILER::Reconcile(), ORCAD_CONVERTER::recordNetNameMap(), CONNECTION_SUBGRAPH::ResolveDrivers(), GRAPHIC_EDIT_TOOL::runInteractive(), MATCH_PROPERTIES_TOOL::runInteractive(), safeConnectivityLabelPosition(), SCH_SELECTION_TOOL::SelectMultiple(), MODEL_ALIGN::SolveAlignment(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones(), SCH_CONNECTIVITY::ENGINE::UnconnectedPins(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().

◆ endpointBoundsOverlap()

static bool endpointBoundsOverlap ( const SEG & aItem,
const SEG & aQuery,
int aPadding )
static

Definition at line 47 of file test_segment_index.cpp.

References SEG::A, SEG::B, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by BOOST_AUTO_TEST_CASE().