KiCad PCB EDA Suite
PCB_SHAPE::cmp_drawings Struct Reference

#include <pcb_shape.h>

Public Member Functions

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

Detailed Description

Definition at line 149 of file pcb_shape.h.

Member Function Documentation

◆ operator()()

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

Definition at line 214 of file pcb_shape.cpp.

216 {
217  if( aFirst->Type() != aSecond->Type() )
218  return aFirst->Type() < aSecond->Type();
219 
220  if( aFirst->GetLayer() != aSecond->GetLayer() )
221  return aFirst->GetLayer() < aSecond->GetLayer();
222 
223  if( aFirst->Type() == PCB_SHAPE_T )
224  {
225  const PCB_SHAPE* dwgA = static_cast<const PCB_SHAPE*>( aFirst );
226  const PCB_SHAPE* dwgB = static_cast<const PCB_SHAPE*>( aSecond );
227 
228  if( dwgA->GetShape() != dwgB->GetShape() )
229  return dwgA->GetShape() < dwgB->GetShape();
230  }
231 
232  return aFirst->m_Uuid < aSecond->m_Uuid;
233 }
const KIID m_Uuid
Definition: eda_item.h:474
SHAPE_T GetShape() const
Definition: eda_shape.h:101
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 BOARD_ITEM::GetLayer(), EDA_SHAPE::GetShape(), EDA_ITEM::m_Uuid, PCB_SHAPE_T, and EDA_ITEM::Type().


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