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 1132 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 2220 of file board.cpp.

2222{
2223 if( aFirst->Type() != aSecond->Type() )
2224 return aFirst->Type() < aSecond->Type();
2225
2226 if( aFirst->GetLayer() != aSecond->GetLayer() )
2227 return aFirst->GetLayer() < aSecond->GetLayer();
2228
2229 if( aFirst->Type() == PCB_SHAPE_T )
2230 {
2231 const PCB_SHAPE* shape = static_cast<const PCB_SHAPE*>( aFirst );
2232 const PCB_SHAPE* other = static_cast<const PCB_SHAPE*>( aSecond );
2233 return shape->Compare( other );
2234 }
2235 else if( aFirst->Type() == PCB_TEXT_T )
2236 {
2237 const PCB_TEXT* text = static_cast<const PCB_TEXT*>( aFirst );
2238 const PCB_TEXT* other = static_cast<const PCB_TEXT*>( aSecond );
2239 return text->Compare( other );
2240 }
2241 else if( aFirst->Type() == PCB_TEXTBOX_T )
2242 {
2243 const PCB_TEXTBOX* textbox = static_cast<const PCB_TEXTBOX*>( aFirst );
2244 const PCB_TEXTBOX* other = static_cast<const PCB_TEXTBOX*>( aSecond );
2245
2246 return textbox->PCB_SHAPE::Compare( other ) && textbox->EDA_TEXT::Compare( other );
2247 }
2248
2249 return aFirst->m_Uuid < aSecond->m_Uuid;
2250}
virtual PCB_LAYER_ID GetLayer() const
Return the primary layer this item is on.
Definition: board_item.h:192
const KIID m_Uuid
Definition: eda_item.h:492
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
int Compare(const EDA_SHAPE *aOther) const
Definition: eda_shape.cpp:1508
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition: typeinfo.h:91
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition: typeinfo.h:90

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


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