21#include <boost/test/unit_test.hpp>
56 auto resultTooLarge = prop->
Validate( wxAny( 400 ), &shape );
57 BOOST_CHECK( resultTooLarge.has_value() );
59 auto resultOK = prop->
Validate( wxAny( 200 ), &shape );
60 BOOST_CHECK( !resultOK.has_value() );
79 BOOST_CHECK( effectiveShape->Collide( probe.
GetSeg(), 0 ) );
122 BOOST_CHECK( shape.
HitTest( selection,
false, 0 ) );
Implement an R-tree for fast spatial and layer indexing of connectable items.
void Insert(BOARD_ITEM *aItem, PCB_LAYER_ID aLayer, DRC_CONSTRAINT_T aConstraintType, int aWorstClearance=0, bool aAtomicTables=false)
Insert an item into the tree on a particular layer with an optional worst clearance.
int QueryColliding(BOARD_ITEM *aRefItem, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer, std::function< bool(BOARD_ITEM *)> aFilter=nullptr, std::function< bool(BOARD_ITEM *)> aVisitor=nullptr, int aClearance=0) const
This is a fast test which essentially does bounding-box overlap given a worst-case clearance.
void Build()
Finalize all pending inserts by bulk-building packed R-trees from the staged items.
void SetEndEndingLength(int aLength)
void SetStartEndingStyle(LINE_ENDING_STYLE aStyle)
void SetEndEndingWidth(int aWidth)
void SetCornerRadius(int aRadius)
void SetEndEndingStyle(LINE_ENDING_STYLE aStyle)
void SetStartEndingLength(int aLength)
void SetStartEndingWidth(int aWidth)
int GetCornerRadius() const
void SetWidth(int aWidth) override
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void SetEnd(const VECTOR2I &aEnd) override
std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT, DRC_CONSTRAINT_T aUsage=NULL_CONSTRAINT) const override
Make a set of SHAPE objects representing the PCB_SHAPE.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetStart(const VECTOR2I &aStart) override
VALIDATOR_RESULT Validate(const wxAny &&aValue, EDA_ITEM *aItem)
Provide class metadata.Helper macro to map type hashes to names.
static PROPERTY_MANAGER & Instance()
void Rebuild()
Rebuild the list of all registered properties.
PROPERTY_BASE * GetProperty(TYPE_ID aType, const wxString &aProperty) const
Return a property for a specific type.
const SEG & GetSeg() const
@ RECTANGLE
Use RECTANGLE instead of RECT to avoid collision in a Windows header.
Some functions to handle hotkeys in KiCad.
BOOST_AUTO_TEST_CASE(PCBShapeCornerRadius)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I