27#include <unordered_set>
51struct COLLISION_SEARCH_CONTEXT;
162 int aLayer = -1 )
const
180 return ( aKindMask &
m_kind ) != 0;
290 virtual bool HasHole()
const {
return false; }
294 virtual const std::string
Format()
const;
318template<
typename T,
typename S>
319std::unique_ptr<T>
ItemCast( std::unique_ptr<S> aPtr )
321 static_assert( std::is_base_of<ITEM, S>::value,
"Need to be handed a ITEM!" );
322 static_assert( std::is_base_of<ITEM, T>::value,
"Need to cast to an ITEM!" );
323 return std::unique_ptr<T>(
static_cast<T*
>( aPtr.release() ) );
327std::unique_ptr< typename std::remove_const<T>::type >
Clone(
const T& aItem )
329 static_assert( std::is_base_of<ITEM, T>::value,
"Need to be handed an ITEM!" );
330 return std::unique_ptr<typename std::remove_const<T>::type>( aItem.Clone() );
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Base class for PNS router board items.
BOARD_ITEM * Parent() const
virtual bool HasUniqueShapeLayers() const
void SetLayers(const PNS_LAYER_RANGE &aLayers)
void SetIsFreePad(bool aIsFreePad=true)
virtual const std::string Format() const
virtual void Unmark(int aMarker=-1) const
virtual ITEM * ParentPadVia() const
virtual std::vector< int > UniqueShapeLayers() const
Return a list of layers that have unique (potentially different) shapes.
virtual const SHAPE * Shape(int aLayer) const
Return the geometrical shape of the item.
const PNS_LAYER_RANGE & Layers() const
virtual NET_HANDLE Net() const
virtual void SetHole(HOLE *aHole)
PnsKind Kind() const
Return the type (kind) of the item.
virtual ITEM * Clone() const =0
Return a deep copy of the item.
std::set< int > RelevantShapeLayers(const ITEM *aOther) const
Returns the set of layers on which either this or the other item can have a unique shape.
void SetNet(NET_HANDLE aNet)
virtual void SetRank(int aRank)
virtual int Layer() const
void SetLayer(int aLayer)
void SetIsCompoundShapePrimitive()
PnsKind
< Supported item types
void SetParent(BOARD_ITEM *aParent)
bool Collide(const ITEM *aHead, const NODE *aNode, int aLayer, COLLISION_SEARCH_CONTEXT *aCtx=nullptr) const
Check for a collision (clearance violation) with between us and item aOther.
bool collideSimple(const ITEM *aHead, const NODE *aNode, int aLayer, COLLISION_SEARCH_CONTEXT *aCtx) const
virtual const NODE * OwningNode() const
bool IsCompoundShapePrimitive() const
bool OfKind(int aKindMask) const
virtual VECTOR2I Anchor(int n) const
std::string KindStr() const
bool LayersOverlap(const ITEM *aOther) const
Return true if the set of layers spanned by aOther overlaps our layers.
bool m_isCompoundShapePrimitive
virtual HOLE * Hole() const
virtual const SHAPE_LINE_CHAIN Hull(int aClearance=0, int aWalkaroundThickness=0, int aLayer=-1) const
virtual void Mark(int aMarker) const
virtual int AnchorCount() const
virtual bool HasHole() const
virtual BOARD_ITEM * BoardItem() const
void SetRoutable(bool aRoutable)
virtual int Marker() const
Keep the router "world" - i.e.
void SetOwner(const ITEM_OWNER *aOwner)
Set the node that owns this item.
const ITEM_OWNER * m_owner
bool BelongsTo(const ITEM_OWNER *aNode) const
const ITEM_OWNER * Owner() const
Return the owner of this item, or NULL if there's none.
Represent a contiguous set of PCB layers.
bool Overlaps(const PNS_LAYER_RANGE &aOther) const
Represent a polyline containing arcs as well as line segments: A chain of connected line and/or arc s...
An abstract shape on 2D plane.
Push and Shove diff pair dimensions (gap) settings dialog.
std::unique_ptr< T > ItemCast(std::unique_ptr< S > aPtr)
std::unique_ptr< typename std::remove_const< T >::type > Clone(const T &aItem)
VECTOR2< int32_t > VECTOR2I