Browse Source

Performance tweaks.

master
Jeff Young 4 days ago
parent
commit
e84c94a557
  1. 7
      3d-viewer/3d_rendering/opengl/create_scene.cpp
  2. 13
      common/git/libgit_backend.cpp
  3. 2
      pcbnew/dialogs/dialog_footprint_properties.cpp
  4. 4
      pcbnew/dialogs/panel_fp_properties_3d_model.cpp
  5. 5
      pcbnew/exporters/exporter_vrml.cpp
  6. 3
      pcbnew/exporters/step/exporter_step.cpp

7
3d-viewer/3d_rendering/opengl/create_scene.cpp

@ -1027,6 +1027,8 @@ void RENDER_3D_OPENGL::load3dModels( REPORTER* aStatusReporter )
}
#endif
S3D_CACHE* cacheMgr = m_boardAdapter.Get3dCacheManager();
// Go for all footprints
for( const FOOTPRINT* footprint : m_boardAdapter.GetBoard()->Footprints() )
{
@ -1073,9 +1075,8 @@ void RENDER_3D_OPENGL::load3dModels( REPORTER* aStatusReporter )
embeddedFilesStack.push_back( footprint->GetEmbeddedFiles() );
embeddedFilesStack.push_back( m_boardAdapter.GetBoard()->GetEmbeddedFiles() );
const S3DMODEL* modelPtr = m_boardAdapter.Get3dCacheManager()->GetModel( fp_model.m_Filename,
footprintBasePath,
embeddedFilesStack );
const S3DMODEL* modelPtr = cacheMgr->GetModel( fp_model.m_Filename, footprintBasePath,
std::move( embeddedFilesStack ) );
// only add it if the return is not NULL
if( modelPtr )

13
common/git/libgit_backend.cpp

@ -408,16 +408,10 @@ std::map<wxString, FileStatus> LIBGIT_BACKEND::GetFileStatus( GIT_STATUS_HANDLER
{
const git_status_entry* entry = git_status_byindex( status_list, ii );
std::string path( entry->head_to_index ? entry->head_to_index->old_file.path
: entry->index_to_workdir->old_file.path );
: entry->index_to_workdir->old_file.path );
wxString absPath = repoWorkDir + path;
FileStatus fileStatus;
fileStatus.filePath = absPath;
fileStatus.gitStatus = entry->status;
fileStatus.status = aHandler->ConvertStatus( entry->status );
fileStatusMap[absPath] = fileStatus;
fileStatusMap[absPath] = FileStatus{ absPath, aHandler->ConvertStatus( entry->status ), entry->status };
}
return fileStatusMap;
@ -1014,8 +1008,7 @@ PullResult LIBGIT_BACKEND::handleFastForward( GIT_PULL_HANDLER* aHandler )
return PullResult::Error;
}
std::pair<std::string, std::vector<CommitDetails>>& branchCommits =
aHandler->m_fetchResults.emplace_back();
std::pair<std::string, std::vector<CommitDetails>>& branchCommits = aHandler->m_fetchResults.emplace_back();
branchCommits.first = currentBranchName;
git_oid commitOid;

2
pcbnew/dialogs/dialog_footprint_properties.cpp

@ -82,7 +82,7 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
embeddedFilesStack.push_back( m_embeddedFiles->GetLocalFiles() );
embeddedFilesStack.push_back( m_frame->GetBoard()->GetEmbeddedFiles() );
m_fields = new PCB_FIELDS_GRID_TABLE( m_frame, this, embeddedFilesStack );
m_fields = new PCB_FIELDS_GRID_TABLE( m_frame, this, std::move( embeddedFilesStack ) );
m_delayedErrorMessage = wxEmptyString;
m_delayedFocusGrid = nullptr;

4
pcbnew/dialogs/panel_fp_properties_3d_model.cpp

@ -441,7 +441,7 @@ void PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel( wxCommandEvent& )
embeddedFilesStack.push_back( m_filesPanel->GetLocalFiles() );
embeddedFilesStack.push_back( m_frame->GetBoard()->GetEmbeddedFiles() );
wxString fullPath = res->ResolvePath( model.m_Filename, footprintBasePath, embeddedFilesStack );
wxString fullPath = res->ResolvePath( model.m_Filename, footprintBasePath, std::move( embeddedFilesStack ) );
wxFileName fname( fullPath );
EMBEDDED_FILES::EMBEDDED_FILE* result = m_filesPanel->AddEmbeddedFile( fname.GetFullPath() ); ;
@ -591,7 +591,7 @@ MODEL_VALIDATE_ERRORS PANEL_FP_PROPERTIES_3D_MODEL::validateModelExists( const w
embeddedFilesStack.push_back( m_filesPanel->GetLocalFiles() );
embeddedFilesStack.push_back( m_frame->GetBoard()->GetEmbeddedFiles() );
wxString fullPath = resolv->ResolvePath( aFilename, footprintBasePath, embeddedFilesStack );
wxString fullPath = resolv->ResolvePath( aFilename, footprintBasePath, std::move( embeddedFilesStack ) );
if( fullPath.IsEmpty() )
return MODEL_VALIDATE_ERRORS::RESOLVE_FAIL;

5
pcbnew/exporters/exporter_vrml.cpp

@ -1049,7 +1049,8 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream
embeddedFilesStack.push_back( aFootprint->GetEmbeddedFiles() );
embeddedFilesStack.push_back( m_board->GetEmbeddedFiles() );
SGNODE* mod3d = (SGNODE*) m_Cache3Dmodels->Load( sM->m_Filename, footprintBasePath, embeddedFilesStack );
SGNODE* mod3d = (SGNODE*) m_Cache3Dmodels->Load( sM->m_Filename, footprintBasePath,
std::move( embeddedFilesStack ) );
/* Calculate 3D shape rotation:
* this is the rotation parameters, with an additional 180 deg rotation
@ -1113,7 +1114,7 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream
embeddedFilesStack.push_back( m_board->GetEmbeddedFiles() );
wxFileName srcFile = m_Cache3Dmodels->GetResolver()->ResolvePath( sM->m_Filename, footprintBasePath,
embeddedFilesStack );
std::move( embeddedFilesStack ) );
if( !srcFile.FileExists() ) {
// skip model where the file cannot be resolved
++sM;

3
pcbnew/exporters/step/exporter_step.cpp

@ -360,7 +360,8 @@ bool EXPORTER_STEP::buildFootprint3DShapes( FOOTPRINT* aFootprint, const VECTOR2
embeddedFilesStack.push_back( aFootprint->GetEmbeddedFiles() );
embeddedFilesStack.push_back( m_board->GetEmbeddedFiles() );
wxString mname = m_resolver->ResolvePath( fp_model.m_Filename, footprintBasePath, embeddedFilesStack );
wxString mname = m_resolver->ResolvePath( fp_model.m_Filename, footprintBasePath,
std::move( embeddedFilesStack ) );
if( mname.empty() || !wxFileName::FileExists( mname ) )
{

Loading…
Cancel
Save