KiCad PCB EDA Suite
FOOTPRINT::cmp_drawings Struct Reference

#include <footprint.h>

Public Member Functions

bool operator() (const BOARD_ITEM *aFirst, const BOARD_ITEM *aSecond) const
 

Detailed Description

Definition at line 715 of file footprint.h.

Member Function Documentation

◆ operator()()

bool FOOTPRINT::cmp_drawings::operator() ( const BOARD_ITEM aFirst,
const BOARD_ITEM aSecond 
) const

Definition at line 2153 of file footprint.cpp.

2155 {
2156  if( aFirst->Type() != aSecond->Type() )
2157  return aFirst->Type() < aSecond->Type();
2158 
2159  if( aFirst->GetLayer() != aSecond->GetLayer() )
2160  return aFirst->GetLayer() < aSecond->GetLayer();
2161 
2162  if( aFirst->Type() == PCB_FP_SHAPE_T )
2163  {
2164  const FP_SHAPE* dwgA = static_cast<const FP_SHAPE*>( aFirst );
2165  const FP_SHAPE* dwgB = static_cast<const FP_SHAPE*>( aSecond );
2166 
2167  if( dwgA->GetShape() != dwgB->GetShape() )
2168  return dwgA->GetShape() < dwgB->GetShape();
2169  }
2170 
2171  if( aFirst->m_Uuid != aSecond->m_Uuid ) // shopuld be always the case foer valid boards
2172  return aFirst->m_Uuid < aSecond->m_Uuid;
2173 
2174  return aFirst < aSecond;
2175 }
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
const KIID m_Uuid
Definition: eda_item.h:475
SHAPE_T GetShape() const
Definition: eda_shape.h:92
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:140
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:113

References BOARD_ITEM::GetLayer(), EDA_SHAPE::GetShape(), EDA_ITEM::m_Uuid, PCB_FP_SHAPE_T, and EDA_ITEM::Type().


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