KiCad PCB EDA Suite
gendrill_file_writer_base.cpp File Reference
#include <board.h>
#include <footprint.h>
#include <pad.h>
#include <pcb_track.h>
#include <collectors.h>
#include <reporter.h>
#include <gendrill_file_writer_base.h>

Go to the source code of this file.

Functions

static bool cmpHoleSorting (const HOLE_INFO &a, const HOLE_INFO &b)
 

Function Documentation

◆ cmpHoleSorting()

static bool cmpHoleSorting ( const HOLE_INFO a,
const HOLE_INFO b 
)
static

Definition at line 43 of file gendrill_file_writer_base.cpp.

44 {
46  return b.m_Hole_NotPlated;
47 
48  if( a.m_Hole_Diameter != b.m_Hole_Diameter )
49  return a.m_Hole_Diameter < b.m_Hole_Diameter;
50 
51  // At this point (same diameter, same plated type), group by attribute
52  // type (via, pad, mechanical, although currently only not plated pads are mechanical)
53  if( a.m_HoleAttribute != b.m_HoleAttribute )
54  return a.m_HoleAttribute < b.m_HoleAttribute;
55 
56  // At this point (same diameter, same type), sort by X then Y position.
57  // This is optimal for drilling and make the file reproducible as long as holes
58  // have not changed, even if the data order has changed.
59  if( a.m_Hole_Pos.x != b.m_Hole_Pos.x )
60  return a.m_Hole_Pos.x < b.m_Hole_Pos.x;
61 
62  return a.m_Hole_Pos.y < b.m_Hole_Pos.y;
63 }
HOLE_ATTRIBUTE m_HoleAttribute

References HOLE_INFO::m_Hole_Diameter, HOLE_INFO::m_Hole_NotPlated, HOLE_INFO::m_Hole_Pos, and HOLE_INFO::m_HoleAttribute.

Referenced by GENDRILL_WRITER_BASE::buildHolesList().