Horizon
|
#include <pns_item.h>
Public Types | |
enum | PnsKind { SOLID_T = 1 , LINE_T = 2 , JOINT_T = 4 , SEGMENT_T = 8 , VIA_T = 16 , DIFF_PAIR_T = 32 , ANY_T = 0xff } |
| |
Public Member Functions | |
ITEM (PnsKind aKind) | |
ITEM (const ITEM &aOther) | |
virtual ITEM * | Clone () const =0 |
Function Clone() More... | |
virtual const SHAPE_LINE_CHAIN | Hull (int aClearance=0, int aWalkaroundThickness=0) const |
PnsKind | Kind () const |
Function Kind() More... | |
bool | OfKind (int aKindMask) const |
Function OfKind() More... | |
const std::string | KindStr () const |
Function KindStr() More... | |
void | SetParent (const PNS_HORIZON_PARENT_ITEM *aParent) |
Function SetParent() More... | |
auto | Parent () const |
Function Parent() More... | |
void | SetNet (int aNet) |
Function SetNet() More... | |
int | Net () const |
Function Net() More... | |
bool | InAnyNet () const |
void | SetLayers (const LAYER_RANGE &aLayers) |
Function SetLayers() More... | |
void | SetLayer (int aLayer) |
Function SetLayer() More... | |
const LAYER_RANGE & | Layers () const |
Function Layers() More... | |
virtual int | Layer () const |
Function Layer() More... | |
bool | LayersOverlap (const ITEM *aOther) const |
Function LayersOverlap() More... | |
void | SetOwner (NODE *aOwner) |
Functon SetOwner() More... | |
bool | BelongsTo (NODE *aNode) const |
Function BelongsTo() More... | |
NODE * | Owner () const |
Function Owner() More... | |
virtual bool | Collide (const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I &aMTV, bool aDifferentNetsOnly=true) const |
Function Collide() More... | |
bool | Collide (const ITEM *aOther, int aClearance, bool aDifferentNetsOnly=true) const |
Function Collide() More... | |
virtual const SHAPE * | Shape () const |
Function Shape() More... | |
virtual void | Mark (int aMarker) |
virtual void | Unmark (int aMarker=-1) |
virtual int | Marker () const |
virtual void | SetRank (int aRank) |
virtual int | Rank () const |
virtual VECTOR2I | Anchor (int n) const |
virtual int | AnchorCount () const |
bool | IsLocked () const |
void | SetRoutable (bool aRoutable) |
bool | IsRoutable () const |
Static Public Attributes | |
static const int | UnusedNet = INT_MAX |
Protected Attributes | |
PnsKind | m_kind |
const PNS_HORIZON_PARENT_ITEM * | m_parent |
NODE * | m_owner |
LAYER_RANGE | m_layers |
bool | m_movable |
int | m_net |
int | m_marker |
int | m_rank |
bool | m_routable |
Class ITEM.
Base class for PNS router board items. Implements the shared properties of all PCB items - net, spanned layers, geometric shape & refererence to owning model.
|
inline |
Function BelongsTo()
|
pure virtual |
Function Clone()
Returns a deep copy of the item
Implemented in PNS::VIA, PNS::SOLID, PNS::SEGMENT, PNS::LINE, PNS::JOINT, and PNS::DIFF_PAIR.
|
inline |
Function Collide()
A shortcut for ITEM::Colllide() without MTV stuff.
|
virtual |
Function Collide()
Checks for a collision (clearance violation) with between us and item aOther. Collision checking takes all PCB stuff into accound (layers, nets, DRC rules). Optionally returns a minimum translation vector for force propagation algorithm.
aOther | item to check collision against |
aClearance | desired clearance |
aNeedMTV | when true, the minimum translation vector is calculated |
aMTV | the minimum translation vector |
const std::string PNS::ITEM::KindStr | ( | ) | const |
Function KindStr()
Returns the kind of the item, as string
|
inlinevirtual |
Function Layer()
Returns the item's layer, for single-layered items only.
Reimplemented in PNS::SEGMENT.
|
inline |
Function Layers()
Returns the contiguous set of layers spanned by the item.
|
inline |
Function LayersOverlap()
Returns true if the set of layers spanned by aOther overlaps our layers.
|
inline |
Function Net()
Returns the item's net.
|
inline |
Function OfKind()
Returns true if the item's type matches the mask aKindMask.
|
inline |
Function Owner()
Returns the owner of this item, or NULL if there's none.
|
inline |
Function Parent()
Returns the corresponding parent object in the host application's model.
|
inline |
Function SetLayer()
Sets the layers spanned by the item to a single layer aLayer.
|
inline |
Function SetLayers()
Sets the layers spanned by the item to aLayers.
|
inline |
Function SetNet()
Sets the item's net to aNet
|
inline |
Functon SetOwner()
Sets the node that owns this item. An item can belong to a single NODE or stay unowned.
|
inline |
Function SetParent()
Sets the corresponding parent object in the host application's model.
|
inlinevirtual |
Function Shape()
Returns the geometrical shape of the item. Used for collision detection & spatial indexing.
Reimplemented in PNS::VIA, PNS::SOLID, PNS::SEGMENT, and PNS::LINE.