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 1059 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 2103 of file board.cpp.

2105 {
2106  if( aFirst->Type() != aSecond->Type() )
2107  return aFirst->Type() < aSecond->Type();
2108 
2109  if( aFirst->GetLayer() != aSecond->GetLayer() )
2110  return aFirst->GetLayer() < aSecond->GetLayer();
2111 
2112  if( aFirst->Type() == PCB_SHAPE_T )
2113  {
2114  const PCB_SHAPE* shape = static_cast<const PCB_SHAPE*>( aFirst );
2115  const PCB_SHAPE* other = static_cast<const PCB_SHAPE*>( aSecond );
2116  return shape->Compare( other );
2117  }
2118  else if( aFirst->Type() == PCB_TEXT_T )
2119  {
2120  const PCB_TEXT* text = static_cast<const PCB_TEXT*>( aFirst );
2121  const PCB_TEXT* other = static_cast<const PCB_TEXT*>( aSecond );
2122  return text->Compare( other );
2123  }
2124 
2125  return aFirst->m_Uuid < aSecond->m_Uuid;
2126 }
class PCB_TEXT, text on a layer
Definition: typeinfo.h:91
int Compare(const EDA_SHAPE *aOther) const
Definition: eda_shape.cpp:1465
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:143
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: