KiCad PCB EDA Suite
TSubRect Struct Reference
Inheritance diagram for TSubRect:
CRectPlacement::TRect CRectPlacement::TPos

Public Member Functions

 TSubRect ()
 
 TSubRect (int _w, int _h, int _n)
 
bool Contains (const TPos &p) const
 
bool Contains (const TRect &r) const
 
bool Intersects (const TRect &r) const
 
bool operator== (const TPos &p) const
 

Static Public Member Functions

static bool Greater (const TRect &a, const TRect &b)
 

Public Attributes

int n
 
int w
 
int h
 
int x
 
int y
 

Detailed Description

Definition at line 50 of file spread_footprints.cpp.

Constructor & Destructor Documentation

TSubRect::TSubRect ( )
inline

Definition at line 54 of file spread_footprints.cpp.

54  : TRect(),
55  n( 0 )
56  {
57  }
TSubRect::TSubRect ( int  _w,
int  _h,
int  _n 
)
inline

Definition at line 59 of file spread_footprints.cpp.

59  :
60  TRect( 0, 0, _w, _h ), n( _n ) { }

Member Function Documentation

bool CRectPlacement::TRect::Contains ( const TPos p) const
inlineinherited

Definition at line 43 of file rect_placement.h.

References CRectPlacement::TRect::w, CRectPlacement::TPos::x, and CRectPlacement::TPos::y.

Referenced by CRectPlacement::IsFree().

44  {
45  return p.x >= x && p.y >= y && p.x < (x + w) && p.y < (y + h);
46  }
bool CRectPlacement::TRect::Contains ( const TRect r) const
inlineinherited

Definition at line 47 of file rect_placement.h.

References CRectPlacement::TRect::h, CRectPlacement::TRect::w, CRectPlacement::TPos::x, and CRectPlacement::TPos::y.

48  {
49  return r.x >= x && r.y >= y &&
50  (r.x + r.w) <= (x + w) && (r.y + r.h) <= (y + h);
51  }
static bool CRectPlacement::TRect::Greater ( const TRect a,
const TRect b 
)
inlinestaticinherited

Definition at line 62 of file rect_placement.h.

References CRectPlacement::TRect::h, and CRectPlacement::TRect::w.

Referenced by spreadRectangles().

63  {
64  return (a.w > b.w && a.w > b.h) || (a.h > b.w && a.h > b.h);
65  }
bool CRectPlacement::TRect::Intersects ( const TRect r) const
inlineinherited

Definition at line 52 of file rect_placement.h.

References CRectPlacement::TRect::h, CRectPlacement::TRect::w, CRectPlacement::TPos::x, and CRectPlacement::TPos::y.

53  {
54  return w > 0 && h > 0 && r.w > 0 && r.h > 0
55  && ( (r.x + r.w) > x && r.x < (x + w) && (r.y + r.h) > y && r.y < (y + h) );
56  }
bool CRectPlacement::TPos::operator== ( const TPos p) const
inlineinherited

Definition at line 32 of file rect_placement.h.

References CRectPlacement::TPos::x, and CRectPlacement::TPos::y.

32 { return x == p.x && y == p.y; }

Member Data Documentation

int TSubRect::n

Definition at line 52 of file spread_footprints.cpp.

Referenced by PCB_EDIT_FRAME::SpreadFootprints().


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