KiCad PCB EDA Suite
Loading...
Searching...
No Matches
drc_test_provider_library_parity.cpp File Reference
#include <kiway.h>
#include <macros.h>
#include <netlist_reader/pcb_netlist.h>
#include <fp_lib_table.h>
#include <board.h>
#include <pcb_shape.h>
#include <zone.h>
#include <footprint.h>
#include <pad.h>
#include <drc/drc_engine.h>
#include <drc/drc_item.h>
#include <drc/drc_test_provider.h>
#include <project_pcb.h>

Go to the source code of this file.

Classes

class  DRC_TEST_PROVIDER_LIBRARY_PARITY
 

Namespaces

namespace  detail
 

Macros

#define TEST(a, b, msg)
 
#define EPSILON   1
 
#define TEST_PT(a, b, msg)
 
#define EPSILON_D   0.000001
 
#define TEST_D(a, b, msg)
 
#define ITEM_DESC(item)   ( item )->GetItemDescription( &g_unitsProvider )
 
#define PAD_DESC(pad)   wxString::Format( _( "Pad %s" ), ( pad )->GetNumber() )
 
#define REPORT_MSG(s, p)   aReporter.Report( wxString::Format( s, p ) )
 
#define TEST_ATTR(a, b, attr, msg)   TEST( ( a & attr ), ( b & attr ), msg )
 
#define REPORT(msg)   { if( aReporter ) aReporter->Report( msg ); }
 
#define CHECKPOINT   { if( diff && !aReporter ) return diff; }
 

Functions

bool primitiveNeedsUpdate (const std::shared_ptr< PCB_SHAPE > &a, const std::shared_ptr< PCB_SHAPE > &b)
 
bool padHasOverrides (const PAD *a, const PAD *b, REPORTER &aReporter)
 
bool padNeedsUpdate (const PAD *a, const PAD *b, REPORTER *aReporter)
 
bool shapeNeedsUpdate (const PCB_SHAPE &curr_shape, const PCB_SHAPE &ref_shape)
 
bool zoneNeedsUpdate (const ZONE *a, const ZONE *b, REPORTER *aReporter)
 

Variables

UNITS_PROVIDER g_unitsProvider (pcbIUScale, EDA_UNITS::MILLIMETRES)
 
static DRC_REGISTER_TEST_PROVIDER< DRC_TEST_PROVIDER_LIBRARY_PARITYdetail::dummy
 

Macro Definition Documentation

◆ CHECKPOINT

#define CHECKPOINT   { if( diff && !aReporter ) return diff; }

◆ EPSILON

#define EPSILON   1

Definition at line 91 of file drc_test_provider_library_parity.cpp.

◆ EPSILON_D

#define EPSILON_D   0.000001

Definition at line 107 of file drc_test_provider_library_parity.cpp.

◆ ITEM_DESC

#define ITEM_DESC (   item)    ( item )->GetItemDescription( &g_unitsProvider )

Definition at line 122 of file drc_test_provider_library_parity.cpp.

◆ PAD_DESC

#define PAD_DESC (   pad)    wxString::Format( _( "Pad %s" ), ( pad )->GetNumber() )

Definition at line 123 of file drc_test_provider_library_parity.cpp.

◆ REPORT

#define REPORT (   msg)    { if( aReporter ) aReporter->Report( msg ); }

◆ REPORT_MSG

#define REPORT_MSG (   s,
 
)    aReporter.Report( wxString::Format( s, p ) )

◆ TEST

#define TEST (   a,
  b,
  msg 
)
Value:
do { \
if( a != b ) \
{ \
diff = true; \
\
if( aReporter && wxString( msg ).length() ) \
aReporter->Report( msg ); \
} \
\
if( diff && !aReporter ) \
return diff; \
} while (0)

Definition at line 77 of file drc_test_provider_library_parity.cpp.

◆ TEST_ATTR

#define TEST_ATTR (   a,
  b,
  attr,
  msg 
)    TEST( ( a & attr ), ( b & attr ), msg )

◆ TEST_D

#define TEST_D (   a,
  b,
  msg 
)
Value:
do { \
if( abs( a - b ) > EPSILON_D ) \
{ \
diff = true; \
\
if( aReporter && wxString( msg ).length() ) \
aReporter->Report( msg ); \
} \
\
if( diff && !aReporter ) \
return diff; \
} while (0)

Definition at line 108 of file drc_test_provider_library_parity.cpp.

◆ TEST_PT

#define TEST_PT (   a,
  b,
  msg 
)
Value:
do { \
if( abs( a.x - b.x ) > EPSILON \
|| abs( a.y - b.y ) > EPSILON ) \
{ \
diff = true; \
\
if( aReporter && wxString( msg ).length() ) \
aReporter->Report( msg ); \
} \
\
if( diff && !aReporter ) \
return diff; \
} while (0)

Definition at line 92 of file drc_test_provider_library_parity.cpp.

Function Documentation

◆ padHasOverrides()

◆ padNeedsUpdate()

◆ primitiveNeedsUpdate()

bool primitiveNeedsUpdate ( const std::shared_ptr< PCB_SHAPE > &  a,
const std::shared_ptr< PCB_SHAPE > &  b 
)

◆ shapeNeedsUpdate()

◆ zoneNeedsUpdate()

Variable Documentation

◆ g_unitsProvider