KiCad PCB EDA Suite
gerber_file_image_list.cpp File Reference
#include <gerbview.h>
#include <gerbview_frame.h>
#include <gerber_file_image.h>
#include <gerber_file_image_list.h>
#include <X2_gerber_attributes.h>
#include <map>

Go to the source code of this file.

Functions

static bool sortZorder (const GERBER_FILE_IMAGE *const &ref, const GERBER_FILE_IMAGE *const &test)
 

Variables

GERBER_FILE_IMAGE_LIST s_GERBER_List
 

Function Documentation

◆ sortZorder()

static bool sortZorder ( const GERBER_FILE_IMAGE *const &  ref,
const GERBER_FILE_IMAGE *const &  test 
)
static

Definition at line 198 of file gerber_file_image_list.cpp.

199 {
200  if( !ref && !test )
201  return false; // do not change order: no criteria to sort items
202 
203  if( !ref || !ref->m_InUse )
204  return false; // Not used: ref ordered after
205 
206  if( !test || !test->m_InUse )
207  return true; // Not used: ref ordered before
208 
209  if( !ref->m_FileFunction && !test->m_FileFunction )
210  return false; // do not change order: no criteria to sort items
211 
212  if( !ref->m_FileFunction )
213  return false;
214 
215  if( !test->m_FileFunction )
216  return true;
217 
218  if( ref->m_FileFunction->GetZOrder() != test->m_FileFunction->GetZOrder() )
219  return ref->m_FileFunction->GetZOrder() > test->m_FileFunction->GetZOrder();
220 
221  return ref->m_FileFunction->GetZSubOrder() > test->m_FileFunction->GetZSubOrder();
222 }
X2_ATTRIBUTE_FILEFUNCTION * m_FileFunction
int GetZSubOrder()
the Order of the bdr copper layer, from front (Top) side to back (Bot) side
int GetZOrder()
the Order of the board layer, from front (Top) side to back (Bot) side

References X2_ATTRIBUTE_FILEFUNCTION::GetZOrder(), X2_ATTRIBUTE_FILEFUNCTION::GetZSubOrder(), GERBER_FILE_IMAGE::m_FileFunction, and GERBER_FILE_IMAGE::m_InUse.

Referenced by GERBER_FILE_IMAGE_LIST::SortImagesByZOrder().

Variable Documentation

◆ s_GERBER_List

GERBER_FILE_IMAGE_LIST s_GERBER_List

Definition at line 40 of file gerber_file_image_list.cpp.

Referenced by GERBER_FILE_IMAGE_LIST::GetImagesList().