KiCad PCB EDA Suite
pns_kicad_iface.cpp File Reference
#include <board.h>
#include <board_connected_item.h>
#include <fp_text.h>
#include <footprint.h>
#include <track.h>
#include <zone.h>
#include <pcb_shape.h>
#include <pcb_text.h>
#include <board_commit.h>
#include <layers_id_colors_and_visibility.h>
#include <geometry/convex_hull.h>
#include <confirm.h>
#include <pcb_painter.h>
#include <geometry/shape.h>
#include <geometry/shape_line_chain.h>
#include <geometry/shape_arc.h>
#include <geometry/shape_simple.h>
#include <drc/drc_rule.h>
#include <drc/drc_engine.h>
#include <memory>
#include <advanced_config.h>
#include "pns_kicad_iface.h"
#include "pns_arc.h"
#include "pns_routing_settings.h"
#include "pns_sizes_settings.h"
#include "pns_item.h"
#include "pns_solid.h"
#include "pns_segment.h"
#include "pns_node.h"
#include "pns_router.h"
#include "pns_debug_decorator.h"
#include "router_preview_item.h"

Go to the source code of this file.

Classes

class  PNS_PCBNEW_RULE_RESOLVER
 
class  PNS_PCBNEW_DEBUG_DECORATOR
 

Typedefs

typedef VECTOR2I::extended_type ecoord
 

Functions

bool isCopper (const PNS::ITEM *aItem)
 
bool isEdge (const PNS::ITEM *aItem)
 

Typedef Documentation

◆ ecoord

Definition at line 62 of file pns_kicad_iface.cpp.

Function Documentation

◆ isCopper()

bool isCopper ( const PNS::ITEM aItem)

Definition at line 159 of file pns_kicad_iface.cpp.

160 {
161  BOARD_ITEM* parent = aItem->Parent();
162 
163  if( parent && parent->Type() == PCB_PAD_T )
164  {
165  PAD* pad = static_cast<PAD*>( parent );
166  return pad->IsOnCopperLayer() && pad->GetAttribute() != PAD_ATTRIB_NPTH;
167  }
168 
169  return true;
170 }
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
BOARD_ITEM * Parent() const
Definition: pns_item.h:145
class PAD, a pad in a footprint
Definition: typeinfo.h:89
like PAD_PTH, but not plated mechanical use only, no connection allowed
Definition: pad_shapes.h:85
Definition: pad.h:60
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:163

References pad, PAD_ATTRIB_NPTH, PNS::ITEM::Parent(), PCB_PAD_T, and EDA_ITEM::Type().

Referenced by PNS_PCBNEW_RULE_RESOLVER::Clearance().

◆ isEdge()

bool isEdge ( const PNS::ITEM aItem)

Definition at line 173 of file pns_kicad_iface.cpp.

174 {
175  const BOARD_ITEM *parent = aItem->Parent();
176 
177  if( parent )
178  {
179  return parent->GetLayer() == Edge_Cuts || parent->GetLayer () == Margin;
180  }
181 
182  return false;
183 }
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:82
BOARD_ITEM * Parent() const
Definition: pns_item.h:145
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:173

References Edge_Cuts, BOARD_ITEM::GetLayer(), Margin, and PNS::ITEM::Parent().

Referenced by PNS_PCBNEW_RULE_RESOLVER::Clearance().