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 157 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 368 of file pcb_shape.cpp.

370{
371 if( aFirst->Type() != aSecond->Type() )
372 return aFirst->Type() < aSecond->Type();
373
374 if( aFirst->GetLayer() != aSecond->GetLayer() )
375 return aFirst->GetLayer() < aSecond->GetLayer();
376
377 if( aFirst->Type() == PCB_SHAPE_T )
378 {
379 const PCB_SHAPE* dwgA = static_cast<const PCB_SHAPE*>( aFirst );
380 const PCB_SHAPE* dwgB = static_cast<const PCB_SHAPE*>( aSecond );
381
382 if( dwgA->GetShape() != dwgB->GetShape() )
383 return dwgA->GetShape() < dwgB->GetShape();
384 }
385
386 return aFirst->m_Uuid < aSecond->m_Uuid;
387}
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:180
const KIID m_Uuid
Definition: eda_item.h:492
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
SHAPE_T GetShape() const
Definition: eda_shape.h:113
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88

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: