KiCad PCB EDA Suite
BOARD::cmp_drawings Struct Reference

#include <board.h>

Public Member Functions

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

Detailed Description

Definition at line 1084 of file board.h.

Member Function Documentation

◆ operator()()

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

Definition at line 2148 of file board.cpp.

2150 {
2151  if( aFirst->Type() != aSecond->Type() )
2152  return aFirst->Type() < aSecond->Type();
2153 
2154  if( aFirst->GetLayer() != aSecond->GetLayer() )
2155  return aFirst->GetLayer() < aSecond->GetLayer();
2156 
2157  if( aFirst->Type() == PCB_SHAPE_T )
2158  {
2159  const PCB_SHAPE* shape = static_cast<const PCB_SHAPE*>( aFirst );
2160  const PCB_SHAPE* other = static_cast<const PCB_SHAPE*>( aSecond );
2161  return shape->Compare( other );
2162  }
2163  else if( aFirst->Type() == PCB_TEXT_T )
2164  {
2165  const PCB_TEXT* text = static_cast<const PCB_TEXT*>( aFirst );
2166  const PCB_TEXT* other = static_cast<const PCB_TEXT*>( aSecond );
2167  return text->Compare( other );
2168  }
2169 
2170  return aFirst->m_Uuid < aSecond->m_Uuid;
2171 }
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
int Compare(const EDA_SHAPE *aOther) const
Definition: eda_shape.cpp:1424
const KIID m_Uuid
Definition: eda_item.h:474
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:90
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:142
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:112

References EDA_SHAPE::Compare(), BOARD_ITEM::GetLayer(), EDA_ITEM::m_Uuid, PCB_SHAPE_T, PCB_TEXT_T, text, and EDA_ITEM::Type().


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