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 207 of file gerber_file_image_list.cpp.

208 {
209  if( !ref && !test )
210  return false; // do not change order: no criteria to sort items
211 
212  if( !ref || !ref->m_InUse )
213  return false; // Not used: ref ordered after
214 
215  if( !test || !test->m_InUse )
216  return true; // Not used: ref ordered before
217 
218  if( !ref->m_FileFunction && !test->m_FileFunction )
219  return false; // do not change order: no criteria to sort items
220 
221  if( !ref->m_FileFunction )
222  return false;
223 
224  if( !test->m_FileFunction )
225  return true;
226 
227  if( ref->m_FileFunction->GetZOrder() != test->m_FileFunction->GetZOrder() )
228  return ref->m_FileFunction->GetZOrder() > test->m_FileFunction->GetZOrder();
229 
230  return ref->m_FileFunction->GetZSubOrder() > test->m_FileFunction->GetZSubOrder();
231 }
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().