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 716 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 2171 of file footprint.cpp.

2173 {
2174  if( aFirst->Type() != aSecond->Type() )
2175  return aFirst->Type() < aSecond->Type();
2176 
2177  if( aFirst->GetLayer() != aSecond->GetLayer() )
2178  return aFirst->GetLayer() < aSecond->GetLayer();
2179 
2180  if( aFirst->Type() == PCB_FP_SHAPE_T )
2181  {
2182  const FP_SHAPE* dwgA = static_cast<const FP_SHAPE*>( aFirst );
2183  const FP_SHAPE* dwgB = static_cast<const FP_SHAPE*>( aSecond );
2184 
2185  if( dwgA->GetShape() != dwgB->GetShape() )
2186  return dwgA->GetShape() < dwgB->GetShape();
2187  }
2188 
2189  if( aFirst->m_Uuid != aSecond->m_Uuid ) // shopuld be always the case foer valid boards
2190  return aFirst->m_Uuid < aSecond->m_Uuid;
2191 
2192  return aFirst < aSecond;
2193 }
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:93
const KIID m_Uuid
Definition: eda_item.h:474
SHAPE_T GetShape() const
Definition: eda_shape.h:101
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:143
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

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: