Horizon
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
PNS::ITEM Class Referenceabstract

Class ITEM. More...

#include <pns_item.h>

Inheritance diagram for PNS::ITEM:
PNS::DIFF_PAIR PNS::JOINT PNS::LINE PNS::SEGMENT PNS::SOLID PNS::VIA

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
}
 

Supported item types


 

Public Member Functions

 ITEM (PnsKind aKind)
 
 ITEM (const ITEM &aOther)
 
virtual ITEMClone () 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_RANGELayers () 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...
 
NODEOwner () 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 SHAPEShape () 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_ITEMm_parent
 
NODEm_owner
 
LAYER_RANGE m_layers
 
bool m_movable
 
int m_net
 
int m_marker
 
int m_rank
 
bool m_routable
 

Detailed Description

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.

Member Function Documentation

◆ BelongsTo()

bool PNS::ITEM::BelongsTo ( NODE aNode) const
inline

Function BelongsTo()

Returns
true if the item is owned by the node aNode.

◆ Clone()

virtual ITEM* PNS::ITEM::Clone ( ) const
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.

◆ Collide() [1/2]

bool PNS::ITEM::Collide ( const ITEM aOther,
int  aClearance,
bool  aDifferentNetsOnly = true 
) const
inline

Function Collide()

A shortcut for ITEM::Colllide() without MTV stuff.

◆ Collide() [2/2]

bool PNS::ITEM::Collide ( const ITEM aOther,
int  aClearance,
bool  aNeedMTV,
VECTOR2I aMTV,
bool  aDifferentNetsOnly = true 
) const
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.

Parameters
aOtheritem to check collision against
aClearancedesired clearance
aNeedMTVwhen true, the minimum translation vector is calculated
aMTVthe minimum translation vector
Returns
true, if a collision was found.

◆ Kind()

PnsKind PNS::ITEM::Kind ( ) const
inline

Function Kind()

Returns the type (kind) of the item

◆ KindStr()

const std::string PNS::ITEM::KindStr ( ) const

Function KindStr()

Returns the kind of the item, as string

◆ Layer()

virtual int PNS::ITEM::Layer ( ) const
inlinevirtual

Function Layer()

Returns the item's layer, for single-layered items only.

Reimplemented in PNS::SEGMENT.

◆ Layers()

const LAYER_RANGE& PNS::ITEM::Layers ( ) const
inline

Function Layers()

Returns the contiguous set of layers spanned by the item.

◆ LayersOverlap()

bool PNS::ITEM::LayersOverlap ( const ITEM aOther) const
inline

Function LayersOverlap()

Returns true if the set of layers spanned by aOther overlaps our layers.

◆ Net()

int PNS::ITEM::Net ( ) const
inline

Function Net()

Returns the item's net.

◆ OfKind()

bool PNS::ITEM::OfKind ( int  aKindMask) const
inline

Function OfKind()

Returns true if the item's type matches the mask aKindMask.

◆ Owner()

NODE* PNS::ITEM::Owner ( ) const
inline

Function Owner()

Returns the owner of this item, or NULL if there's none.

◆ Parent()

auto PNS::ITEM::Parent ( ) const
inline

Function Parent()

Returns the corresponding parent object in the host application's model.

◆ SetLayer()

void PNS::ITEM::SetLayer ( int  aLayer)
inline

Function SetLayer()

Sets the layers spanned by the item to a single layer aLayer.

◆ SetLayers()

void PNS::ITEM::SetLayers ( const LAYER_RANGE aLayers)
inline

Function SetLayers()

Sets the layers spanned by the item to aLayers.

◆ SetNet()

void PNS::ITEM::SetNet ( int  aNet)
inline

Function SetNet()

Sets the item's net to aNet

◆ SetOwner()

void PNS::ITEM::SetOwner ( NODE aOwner)
inline

Functon SetOwner()

Sets the node that owns this item. An item can belong to a single NODE or stay unowned.

◆ SetParent()

void PNS::ITEM::SetParent ( const PNS_HORIZON_PARENT_ITEM aParent)
inline

Function SetParent()

Sets the corresponding parent object in the host application's model.

◆ Shape()

virtual const SHAPE* PNS::ITEM::Shape ( ) const
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.


The documentation for this class was generated from the following files: