SEARCH_RESULT -> INSPECT_RESULT

To fix the name squatting it's doing for future functionality
This commit is contained in:
Marek Roszko 2022-07-29 20:00:39 -04:00
parent f0b9e67212
commit a8505d9c76
33 changed files with 114 additions and 114 deletions

View File

@ -90,7 +90,7 @@ EDA_ITEM* EDA_ITEM::Clone() const
// see base_struct.h
// many classes inherit this method, be careful:
//TODO (snh): Fix this to use std::set instead of C-style vector
SEARCH_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
INSPECT_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{
#if 0 && defined(DEBUG)
std::cout << GetClass().mb_str() << ' ';
@ -98,11 +98,11 @@ SEARCH_RESULT EDA_ITEM::Visit( INSPECTOR inspector, void* testData, const KICAD_
if( IsType( scanTypes ) )
{
if( SEARCH_RESULT::QUIT == inspector( this, testData ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == inspector( this, testData ) )
return INSPECT_RESULT::QUIT;
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -115,7 +115,7 @@ const KICAD_T EE_COLLECTOR::FieldOwners[] = {
};
SEARCH_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData )
INSPECT_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData )
{
if( m_Unit || m_Convert )
{
@ -127,10 +127,10 @@ SEARCH_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData )
if( lib_item && lib_item->Type() != LIB_PIN_T )
{
if( m_Unit && lib_item->GetUnit() && lib_item->GetUnit() != m_Unit )
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
if( m_Convert && lib_item->GetConvert() && lib_item->GetConvert() != m_Convert )
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}
}
@ -142,7 +142,7 @@ SEARCH_RESULT EE_COLLECTOR::Inspect( EDA_ITEM* aItem, void* aTestData )
aItem->ClearFlags( SHOW_ELEC_TYPE );
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}
@ -180,7 +180,7 @@ void EE_COLLECTOR::Collect( LIB_ITEMS_CONTAINER& aItems, const KICAD_T aFilterLi
for( LIB_ITEM& item : aItems )
{
if( item.Visit( m_inspector, nullptr, m_scanTypes ) == SEARCH_RESULT::QUIT )
if( item.Visit( m_inspector, nullptr, m_scanTypes ) == INSPECT_RESULT::QUIT )
break;
}
}

View File

@ -69,7 +69,7 @@ public:
return nullptr;
}
SEARCH_RESULT Inspect( EDA_ITEM* aItem, void* aTestData ) override;
INSPECT_RESULT Inspect( EDA_ITEM* aItem, void* aTestData ) override;
/**
* Scan a #EDA_ITEM using this class's Inspector method which does the collection.

View File

@ -1235,7 +1235,7 @@ LIB_ITEM* LIB_SYMBOL::LocateDrawItem( int aUnit, int aConvert, KICAD_T aType,
}
SEARCH_RESULT LIB_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData,
INSPECT_RESULT LIB_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData,
const KICAD_T aFilterTypes[] )
{
// The part itself is never inspected, only its children
@ -1243,12 +1243,12 @@ SEARCH_RESULT LIB_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData,
{
if( item.IsType( aFilterTypes ) )
{
if( aInspector( &item, aTestData ) == SEARCH_RESULT::QUIT )
return SEARCH_RESULT::QUIT;
if( aInspector( &item, aTestData ) == INSPECT_RESULT::QUIT )
return INSPECT_RESULT::QUIT;
}
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -502,7 +502,7 @@ public:
LIB_ITEMS_CONTAINER& GetDrawItems() { return m_drawings; }
const LIB_ITEMS_CONTAINER& GetDrawItems() const { return m_drawings; }
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
/**
* Set the units per symbol count.

View File

@ -509,15 +509,15 @@ void SCH_LABEL_BASE::RunOnChildren( const std::function<void( SCH_ITEM* )>& aFun
}
SEARCH_RESULT SCH_LABEL_BASE::Visit( INSPECTOR aInspector, void* testData,
INSPECT_RESULT SCH_LABEL_BASE::Visit( INSPECTOR aInspector, void* testData,
const KICAD_T aFilterTypes[] )
{
KICAD_T stype;
if( IsType( aFilterTypes ) )
{
if( SEARCH_RESULT::QUIT == aInspector( this, nullptr ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( this, nullptr ) )
return INSPECT_RESULT::QUIT;
}
for( const KICAD_T* p = aFilterTypes; (stype = *p) != EOT; ++p )
@ -526,13 +526,13 @@ SEARCH_RESULT SCH_LABEL_BASE::Visit( INSPECTOR aInspector, void* testData,
{
for( SCH_FIELD& field : m_fields )
{
if( SEARCH_RESULT::QUIT == aInspector( &field, this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( &field, this ) )
return INSPECT_RESULT::QUIT;
}
}
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -119,7 +119,7 @@ public:
void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
VECTOR2I GetSchematicTextOffset( const RENDER_SETTINGS* aSettings ) const override;

View File

@ -945,7 +945,7 @@ std::vector<VECTOR2I> SCH_SHEET::GetConnectionPoints() const
}
SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICAD_T aFilterTypes[] )
INSPECT_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICAD_T aFilterTypes[] )
{
KICAD_T stype;
@ -954,8 +954,8 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICA
// If caller wants to inspect my type
if( stype == SCH_LOCATE_ANY_T || stype == Type() )
{
if( SEARCH_RESULT::QUIT == aInspector( this, nullptr ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( this, nullptr ) )
return INSPECT_RESULT::QUIT;
}
if( stype == SCH_LOCATE_ANY_T || stype == SCH_FIELD_T )
@ -963,8 +963,8 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICA
// Test the sheet fields.
for( SCH_FIELD& field : m_fields )
{
if( SEARCH_RESULT::QUIT == aInspector( &field, this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( &field, this ) )
return INSPECT_RESULT::QUIT;
}
}
@ -973,13 +973,13 @@ SEARCH_RESULT SCH_SHEET::Visit( INSPECTOR aInspector, void* testData, const KICA
// Test the sheet labels.
for( SCH_SHEET_PIN* sheetPin : m_pins )
{
if( SEARCH_RESULT::QUIT == aInspector( sheetPin, this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( sheetPin, this ) )
return INSPECT_RESULT::QUIT;
}
}
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -350,7 +350,7 @@ public:
std::vector<VECTOR2I> GetConnectionPoints() const override;
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
void RunOnChildren( const std::function<void( SCH_ITEM* )>& aFunction ) override;

View File

@ -1711,7 +1711,7 @@ wxString SCH_SYMBOL::GetSelectMenuText( EDA_UNITS aUnits ) const
}
SEARCH_RESULT SCH_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData,
INSPECT_RESULT SCH_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData,
const KICAD_T aFilterTypes[] )
{
KICAD_T stype;
@ -1722,42 +1722,42 @@ SEARCH_RESULT SCH_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData,
|| ( stype == SCH_SYMBOL_T )
|| ( stype == SCH_SYMBOL_LOCATE_POWER_T && m_part && m_part->IsPower() ) )
{
if( SEARCH_RESULT::QUIT == aInspector( this, aTestData ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
return INSPECT_RESULT::QUIT;
}
if( stype == SCH_LOCATE_ANY_T || stype == SCH_FIELD_T )
{
for( SCH_FIELD& field : m_fields )
{
if( SEARCH_RESULT::QUIT == aInspector( &field, (void*) this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( &field, (void*) this ) )
return INSPECT_RESULT::QUIT;
}
}
if( stype == SCH_FIELD_LOCATE_REFERENCE_T )
{
if( SEARCH_RESULT::QUIT == aInspector( GetField( REFERENCE_FIELD ), (void*) this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( GetField( REFERENCE_FIELD ), (void*) this ) )
return INSPECT_RESULT::QUIT;
}
if( stype == SCH_FIELD_LOCATE_VALUE_T
|| ( stype == SCH_SYMBOL_LOCATE_POWER_T && m_part && m_part->IsPower() ) )
{
if( SEARCH_RESULT::QUIT == aInspector( GetField( VALUE_FIELD ), (void*) this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( GetField( VALUE_FIELD ), (void*) this ) )
return INSPECT_RESULT::QUIT;
}
if( stype == SCH_FIELD_LOCATE_FOOTPRINT_T )
{
if( SEARCH_RESULT::QUIT == aInspector( GetField( FOOTPRINT_FIELD ), (void*) this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( GetField( FOOTPRINT_FIELD ), (void*) this ) )
return INSPECT_RESULT::QUIT;
}
if( stype == SCH_FIELD_LOCATE_DATASHEET_T )
{
if( SEARCH_RESULT::QUIT == aInspector( GetField( DATASHEET_FIELD ), (void*) this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( GetField( DATASHEET_FIELD ), (void*) this ) )
return INSPECT_RESULT::QUIT;
}
if( stype == SCH_LOCATE_ANY_T || stype == SCH_PIN_T )
@ -1775,13 +1775,13 @@ SEARCH_RESULT SCH_SYMBOL::Visit( INSPECTOR aInspector, void* aTestData,
if( pin_convert > 0 && pin_convert != GetConvert() )
continue;
if( SEARCH_RESULT::QUIT == aInspector( pin.get(), (void*) this ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( pin.get(), (void*) this ) )
return INSPECT_RESULT::QUIT;
}
}
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -630,7 +630,7 @@ public:
std::vector<VECTOR2I> GetConnectionPoints() const override;
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
/**
* Return the symbol library item at \a aPosition that is part of this symbol.

View File

@ -75,10 +75,10 @@ EDA_RECT GBR_LAYOUT::ComputeBoundingBox() const
}
SEARCH_RESULT GBR_LAYOUT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
INSPECT_RESULT GBR_LAYOUT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{
KICAD_T stype;
SEARCH_RESULT result = SEARCH_RESULT::CONTINUE;
INSPECT_RESULT result = INSPECT_RESULT::CONTINUE;
const KICAD_T* p = scanTypes;
bool done = false;
@ -102,7 +102,7 @@ SEARCH_RESULT GBR_LAYOUT::Visit( INSPECTOR inspector, void* testData, const KICA
result = gerber->Visit( inspector, testData, p );
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
}
@ -114,7 +114,7 @@ SEARCH_RESULT GBR_LAYOUT::Visit( INSPECTOR inspector, void* testData, const KICA
break;
}
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
}

View File

@ -78,7 +78,7 @@ public:
void SetBoundingBox( const EDA_RECT& aBox ) { m_BoundingBox = aBox; }
///< @copydoc EDA_ITEM::Visit()
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override { ShowDummy( os ); }

View File

@ -34,12 +34,12 @@ const KICAD_T GERBER_COLLECTOR::AllItems[] = {
* @param testData is not used here.
* @return SEARCH_QUIT if the iterator is to stop the scan, else SCAN_CONTINUE.
*/
SEARCH_RESULT GERBER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
INSPECT_RESULT GERBER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
{
if( testItem->HitTest( m_refPos ) )
Append( testItem );
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -70,7 +70,7 @@ public:
* @param testData is not used in this class.
* @return SEARCH_QUIT if the Iterator is to stop the scan else SCAN_CONTINUE.
*/
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
/**
* Scan an EDA_ITEM using this class's Inspector method, which does the collection.

View File

@ -996,7 +996,7 @@ double GERBER_DRAW_ITEM::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
}
SEARCH_RESULT GERBER_DRAW_ITEM::Visit( INSPECTOR inspector, void* testData,
INSPECT_RESULT GERBER_DRAW_ITEM::Visit( INSPECTOR inspector, void* testData,
const KICAD_T scanTypes[] )
{
KICAD_T stype = *scanTypes;
@ -1004,11 +1004,11 @@ SEARCH_RESULT GERBER_DRAW_ITEM::Visit( INSPECTOR inspector, void* testData,
// If caller wants to inspect my type
if( stype == Type() )
{
if( SEARCH_RESULT::QUIT == inspector( this, testData ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == inspector( this, testData ) )
return INSPECT_RESULT::QUIT;
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -231,7 +231,7 @@ public:
double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
///< @copydoc EDA_ITEM::Visit()
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
///< @copydoc EDA_ITEM::GetSelectMenuText()
virtual wxString GetSelectMenuText( EDA_UNITS aUnits ) const override;

View File

@ -405,10 +405,10 @@ void GERBER_FILE_IMAGE::RemoveAttribute( X2_ATTRIBUTE& aAttribute )
}
SEARCH_RESULT GERBER_FILE_IMAGE::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
INSPECT_RESULT GERBER_FILE_IMAGE::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{
KICAD_T stype;
SEARCH_RESULT result = SEARCH_RESULT::CONTINUE;
INSPECT_RESULT result = INSPECT_RESULT::CONTINUE;
const KICAD_T* p = scanTypes;
bool done = false;
@ -434,7 +434,7 @@ SEARCH_RESULT GERBER_FILE_IMAGE::Visit( INSPECTOR inspector, void* testData, con
break;
}
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
}

View File

@ -299,7 +299,7 @@ public:
void RemoveAttribute( X2_ATTRIBUTE& aAttribute );
///< @copydoc EDA_ITEM::Visit()
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
#if defined(DEBUG)

View File

@ -63,9 +63,9 @@ public:
virtual ~COLLECTOR() {}
virtual SEARCH_RESULT Inspect( EDA_ITEM* aItem, void* aTestData )
virtual INSPECT_RESULT Inspect( EDA_ITEM* aItem, void* aTestData )
{
return SEARCH_RESULT::QUIT;
return INSPECT_RESULT::QUIT;
};
using ITER = std::vector<EDA_ITEM*>::iterator;

View File

@ -38,7 +38,7 @@
enum class BITMAPS : unsigned int;
enum class SEARCH_RESULT
enum class INSPECT_RESULT
{
QUIT,
CONTINUE
@ -87,7 +87,7 @@ class MSG_PANEL_ITEM;
* @return A #SEARCH_RESULT type #SEARCH_QUIT if the iterator function is to
* stop the scan, else #SEARCH_CONTINUE;
*/
typedef std::function< SEARCH_RESULT ( EDA_ITEM* aItem, void* aTestData ) > INSPECTOR_FUNC;
typedef std::function< INSPECT_RESULT ( EDA_ITEM* aItem, void* aTestData ) > INSPECTOR_FUNC;
///< std::function passed to nested users by ref, avoids copying std::function.
typedef const INSPECTOR_FUNC& INSPECTOR;
@ -305,13 +305,13 @@ public:
* @return #SEARCH_RESULT SEARCH_QUIT if the Iterator is to stop the scan,
* else #SCAN_CONTINUE, and determined by the inspector.
*/
virtual SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] );
virtual INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] );
/**
* This changes first parameter to avoid the DList and use the main queue instead.
*/
template< class T >
static SEARCH_RESULT IterateForward( std::deque<T>& aList,
static INSPECT_RESULT IterateForward( std::deque<T>& aList,
INSPECTOR inspector,
void* testData,
const KICAD_T scanTypes[] )
@ -319,28 +319,28 @@ public:
for( auto it : aList )
{
if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
== SEARCH_RESULT::QUIT )
return SEARCH_RESULT::QUIT;
== INSPECT_RESULT::QUIT )
return INSPECT_RESULT::QUIT;
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}
/**
* Change first parameter to avoid the DList and use std::vector instead.
*/
template <class T>
static SEARCH_RESULT IterateForward(
static INSPECT_RESULT IterateForward(
std::vector<T>& aList, INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{
for( auto it : aList )
{
if( static_cast<EDA_ITEM*>( it )->Visit( inspector, testData, scanTypes )
== SEARCH_RESULT::QUIT )
return SEARCH_RESULT::QUIT;
== INSPECT_RESULT::QUIT )
return INSPECT_RESULT::QUIT;
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}
/**

View File

@ -161,7 +161,7 @@ public:
const EDA_RECT GetBoundingBox() const override;
///< @copydoc EDA_ITEM::Visit
SEARCH_RESULT Visit( INSPECTOR aInspector, void* aTestData,
INSPECT_RESULT Visit( INSPECTOR aInspector, void* aTestData,
const KICAD_T aScanTypes[] ) override;
///< @copydoc VIEW_ITEM::ViewGetLayers

View File

@ -333,7 +333,7 @@ void BOARD::Move( const VECTOR2I& aMoveVector ) // overload
// aMoveVector was snapshotted, don't need "data".
brd_item->Move( aMoveVector );
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
};
Visit( inspector, nullptr, top_level_board_stuff );
@ -351,7 +351,7 @@ TRACKS BOARD::TracksInNet( int aNetCode )
if( t->GetNetCode() == aNetCode )
ret.push_back( t );
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
};
// visit this BOARD's PCB_TRACKs and PCB_VIAs with above TRACK INSPECTOR which
@ -1266,10 +1266,10 @@ void BOARD::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>
}
SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
INSPECT_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{
KICAD_T stype;
SEARCH_RESULT result = SEARCH_RESULT::CONTINUE;
INSPECT_RESULT result = INSPECT_RESULT::CONTINUE;
const KICAD_T* p = scanTypes;
bool done = false;
@ -1391,7 +1391,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
{
result = marker->Visit( inspector, testData, p );
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
}
@ -1403,7 +1403,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
{
result = zone->Visit( inspector, testData, p );
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
}
@ -1420,7 +1420,7 @@ SEARCH_RESULT BOARD::Visit( INSPECTOR inspector, void* testData, const KICAD_T s
break;
}
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
}

View File

@ -763,7 +763,7 @@ public:
* @return SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE, and
* determined by the inspector.
*/
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
/**
* Search for a FOOTPRINT within this board with the given reference designator.

View File

@ -174,7 +174,7 @@ const KICAD_T GENERAL_COLLECTOR::DraggableItems[] = {
};
SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
INSPECT_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
{
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
FOOTPRINT* footprint = nullptr;
@ -613,7 +613,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
}
exit:
return SEARCH_RESULT::CONTINUE; // always when collecting
return INSPECT_RESULT::CONTINUE; // always when collecting
}
@ -645,13 +645,13 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const KICAD_T aScanList[],
}
SEARCH_RESULT PCB_TYPE_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
INSPECT_RESULT PCB_TYPE_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
{
// The Visit() function only visits the testItem if its type was in the
// the scanList, so therefore we can collect anything given to us here.
Append( testItem );
return SEARCH_RESULT::CONTINUE; // always when collecting
return INSPECT_RESULT::CONTINUE; // always when collecting
}
@ -663,14 +663,14 @@ void PCB_TYPE_COLLECTOR::Collect( BOARD_ITEM* aBoard, const KICAD_T aScanList[]
}
SEARCH_RESULT PCB_LAYER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
INSPECT_RESULT PCB_LAYER_COLLECTOR::Inspect( EDA_ITEM* testItem, void* testData )
{
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
if( item->IsOnLayer( m_layer_id ) )
Append( testItem );
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -331,7 +331,7 @@ public:
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE;
*/
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
/**
* Scan a BOARD_ITEM using this class's Inspector method, which does the collection.
@ -559,7 +559,7 @@ public:
* @param testData is not used in this class.
* @return SEARCH_QUIT if the Iterator is to stop the scan, else SCAN_CONTINUE;
*/
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
/**
* Collect #BOARD_ITEM objects using this class's Inspector method, which does the collection.
@ -594,7 +594,7 @@ public:
* @return SEARCH_RESULT - SEARCH_QUIT if the Iterator is to stop the scan,
* else SCAN_CONTINUE;
*/
SEARCH_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
INSPECT_RESULT Inspect( EDA_ITEM* testItem, void* testData ) override;
/**
* Test a BOARD_ITEM using this class's Inspector method, which does the collection.

View File

@ -1237,10 +1237,10 @@ void FOOTPRINT::Add3DModel( FP_3DMODEL* a3DModel )
// see footprint.h
SEARCH_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
INSPECT_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{
KICAD_T stype;
SEARCH_RESULT result = SEARCH_RESULT::CONTINUE;
INSPECT_RESULT result = INSPECT_RESULT::CONTINUE;
const KICAD_T* p = scanTypes;
bool done = false;
@ -1272,12 +1272,12 @@ SEARCH_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD
case PCB_FP_TEXT_T:
result = inspector( m_reference, testData );
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
result = inspector( m_value, testData );
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
// Intentionally fall through since m_Drawings can hold PCB_FP_SHAPE_T also
@ -1326,7 +1326,7 @@ SEARCH_RESULT FOOTPRINT::Visit( INSPECTOR inspector, void* testData, const KICAD
break;
}
if( result == SEARCH_RESULT::QUIT )
if( result == INSPECT_RESULT::QUIT )
break;
}

View File

@ -596,7 +596,7 @@ public:
*/
void Add3DModel( FP_3DMODEL* a3DModel );
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
wxString GetClass() const override
{

View File

@ -237,7 +237,7 @@ void PCB_BASE_EDIT_FRAME::unitsChangeRefresh()
view->Update( dimension );
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
};
board->Visit( inspector, nullptr, GENERAL_COLLECTOR::Dimensions );

View File

@ -233,19 +233,19 @@ const EDA_RECT PCB_GROUP::GetBoundingBox() const
}
SEARCH_RESULT PCB_GROUP::Visit( INSPECTOR aInspector, void* aTestData, const KICAD_T aScanTypes[] )
INSPECT_RESULT PCB_GROUP::Visit( INSPECTOR aInspector, void* aTestData, const KICAD_T aScanTypes[] )
{
for( const KICAD_T* stype = aScanTypes; *stype != EOT; ++stype )
{
// If caller wants to inspect my type
if( *stype == Type() )
{
if( SEARCH_RESULT::QUIT == aInspector( this, aTestData ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == aInspector( this, aTestData ) )
return INSPECT_RESULT::QUIT;
}
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -351,18 +351,18 @@ void PCB_VIA::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
// see class_track.h
SEARCH_RESULT PCB_TRACK::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
INSPECT_RESULT PCB_TRACK::Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] )
{
KICAD_T stype = *scanTypes;
// If caller wants to inspect my type
if( stype == Type() )
{
if( SEARCH_RESULT::QUIT == inspector( this, testData ) )
return SEARCH_RESULT::QUIT;
if( INSPECT_RESULT::QUIT == inspector( this, testData ) )
return INSPECT_RESULT::QUIT;
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
}

View File

@ -173,7 +173,7 @@ public:
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
SEARCH_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
INSPECT_RESULT Visit( INSPECTOR inspector, void* testData, const KICAD_T scanTypes[] ) override;
bool HitTest( const VECTOR2I& aPosition, int aAccuracy = 0 ) const override;
bool HitTest( const EDA_RECT& aRect, bool aContained, int aAccuracy = 0 ) const override;

View File

@ -2104,7 +2104,7 @@ void PCB_SELECTION_TOOL::RebuildSelection()
// Let selected parents handle their children.
if( parent && parent->IsSelected() )
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
highlight( item, SELECTED, &m_selection );
}
@ -2119,7 +2119,7 @@ void PCB_SELECTION_TOOL::RebuildSelection()
item->ClearFlags( ENTERED );
}
return SEARCH_RESULT::CONTINUE;
return INSPECT_RESULT::CONTINUE;
};
board()->Visit( inspector, nullptr, m_isFootprintEditor ? GENERAL_COLLECTOR::FootprintItems