KiCAD pcbnew scripting
Public Member Functions | Static Public Attributes | List of all members
pcbnew.BOARD_ITEM Class Reference
Inheritance diagram for pcbnew.BOARD_ITEM:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, args, kwargs)
 
def GetPosition (self)
 
def GetCenter (self)
 
def SetPosition (self, aPos)
 
def IsConnected (self)
 
def Next (self)
 
def Back (self)
 
def GetParent (self)
 
def GetLayer (self)
 
def GetLayerSet (self)
 
def SetLayer (self, aLayer)
 
def Draw (self, args)
 
def SwapData (self, aImage)
 
def IsOnLayer (self, aLayer)
 
def IsTrack (self)
 
def IsLocked (self)
 
def SetLocked (self, aLocked)
 
def UnLink (self)
 
def DeleteStructure (self)
 
def ShowShape (aShape)
 
def Move (self, args)
 
def Rotate (self, args)
 
def Flip (self, args)
 
def GetBoard (self)
 
def GetLayerName (self)
 
def HitTest (self, args)
 
def FormatAngle (aAngle)
 
def FormatInternalUnits (args)
 
def ViewGetLayers (self, aLayers, aCount)
 
def Cast (self)
 
def Duplicate (self)
 
def SetPos (self, p)
 
def SetStartEnd (self, start, end)
 
- Public Member Functions inherited from pcbnew.EDA_ITEM
def __init__ (self, args, kwargs)
 
def Type (self)
 
def SetTimeStamp (self, aNewTimeStamp)
 
def GetTimeStamp (self)
 
def Next (self)
 
def Back (self)
 
def GetParent (self)
 
def GetList (self)
 
def SetParent (self, aParent)
 
def SetList (self, aList)
 
def IsNew (self)
 
def IsModified (self)
 
def IsMoving (self)
 
def IsDragging (self)
 
def IsWireImage (self)
 
def IsSelected (self)
 
def IsResized (self)
 
def IsHighlighted (self)
 
def IsBrightened (self)
 
def SetWireImage (self)
 
def SetSelected (self)
 
def SetHighlighted (self)
 
def SetBrightened (self)
 
def ClearSelected (self)
 
def ClearHighlighted (self)
 
def ClearBrightened (self)
 
def SetModified (self)
 
def GetState (self, type)
 
def SetState (self, type, state)
 
def GetStatus (self)
 
def SetStatus (self, aStatus)
 
def SetFlags (self, aMask)
 
def ClearFlags
 
def GetFlags (self)
 
def SetForceVisible (self, aEnable)
 
def GetMsgPanelInfo (self, aList)
 
def HitTest (self, aPosition)
 
def GetBoundingBox (self)
 
def Clone (self)
 
def IterateForward (listStart, inspector, testData, scanTypes)
 
def Visit (self, inspector, testData, scanTypes)
 
def GetClass (self)
 
def GetSelectMenuText (self)
 
def GetMenuImage (self)
 
def Matches (self, aSearchData, aAuxData, aFindLocation)
 
def Replace (self, args)
 
def IsReplaceable (self)
 
def __lt__ (self, aItem)
 
def Sort (aLeft, aRight)
 
def ViewBBox (self)
 
def ViewGetLayers (self, aLayers, aCount)
 

Static Public Attributes

tuple ShowShape = staticmethod(ShowShape)
 
tuple FormatAngle = staticmethod(FormatAngle)
 
tuple FormatInternalUnits = staticmethod(FormatInternalUnits)
 
- Static Public Attributes inherited from pcbnew.EDA_ITEM
tuple IterateForward = staticmethod(IterateForward)
 
tuple Sort = staticmethod(Sort)
 

Detailed Description

Class BOARD_ITEM is a base class for any item which can be embedded
within the BOARD container class, and therefore instances of derived
classes should only be found in Pcbnew or other programs that use
class BOARD and its contents.

The corresponding class in Eeschema is SCH_ITEM.

C++ includes: class_board_item.h 

Definition at line 15064 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.BOARD_ITEM.__init__ (   self,
  args,
  kwargs 
)

Definition at line 15086 of file pcbnew.py.

Member Function Documentation

def pcbnew.BOARD_ITEM.Back (   self)
Back(BOARD_ITEM self) -> BOARD_ITEM

BOARD_ITEM*
BOARD_ITEM::Back() const 

Definition at line 15153 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Cast (   self)

Definition at line 15487 of file pcbnew.py.

def pcbnew.BOARD_ITEM.DeleteStructure (   self)
DeleteStructure(BOARD_ITEM self)

void
BOARD_ITEM::DeleteStructure()

Function DeleteStructure deletes this object after UnLink()ing it from
its owner if it has one. 

Definition at line 15331 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Draw (   self,
  args 
)
Draw(BOARD_ITEM self, EDA_DRAW_PANEL * panel, wxDC * DC, GR_DRAWMODE aDrawMode, wxPoint offset)
Draw(BOARD_ITEM self, EDA_DRAW_PANEL * panel, wxDC * DC, GR_DRAWMODE aDrawMode)

virtual void
BOARD_ITEM::Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE
aDrawMode, const wxPoint &offset=ZeroOffset)=0

Function Draw BOARD_ITEMs have their own color information. 

Definition at line 15218 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.BOARD_ITEM.Duplicate (   self)

Definition at line 15518 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Flip (   self,
  args 
)
Flip(BOARD_ITEM self, wxPoint aCentre)
Flip(BOARD_ITEM self, VECTOR2I const & aCentre)

void BOARD_ITEM::Flip(const
VECTOR2I &aCentre) 

Definition at line 15374 of file pcbnew.py.

def pcbnew.BOARD_ITEM.FormatAngle (   aAngle)
FormatAngle(double aAngle) -> string

Definition at line 15442 of file pcbnew.py.

def pcbnew.BOARD_ITEM.FormatInternalUnits (   args)
FormatInternalUnits(int aValue) -> string
FormatInternalUnits(wxPoint aPoint) -> string
FormatInternalUnits(wxSize aSize) -> string

Definition at line 15450 of file pcbnew.py.

def pcbnew.BOARD_ITEM.GetBoard (   self)
GetBoard(BOARD_ITEM self) -> BOARD

BOARD *
BOARD_ITEM::GetBoard() const

Function GetBoard returns the BOARD in which this BOARD_ITEM resides,
or NULL if none. 

Definition at line 15385 of file pcbnew.py.

def pcbnew.BOARD_ITEM.GetCenter (   self)
GetCenter(BOARD_ITEM self) -> wxPoint

virtual const wxPoint
BOARD_ITEM::GetCenter() const

Function GetCenter()

This defaults to the same point as returned by GetPosition(), unless
overridden

centre point of the item 

Definition at line 15100 of file pcbnew.py.

def pcbnew.BOARD_ITEM.GetLayer (   self)
GetLayer(BOARD_ITEM self) -> PCB_LAYER_ID

virtual PCB_LAYER_ID
BOARD_ITEM::GetLayer() const

Function GetLayer returns the primary layer this item is on. 

Definition at line 15173 of file pcbnew.py.

def pcbnew.BOARD_ITEM.GetLayerName (   self)
GetLayerName(BOARD_ITEM self) -> wxString

wxString
BOARD_ITEM::GetLayerName() const

Function GetLayerName returns the name of the PCB layer on which the
item resides.

wxString containing the layer name associated with this item. 

Definition at line 15398 of file pcbnew.py.

def pcbnew.BOARD_ITEM.GetLayerSet (   self)
GetLayerSet(BOARD_ITEM self) -> LSET

virtual LSET
BOARD_ITEM::GetLayerSet() const

Function GetLayerSet returns a "layer mask", which is a bitmap of
all layers on which the TRACK segment or VIA physically resides.

int - a layer mask, see layers_id_colors_visibility.h. 

Definition at line 15185 of file pcbnew.py.

def pcbnew.BOARD_ITEM.GetParent (   self)
GetParent(BOARD_ITEM self) -> BOARD_ITEM_CONTAINER

BOARD_ITEM_CONTAINER*
BOARD_ITEM::GetParent() const 

Definition at line 15163 of file pcbnew.py.

def pcbnew.BOARD_ITEM.GetPosition (   self)
GetPosition(BOARD_ITEM self) -> wxPoint

virtual const
wxPoint& BOARD_ITEM::GetPosition() const =0 

Definition at line 15090 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.BOARD_ITEM.HitTest (   self,
  args 
)
HitTest(BOARD_ITEM self, wxPoint aPosition) -> bool
HitTest(BOARD_ITEM self, EDA_RECT aRect, bool aContained=True, int aAccuracy=0) -> bool
HitTest(BOARD_ITEM self, EDA_RECT aRect, bool aContained=True) -> bool
HitTest(BOARD_ITEM self, EDA_RECT aRect) -> bool

virtual bool
BOARD_ITEM::HitTest(const EDA_RECT &aRect, bool aContained=true, int
aAccuracy=0) const

Function HitTest tests if the aRect intersects or contains this object
(depending on aContained).

Parameters:
-----------

aRect:  A reference to an EDA_RECT object containg the area to test.

aContained:  Test if aRect contains this object completly.

aAccuracy:  Increase the item bounding box by this amount.

bool - True if aRect contains this object completly or if aRect
intersects the object and aContained is False, otherwise false. 

Definition at line 15413 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.BOARD_ITEM.IsConnected (   self)
IsConnected(BOARD_ITEM self) -> bool

virtual bool
BOARD_ITEM::IsConnected() const

Function IsConnected() Returns information if the object is derived
from BOARD_CONNECTED_ITEM.

True if the object is of BOARD_CONNECTED_ITEM type, false otherwise.

Definition at line 15127 of file pcbnew.py.

def pcbnew.BOARD_ITEM.IsLocked (   self)
IsLocked(BOARD_ITEM self) -> bool

virtual bool
BOARD_ITEM::IsLocked() const

Function IsLocked.

bool - true if the object is locked, else false 

Definition at line 15291 of file pcbnew.py.

def pcbnew.BOARD_ITEM.IsOnLayer (   self,
  aLayer 
)
IsOnLayer(BOARD_ITEM self, PCB_LAYER_ID aLayer) -> bool

virtual bool
BOARD_ITEM::IsOnLayer(PCB_LAYER_ID aLayer) const

Function IsOnLayer tests to see if this object is on the given layer.

Is virtual so objects like D_PAD, which reside on multiple layers can
do their own form of testing.

Parameters:
-----------

aLayer:  The layer to test for.

bool - true if on given layer, else false. 

Definition at line 15254 of file pcbnew.py.

def pcbnew.BOARD_ITEM.IsTrack (   self)
IsTrack(BOARD_ITEM self) -> bool

bool
BOARD_ITEM::IsTrack() const

Function IsTrack tests to see if this object is a track or via (or
microvia).

form of testing. bool - true if a track or via, else false. 

Definition at line 15276 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Move (   self,
  args 
)
Move(BOARD_ITEM self, wxPoint aMoveVector)
Move(BOARD_ITEM self, VECTOR2I const & aMoveVector)

void BOARD_ITEM::Move(const
VECTOR2I &aMoveVector) 

Definition at line 15352 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Next (   self)
Next(BOARD_ITEM self) -> BOARD_ITEM

BOARD_ITEM*
BOARD_ITEM::Next() const 

Definition at line 15143 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Rotate (   self,
  args 
)
Rotate(BOARD_ITEM self, wxPoint aRotCentre, double aAngle)
Rotate(BOARD_ITEM self, VECTOR2I const & aRotCentre, double aAngle)

void
BOARD_ITEM::Rotate(const VECTOR2I &aRotCentre, double aAngle) 

Definition at line 15363 of file pcbnew.py.

def pcbnew.BOARD_ITEM.SetLayer (   self,
  aLayer 
)
SetLayer(BOARD_ITEM self, PCB_LAYER_ID aLayer)

virtual void
BOARD_ITEM::SetLayer(PCB_LAYER_ID aLayer)

Function SetLayer sets the layer this item is on.

Parameters:
-----------

aLayer:  The layer number. is virtual because some items (in fact:
class DIMENSION) have a slightly different initialization 

Definition at line 15200 of file pcbnew.py.

def pcbnew.BOARD_ITEM.SetLocked (   self,
  aLocked 
)
SetLocked(BOARD_ITEM self, bool aLocked)

virtual void
BOARD_ITEM::SetLocked(bool aLocked)

Function SetLocked modifies 'lock' status for of the item. 

Definition at line 15305 of file pcbnew.py.

def pcbnew.BOARD_ITEM.SetPos (   self,
  p 
)

Definition at line 15525 of file pcbnew.py.

def pcbnew.BOARD_ITEM.SetPosition (   self,
  aPos 
)
SetPosition(BOARD_ITEM self, wxPoint aPos)

virtual void
BOARD_ITEM::SetPosition(const wxPoint &aPos)=0 

Definition at line 15117 of file pcbnew.py.

def pcbnew.BOARD_ITEM.SetStartEnd (   self,
  start,
  end 
)

Definition at line 15529 of file pcbnew.py.

def pcbnew.BOARD_ITEM.ShowShape (   aShape)
ShowShape(STROKE_T aShape) -> wxString

Definition at line 15344 of file pcbnew.py.

def pcbnew.BOARD_ITEM.SwapData (   self,
  aImage 
)
SwapData(BOARD_ITEM self, BOARD_ITEM aImage)

void
BOARD_ITEM::SwapData(BOARD_ITEM *aImage)

Swap data between aItem and aImage.

aItem and aImage should have the same type Used in undo redo command
to swap values between an item and its copy Only values like layer,
size .. which are modified by edition are swapped, not the pointers
like Pnext and Pback because aItem is not changed in the linked list

Parameters:
-----------

aImage:  = the item image which contains data to swap 

Definition at line 15232 of file pcbnew.py.

def pcbnew.BOARD_ITEM.UnLink (   self)
UnLink(BOARD_ITEM self)

void BOARD_ITEM::UnLink()

Function UnLink detaches this object from its owner.

This base class implementation should work for all derived classes
which are held in a DLIST<>. 

Definition at line 15317 of file pcbnew.py.

Here is the caller graph for this function:

def pcbnew.BOARD_ITEM.ViewGetLayers (   self,
  aLayers,
  aCount 
)
ViewGetLayers(BOARD_ITEM self, int [] aLayers, int & aCount)

void
BOARD_ITEM::ViewGetLayers(int aLayers[], int &aCount) const override

Function ViewGetLayers() Returns the all the layers within the VIEW
the object is painted on.

For instance, a D_PAD spans zero or more copper layers and a few
technical layers. ViewDraw() or PAINTER::Draw() is repeatedly called
for each of the layers returned by ViewGetLayers(), depending on the
rendering order.

Parameters:
-----------

aLayers[]:  output layer index array

aCount:  number of layer indices in aLayers[] 

Definition at line 15462 of file pcbnew.py.

Member Data Documentation

tuple pcbnew.BOARD_ITEM.FormatAngle = staticmethod(FormatAngle)
static

Definition at line 15447 of file pcbnew.py.

tuple pcbnew.BOARD_ITEM.FormatInternalUnits = staticmethod(FormatInternalUnits)
static

Definition at line 15459 of file pcbnew.py.

tuple pcbnew.BOARD_ITEM.ShowShape = staticmethod(ShowShape)
static

Definition at line 15349 of file pcbnew.py.


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