37 [
this](
EDA_ITEM* aItem ) -> std::vector<TEXT_VAR_REF_KEY>
48 if( aItem && aItem->
IsType( { SCH_FIELD_T, SCH_SHEET_PIN_T, SCH_TABLECELL_T } ) )
57 std::vector<TEXT_VAR_REF_KEY> keys;
69 if( std::find( keys.begin(), keys.end(), key ) == keys.end() )
70 keys.push_back( key );
86 std::vector<TEXT_VAR_REF_KEY> keys =
collectKeys( aItem );
142 if( tracked == item )
168 std::set<SCH_SCREEN*> screens;
173 screens.insert( screen );
202 for(
SCH_ITEM* item : screen->Items() )
210 std::vector<TEXT_VAR_REF_KEY> out;
218 [&](
const wxString& aPrimary )
220 if( aPrimary.IsEmpty() )
227 if( std::find( out.begin(), out.end(), key ) == out.end() )
228 out.push_back( key );
238 addKey( sym->
GetRef( &aPath,
false ) );
239 addKey(
path.AsString() );
244 if( hierarchy.empty() )
256 if(
path.LastScreen() == parentScreen )
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
EDA_ITEM * GetParent() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
static SCH_ITEM * trackedItem(SCH_ITEM *aItem)
std::vector< TEXT_VAR_REF_KEY > ExtractSourceKeys(EDA_ITEM *aItem) const
Return the keys aItem could source as a cross-reference target.
void noteSheets(const std::vector< SCH_ITEM * > &aItems)
void OnSchItemsChanged(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override
void SyncToHierarchy()
Rebuild only if a sheet was added or removed, or the set of screens in the hierarchy differs from the...
std::vector< TEXT_VAR_REF_KEY > trackKeys(SCH_ITEM *aItem)
void registerItem(SCH_ITEM *aItem)
void handleItemChanged(SCH_ITEM *aItem)
SCHEMATIC_TEXT_VAR_ADAPTER(SCHEMATIC &aSchematic)
void OnSchItemsRemoved(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override
std::set< SCH_SCREEN * > m_indexedScreens
std::set< SCH_SCREEN * > hierarchyScreens() const
static std::vector< TEXT_VAR_REF_KEY > collectKeys(SCH_ITEM *aItem)
TEXT_VAR_TRACKER m_tracker
void RebuildIndex()
Walk every sheet in the hierarchy and register text-bearing items.
void OnSchItemsAdded(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aItems) override
std::unordered_set< SCH_ITEM * > m_registered
Holds all the data relating to one schematic.
Base class for any item which can be embedded within the SCHEMATIC container class,...
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction, RECURSE_MODE aMode)
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
Identifies a single resolvable source that a text item's ${...} reference depends on.
std::vector< TEXT_VAR_REF_KEY > FilterTrackable(const std::vector< TEXT_VAR_REF_KEY > &aRefs)
Filter aRefs down to the subset that should be registered in the index (drops OP and any future non-t...