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

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