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

Public Member Functions

def __init__ (self, args)
 
def Centre (self)
 
def Move (self, aMoveVector)
 
def Normalize (self)
 
def Contains (self, args)
 
def GetSize (self)
 
def GetSizeMax (self)
 
def GetX (self)
 
def GetY (self)
 
def GetOrigin (self)
 
def GetPosition (self)
 
def GetEnd (self)
 
def GetCenter (self)
 
def GetWidth (self)
 
def GetHeight (self)
 
def GetRight (self)
 
def GetLeft (self)
 
def GetTop (self)
 
def GetBottom (self)
 
def SetOrigin (self, args)
 
def SetSize (self, args)
 
def Offset (self, args)
 
def SetX (self, val)
 
def SetY (self, val)
 
def SetWidth (self, val)
 
def SetHeight (self, val)
 
def SetEnd (self, args)
 
def RevertYAxis (self)
 
def Intersects (self, args)
 
def ClosestPointTo (self, aPoint)
 
def FarthestPointTo (self, aPoint)
 
def IntersectsCircle (self, aCenter, aRadius)
 
def IntersectsCircleEdge (self, aCenter, aRadius, aWidth)
 
def getWxRect (self)
 
def getBOX2I (self)
 
def Inflate (self, args)
 
def Merge (self, args)
 
def GetArea (self)
 
def Common (self, aRect)
 
def GetBoundingBoxRotated (self, aRotCenter, aAngle)
 

Public Attributes

 this
 

Detailed Description

Class EDA_RECT handles the component boundary box.

This class is similar to wxRect, but some wxRect functions are very
curious, and are working only if dimensions are >= 0 (not always the
case in KiCad) and also KiCad needs some specific method. so I prefer
this more suitable class

C++ includes: class_eda_rect.h 

Definition at line 2162 of file pcbnew.py.

Constructor & Destructor Documentation

def pcbnew.EDA_RECT.__init__ (   self,
  args 
)
__init__(EDA_RECT self) -> EDA_RECT
__init__(EDA_RECT self, wxPoint aPos, wxSize aSize) -> EDA_RECT

EDA_RECT::EDA_RECT(const
wxPoint &aPos, const wxSize &aSize) 

Definition at line 2181 of file pcbnew.py.

Member Function Documentation

def pcbnew.EDA_RECT.Centre (   self)
Centre(EDA_RECT self) -> wxPoint

wxPoint EDA_RECT::Centre()
const 

Definition at line 2195 of file pcbnew.py.

def pcbnew.EDA_RECT.ClosestPointTo (   self,
  aPoint 
)
ClosestPointTo(EDA_RECT self, wxPoint aPoint) -> wxPoint

const wxPoint
EDA_RECT::ClosestPointTo(const wxPoint &aPoint) const

Return the point in this rect that is closest to the provided point.

Definition at line 2520 of file pcbnew.py.

def pcbnew.EDA_RECT.Common (   self,
  aRect 
)
Common(EDA_RECT self, EDA_RECT aRect) -> EDA_RECT

EDA_RECT
EDA_RECT::Common(const EDA_RECT &aRect) const

Function Common returns the area that is common with another
rectangle.

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

aRect:  is the rectangle to find the common area with.

The common area rect or 0-sized rectangle if there is no intersection.

Definition at line 2649 of file pcbnew.py.

def pcbnew.EDA_RECT.Contains (   self,
  args 
)
Contains(EDA_RECT self, wxPoint aPoint) -> bool
Contains(EDA_RECT self, int x, int y) -> bool
Contains(EDA_RECT self, EDA_RECT aRect) -> bool

bool
EDA_RECT::Contains(const EDA_RECT &aRect) const

Function Contains.

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

aRect:  = the EDA_RECT to test

true if aRect is Contained. A common edge is seen as contained 

Definition at line 2234 of file pcbnew.py.

def pcbnew.EDA_RECT.FarthestPointTo (   self,
  aPoint 
)
FarthestPointTo(EDA_RECT self, wxPoint aPoint) -> wxPoint

const wxPoint
EDA_RECT::FarthestPointTo(const wxPoint &aPoint) const

Return the point in this rect that is farthest from the provided
point. 

Definition at line 2533 of file pcbnew.py.

def pcbnew.EDA_RECT.GetArea (   self)
GetArea(EDA_RECT self) -> double

double EDA_RECT::GetArea()
const

Function GetArea returns the area of the rectangle.

The area of the rectangle. 

Definition at line 2635 of file pcbnew.py.

def pcbnew.EDA_RECT.GetBottom (   self)
GetBottom(EDA_RECT self) -> int

int EDA_RECT::GetBottom()
const 

Definition at line 2387 of file pcbnew.py.

def pcbnew.EDA_RECT.GetBoundingBoxRotated (   self,
  aRotCenter,
  aAngle 
)
GetBoundingBoxRotated(EDA_RECT self, wxPoint aRotCenter, double aAngle) -> EDA_RECT

const
EDA_RECT EDA_RECT::GetBoundingBoxRotated(wxPoint aRotCenter, double
aAngle)

Function GetBoundingBoxRotated.

the bounding box of this, after rotation

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

aAngle:  = the rotation angle in 0.1 deg.

aRotCenter:  = the rotation point. useful to calculate bounding box of
rotated items, when rotation if not k*90 degrees 

Definition at line 2670 of file pcbnew.py.

def pcbnew.EDA_RECT.getBOX2I (   self)
getBOX2I(EDA_RECT self) -> BOX2I

Definition at line 2595 of file pcbnew.py.

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

const wxPoint
EDA_RECT::GetCenter() const 

Definition at line 2327 of file pcbnew.py.

def pcbnew.EDA_RECT.GetEnd (   self)
GetEnd(EDA_RECT self) -> wxPoint

const wxPoint
EDA_RECT::GetEnd() const 

Definition at line 2317 of file pcbnew.py.

def pcbnew.EDA_RECT.GetHeight (   self)
GetHeight(EDA_RECT self) -> int

int EDA_RECT::GetHeight()
const 

Definition at line 2347 of file pcbnew.py.

def pcbnew.EDA_RECT.GetLeft (   self)
GetLeft(EDA_RECT self) -> int

int EDA_RECT::GetLeft()
const 

Definition at line 2367 of file pcbnew.py.

def pcbnew.EDA_RECT.GetOrigin (   self)
GetOrigin(EDA_RECT self) -> wxPoint

const wxPoint&
EDA_RECT::GetOrigin() const 

Definition at line 2297 of file pcbnew.py.

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

const wxPoint&
EDA_RECT::GetPosition() const 

Definition at line 2307 of file pcbnew.py.

def pcbnew.EDA_RECT.GetRight (   self)
GetRight(EDA_RECT self) -> int

int EDA_RECT::GetRight()
const 

Definition at line 2357 of file pcbnew.py.

def pcbnew.EDA_RECT.GetSize (   self)
GetSize(EDA_RECT self) -> wxSize

const wxSize&
EDA_RECT::GetSize() const 

Definition at line 2255 of file pcbnew.py.

def pcbnew.EDA_RECT.GetSizeMax (   self)
GetSizeMax(EDA_RECT self) -> int

int
EDA_RECT::GetSizeMax() const

GetSizeMax.

the max size dimension 

Definition at line 2265 of file pcbnew.py.

def pcbnew.EDA_RECT.GetTop (   self)
GetTop(EDA_RECT self) -> int

int EDA_RECT::GetTop() const

Definition at line 2377 of file pcbnew.py.

def pcbnew.EDA_RECT.GetWidth (   self)
GetWidth(EDA_RECT self) -> int

int EDA_RECT::GetWidth()
const 

Definition at line 2337 of file pcbnew.py.

def pcbnew.EDA_RECT.getWxRect (   self)
getWxRect(EDA_RECT self) -> wxRect

Definition at line 2590 of file pcbnew.py.

def pcbnew.EDA_RECT.GetX (   self)
GetX(EDA_RECT self) -> int

int EDA_RECT::GetX() const 

Definition at line 2279 of file pcbnew.py.

def pcbnew.EDA_RECT.GetY (   self)
GetY(EDA_RECT self) -> int

int EDA_RECT::GetY() const 

Definition at line 2288 of file pcbnew.py.

def pcbnew.EDA_RECT.Inflate (   self,
  args 
)
Inflate(EDA_RECT self, wxCoord dx, wxCoord dy) -> EDA_RECT
Inflate(EDA_RECT self, int aDelta) -> EDA_RECT

EDA_RECT &
EDA_RECT::Inflate(int aDelta)

Function Inflate inflates the rectangle horizontally and vertically by
aDelta.

If aDelta is negative the rectangle is deflated. 

Definition at line 2600 of file pcbnew.py.

def pcbnew.EDA_RECT.Intersects (   self,
  args 
)
Intersects(EDA_RECT self, EDA_RECT aRect) -> bool
Intersects(EDA_RECT self, EDA_RECT aRect, double aRot) -> bool
Intersects(EDA_RECT self, wxPoint aPoint1, wxPoint aPoint2) -> bool

bool
EDA_RECT::Intersects(const wxPoint &aPoint1, const wxPoint &aPoint2)
const

Function Intersects tests for a common area between a segment and this
rectangle.

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

aPoint1:  First point of the segment to test intersection with.

aPoint2:  Second point of the segment to test intersection with.

bool - true if the argument segment intersects this rectangle. (i.e.
if the segment and rectangle have at least a common point) 

Definition at line 2494 of file pcbnew.py.

def pcbnew.EDA_RECT.IntersectsCircle (   self,
  aCenter,
  aRadius 
)
IntersectsCircle(EDA_RECT self, wxPoint aCenter, int const aRadius) -> bool

bool
EDA_RECT::IntersectsCircle(const wxPoint &aCenter, const int aRadius)
const

Function IntersectsCircle tests for a common area between a circle and
this rectangle.

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

aCenter:  center of the circle

aRadius:  radius of the circle 

Definition at line 2546 of file pcbnew.py.

def pcbnew.EDA_RECT.IntersectsCircleEdge (   self,
  aCenter,
  aRadius,
  aWidth 
)
IntersectsCircleEdge(EDA_RECT self, wxPoint aCenter, int const aRadius, int const aWidth) -> bool

bool
EDA_RECT::IntersectsCircleEdge(const wxPoint &aCenter, const int
aRadius, const int aWidth) const

IntersectsCircleEdge Tests for intersection between this rect and the
edge (radius) of a circle.

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

aCenter:  center of the circle

aRadius:  radius of the circle

aWidth:  width of the circle edge 

Definition at line 2567 of file pcbnew.py.

def pcbnew.EDA_RECT.Merge (   self,
  args 
)
Merge(EDA_RECT self, EDA_RECT aRect)
Merge(EDA_RECT self, wxPoint aPoint)

void EDA_RECT::Merge(const
wxPoint &aPoint)

Function Merge modifies the position and size of the rectangle in
order to contain the given point.

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

aPoint:  The point to merge with the rectangle. 

Definition at line 2616 of file pcbnew.py.

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

void EDA_RECT::Move(const
wxPoint &aMoveVector)

Function Move moves the rectangle by the aMoveVector.

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

aMoveVector:  A wxPoint that is the value to move this rectangle 

Definition at line 2205 of file pcbnew.py.

def pcbnew.EDA_RECT.Normalize (   self)
Normalize(EDA_RECT self)

void
EDA_RECT::Normalize()

Function Normalize ensures that the height ant width are positive. 

Definition at line 2222 of file pcbnew.py.

def pcbnew.EDA_RECT.Offset (   self,
  args 
)
Offset(EDA_RECT self, int dx, int dy)
Offset(EDA_RECT self, wxPoint offset)

void EDA_RECT::Offset(const
wxPoint &offset) 

Definition at line 2419 of file pcbnew.py.

def pcbnew.EDA_RECT.RevertYAxis (   self)
RevertYAxis(EDA_RECT self)

void
EDA_RECT::RevertYAxis()

Function RevertYAxis Mirror the rectangle from the X axis (negate Y
pos and size) 

Definition at line 2481 of file pcbnew.py.

def pcbnew.EDA_RECT.SetEnd (   self,
  args 
)
SetEnd(EDA_RECT self, int x, int y)
SetEnd(EDA_RECT self, wxPoint pos)

void EDA_RECT::SetEnd(const
wxPoint &pos) 

Definition at line 2470 of file pcbnew.py.

def pcbnew.EDA_RECT.SetHeight (   self,
  val 
)
SetHeight(EDA_RECT self, int val)

void
EDA_RECT::SetHeight(int val) 

Definition at line 2460 of file pcbnew.py.

def pcbnew.EDA_RECT.SetOrigin (   self,
  args 
)
SetOrigin(EDA_RECT self, wxPoint pos)
SetOrigin(EDA_RECT self, int x, int y)

void
EDA_RECT::SetOrigin(int x, int y) 

Definition at line 2397 of file pcbnew.py.

def pcbnew.EDA_RECT.SetSize (   self,
  args 
)
SetSize(EDA_RECT self, wxSize size)
SetSize(EDA_RECT self, int w, int h)

void EDA_RECT::SetSize(int
w, int h) 

Definition at line 2408 of file pcbnew.py.

def pcbnew.EDA_RECT.SetWidth (   self,
  val 
)
SetWidth(EDA_RECT self, int val)

void
EDA_RECT::SetWidth(int val) 

Definition at line 2450 of file pcbnew.py.

def pcbnew.EDA_RECT.SetX (   self,
  val 
)
SetX(EDA_RECT self, int val)

void EDA_RECT::SetX(int val)

Definition at line 2430 of file pcbnew.py.

def pcbnew.EDA_RECT.SetY (   self,
  val 
)
SetY(EDA_RECT self, int val)

void EDA_RECT::SetY(int val)

Definition at line 2440 of file pcbnew.py.

Member Data Documentation

pcbnew.EDA_RECT.this

Definition at line 2193 of file pcbnew.py.


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