|
KiCad PCB EDA Suite
|
An index of STEP-family model files keyed by normalised filename stem. More...
#include <model_substitution_helpers.h>
Public Member Functions | |
| void | Build (const wxString &aProjectPath, const FILENAME_RESOLVER *aResolver) |
Walk the resolver's search paths, the project's 3dshapes/ subdirectory, and the user's COMMON_SETTINGS::m_Extra3DSearchDirs collecting every STEP-family file (.step, .stp, .stpz, .step.gz, .stp.gz, .iges, .igs) indexed by normalised stem. | |
| wxString | FindMatchFor (const wxString &aMissingWrl) const |
| Look up the best STEP-family replacement for a missing WRL reference. | |
| bool | Empty () const |
Private Attributes | |
| std::unordered_map< wxString, std::vector< wxString > > | m_byStem |
| Normalised stem → list of absolute STEP-family paths sharing that stem. | |
An index of STEP-family model files keyed by normalised filename stem.
The catalog is built by walking the 3D search paths once and is then consulted many times to resolve missing WRL references without re-walking the filesystem per lookup.
Definition at line 52 of file model_substitution_helpers.h.
| void MODEL_SUBSTITUTION::STEP_CATALOG::Build | ( | const wxString & | aProjectPath, |
| const FILENAME_RESOLVER * | aResolver ) |
Walk the resolver's search paths, the project's 3dshapes/ subdirectory, and the user's COMMON_SETTINGS::m_Extra3DSearchDirs collecting every STEP-family file (.step, .stp, .stpz, .step.gz, .stp.gz, .iges, .igs) indexed by normalised stem.
Safe to call multiple times; each call rebuilds the index.
| aProjectPath | is the project directory used to locate a local 3dshapes/ tree; may be empty. |
| aResolver | provides the list of standard search paths. May be null, in which case only the project path and common settings extra directories are scanned. |
Definition at line 196 of file model_substitution_helpers.cpp.
References m_byStem.
Referenced by DIALOG_MIGRATE_3D_MODELS::AutoMigrateByFilename().
|
inline |
Definition at line 83 of file model_substitution_helpers.h.
References m_byStem.
| wxString MODEL_SUBSTITUTION::STEP_CATALOG::FindMatchFor | ( | const wxString & | aMissingWrl | ) | const |
Look up the best STEP-family replacement for a missing WRL reference.
When multiple catalog entries share the same stem, prefer one whose parent-directory basename matches the parent directory of aMissingWrl (e.g. both sit in Resistor_SMD.3dshapes).
| aMissingWrl | is the original (unresolved) .wrl / .wrz filename, possibly with ${VAR} aliases intact. |
Definition at line 221 of file model_substitution_helpers.cpp.
References MODEL_SUBSTITUTION::IsWrlExtension(), and m_byStem.
Referenced by DIALOG_MIGRATE_3D_MODELS::AutoMigrateByFilename().
|
private |
Normalised stem → list of absolute STEP-family paths sharing that stem.
Definition at line 87 of file model_substitution_helpers.h.
Referenced by Build(), Empty(), and FindMatchFor().