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, aMoveVector)
 
def Rotate (self, aRotCentre, aAngle)
 
def Flip (self, aCentre)
 
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 14424 of file pcbnew.py.

Constructor & Destructor Documentation

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

Definition at line 14446 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 14513 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Cast (   self)

Definition at line 14855 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 14691 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 14578 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Duplicate (   self)

Definition at line 14886 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Flip (   self,
  aCentre 
)
Flip(BOARD_ITEM self, wxPoint aCentre)

virtual void
BOARD_ITEM::Flip(const wxPoint &aCentre)

Function Flip Flip this object, i.e.

change the board side for this object

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

aCentre:  - the rotation point. 

Definition at line 14748 of file pcbnew.py.

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

Definition at line 14824 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 14832 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 14767 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 14460 of file pcbnew.py.

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

PCB_LAYER_ID
BOARD_ITEM::GetLayer() const

Function GetLayer returns the primary layer this item is on. 

Definition at line 14533 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 14780 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 14545 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 14523 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 14450 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 14795 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 14487 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 14651 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 14614 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 14636 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Move (   self,
  aMoveVector 
)
Move(BOARD_ITEM self, wxPoint aMoveVector)

virtual void
BOARD_ITEM::Move(const wxPoint &aMoveVector)

Function Move move this object.

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

aMoveVector:  - the move vector for this object. 

Definition at line 14712 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 14503 of file pcbnew.py.

def pcbnew.BOARD_ITEM.Rotate (   self,
  aRotCentre,
  aAngle 
)
Rotate(BOARD_ITEM self, wxPoint aRotCentre, double aAngle)

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

Function Rotate Rotate this object.

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

aRotCentre:  - the rotation point.

aAngle:  - the rotation angle in 0.1 degree. 

Definition at line 14729 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 14560 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 14665 of file pcbnew.py.

def pcbnew.BOARD_ITEM.SetPos (   self,
  p 
)

Definition at line 14893 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 14477 of file pcbnew.py.

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

Definition at line 14897 of file pcbnew.py.

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

Definition at line 14704 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 14592 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 14677 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

Definition at line 14844 of file pcbnew.py.

Member Data Documentation

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

Definition at line 14829 of file pcbnew.py.

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

Definition at line 14841 of file pcbnew.py.

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

Definition at line 14709 of file pcbnew.py.


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