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

192 {
193  if( !ref && !test )
194  return false; // do not change order: no criteria to sort items
195 
196  if( !ref || !ref->m_InUse )
197  return false; // Not used: ref ordered after
198 
199  if( !test || !test->m_InUse )
200  return true; // Not used: ref ordered before
201 
202  if( !ref->m_FileFunction && !test->m_FileFunction )
203  return false; // do not change order: no criteria to sort items
204 
205  if( !ref->m_FileFunction )
206  return false;
207 
208  if( !test->m_FileFunction )
209  return true;
210 
211  if( ref->m_FileFunction->GetZOrder() != test->m_FileFunction->GetZOrder() )
212  return ref->m_FileFunction->GetZOrder() > test->m_FileFunction->GetZOrder();
213 
214  return ref->m_FileFunction->GetZSubOrder() > test->m_FileFunction->GetZSubOrder();
215 }
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