KiCad PCB EDA Suite
PNS_PCBNEW_DEBUG_DECORATOR Class Reference
Inheritance diagram for PNS_PCBNEW_DEBUG_DECORATOR:
PNS::DEBUG_DECORATOR

Public Member Functions

 PNS_PCBNEW_DEBUG_DECORATOR (KIGFX::VIEW *aView=NULL)
 
 ~PNS_PCBNEW_DEBUG_DECORATOR ()
 
void SetView (KIGFX::VIEW *aView)
 
void AddPoint (VECTOR2I aP, int aColor) override
 
void AddBox (BOX2I aB, int aColor) override
 
void AddSegment (SEG aS, int aColor) override
 
void AddDirections (VECTOR2D aP, int aMask, int aColor) override
 
void AddLine (const SHAPE_LINE_CHAIN &aLine, int aType, int aWidth) override
 
void Clear () override
 

Private Attributes

KIGFX::VIEWm_view
 
KIGFX::VIEW_GROUPm_items
 

Detailed Description

Definition at line 362 of file pns_kicad_iface.cpp.

Constructor & Destructor Documentation

PNS_PCBNEW_DEBUG_DECORATOR::PNS_PCBNEW_DEBUG_DECORATOR ( KIGFX::VIEW aView = NULL)
inline

Definition at line 365 of file pns_kicad_iface.cpp.

366  m_view( NULL ), m_items( NULL )
367  {
368  SetView( aView );
369  }
KIGFX::VIEW_GROUP * m_items
void SetView(KIGFX::VIEW *aView)
PNS_PCBNEW_DEBUG_DECORATOR::~PNS_PCBNEW_DEBUG_DECORATOR ( )
inline

Definition at line 371 of file pns_kicad_iface.cpp.

372  {
373  Clear();
374  delete m_items;
375  }
KIGFX::VIEW_GROUP * m_items

Member Function Documentation

void PNS_PCBNEW_DEBUG_DECORATOR::AddBox ( BOX2I  aB,
int  aColor 
)
inlineoverridevirtual

Reimplemented from PNS::DEBUG_DECORATOR.

Definition at line 408 of file pns_kicad_iface.cpp.

References SHAPE_LINE_CHAIN::Append(), BOX2< Vec >::GetOrigin(), BOX2< Vec >::GetSize(), VECTOR2< T >::x, and VECTOR2< T >::y.

409  {
411 
412  VECTOR2I o = aB.GetOrigin();
413  VECTOR2I s = aB.GetSize();
414 
415  l.Append( o );
416  l.Append( o.x + s.x, o.y );
417  l.Append( o.x + s.x, o.y + s.y );
418  l.Append( o.x, o.y + s.y );
419  l.Append( o );
420 
421  AddLine( l, aColor, 10000 );
422  }
const Vec & GetOrigin() const
Definition: box2.h:181
const Vec & GetSize() const
Definition: box2.h:177
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
Class SHAPE_LINE_CHAIN.
void AddLine(const SHAPE_LINE_CHAIN &aLine, int aType, int aWidth) override
void PNS_PCBNEW_DEBUG_DECORATOR::AddDirections ( VECTOR2D  aP,
int  aMask,
int  aColor 
)
inlineoverridevirtual

Reimplemented from PNS::DEBUG_DECORATOR.

Definition at line 434 of file pns_kicad_iface.cpp.

References i, and DIRECTION_45::ToVector().

435  {
436  BOX2I b( aP - VECTOR2I( 10000, 10000 ), VECTOR2I( 20000, 20000 ) );
437 
438  AddBox( b, aColor );
439  for( int i = 0; i < 8; i++ )
440  {
441  if( ( 1 << i ) & aMask )
442  {
444  AddSegment( SEG( aP, aP + v ), aColor );
445  }
446  }
447  }
const VECTOR2I ToVector() const
Function ToVector()
Definition: direction45.h:298
void AddBox(BOX2I aB, int aColor) override
VECTOR2< int > VECTOR2I
Definition: vector2d.h:589
Class DIRECTION_45.
Definition: direction45.h:36
Definition: seg.h:36
size_t i
Definition: json11.cpp:597
Directions
Enum Directions Represents available directions - there are 8 of them, as on a rectilinear map (north...
Definition: direction45.h:45
void AddSegment(SEG aS, int aColor) override
void PNS_PCBNEW_DEBUG_DECORATOR::AddLine ( const SHAPE_LINE_CHAIN aLine,
int  aType,
int  aWidth 
)
inlineoverridevirtual

Reimplemented from PNS::DEBUG_DECORATOR.

Definition at line 449 of file pns_kicad_iface.cpp.

References ROUTER_PREVIEW_ITEM::Line().

450  {
451  ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( NULL, m_view );
452 
453  pitem->Line( aLine, aWidth, aType );
454  m_items->Add( pitem ); // Should not be needed, as m_items has been passed as a parent group in alloc;
455  m_view->Update( m_items );
456  }
void Line(const SHAPE_LINE_CHAIN &aLine, int aWidth=0, int aStyle=0)
KIGFX::VIEW_GROUP * m_items
virtual void Add(VIEW_ITEM *aItem)
Function Add() Adds an item to the group.
Definition: view_group.cpp:55
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1499
void PNS_PCBNEW_DEBUG_DECORATOR::AddPoint ( VECTOR2I  aP,
int  aColor 
)
inlineoverridevirtual

Reimplemented from PNS::DEBUG_DECORATOR.

Definition at line 392 of file pns_kicad_iface.cpp.

References SHAPE_LINE_CHAIN::Append(), and SHAPE_LINE_CHAIN::Clear().

393  {
395 
396  l.Append( aP - VECTOR2I( -50000, -50000 ) );
397  l.Append( aP + VECTOR2I( -50000, -50000 ) );
398 
399  AddLine( l, aColor, 10000 );
400 
401  l.Clear();
402  l.Append( aP - VECTOR2I( 50000, -50000 ) );
403  l.Append( aP + VECTOR2I( 50000, -50000 ) );
404 
405  AddLine( l, aColor, 10000 );
406  }
VECTOR2< int > VECTOR2I
Definition: vector2d.h:589
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
Class SHAPE_LINE_CHAIN.
void Clear()
Function Clear() Removes all points from the line chain.
void AddLine(const SHAPE_LINE_CHAIN &aLine, int aType, int aWidth) override
void PNS_PCBNEW_DEBUG_DECORATOR::AddSegment ( SEG  aS,
int  aColor 
)
inlineoverridevirtual

Reimplemented from PNS::DEBUG_DECORATOR.

Definition at line 424 of file pns_kicad_iface.cpp.

References SEG::A, SHAPE_LINE_CHAIN::Append(), and SEG::B.

425  {
427 
428  l.Append( aS.A );
429  l.Append( aS.B );
430 
431  AddLine( l, aColor, 10000 );
432  }
void Append(int aX, int aY, bool aAllowDuplication=false)
Function Append()
Class SHAPE_LINE_CHAIN.
VECTOR2I A
Definition: seg.h:46
void AddLine(const SHAPE_LINE_CHAIN &aLine, int aType, int aWidth) override
VECTOR2I B
Definition: seg.h:47
void PNS_PCBNEW_DEBUG_DECORATOR::Clear ( )
inlineoverridevirtual

Reimplemented from PNS::DEBUG_DECORATOR.

Definition at line 458 of file pns_kicad_iface.cpp.

459  {
460  if( m_view && m_items )
461  {
462  m_items->FreeItems();
463  m_view->Update( m_items );
464  }
465  }
KIGFX::VIEW_GROUP * m_items
void FreeItems()
Function FreeItems() Frees all the items that were added to the group.
Definition: view_group.cpp:167
virtual void Update(VIEW_ITEM *aItem, int aUpdateFlags)
For dynamic VIEWs, informs the associated VIEW that the graphical representation of this item has cha...
Definition: view.cpp:1499
void PNS_PCBNEW_DEBUG_DECORATOR::SetView ( KIGFX::VIEW aView)
inline

Definition at line 377 of file pns_kicad_iface.cpp.

References LAYER_GP_OVERLAY.

378  {
379  Clear();
380  delete m_items;
381  m_items = NULL;
382  m_view = aView;
383 
384  if( m_view == NULL )
385  return;
386 
389  m_view->Add( m_items );
390  }
KIGFX::VIEW_GROUP * m_items
general purpose overlay
virtual void SetLayer(int aLayer)
Function SetLayer() Sets layer used to draw the group.
Definition: view_group.h:115
virtual void Add(VIEW_ITEM *aItem, int aDrawPriority=-1)
Function Add() Adds a VIEW_ITEM to the view.
Definition: view.cpp:334

Member Data Documentation

KIGFX::VIEW_GROUP* PNS_PCBNEW_DEBUG_DECORATOR::m_items
private

Definition at line 469 of file pns_kicad_iface.cpp.

KIGFX::VIEW* PNS_PCBNEW_DEBUG_DECORATOR::m_view
private

Definition at line 468 of file pns_kicad_iface.cpp.


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