KiCad PCB EDA Suite
class_gerber_file_image_list.cpp File Reference
#include <fctsys.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <class_gerber_file_image.h>
#include <class_gerber_file_image_list.h>
#include <class_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

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

Definition at line 201 of file class_gerber_file_image_list.cpp.

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().

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

Variable Documentation