Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a9ca49a600 | |||
| a34e7c9def | |||
| 0d1748c91c |
@@ -54,15 +54,6 @@ common/pcb_keywords.cpp
|
||||
include/pcb_lexer.h
|
||||
fp-info-cache
|
||||
|
||||
# .md generated files
|
||||
eeschema/dialogs/dialog_bom_help_md.h
|
||||
pcb_calculator/attenuators/bridget_tee_formula.h
|
||||
pcb_calculator/attenuators/pi_formula.h
|
||||
pcb_calculator/attenuators/splitter_formula.h
|
||||
pcb_calculator/attenuators/tee_formula.h
|
||||
pcb_calculator/eserie_help.h
|
||||
pcb_calculator/tracks_width_versus_current_formula.h
|
||||
|
||||
# demo project auxiliary files
|
||||
demos/**/*-bak
|
||||
demos/**/_autosave-*
|
||||
|
||||
@@ -43,4 +43,3 @@ include:
|
||||
- local: '/.gitlab/Windows-CI.yml'
|
||||
- local: '/.gitlab/coverity.yml'
|
||||
- local: '/.gitlab/linux-metadata-validate.yml'
|
||||
- local: '/.gitlab/doxygen.yml'
|
||||
|
||||
+14
-88
@@ -1,12 +1,8 @@
|
||||
##########################################################################
|
||||
# Build KiCad on Fedora and save the results
|
||||
##########################################################################
|
||||
.fedora_build_linux_base:
|
||||
fedora_build_linux:
|
||||
stage: build
|
||||
# Don't tag until we have separate CI for MRs
|
||||
# tags:
|
||||
# - kicad-fedora
|
||||
image: registry.gitlab.com/kicad/kicad-ci/source_containers/master/fedora:34
|
||||
extends: .only_code
|
||||
interruptible: false
|
||||
cache:
|
||||
@@ -22,14 +18,14 @@
|
||||
- mkdir -p build/linux
|
||||
- cd build/linux
|
||||
- cmake
|
||||
-G Ninja
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
-DKICAD_BUILD_I18N=ON
|
||||
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON
|
||||
../../
|
||||
- ninja 2>&1 | tee compilation_log.txt
|
||||
- make 2>&1 | tee compilation_log.txt
|
||||
- cd ../../
|
||||
artifacts:
|
||||
# Only save the artifacts that are needed for running the tests in the next stage
|
||||
@@ -43,31 +39,15 @@
|
||||
- build/linux/pcbnew/_pcbnew.so
|
||||
- build/linux/qa/
|
||||
- build/linux/compilation_log.txt
|
||||
exclude:
|
||||
- build/linux/**/*.o
|
||||
- build/linux/**/*.a
|
||||
|
||||
# This split is to ensure we can always use our runner for our jobs
|
||||
fedora_build_linux_kicad:
|
||||
extends: .fedora_build_linux_base
|
||||
tags:
|
||||
- kicad-fedora
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
fedora_build_linux_public:
|
||||
extends: .fedora_build_linux_base
|
||||
except:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
|
||||
# Upload the compilation log in an easily downloadable form
|
||||
.fedora_report_build_warn:
|
||||
fedora_report_build_warn:
|
||||
stage: report
|
||||
extends: .only_code
|
||||
when: always
|
||||
needs:
|
||||
- job: fedora_build_linux
|
||||
artifacts: true
|
||||
script:
|
||||
- echo "Uploading compilation log"
|
||||
- cp build/linux/compilation_log.txt compilation_log.txt
|
||||
@@ -78,32 +58,14 @@ fedora_build_linux_public:
|
||||
paths:
|
||||
- compilation_log.txt
|
||||
|
||||
fedora_report_build_warn_kicad:
|
||||
extends: .fedora_report_build_warn
|
||||
tags:
|
||||
- kicad-fedora
|
||||
needs:
|
||||
- job: fedora_build_linux_kicad
|
||||
artifacts: true
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
fedora_report_build_warn_public:
|
||||
extends: .fedora_report_build_warn
|
||||
needs:
|
||||
- job: fedora_build_linux_public
|
||||
artifacts: true
|
||||
except:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
|
||||
# Report on the metrics of the code
|
||||
.fedora_report_metrics:
|
||||
fedora_report_metrics:
|
||||
stage: report
|
||||
extends: .only_code
|
||||
when: always
|
||||
needs:
|
||||
- job: fedora_build_linux
|
||||
artifacts: true
|
||||
script:
|
||||
- cat build/linux/compilation_log.txt | { grep "warning:" || test $? = 1; } | awk 'END{print "number_of_fedora_warnings "NR}' > metrics.txt
|
||||
- cat metrics.txt
|
||||
@@ -111,30 +73,11 @@ fedora_report_build_warn_public:
|
||||
reports:
|
||||
metrics: metrics.txt
|
||||
|
||||
fedora_report_metrics_kicad:
|
||||
extends: .fedora_report_metrics
|
||||
tags:
|
||||
- kicad-fedora
|
||||
needs:
|
||||
- job: fedora_build_linux_kicad
|
||||
artifacts: true
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
fedora_report_metrics_public:
|
||||
extends: .fedora_report_metrics
|
||||
needs:
|
||||
- job: fedora_build_linux_public
|
||||
artifacts: true
|
||||
except:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
##########################################################################
|
||||
# Run the code unit tests.
|
||||
##########################################################################
|
||||
.fedora_qa:
|
||||
fedora_qa:
|
||||
extends:
|
||||
- .unit_test
|
||||
- .only_code
|
||||
@@ -142,23 +85,6 @@ fedora_report_metrics_public:
|
||||
matrix:
|
||||
# The name of the test without the qa_ prefix
|
||||
- TEST: [python, common, gerbview, pcbnew, eeschema, kimath, sexpr, kicad2step]
|
||||
|
||||
fedora_qa_kicad:
|
||||
extends: .fedora_qa
|
||||
tags:
|
||||
- kicad-fedora
|
||||
needs:
|
||||
- job: fedora_build_linux_kicad
|
||||
- job: fedora_build_linux
|
||||
artifacts: true
|
||||
only:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
fedora_qa_public:
|
||||
extends: .fedora_qa
|
||||
needs:
|
||||
- job: fedora_build_linux_public
|
||||
artifacts: true
|
||||
except:
|
||||
variables:
|
||||
- $CI_PROJECT_ROOT_NAMESPACE == "kicad"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
##########################################################################
|
||||
# Build KiCad on Ubuntu 20.04 and save the results
|
||||
##########################################################################
|
||||
.ubuntu20.04_build:
|
||||
ubuntu20.04_build:
|
||||
stage: build
|
||||
tags:
|
||||
- kicad-ubuntu20.04
|
||||
@@ -30,7 +30,12 @@
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_SCRIPTING=ON
|
||||
-DKICAD_SCRIPTING_MODULES=ON
|
||||
-DKICAD_SCRIPTING_PYTHON3=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
|
||||
-DKICAD_SCRIPTING_ACTION_MENU=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
-DKICAD_BUILD_I18N=ON
|
||||
@@ -52,7 +57,7 @@
|
||||
- build/linux/compilation_log.txt
|
||||
|
||||
# Upload the compilation log in an easily downloadable form
|
||||
.ubuntu20.04_report_build_warn:
|
||||
ubuntu20.04_report_build_warn:
|
||||
stage: report
|
||||
when: always
|
||||
only:
|
||||
@@ -74,7 +79,7 @@
|
||||
- compilation_log.txt
|
||||
|
||||
# Report on the metrics of the code
|
||||
.ubuntu20.04_report_metrics:
|
||||
ubuntu20.04_report_metrics:
|
||||
stage: report
|
||||
when: always
|
||||
only:
|
||||
@@ -95,7 +100,7 @@
|
||||
##########################################################################
|
||||
# Run the code unit tests.
|
||||
##########################################################################
|
||||
.ubuntu20.04_qa:
|
||||
ubuntu20.04_qa:
|
||||
extends:
|
||||
- .unit_test
|
||||
needs:
|
||||
|
||||
+7
-13
@@ -7,29 +7,23 @@ win64_build:
|
||||
- kicad-windows-1809
|
||||
extends: .only_code
|
||||
interruptible: false
|
||||
image: registry.gitlab.com/kicad/kicad-ci/windows-build-image/win1809-msvc:latest
|
||||
variables:
|
||||
VCPKG_BINARY_SOURCES: 'nuget,kicad,readwrite'
|
||||
cache:
|
||||
key: win64-vcpkg-"$CI_COMMIT_REF_SLUG"
|
||||
paths:
|
||||
- build\windows\vcpkg_installed
|
||||
- .vcpkgCache
|
||||
image: registry.gitlab.com/kicad/kicad-ci/source_containers/win64:msvc1809
|
||||
only:
|
||||
- branches@kicad/code/kicad
|
||||
- tags@kicad/code/kicad
|
||||
script:
|
||||
- C:\builder\build.ps1 -Env -Arch x64
|
||||
- $vcpkgCache=Join-Path -Path (Get-Location) -ChildPath ".vcpkgCache";$env:VCPKG_DEFAULT_BINARY_CACHE=$vcpkgCache;New-Item -ItemType Directory -Force -Path $vcpkgCache
|
||||
- nuget.exe sources add -Name kicad -Source "https://nuget.kicad.org:443/v3/index.json"
|
||||
- nuget.exe setapikey $env:KICAD_NUGET_KEY -Source "https://nuget.kicad.org:443/v3/index.json"
|
||||
- mkdir -p build/windows -Force
|
||||
- cd build/windows
|
||||
- cmake `
|
||||
-G "Ninja" `
|
||||
-DCMAKE_TOOLCHAIN_FILE=C:\builder\vcpkg\scripts\buildsystems\vcpkg.cmake `
|
||||
-DCMAKE_TOOLCHAIN_FILE=C:\build\vcpkg\scripts\buildsystems\vcpkg.cmake `
|
||||
-DCMAKE_BUILD_TYPE=Debug `
|
||||
-DKICAD_SCRIPTING=OFF `
|
||||
-DKICAD_SCRIPTING_MODULES=OFF `
|
||||
-DKICAD_SCRIPTING_PYTHON3=OFF `
|
||||
-DKICAD_SCRIPTING_WXPYTHON=OFF `
|
||||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF `
|
||||
-DKICAD_SCRIPTING_ACTION_MENU=OFF `
|
||||
-DKICAD_USE_OCC=ON `
|
||||
-DKICAD_SPICE=ON `
|
||||
-DKICAD_BUILD_PNS_DEBUG_TOOL=ON `
|
||||
|
||||
@@ -59,7 +59,12 @@ Coverity:
|
||||
- cmake
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_SCRIPTING=ON
|
||||
-DKICAD_SCRIPTING_MODULES=ON
|
||||
-DKICAD_SCRIPTING_PYTHON3=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
|
||||
-DKICAD_SCRIPTING_ACTION_MENU=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
- coverity/bin/cov-build --dir cov-int make -j8
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
build_doxygen_docker:
|
||||
image: docker:stable
|
||||
services:
|
||||
- docker:dind
|
||||
stage: build
|
||||
tags:
|
||||
- docker
|
||||
before_script:
|
||||
- docker info
|
||||
- docker login -u gitlab-ci-token -p "$CI_BUILD_TOKEN" "$CI_REGISTRY"
|
||||
script:
|
||||
- docker build -t "${CI_REGISTRY_IMAGE}/doxygen:$CI_COMMIT_BRANCH" -f ./Documentation/doxygen.Dockerfile .
|
||||
- docker push "${CI_REGISTRY_IMAGE}/doxygen:$CI_COMMIT_BRANCH"
|
||||
only:
|
||||
refs:
|
||||
- schedules
|
||||
variables:
|
||||
- $SCHEDULED_JOB_NAME == "doxygen"
|
||||
@@ -30,7 +30,12 @@ validate_linux_metadata:
|
||||
- cmake
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DKICAD_STDLIB_LIGHT_DEBUG=ON
|
||||
-DKICAD_SCRIPTING=ON
|
||||
-DKICAD_SCRIPTING_MODULES=ON
|
||||
-DKICAD_SCRIPTING_PYTHON3=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON=ON
|
||||
-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
|
||||
-DKICAD_SCRIPTING_ACTION_MENU=ON
|
||||
-DKICAD_USE_OCC=ON
|
||||
-DKICAD_SPICE=ON
|
||||
-DKICAD_BUILD_I18N=ON
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <wx/datetime.h>
|
||||
#include <wx/dir.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/stdpaths.h>
|
||||
|
||||
@@ -54,7 +55,6 @@
|
||||
#include <project.h>
|
||||
#include <settings/common_settings.h>
|
||||
#include <settings/settings_manager.h>
|
||||
#include <wx_filename.h>
|
||||
|
||||
|
||||
#define MASK_3D_CACHE "3D_CACHE"
|
||||
@@ -165,7 +165,7 @@ void S3D_CACHE_ENTRY::SetSHA1( const unsigned char* aSHA1Sum )
|
||||
{
|
||||
if( nullptr == aSHA1Sum )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE, wxT( "%s:%s:%d\n * [BUG] NULL passed for aSHA1Sum" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] NULL passed for aSHA1Sum",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return;
|
||||
@@ -194,13 +194,12 @@ S3D_CACHE::S3D_CACHE()
|
||||
|
||||
S3D_CACHE::~S3D_CACHE()
|
||||
{
|
||||
COMMON_SETTINGS* commonSettings = Pgm().GetCommonSettings();
|
||||
|
||||
FlushCache();
|
||||
|
||||
// We'll delete ".3dc" cache files older than this many days
|
||||
int clearCacheInterval = 0;
|
||||
|
||||
if( Pgm().GetCommonSettings() )
|
||||
clearCacheInterval = Pgm().GetCommonSettings()->m_System.clear_3d_cache_interval;
|
||||
int clearCacheInterval = commonSettings->m_System.clear_3d_cache_interval;
|
||||
|
||||
// An interval of zero means the user doesn't want to ever clear the cache
|
||||
|
||||
@@ -222,7 +221,7 @@ SCENEGRAPH* S3D_CACHE::load( const wxString& aModelFile, S3D_CACHE_ENTRY** aCach
|
||||
if( full3Dpath.empty() )
|
||||
{
|
||||
// the model cannot be found; we cannot proceed
|
||||
wxLogTrace( MASK_3D_CACHE, wxT( "%s:%s:%d\n * [3D model] could not find model '%s'\n" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [3D model] could not find model '%s'\n",
|
||||
__FILE__, __FUNCTION__, __LINE__, aModelFile );
|
||||
return nullptr;
|
||||
}
|
||||
@@ -308,8 +307,7 @@ SCENEGRAPH* S3D_CACHE::checkCache( const wxString& aFileName, S3D_CACHE_ENTRY**
|
||||
if( m_CacheMap.insert( std::pair< wxString, S3D_CACHE_ENTRY* >
|
||||
( aFileName, ep ) ).second == false )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( "%s:%s:%d\n * [BUG] duplicate entry in map file; key = '%s'" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] duplicate entry in map file; key = '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
m_CacheList.pop_back();
|
||||
@@ -327,8 +325,7 @@ SCENEGRAPH* S3D_CACHE::checkCache( const wxString& aFileName, S3D_CACHE_ENTRY**
|
||||
if( m_CacheMap.insert( std::pair< wxString, S3D_CACHE_ENTRY* >
|
||||
( aFileName, ep ) ).second == false )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( "%s:%s:%d\n * [BUG] duplicate entry in map file; key = '%s'" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] duplicate entry in map file; key = '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
m_CacheList.pop_back();
|
||||
@@ -361,7 +358,7 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
|
||||
{
|
||||
if( aFileName.empty() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE, wxT( "%s:%s:%d\n * [BUG] empty filename" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * [BUG] empty filename",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -369,7 +366,7 @@ bool S3D_CACHE::getSHA1( const wxString& aFileName, unsigned char* aSHA1Sum )
|
||||
|
||||
if( nullptr == aSHA1Sum )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE, wxT( "%s\n * [BUG] NULL pointer passed for aMD5Sum" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s\n * [BUG] NULL pointer passed for aMD5Sum",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -420,7 +417,7 @@ bool S3D_CACHE::loadCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
if( bname.empty() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( " * [3D model] cannot load cached model; no file hash available" ) );
|
||||
" * [3D model] cannot load cached model; no file hash available" );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -428,7 +425,7 @@ bool S3D_CACHE::loadCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
if( m_CacheDir.empty() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( " * [3D model] cannot load cached model; config directory unknown" ) );
|
||||
" * [3D model] cannot load cached model; config directory unknown" );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -437,7 +434,8 @@ bool S3D_CACHE::loadCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
|
||||
if( !wxFileName::FileExists( fname ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE, wxT( " * [3D model] cannot open file '%s'" ), fname.GetData() );
|
||||
wxString errmsg = "cannot open file";
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] %s '%s'", errmsg.GetData(), fname.GetData() );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -457,7 +455,7 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
{
|
||||
if( nullptr == aCacheItem )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE, wxT( "%s:%s:%d\n * NULL passed for aCacheItem" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * NULL passed for aCacheItem",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -465,7 +463,7 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
|
||||
if( nullptr == aCacheItem->sceneData )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE, wxT( "%s:%s:%d\n * aCacheItem has no valid scene data" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * aCacheItem has no valid scene data",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -476,7 +474,7 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
if( bname.empty() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( " * [3D model] cannot load cached model; no file hash available" ) );
|
||||
" * [3D model] cannot load cached model; no file hash available" );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -484,7 +482,7 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
if( m_CacheDir.empty() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( " * [3D model] cannot load cached model; config directory unknown" ) );
|
||||
" * [3D model] cannot load cached model; config directory unknown" );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -495,8 +493,8 @@ bool S3D_CACHE::saveCacheData( S3D_CACHE_ENTRY* aCacheItem )
|
||||
{
|
||||
if( !wxFileName::FileExists( fname ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( " * [3D model] path exists but is not a regular file '%s'" ), fname );
|
||||
wxLogTrace( MASK_3D_CACHE, " * [3D model] path exists but is not a regular file '%s'",
|
||||
fname );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -512,9 +510,9 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
if( !m_ConfigDir.empty() )
|
||||
return false;
|
||||
|
||||
wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), wxEmptyString );
|
||||
wxFileName cfgdir( ExpandEnvVarSubstitutions( aConfigDir, m_project ), "" );
|
||||
|
||||
cfgdir.Normalize( FN_NORMALIZE_FLAGS );
|
||||
cfgdir.Normalize();
|
||||
|
||||
if( !cfgdir.DirExists() )
|
||||
{
|
||||
@@ -523,7 +521,7 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
if( !cfgdir.DirExists() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( "%s:%s:%d\n * failed to create 3D configuration directory '%s'" ),
|
||||
"%s:%s:%d\n * failed to create 3D configuration directory '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, cfgdir.GetPath() );
|
||||
|
||||
return false;
|
||||
@@ -536,8 +534,8 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
if( !m_FNResolver->Set3DConfigDir( m_ConfigDir ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( "%s:%s:%d\n * could not set 3D Config Directory on filename resolver\n"
|
||||
" * config directory: '%s'" ),
|
||||
"%s:%s:%d\n * could not set 3D Config Directory on filename resolver\n"
|
||||
" * config directory: '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, m_ConfigDir );
|
||||
}
|
||||
|
||||
@@ -550,7 +548,7 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
// 3. MSWin: AppData\Local\kicad\3d
|
||||
wxFileName cacheDir;
|
||||
cacheDir.AssignDir( PATHS::GetUserCachePath() );
|
||||
cacheDir.AppendDir( wxT( "3d" ) );
|
||||
cacheDir.AppendDir( "3d" );
|
||||
|
||||
if( !cacheDir.DirExists() )
|
||||
{
|
||||
@@ -558,8 +556,7 @@ bool S3D_CACHE::Set3DConfigDir( const wxString& aConfigDir )
|
||||
|
||||
if( !cacheDir.DirExists() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( "%s:%s:%d\n * failed to create 3D cache directory '%s'" ),
|
||||
wxLogTrace( MASK_3D_CACHE, "%s:%s:%d\n * failed to create 3D cache directory '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, cacheDir.GetPath() );
|
||||
|
||||
return false;
|
||||
@@ -654,7 +651,7 @@ S3DMODEL* S3D_CACHE::GetModel( const wxString& aModelFileName )
|
||||
if( !cp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_CACHE,
|
||||
wxT( "%s:%s:%d\n * [BUG] model loaded with no associated S3D_CACHE_ENTRY" ),
|
||||
"%s:%s:%d\n * [BUG] model loaded with no associated S3D_CACHE_ENTRY",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -29,13 +29,13 @@
|
||||
|
||||
#include <wx/dir.h>
|
||||
#include <wx/dynlib.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include <wx/stdpaths.h>
|
||||
#include <wx/string.h>
|
||||
|
||||
#include <common.h>
|
||||
#include <paths.h>
|
||||
#include <wx_filename.h>
|
||||
#include "3d_plugin_manager.h"
|
||||
#include "plugins/3d/3d_plugin.h"
|
||||
#include "3d_cache/sg/scenegraph.h"
|
||||
@@ -65,11 +65,11 @@ S3D_PLUGIN_MANAGER::S3D_PLUGIN_MANAGER()
|
||||
{
|
||||
std::multimap< const wxString, KICAD_PLUGIN_LDR_3D* >::const_iterator sM = m_ExtMap.begin();
|
||||
std::multimap< const wxString, KICAD_PLUGIN_LDR_3D* >::const_iterator eM = m_ExtMap.end();
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( " * Extension [plugin name]:\n" ) );
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, " * Extension [plugin name]:\n" );
|
||||
|
||||
while( sM != eM )
|
||||
{
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( " + '%s' [%s]\n" ), sM->first.GetData(),
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, " + '%s' [%s]\n", sM->first.GetData(),
|
||||
sM->second->GetKicadPluginName() );
|
||||
++sM;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ S3D_PLUGIN_MANAGER::S3D_PLUGIN_MANAGER()
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( " * No plugins available\n" ) );
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, " * No plugins available\n" );
|
||||
}
|
||||
|
||||
|
||||
@@ -86,17 +86,17 @@ S3D_PLUGIN_MANAGER::S3D_PLUGIN_MANAGER()
|
||||
/// list of file filters
|
||||
std::list< wxString >::const_iterator sFF = m_FileFilters.begin();
|
||||
std::list< wxString >::const_iterator eFF = m_FileFilters.end();
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( " * File filters:\n" ) );
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, " * File filters:\n" );
|
||||
|
||||
while( sFF != eFF )
|
||||
{
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( " + '%s'\n" ), (*sFF).GetData() );
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, " + '%s'\n", (*sFF).GetData() );
|
||||
++sFF;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( " * No file filters available\n" ) );
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, " * No file filters available\n" );
|
||||
}
|
||||
#endif // DEBUG
|
||||
}
|
||||
@@ -153,14 +153,24 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
|
||||
|
||||
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
|
||||
checkPluginPath( std::string( fn.GetPathWithSep().ToUTF8() ), searchpaths );
|
||||
|
||||
// check for per-user third party plugins
|
||||
// note: GetUserDataDir() gives '.pcbnew' rather than '.kicad' since it uses the exe name;
|
||||
fn.AssignDir( PATHS::GetUserPlugins3DPath() );
|
||||
checkPluginPath( fn.GetPathWithSep(), searchpaths );
|
||||
#else
|
||||
|
||||
// Search path on OS X is
|
||||
// (1) Machine /Library/Application Support/kicad/PlugIns/3d
|
||||
// (1) User ~/Library/Application Support/kicad/PlugIns/3d
|
||||
checkPluginPath( PATHS::GetOSXKicadUserDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
|
||||
|
||||
// (2) Machine /Library/Application Support/kicad/PlugIns/3d
|
||||
checkPluginPath( PATHS::GetOSXKicadMachineDataDir() + wxT( "/PlugIns/3d" ), searchpaths );
|
||||
|
||||
// (2) Bundle kicad.app/Contents/PlugIns/3d
|
||||
// (3) Bundle kicad.app/Contents/PlugIns/3d
|
||||
fn.AssignDir( PATHS::GetStockPlugins3DPath() );
|
||||
checkPluginPath( fn.GetPathWithSep(), searchpaths );
|
||||
|
||||
#endif
|
||||
|
||||
std::list< wxString >::iterator sPL = searchpaths.begin();
|
||||
@@ -168,7 +178,7 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
|
||||
|
||||
while( sPL != ePL )
|
||||
{
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( "%s:%s:%d * [DEBUG] searching path: '%s'" ),
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, "%s:%s:%d * [DEBUG] searching path: '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, (*sPL).ToUTF8() );
|
||||
|
||||
listPlugins( *sPL, pluginlist );
|
||||
@@ -187,13 +197,13 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
|
||||
|
||||
if( pp->Open( sPL->ToUTF8() ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( "%s:%s:%d * [DEBUG] adding plugin" ),
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, "%s:%s:%d * [DEBUG] adding plugin",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
m_Plugins.push_back( pp );
|
||||
int nf = pp->GetNFilters();
|
||||
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( "%s:%s:%d * [DEBUG] adding %d filters" ),
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, "%s:%s:%d * [DEBUG] adding %d filters",
|
||||
__FILE__, __FUNCTION__, __LINE__, nf );
|
||||
|
||||
for( int i = 0; i < nf; ++i )
|
||||
@@ -211,7 +221,7 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( "%s:%s:%d * [DEBUG] deleting plugin" ),
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, "%s:%s:%d * [DEBUG] deleting plugin",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
delete pp;
|
||||
@@ -220,7 +230,7 @@ void S3D_PLUGIN_MANAGER::loadPlugins( void )
|
||||
++sPL;
|
||||
}
|
||||
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( "%s:%s:%d * [DEBUG] plugins loaded" ),
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, "%s:%s:%d * [DEBUG] plugins loaded",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
}
|
||||
|
||||
@@ -278,7 +288,7 @@ void S3D_PLUGIN_MANAGER::checkPluginName( const wxString& aPath,
|
||||
|
||||
wxFileName path( ExpandEnvVarSubstitutions( aPath, nullptr ) );
|
||||
|
||||
path.Normalize( FN_NORMALIZE_FLAGS );
|
||||
path.Normalize();
|
||||
|
||||
// determine if the path is already in the list
|
||||
wxString wxpath = path.GetFullPath();
|
||||
@@ -295,7 +305,7 @@ void S3D_PLUGIN_MANAGER::checkPluginName( const wxString& aPath,
|
||||
|
||||
aPluginList.push_back( wxpath );
|
||||
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( " * [INFO] found 3D plugin '%s'\n" ), wxpath.GetData() );
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, " * [INFO] found 3D plugin '%s'\n", wxpath.GetData() );
|
||||
}
|
||||
|
||||
|
||||
@@ -306,17 +316,16 @@ void S3D_PLUGIN_MANAGER::checkPluginPath( const wxString& aPath,
|
||||
if( aPath.empty() )
|
||||
return;
|
||||
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( " * [INFO] checking for 3D plugins in '%s'\n" ),
|
||||
aPath.GetData() );
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, " * [INFO] checking for 3D plugins in '%s'\n", aPath.GetData() );
|
||||
|
||||
wxFileName path;
|
||||
|
||||
if( aPath.StartsWith( wxT( "${" ) ) || aPath.StartsWith( wxT( "$(" ) ) )
|
||||
path.Assign( ExpandEnvVarSubstitutions( aPath, nullptr ), wxEmptyString );
|
||||
if( aPath.StartsWith( "${" ) || aPath.StartsWith( "$(" ) )
|
||||
path.Assign( ExpandEnvVarSubstitutions( aPath, nullptr ), "" );
|
||||
else
|
||||
path.Assign( aPath, wxEmptyString );
|
||||
path.Assign( aPath, "" );
|
||||
|
||||
path.Normalize( FN_NORMALIZE_FLAGS );
|
||||
path.Normalize();
|
||||
|
||||
if( !wxFileName::DirExists( path.GetFullPath() ) )
|
||||
return;
|
||||
@@ -368,7 +377,7 @@ void S3D_PLUGIN_MANAGER::addExtensionMap( KICAD_PLUGIN_LDR_3D* aPlugin )
|
||||
|
||||
int nExt = aPlugin->GetNExtensions();
|
||||
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( "%s:%s:%d * [INFO] adding %d extensions" ),
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, "%s:%s:%d * [INFO] adding %d extensions",
|
||||
__FILE__, __FUNCTION__, __LINE__, nExt );
|
||||
|
||||
for( int i = 0; i < nExt; ++i )
|
||||
@@ -406,10 +415,10 @@ SCENEGRAPH* S3D_PLUGIN_MANAGER::Load3DModel( const wxString& aFileName, std::str
|
||||
#endif
|
||||
|
||||
// .gz files are compressed versions that may have additional information in the previous extension
|
||||
if( ext_to_find == wxT( "gz" ) )
|
||||
if( ext_to_find == "gz" )
|
||||
{
|
||||
wxFileName second( raw.GetName() );
|
||||
ext_to_find = second.GetExt() + wxT( ".gz" );
|
||||
ext_to_find = second.GetExt() + ".gz";
|
||||
}
|
||||
|
||||
std::pair < std::multimap< const wxString, KICAD_PLUGIN_LDR_3D* >::iterator,
|
||||
@@ -443,7 +452,7 @@ void S3D_PLUGIN_MANAGER::ClosePlugins( void )
|
||||
std::list< KICAD_PLUGIN_LDR_3D* >::iterator sP = m_Plugins.begin();
|
||||
std::list< KICAD_PLUGIN_LDR_3D* >::iterator eP = m_Plugins.end();
|
||||
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, wxT( "%s:%s:%d * [INFO] closing %d extensions" ),
|
||||
wxLogTrace( MASK_3D_PLUGINMGR, "%s:%s:%d * [INFO] closing %d extensions",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( m_Plugins.size() ) );
|
||||
|
||||
while( sP != eP )
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/log.h>
|
||||
#include "plugins/3dapi/ifsg_api.h"
|
||||
@@ -98,7 +97,7 @@ bool S3D::WriteVRML( const char* filename, bool overwrite, SGNODE* aTopNode,
|
||||
|
||||
if( op.fail() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] failed to open file '%s'" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] failed to open file '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, filename );
|
||||
|
||||
return false;
|
||||
@@ -123,7 +122,7 @@ bool S3D::WriteVRML( const char* filename, bool overwrite, SGNODE* aTopNode,
|
||||
|
||||
CLOSE_STREAM( op );
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] problems encountered writing file '%s'" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] problems encountered writing file '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, filename );
|
||||
|
||||
return false;
|
||||
@@ -168,7 +167,7 @@ bool S3D::WriteCache( const char* aFileName, bool overwrite, SGNODE* aNode,
|
||||
{
|
||||
if( !overwrite )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] file exists not overwriting '%s'" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] file exists not overwriting '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
return false;
|
||||
@@ -177,7 +176,7 @@ bool S3D::WriteCache( const char* aFileName, bool overwrite, SGNODE* aNode,
|
||||
// make sure we make no attempt to write a directory
|
||||
if( !wxFileName::FileExists( aFileName ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] specified path is a directory '%s'" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] specified path is a directory '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
return false;
|
||||
@@ -188,7 +187,7 @@ bool S3D::WriteCache( const char* aFileName, bool overwrite, SGNODE* aNode,
|
||||
|
||||
if( output.fail() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] failed to open file '%s'" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] failed to open file '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
return false;
|
||||
@@ -206,8 +205,7 @@ bool S3D::WriteCache( const char* aFileName, bool overwrite, SGNODE* aNode,
|
||||
|
||||
if( !rval )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [INFO] problems encountered writing cache file '%s'" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] problems encountered writing cache file '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
// delete the defective file
|
||||
@@ -228,19 +226,21 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr,
|
||||
|
||||
if( !wxFileName::FileExists( aFileName ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] no such file '%s'" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] no such file '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unique_ptr<SGNODE> np = std::make_unique<SCENEGRAPH>( nullptr );
|
||||
SGNODE* np = new SCENEGRAPH( nullptr );
|
||||
|
||||
OPEN_ISTREAM( file, aFileName );
|
||||
|
||||
if( file.fail() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] failed to open file '%s'" ),
|
||||
delete np;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] failed to open file '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
return nullptr;
|
||||
@@ -256,10 +256,9 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr,
|
||||
|
||||
if( '(' != schar )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; missing left parenthesis"
|
||||
" at position '%d'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( file.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; missing left parenthesis at position '%d'",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( file.tellg() ) );
|
||||
|
||||
CLOSE_STREAM( file );
|
||||
return nullptr;
|
||||
@@ -291,10 +290,9 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr,
|
||||
|
||||
if( '(' != schar )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; missing left parenthesis"
|
||||
" at position '%d'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( file.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; missing left parenthesis at position '%d'",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( file.tellg() ) );
|
||||
|
||||
CLOSE_STREAM( file );
|
||||
return nullptr;
|
||||
@@ -323,15 +321,15 @@ SGNODE* S3D::ReadCache( const char* aFileName, void* aPluginMgr,
|
||||
|
||||
if( !rval )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] problems encountered reading cache file "
|
||||
"'%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aFileName );
|
||||
delete np;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] problems encountered reading cache file '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, aFileName );
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return np.release();
|
||||
return np;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -56,8 +56,7 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( SGNODE* aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -73,8 +72,7 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( IFSG_NODE& aParent )
|
||||
#ifdef DEBUG
|
||||
if( ! pp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
BadParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -85,8 +83,7 @@ IFSG_APPEARANCE::IFSG_APPEARANCE( IFSG_NODE& aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -126,8 +123,7 @@ bool IFSG_APPEARANCE::NewNode( SGNODE* aParent )
|
||||
|
||||
if( aParent != m_node->GetParent() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGAPPEARANCE" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGAPPEARANCE",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeTypeName( aParent->GetNodeType() ) );
|
||||
|
||||
@@ -254,7 +250,7 @@ bool IFSG_APPEARANCE::SetShininess( float aShininess ) noexcept
|
||||
|
||||
if( aShininess < 0 || aShininess > 1.0 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] shininess out of range [0..1]" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] shininess out of range [0..1]",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -272,7 +268,7 @@ bool IFSG_APPEARANCE::SetTransparency( float aTransparency ) noexcept
|
||||
|
||||
if( aTransparency < 0 || aTransparency > 1.0 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] transparency out of range [0..1]" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] transparency out of range [0..1]",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
|
||||
@@ -56,7 +56,7 @@ IFSG_COLORS::IFSG_COLORS( SGNODE* aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d" ), __FILE__, __FUNCTION__, __LINE__ );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d", __FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -73,8 +73,7 @@ IFSG_COLORS::IFSG_COLORS( IFSG_NODE& aParent )
|
||||
// Braces needed due to dangling else warning from wxLogTrace macro
|
||||
if( !pp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
BadParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -85,7 +84,7 @@ IFSG_COLORS::IFSG_COLORS( IFSG_NODE& aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
|
||||
return;
|
||||
@@ -126,7 +125,7 @@ bool IFSG_COLORS::NewNode( SGNODE* aParent )
|
||||
|
||||
if( aParent != m_node->GetParent() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGCOLORS" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGCOLORS",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeTypeName( aParent->GetNodeType() ) );
|
||||
|
||||
|
||||
@@ -57,8 +57,7 @@ IFSG_COORDINDEX::IFSG_COORDINDEX( SGNODE* aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -73,8 +72,7 @@ IFSG_COORDINDEX::IFSG_COORDINDEX( IFSG_NODE& aParent )
|
||||
|
||||
if( !pp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
BadParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -83,8 +81,7 @@ IFSG_COORDINDEX::IFSG_COORDINDEX( IFSG_NODE& aParent )
|
||||
|
||||
if( !m_node->SetParent( pp ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
@@ -126,8 +123,7 @@ bool IFSG_COORDINDEX::NewNode( SGNODE* aParent )
|
||||
|
||||
if( aParent != m_node->GetParent() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGCOORDINDEX" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGCOORDINDEX",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeTypeName( aParent->GetNodeType() ) );
|
||||
|
||||
|
||||
@@ -56,8 +56,7 @@ IFSG_COORDS::IFSG_COORDS( SGNODE* aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -73,8 +72,7 @@ IFSG_COORDS::IFSG_COORDS( IFSG_NODE& aParent )
|
||||
#ifdef DEBUG
|
||||
if( !pp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
BadParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -85,8 +83,7 @@ IFSG_COORDS::IFSG_COORDS( IFSG_NODE& aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -126,7 +123,7 @@ bool IFSG_COORDS::NewNode( SGNODE* aParent )
|
||||
|
||||
if( aParent != m_node->GetParent() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGCOORDS" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGCOORDS",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeTypeName( aParent->GetNodeType() ) );
|
||||
|
||||
|
||||
@@ -57,8 +57,7 @@ IFSG_FACESET::IFSG_FACESET( SGNODE* aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -74,8 +73,7 @@ IFSG_FACESET::IFSG_FACESET( IFSG_NODE& aParent )
|
||||
#ifdef DEBUG
|
||||
if( ! pp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
BadParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -86,8 +84,7 @@ IFSG_FACESET::IFSG_FACESET( IFSG_NODE& aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -127,7 +124,7 @@ bool IFSG_FACESET::NewNode( SGNODE* aParent )
|
||||
|
||||
if( aParent != m_node->GetParent() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGFACESET" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGFACESET",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeTypeName( aParent->GetNodeType() ) );
|
||||
|
||||
|
||||
@@ -57,8 +57,7 @@ IFSG_NORMALS::IFSG_NORMALS( SGNODE* aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -74,8 +73,7 @@ IFSG_NORMALS::IFSG_NORMALS( IFSG_NODE& aParent )
|
||||
#ifdef DEBUG
|
||||
if( ! pp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
BadParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -86,8 +84,7 @@ IFSG_NORMALS::IFSG_NORMALS( IFSG_NODE& aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -127,7 +124,7 @@ bool IFSG_NORMALS::NewNode( SGNODE* aParent )
|
||||
|
||||
if( aParent != m_node->GetParent() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGNORMALS" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGNORMALS",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeTypeName( aParent->GetNodeType() ) );
|
||||
|
||||
|
||||
@@ -57,8 +57,7 @@ IFSG_SHAPE::IFSG_SHAPE( SGNODE* aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -74,8 +73,7 @@ IFSG_SHAPE::IFSG_SHAPE( IFSG_NODE& aParent )
|
||||
#ifdef DEBUG
|
||||
if( !pp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
BadParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, BadParent );
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -86,8 +84,7 @@ IFSG_SHAPE::IFSG_SHAPE( IFSG_NODE& aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -127,7 +124,7 @@ bool IFSG_SHAPE::NewNode( SGNODE* aParent )
|
||||
|
||||
if( aParent != m_node->GetParent() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGSHAPE" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SGSHAPE",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeTypeName( aParent->GetNodeType() ) );
|
||||
|
||||
|
||||
@@ -56,8 +56,7 @@ IFSG_TRANSFORM::IFSG_TRANSFORM( SGNODE* aParent )
|
||||
delete m_node;
|
||||
m_node = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d %s" ), __FILE__, __FUNCTION__, __LINE__,
|
||||
WrongParent );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d %s", __FILE__, __FUNCTION__, __LINE__, WrongParent );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -97,7 +96,7 @@ bool IFSG_TRANSFORM::NewNode( SGNODE* aParent )
|
||||
|
||||
if( aParent != m_node->GetParent() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SCENEGRAPH" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid SGNODE parent (%s) to SCENEGRAPH",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeTypeName( aParent->GetNodeType() ) );
|
||||
|
||||
@@ -149,7 +148,7 @@ bool IFSG_TRANSFORM::SetScale( double aScale )
|
||||
|
||||
if( aScale < 1e-8 && aScale > -1e-8 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] |scale| is < 1e-8 - this seems strange" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] |scale| is < 1e-8 - this seems strange",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
|
||||
@@ -49,10 +49,8 @@ SCENEGRAPH::SCENEGRAPH( SGNODE* aParent ) : SGNODE( aParent )
|
||||
{
|
||||
m_Parent = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] inappropriate parent to SCENEGRAPH (type %d)" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeType() );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] inappropriate parent to SCENEGRAPH (type %d)" ,
|
||||
__FILE__, __FUNCTION__, __LINE__, aParent->GetNodeType() );
|
||||
}
|
||||
else if( nullptr != aParent && S3D::SGTYPE_TRANSFORM == aParent->GetNodeType() )
|
||||
{
|
||||
@@ -142,7 +140,7 @@ void SCENEGRAPH::unlinkNode( const SGNODE* aNode, bool isChild )
|
||||
break;
|
||||
}
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] unlinkNode() did not find its target" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] unlinkNode() did not find its target",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
}
|
||||
|
||||
@@ -168,11 +166,8 @@ bool SCENEGRAPH::addNode( SGNODE* aNode, bool isChild )
|
||||
ADD_NODE( S3D::SGTYPE_TRANSFORM, SCENEGRAPH, aNode, m_Transforms, m_RTransforms, isChild );
|
||||
ADD_NODE( S3D::SGTYPE_SHAPE, SGSHAPE, aNode, m_Shape, m_RShape, isChild );
|
||||
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] object '%s' is not a valid type for this object (%d)" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aNode->GetName(),
|
||||
aNode->GetNodeType() );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] object '%s' is not a valid type for this object (%d)",
|
||||
__FILE__, __FUNCTION__, __LINE__, aNode->GetName(), aNode->GetNodeType() );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -363,8 +358,7 @@ bool SCENEGRAPH::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( aFile.fail() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad stream" ),
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream", __FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -420,8 +414,7 @@ bool SCENEGRAPH::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( !m_Transforms[i]->WriteCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [INFO] bad stream while writing child transforms" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream while writing child transforms",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -441,8 +434,7 @@ bool SCENEGRAPH::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( !m_Shape[i]->WriteCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [INFO] bad stream while writing child shapes" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream while writing child shapes",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -475,8 +467,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
// we need to read the tag and verify its type
|
||||
if( S3D::SGTYPE_TRANSFORM != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; tag mismatch at position "
|
||||
"%ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; tag mismatch at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -512,8 +504,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_TRANSFORM != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad child transform tag "
|
||||
"at position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad child transform tag at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -525,8 +517,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !sp->ReadCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data while reading transform "
|
||||
"%ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data while reading transform %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -539,8 +531,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_TRANSFORM != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad ref transform tag at "
|
||||
"position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad ref transform tag at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -551,8 +543,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !sp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: cannot find ref "
|
||||
"transform at position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: cannot find ref transform at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -561,8 +553,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( S3D::SGTYPE_TRANSFORM != sp->GetNodeType() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: type is not TRANSFORM "
|
||||
"at position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: type is not TRANSFORM at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -577,8 +569,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_SHAPE != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad child shape tag at "
|
||||
"position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad child shape tag at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -590,9 +582,9 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !sp->ReadCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; corrupt data while "
|
||||
"reading shape at position %ul" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; corrupt data while reading shape at "
|
||||
"position %ul", __FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
@@ -604,8 +596,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_SHAPE != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad ref shape tag at "
|
||||
"position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad ref shape tag at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -616,8 +608,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !sp )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: cannot find ref shape "
|
||||
"at position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: cannot find ref shape at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -626,8 +618,8 @@ bool SCENEGRAPH::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( S3D::SGTYPE_SHAPE != sp->GetNodeType() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: type is not SGSHAPE at "
|
||||
"position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: type is not SGSHAPE at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
|
||||
@@ -45,8 +45,7 @@ SGAPPEARANCE::SGAPPEARANCE( SGNODE* aParent ) : SGNODE( aParent )
|
||||
{
|
||||
m_Parent = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] inappropriate parent to SGAPPEARANCE (type %s )" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] inappropriate parent to SGAPPEARANCE (type %s )",
|
||||
__FILE__, __FUNCTION__, __LINE__, aParent->GetNodeType() );
|
||||
}
|
||||
else if( nullptr != aParent && S3D::SGTYPE_SHAPE == aParent->GetNodeType() )
|
||||
@@ -99,7 +98,7 @@ bool SGAPPEARANCE::SetEmissive( float aRVal, float aGVal, float aBVal )
|
||||
|
||||
bool SGAPPEARANCE::SetEmissive( const SGCOLOR* aRGBColor )
|
||||
{
|
||||
wxCHECK_MSG( aRGBColor, false, wxT( "NULL pointer passed for aRGBColor" ) );
|
||||
wxCHECK_MSG( aRGBColor, false, "NULL pointer passed for aRGBColor" );
|
||||
|
||||
return emissive.SetColor( aRGBColor );
|
||||
}
|
||||
@@ -119,7 +118,7 @@ bool SGAPPEARANCE::SetDiffuse( float aRVal, float aGVal, float aBVal )
|
||||
|
||||
bool SGAPPEARANCE::SetDiffuse( const SGCOLOR* aRGBColor )
|
||||
{
|
||||
wxCHECK_MSG( aRGBColor, false, wxT( "NULL pointer passed for aRGBColor" ) );
|
||||
wxCHECK_MSG( aRGBColor, false, "NULL pointer passed for aRGBColor" );
|
||||
|
||||
return diffuse.SetColor( aRGBColor );
|
||||
}
|
||||
@@ -139,7 +138,7 @@ bool SGAPPEARANCE::SetSpecular( float aRVal, float aGVal, float aBVal )
|
||||
|
||||
bool SGAPPEARANCE::SetSpecular( const SGCOLOR* aRGBColor )
|
||||
{
|
||||
wxCHECK_MSG( aRGBColor, false, wxT( "NULL pointer passed for aRGBColor" ) );
|
||||
wxCHECK_MSG( aRGBColor, false, "NULL pointer passed for aRGBColor" );
|
||||
|
||||
return specular.SetColor( aRGBColor );
|
||||
}
|
||||
@@ -158,7 +157,7 @@ bool SGAPPEARANCE::SetAmbient( float aRVal, float aGVal, float aBVal )
|
||||
|
||||
bool SGAPPEARANCE::SetAmbient( const SGCOLOR* aRGBColor )
|
||||
{
|
||||
wxCHECK_MSG( aRGBColor, false, wxT( "NULL pointer passed for aRGBColor" ) );
|
||||
wxCHECK_MSG( aRGBColor, false, "NULL pointer passed for aRGBColor" );
|
||||
|
||||
return ambient.SetColor( aRGBColor );
|
||||
}
|
||||
@@ -185,20 +184,20 @@ SGNODE* SGAPPEARANCE::FindNode( const char* aNodeName, const SGNODE* aCaller) no
|
||||
void SGAPPEARANCE::unlinkChildNode( const SGNODE* aCaller ) noexcept
|
||||
{
|
||||
wxCHECK_MSG( aCaller, /* void */,
|
||||
wxT( "unexpected code branch; node should have no children or refs" ) );
|
||||
"unexpected code branch; node should have no children or refs" );
|
||||
}
|
||||
|
||||
|
||||
void SGAPPEARANCE::unlinkRefNode( const SGNODE* aCaller ) noexcept
|
||||
{
|
||||
wxCHECK_MSG( aCaller, /* void */,
|
||||
wxT( "unexpected code branch; node should have no children or refs" ) );
|
||||
"unexpected code branch; node should have no children or refs" );
|
||||
}
|
||||
|
||||
|
||||
bool SGAPPEARANCE::AddRefNode( SGNODE* aNode ) noexcept
|
||||
{
|
||||
wxCHECK_MSG( aNode, false, wxT( "this node does not accept children or refs" ) );
|
||||
wxCHECK_MSG( aNode, false, "this node does not accept children or refs" );
|
||||
|
||||
// This is redundant but it keeps gcc from generating a warning on debug builds.
|
||||
return false;
|
||||
@@ -207,7 +206,7 @@ bool SGAPPEARANCE::AddRefNode( SGNODE* aNode ) noexcept
|
||||
|
||||
bool SGAPPEARANCE::AddChildNode( SGNODE* aNode ) noexcept
|
||||
{
|
||||
wxCHECK_MSG( aNode, false, wxT( "this node does not accept children or refs" ) );
|
||||
wxCHECK_MSG( aNode, false, "this node does not accept children or refs" );
|
||||
|
||||
// This is redundant but it keeps gcc from generating a warning on debug builds.
|
||||
return false;
|
||||
@@ -305,7 +304,7 @@ bool SGAPPEARANCE::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( nullptr == parentNode )
|
||||
{
|
||||
wxCHECK_MSG( m_Parent, false, wxT( "corrupt data; m_aParent is NULL" ) );
|
||||
wxCHECK_MSG( m_Parent, false, "corrupt data; m_aParent is NULL" );
|
||||
|
||||
SGNODE* np = m_Parent;
|
||||
|
||||
@@ -321,12 +320,11 @@ bool SGAPPEARANCE::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
return false;
|
||||
}
|
||||
|
||||
wxCHECK_MSG( parentNode == m_Parent, false, wxT( "corrupt data; parentNode != m_aParent" ) );
|
||||
wxCHECK_MSG( parentNode == m_Parent, false, "corrupt data; parentNode != m_aParent" );
|
||||
|
||||
if( !aFile.good() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad stream" ),
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream", __FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ SGCOLOR::SGCOLOR( float aRVal, float aGVal, float aBVal )
|
||||
{
|
||||
if( !checkRange( aRVal, aGVal, aBVal ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid value passed to constructor" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid value passed to constructor",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
red = 0.0;
|
||||
green = 0.0;
|
||||
@@ -74,7 +74,7 @@ void SGCOLOR::GetColor( SGCOLOR& aColor ) const noexcept
|
||||
|
||||
void SGCOLOR::GetColor( SGCOLOR* aColor ) const noexcept
|
||||
{
|
||||
wxCHECK_MSG( aColor, /* void */, wxT( "NULL pointer passed for aRGBColor" ) );
|
||||
wxCHECK_MSG( aColor, /* void */, "NULL pointer passed for aRGBColor" );
|
||||
|
||||
aColor->red = red;
|
||||
aColor->green = green;
|
||||
@@ -106,7 +106,7 @@ bool SGCOLOR::SetColor( const SGCOLOR& aColor ) noexcept
|
||||
|
||||
bool SGCOLOR::SetColor( const SGCOLOR* aColor ) noexcept
|
||||
{
|
||||
wxCHECK_MSG( aColor, false, wxT( "NULL pointer passed for aRGBColor" ) );
|
||||
wxCHECK_MSG( aColor, false, "NULL pointer passed for aRGBColor" );
|
||||
|
||||
red = aColor->red;
|
||||
green = aColor->green;
|
||||
@@ -121,7 +121,7 @@ bool SGCOLOR::checkRange( float aRedVal, float aGreenVal, float aBlueVal ) const
|
||||
|
||||
if( aRedVal < 0.0 || aRedVal > 1.0 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid RED value: %g" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid RED value: %g",
|
||||
__FILE__, __FUNCTION__, __LINE__, aRedVal );
|
||||
|
||||
ok = false;
|
||||
@@ -129,7 +129,7 @@ bool SGCOLOR::checkRange( float aRedVal, float aGreenVal, float aBlueVal ) const
|
||||
|
||||
if( aGreenVal < 0.0 || aGreenVal > 1.0 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid GREEN value: %g" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid GREEN value: %g",
|
||||
__FILE__, __FUNCTION__, __LINE__, aGreenVal );
|
||||
|
||||
ok = false;
|
||||
@@ -137,7 +137,7 @@ bool SGCOLOR::checkRange( float aRedVal, float aGreenVal, float aBlueVal ) const
|
||||
|
||||
if( aBlueVal < 0.0 || aBlueVal > 1.0 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] invalid BLUE value: %g" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] invalid BLUE value: %g",
|
||||
__FILE__, __FUNCTION__, __LINE__, aBlueVal );
|
||||
|
||||
ok = false;
|
||||
@@ -181,7 +181,7 @@ void SGPOINT::GetPoint( const SGPOINT& aPoint ) noexcept
|
||||
|
||||
void SGPOINT::GetPoint( const SGPOINT* aPoint ) noexcept
|
||||
{
|
||||
wxCHECK_MSG( aPoint, /* void */, wxT( "NULL pointer passed for aPoint" ) );
|
||||
wxCHECK_MSG( aPoint, /* void */, "NULL pointer passed for aPoint" );
|
||||
|
||||
x = aPoint->x;
|
||||
y = aPoint->y;
|
||||
|
||||
@@ -38,8 +38,7 @@ SGCOLORS::SGCOLORS( SGNODE* aParent ) : SGNODE( aParent )
|
||||
{
|
||||
m_Parent = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] inappropriate parent to SGCOLORS (type %s)" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] inappropriate parent to SGCOLORS (type %s)",
|
||||
__FILE__, __FUNCTION__, __LINE__, aParent->GetNodeType() );
|
||||
}
|
||||
else if( nullptr != aParent && S3D::SGTYPE_FACESET == aParent->GetNodeType() )
|
||||
@@ -260,8 +259,7 @@ bool SGCOLORS::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !aFile.good() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad stream" ),
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream", __FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,8 +40,7 @@ SGCOORDS::SGCOORDS( SGNODE* aParent ) : SGNODE( aParent )
|
||||
{
|
||||
m_Parent = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] inappropriate parent to SGCOORDS (type %s)" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] inappropriate parent to SGCOORDS (type %s)",
|
||||
__FILE__, __FUNCTION__, __LINE__, aParent->GetNodeType() );
|
||||
}
|
||||
else if( nullptr != aParent && S3D::SGTYPE_FACESET == aParent->GetNodeType() )
|
||||
@@ -262,8 +261,7 @@ bool SGCOORDS::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !aFile.good() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad stream" ),
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream", __FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,10 +52,8 @@ SGFACESET::SGFACESET( SGNODE* aParent ) : SGNODE( aParent )
|
||||
{
|
||||
m_Parent = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] inappropriate parent to SGFACESET (type %s)" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeType() );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] inappropriate parent to SGFACESET (type %s)",
|
||||
__FILE__, __FUNCTION__, __LINE__, aParent->GetNodeType() );
|
||||
}
|
||||
else if( nullptr != aParent && S3D::SGTYPE_SHAPE == aParent->GetNodeType() )
|
||||
{
|
||||
@@ -254,7 +252,7 @@ void SGFACESET::unlinkNode( const SGNODE* aNode, bool isChild )
|
||||
}
|
||||
}
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] unlinkNode() did not find its target" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] unlinkNode() did not find its target",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
}
|
||||
|
||||
@@ -285,7 +283,7 @@ bool SGFACESET::addNode( SGNODE* aNode, bool isChild )
|
||||
{
|
||||
if( aNode != m_Colors && aNode != m_RColors )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] assigning multiple Colors nodes" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] assigning multiple Colors nodes",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -314,7 +312,7 @@ bool SGFACESET::addNode( SGNODE* aNode, bool isChild )
|
||||
{
|
||||
if( aNode != m_Coords && aNode != m_RCoords )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] assigning multiple Colors nodes" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] assigning multiple Colors nodes",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -343,7 +341,7 @@ bool SGFACESET::addNode( SGNODE* aNode, bool isChild )
|
||||
{
|
||||
if( aNode != m_Normals && aNode != m_RNormals )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] assigning multiple Normals nodes" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] assigning multiple Normals nodes",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -372,8 +370,7 @@ bool SGFACESET::addNode( SGNODE* aNode, bool isChild )
|
||||
{
|
||||
if( aNode != m_CoordIndices )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
wxT( "%s:%s:%d * [BUG] assigning multiple CoordIndex nodes" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] assigning multiple CoordIndex nodes",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -388,10 +385,8 @@ bool SGFACESET::addNode( SGNODE* aNode, bool isChild )
|
||||
return true;
|
||||
}
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] object type '%s' is not a valid type for "
|
||||
"this object '%d'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aNode->GetName(),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] object type '%s' is not a valid type for "
|
||||
"this object '%d'", __FILE__, __FUNCTION__, __LINE__, aNode->GetName(),
|
||||
aNode->GetNodeType() );
|
||||
|
||||
return false;
|
||||
@@ -514,8 +509,7 @@ bool SGFACESET::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !aFile.good() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad stream" ),
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream", __FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -603,7 +597,7 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
if( m_Coords || m_RCoords || m_CoordIndices || m_Colors || m_RColors || m_Normals
|
||||
|| m_RNormals )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] non-empty node" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] non-empty node",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -617,10 +611,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( ( items[0] && items[1] ) || ( items[3] && items[4] ) || ( items[5] && items[6] ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; multiple item definitions "
|
||||
"at position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; multiple item definitions at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -631,10 +624,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_COORDS != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad child coords tag at "
|
||||
"position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad child coords tag at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -644,10 +636,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !m_Coords->ReadCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; corrupt data while "
|
||||
"reading coords '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; corrupt data while reading coords '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -657,10 +648,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_COORDS != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad ref coords tag at "
|
||||
"position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad ref coords tag at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -669,20 +659,18 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !np )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; cannot find ref "
|
||||
"coords '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; cannot find ref coords '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( S3D::SGTYPE_COORDS != np->GetNodeType() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; type is not SGCOORDS "
|
||||
"'%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; type is not SGCOORDS '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -695,10 +683,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_COORDINDEX != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad coord index tag at "
|
||||
"position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad coord index tag at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -708,10 +695,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !m_CoordIndices->ReadCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data while reading coord "
|
||||
"index '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data while reading coord index '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -721,10 +707,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_NORMALS != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad child normals tag "
|
||||
"at position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad child normals tag at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -734,10 +719,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !m_Normals->ReadCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data while reading normals "
|
||||
"'%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data while reading normals '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -747,10 +731,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_NORMALS != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad ref normals tag at "
|
||||
"position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad ref normals tag at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -759,19 +742,18 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !np )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt: cannot find ref normals "
|
||||
"'%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt: cannot find ref normals '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( S3D::SGTYPE_NORMALS != np->GetNodeType() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt: type is not SGNORMALS '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt: type is not SGNORMALS '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -784,10 +766,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_COLORS != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad child colors tag "
|
||||
"at position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad child colors tag at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -797,10 +778,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !m_Colors->ReadCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data while reading colors "
|
||||
"'%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data while reading colors '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -810,10 +790,9 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_COLORS != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad ref colors tag at "
|
||||
"position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad ref colors tag at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -822,20 +801,18 @@ bool SGFACESET::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !np )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: cannot find ref colors "
|
||||
"'%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: cannot find ref colors '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( S3D::SGTYPE_COLORS != np->GetNodeType() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: type is not SGCOLORS "
|
||||
"'%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: type is not SGCOLORS '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -862,8 +839,8 @@ bool SGFACESET::validate( void )
|
||||
|| ( nullptr == m_Normals && nullptr == m_RNormals )
|
||||
|| ( nullptr == m_CoordIndices ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad model; no vertices, vertex indices, "
|
||||
"or normals" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] bad model; no vertices, vertex indices, or normals",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
validated = true;
|
||||
@@ -883,7 +860,7 @@ bool SGFACESET::validate( void )
|
||||
|
||||
if( nCoords < 3 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad model; fewer than 3 vertices" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad model; fewer than 3 vertices",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
validated = true;
|
||||
@@ -898,8 +875,8 @@ bool SGFACESET::validate( void )
|
||||
|
||||
if( nCIdx < 3 || ( nCIdx % 3 > 0 ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad model; no vertex indices or not "
|
||||
"multiple of 3" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] bad model; no vertex indices or not multiple of 3",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
validated = true;
|
||||
@@ -912,8 +889,7 @@ bool SGFACESET::validate( void )
|
||||
{
|
||||
if( lCIdx[i] < 0 || lCIdx[i] >= (int)nCoords )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad model; vertex index out of "
|
||||
"bounds" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad model; vertex index out of bounds",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
validated = true;
|
||||
@@ -934,11 +910,10 @@ bool SGFACESET::validate( void )
|
||||
|
||||
if( nNorms != nCoords )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad model; number of normals (%ul) does "
|
||||
"not match number of vertices (%ul)" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( nNorms ),
|
||||
static_cast<unsigned long>( nCoords ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] bad model; number of normals (%ul) does not match "
|
||||
"number of vertices (%ul)", __FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( nNorms ), static_cast<unsigned long>( nCoords ) );
|
||||
|
||||
validated = true;
|
||||
valid = false;
|
||||
|
||||
@@ -199,10 +199,9 @@ S3D::SGTYPES S3D::ReadTag( std::istream& aFile, std::string& aName )
|
||||
|
||||
if( '[' != schar )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; missing left bracket at "
|
||||
"position %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<int>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; missing left bracket at position %d",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<int>( aFile.tellg() ) );
|
||||
|
||||
return S3D::SGTYPE_END;
|
||||
}
|
||||
@@ -218,8 +217,8 @@ S3D::SGTYPES S3D::ReadTag( std::istream& aFile, std::string& aName )
|
||||
|
||||
if( schar != ']' )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; could not find right "
|
||||
"bracket" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; could not find right bracket",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return S3D::SGTYPE_END;
|
||||
@@ -230,9 +229,9 @@ S3D::SGTYPES S3D::ReadTag( std::istream& aFile, std::string& aName )
|
||||
|
||||
if( std::string::npos == upos )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; no underscore in name '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; no underscore in name '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return S3D::SGTYPE_END;
|
||||
}
|
||||
@@ -256,9 +255,9 @@ S3D::SGTYPES S3D::ReadTag( std::istream& aFile, std::string& aName )
|
||||
return types[i];
|
||||
}
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; no node type matching '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; no node type matching '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return S3D::SGTYPE_END;
|
||||
}
|
||||
@@ -357,8 +356,8 @@ bool S3D::CalcTriangleNormals( std::vector< SGPOINT > coords, std::vector< int >
|
||||
|
||||
if( vsize < 3 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] invalid vertex set (fewer than 3 "
|
||||
"vertices)" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] invalid vertex set (fewer than 3 vertices)",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -368,7 +367,7 @@ bool S3D::CalcTriangleNormals( std::vector< SGPOINT > coords, std::vector< int >
|
||||
|
||||
if( 0 != isize % 3 || index.empty() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] invalid index set (not multiple of 3)" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] invalid index set (not multiple of 3)",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -376,7 +375,7 @@ bool S3D::CalcTriangleNormals( std::vector< SGPOINT > coords, std::vector< int >
|
||||
|
||||
if( !norms.empty() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] normals set is not empty" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] normals set is not empty",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -399,7 +398,7 @@ bool S3D::CalcTriangleNormals( std::vector< SGPOINT > coords, std::vector< int >
|
||||
std::ostringstream ostr;
|
||||
ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
|
||||
ostr << " * [INFO] invalid index set; index out of bounds";
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s\n" ), ostr.str().c_str() );
|
||||
wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
|
||||
#endif
|
||||
|
||||
return false;
|
||||
@@ -482,8 +481,8 @@ bool S3D::CalcTriangleNormals( std::vector< SGPOINT > coords, std::vector< int >
|
||||
|
||||
if( norms.size() != coords.size() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] number of normals does not equal number "
|
||||
"of vertices" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [BUG] number of normals does not equal number of vertices",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
|
||||
@@ -35,10 +35,8 @@ SGINDEX::SGINDEX( SGNODE* aParent ) : SGNODE( aParent )
|
||||
{
|
||||
m_Parent = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] inappropriate parent to SGINDEX (type "
|
||||
"'%d')" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeType() );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] inappropriate parent to SGINDEX (type '%d')",
|
||||
__FILE__, __FUNCTION__, __LINE__, aParent->GetNodeType() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,8 +182,8 @@ bool SGINDEX::writeCoordIndex( std::ostream& aFile )
|
||||
{
|
||||
size_t n = index.size();
|
||||
|
||||
wxCHECK_MSG( n % 3 == 0, false, wxT( "Coordinate index is not divisible by three (violates "
|
||||
"triangle constraint)" ) );
|
||||
wxCHECK_MSG( n % 3 == 0, false,
|
||||
"Coordinate index is not divisible by three (violates triangle constraint)" );
|
||||
|
||||
aFile << " coordIndex [\n ";
|
||||
|
||||
@@ -283,7 +281,7 @@ bool SGINDEX::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !aFile.good() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad stream" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
|
||||
@@ -196,11 +196,9 @@ void SGNODE::delNodeRef( const SGNODE* aNode )
|
||||
return;
|
||||
}
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] delNodeRef() did not find its target, this "
|
||||
"node type %d, referenced node type %d" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
m_SGtype,
|
||||
aNode->GetNodeType() );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] delNodeRef() did not find its target, "
|
||||
"this node type %d, referenced node type %d", __FILE__, __FUNCTION__, __LINE__,
|
||||
m_SGtype, aNode->GetNodeType() );
|
||||
}
|
||||
|
||||
|
||||
@@ -214,8 +212,8 @@ void SGNODE::AssociateWrapper( SGNODE** aWrapperRef ) noexcept
|
||||
{
|
||||
*m_Association = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [WARNING] association being broken with "
|
||||
"previous wrapper" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [WARNING] association being broken with previous wrapper",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
}
|
||||
|
||||
|
||||
@@ -38,10 +38,8 @@ SGNORMALS::SGNORMALS( SGNODE* aParent ) : SGNODE( aParent )
|
||||
{
|
||||
m_Parent = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] inappropriate parent to SGNORMALS "
|
||||
"(type %d)" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
aParent->GetNodeType() );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] inappropriate parent to SGNORMALS (type %d)",
|
||||
__FILE__, __FUNCTION__, __LINE__, aParent->GetNodeType() );
|
||||
}
|
||||
else if( nullptr != aParent && S3D::SGTYPE_FACESET == aParent->GetNodeType() )
|
||||
{
|
||||
@@ -255,7 +253,7 @@ bool SGNORMALS::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !aFile.good() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad stream" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad stream",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
|
||||
@@ -49,7 +49,7 @@ SGSHAPE::SGSHAPE( SGNODE* aParent ) : SGNODE( aParent )
|
||||
{
|
||||
m_Parent = nullptr;
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] inappropriate parent to SGSHAPE (type %d)" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] inappropriate parent to SGSHAPE (type %d)",
|
||||
__FILE__, __FUNCTION__, __LINE__, aParent->GetNodeType() );
|
||||
}
|
||||
else if( nullptr != aParent && S3D::SGTYPE_TRANSFORM == aParent->GetNodeType() )
|
||||
@@ -195,7 +195,7 @@ void SGSHAPE::unlinkNode( const SGNODE* aNode, bool isChild )
|
||||
}
|
||||
}
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] unlinkNode() did not find its target" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] unlinkNode() did not find its target",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
}
|
||||
|
||||
@@ -222,8 +222,7 @@ bool SGSHAPE::addNode( SGNODE* aNode, bool isChild )
|
||||
{
|
||||
if( aNode != m_Appearance && aNode != m_RAppearance )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] assigning multiple Appearance "
|
||||
"nodes" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] assigning multiple Appearance nodes",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -252,7 +251,7 @@ bool SGSHAPE::addNode( SGNODE* aNode, bool isChild )
|
||||
{
|
||||
if( aNode != m_FaceSet && aNode != m_RFaceSet )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] assigning multiple FaceSet nodes" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] assigning multiple FaceSet nodes",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
@@ -275,8 +274,7 @@ bool SGSHAPE::addNode( SGNODE* aNode, bool isChild )
|
||||
return true;
|
||||
}
|
||||
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] object %s is not a valid type for this "
|
||||
"object (%d)" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] object %s is not a valid type for this object (%d)",
|
||||
__FILE__, __FUNCTION__, __LINE__, aNode->GetName(), aNode->GetNodeType() );
|
||||
|
||||
return false;
|
||||
@@ -380,8 +378,7 @@ bool SGSHAPE::WriteCache( std::ostream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !aFile.good() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [BUG] bad stream" ),
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [BUG] bad stream", __FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -457,10 +454,9 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( ( items[0] && items[1] ) || ( items[2] && items[3] ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; multiple item definitions "
|
||||
"at position %ul" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; multiple item definitions at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -471,8 +467,8 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_APPEARANCE != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad child appearance "
|
||||
"tag at position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad child appearance tag at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -484,8 +480,7 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !m_Appearance->ReadCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data while reading appearance "
|
||||
"'%s'" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] corrupt data while reading appearance '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
@@ -496,8 +491,8 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_APPEARANCE != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad ref appearance tag "
|
||||
"at position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad ref appearance tag at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -508,20 +503,18 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !np )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: cannot find ref "
|
||||
"appearance '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: cannot find ref appearance '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( S3D::SGTYPE_APPEARANCE != np->GetNodeType() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: type is not "
|
||||
"SGAPPEARANCE '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: type is not SGAPPEARANCE '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -534,8 +527,8 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_FACESET != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad child face set tag "
|
||||
"at position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad child face set tag at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -547,8 +540,8 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !m_FaceSet->ReadCache( aFile, this ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data while reading face set "
|
||||
"'%s'" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data while reading face set '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
@@ -559,8 +552,8 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
{
|
||||
if( S3D::SGTYPE_FACESET != S3D::ReadTag( aFile, name ) )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data; bad ref face set tag at "
|
||||
"position %ul" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data; bad ref face set tag at position %ul",
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
static_cast<unsigned long>( aFile.tellg() ) );
|
||||
|
||||
@@ -571,20 +564,18 @@ bool SGSHAPE::ReadCache( std::istream& aFile, SGNODE* parentNode )
|
||||
|
||||
if( !np )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: cannot find ref face "
|
||||
"set '%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: cannot find ref face set '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( S3D::SGTYPE_FACESET != np->GetNodeType() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] corrupt data: type is not SGFACESET "
|
||||
"'%s'" ),
|
||||
__FILE__, __FUNCTION__, __LINE__,
|
||||
name );
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] corrupt data: type is not SGFACESET '%s'",
|
||||
__FILE__, __FUNCTION__, __LINE__, name );
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -621,7 +612,7 @@ bool SGSHAPE::Prepare( const glm::dmat4* aTransform, S3D::MATLIST& materials,
|
||||
|
||||
if( !pf->validate() )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad model; inconsistent data" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad model; inconsistent data",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return true;
|
||||
@@ -674,8 +665,8 @@ bool SGSHAPE::Prepare( const glm::dmat4* aTransform, S3D::MATLIST& materials,
|
||||
|
||||
if( nColors < nCoords )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad model; not enough colors per "
|
||||
"vertex (%ul vs %ul)" ),
|
||||
wxLogTrace( MASK_3D_SG,
|
||||
"%s:%s:%d * [INFO] bad model; not enough colors per vertex (%ul vs %ul)",
|
||||
__FILE__, __FUNCTION__, __LINE__, static_cast<unsigned long>( nColors ),
|
||||
static_cast<unsigned long>( nCoords ) );
|
||||
|
||||
@@ -706,7 +697,7 @@ bool SGSHAPE::Prepare( const glm::dmat4* aTransform, S3D::MATLIST& materials,
|
||||
|
||||
if( vertices.size() < 3 )
|
||||
{
|
||||
wxLogTrace( MASK_3D_SG, wxT( "%s:%s:%d * [INFO] bad model; not enough vertices" ),
|
||||
wxLogTrace( MASK_3D_SG, "%s:%s:%d * [INFO] bad model; not enough vertices",
|
||||
__FILE__, __FUNCTION__, __LINE__ );
|
||||
|
||||
return true;
|
||||
|
||||
@@ -119,7 +119,6 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
|
||||
SetFlag( FL_ZONE, true );
|
||||
SetFlag( FL_SILKSCREEN, true );
|
||||
SetFlag( FL_SOLDERMASK, true );
|
||||
SetFlag( FL_SOLDERPASTE, true );
|
||||
SetFlag( FL_SUBTRACT_MASK_FROM_SILK, false );
|
||||
|
||||
SetFlag( FL_RENDER_OPENGL_COPPER_THICKNESS, true );
|
||||
@@ -165,49 +164,49 @@ BOARD_ADAPTER::BOARD_ADAPTER() :
|
||||
list.push_back( CUSTOM_COLOR_ITEM( r/255.0, g/255.0, b/255.0, a, name ) )
|
||||
|
||||
ADD_COLOR( g_SilkscreenColors, 245, 245, 245, 1.0, NotSpecifiedPrm() ); // White
|
||||
ADD_COLOR( g_SilkscreenColors, 20, 51, 36, 1.0, wxT( "Green" ) );
|
||||
ADD_COLOR( g_SilkscreenColors, 181, 19, 21, 1.0, wxT( "Red" ) );
|
||||
ADD_COLOR( g_SilkscreenColors, 2, 59, 162, 1.0, wxT( "Blue" ) );
|
||||
ADD_COLOR( g_SilkscreenColors, 11, 11, 11, 1.0, wxT( "Black" ) );
|
||||
ADD_COLOR( g_SilkscreenColors, 245, 245, 245, 1.0, wxT( "White" ) );
|
||||
ADD_COLOR( g_SilkscreenColors, 32, 2, 53, 1.0, wxT( "Purple" ) );
|
||||
ADD_COLOR( g_SilkscreenColors, 194, 195, 0, 1.0, wxT( "Yellow" ) );
|
||||
ADD_COLOR( g_SilkscreenColors, 20, 51, 36, 1.0, "Green" );
|
||||
ADD_COLOR( g_SilkscreenColors, 181, 19, 21, 1.0, "Red" );
|
||||
ADD_COLOR( g_SilkscreenColors, 2, 59, 162, 1.0, "Blue" );
|
||||
ADD_COLOR( g_SilkscreenColors, 11, 11, 11, 1.0, "Black" );
|
||||
ADD_COLOR( g_SilkscreenColors, 245, 245, 245, 1.0, "White" );
|
||||
ADD_COLOR( g_SilkscreenColors, 32, 2, 53, 1.0, "Purple" );
|
||||
ADD_COLOR( g_SilkscreenColors, 194, 195, 0, 1.0, "Yellow" );
|
||||
|
||||
ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, NotSpecifiedPrm() ); // Green
|
||||
ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, wxT( "Green" ) );
|
||||
ADD_COLOR( g_MaskColors, 91, 168, 12, 0.83, wxT( "Light Green" ) );
|
||||
ADD_COLOR( g_MaskColors, 13, 104, 11, 0.83, wxT( "Saturated Green" ) );
|
||||
ADD_COLOR( g_MaskColors, 181, 19, 21, 0.83, wxT( "Red" ) );
|
||||
ADD_COLOR( g_MaskColors, 210, 40, 14, 0.83, wxT( "Light Red" ) );
|
||||
ADD_COLOR( g_MaskColors, 239, 53, 41, 0.83, wxT( "Red/Orange" ) );
|
||||
ADD_COLOR( g_MaskColors, 2, 59, 162, 0.83, wxT( "Blue" ) );
|
||||
ADD_COLOR( g_MaskColors, 54, 79, 116, 0.83, wxT( "Light Blue 1" ) );
|
||||
ADD_COLOR( g_MaskColors, 61, 85, 130, 0.83, wxT( "Light Blue 2" ) );
|
||||
ADD_COLOR( g_MaskColors, 21, 70, 80, 0.83, wxT( "Green/Blue" ) );
|
||||
ADD_COLOR( g_MaskColors, 11, 11, 11, 0.83, wxT( "Black" ) );
|
||||
ADD_COLOR( g_MaskColors, 245, 245, 245, 0.83, wxT( "White" ) );
|
||||
ADD_COLOR( g_MaskColors, 32, 2, 53, 0.83, wxT( "Purple" ) );
|
||||
ADD_COLOR( g_MaskColors, 119, 31, 91, 0.83, wxT( "Light Purple" ) );
|
||||
ADD_COLOR( g_MaskColors, 194, 195, 0, 0.83, wxT( "Yellow" ) );
|
||||
ADD_COLOR( g_MaskColors, 20, 51, 36, 0.83, "Green" );
|
||||
ADD_COLOR( g_MaskColors, 91, 168, 12, 0.83, "Light Green" );
|
||||
ADD_COLOR( g_MaskColors, 13, 104, 11, 0.83, "Saturated Green" );
|
||||
ADD_COLOR( g_MaskColors, 181, 19, 21, 0.83, "Red" );
|
||||
ADD_COLOR( g_MaskColors, 210, 40, 14, 0.83, "Light Red" );
|
||||
ADD_COLOR( g_MaskColors, 239, 53, 41, 0.83, "Red/Orange" );
|
||||
ADD_COLOR( g_MaskColors, 2, 59, 162, 0.83, "Blue" );
|
||||
ADD_COLOR( g_MaskColors, 54, 79, 116, 0.83, "Light Blue 1" );
|
||||
ADD_COLOR( g_MaskColors, 61, 85, 130, 0.83, "Light Blue 2" );
|
||||
ADD_COLOR( g_MaskColors, 21, 70, 80, 0.83, "Green/Blue" );
|
||||
ADD_COLOR( g_MaskColors, 11, 11, 11, 0.83, "Black" );
|
||||
ADD_COLOR( g_MaskColors, 245, 245, 245, 0.83, "White" );
|
||||
ADD_COLOR( g_MaskColors, 32, 2, 53, 0.83, "Purple" );
|
||||
ADD_COLOR( g_MaskColors, 119, 31, 91, 0.83, "Light Purple" );
|
||||
ADD_COLOR( g_MaskColors, 194, 195, 0, 0.83, "Yellow" );
|
||||
|
||||
ADD_COLOR( g_PasteColors, 128, 128, 128, 1.0, wxT( "Grey" ) );
|
||||
ADD_COLOR( g_PasteColors, 90, 90, 90, 1.0, wxT( "Dark Grey" ) );
|
||||
ADD_COLOR( g_PasteColors, 213, 213, 213, 1.0, wxT( "Silver" ) );
|
||||
ADD_COLOR( g_PasteColors, 128, 128, 128, 1.0, "Grey" );
|
||||
ADD_COLOR( g_PasteColors, 90, 90, 90, 1.0, "Dark Grey" );
|
||||
ADD_COLOR( g_PasteColors, 213, 213, 213, 1.0, "Silver" );
|
||||
|
||||
ADD_COLOR( g_FinishColors, 184, 115, 50, 1.0, wxT( "Copper" ) );
|
||||
ADD_COLOR( g_FinishColors, 178, 156, 0, 1.0, wxT( "Gold" ) );
|
||||
ADD_COLOR( g_FinishColors, 213, 213, 213, 1.0, wxT( "Silver" ) );
|
||||
ADD_COLOR( g_FinishColors, 160, 160, 160, 1.0, wxT( "Tin" ) );
|
||||
ADD_COLOR( g_FinishColors, 184, 115, 50, 1.0, "Copper" );
|
||||
ADD_COLOR( g_FinishColors, 178, 156, 0, 1.0, "Gold" );
|
||||
ADD_COLOR( g_FinishColors, 213, 213, 213, 1.0, "Silver" );
|
||||
ADD_COLOR( g_FinishColors, 160, 160, 160, 1.0, "Tin" );
|
||||
|
||||
ADD_COLOR( g_BoardColors, 51, 43, 22, 0.83, wxT( "FR4 natural, dark" ) );
|
||||
ADD_COLOR( g_BoardColors, 109, 116, 75, 0.83, wxT( "FR4 natural" ) );
|
||||
ADD_COLOR( g_BoardColors, 252, 252, 250, 0.90, wxT( "PTFE natural" ) );
|
||||
ADD_COLOR( g_BoardColors, 205, 130, 0, 0.68, wxT( "Polyimide" ) );
|
||||
ADD_COLOR( g_BoardColors, 92, 17, 6, 0.90, wxT( "Phenolic natural" ) );
|
||||
ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, wxT( "Brown 1" ) );
|
||||
ADD_COLOR( g_BoardColors, 160, 123, 54, 0.83, wxT( "Brown 2" ) );
|
||||
ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, wxT( "Brown 3" ) );
|
||||
ADD_COLOR( g_BoardColors, 213, 213, 213, 1.0, wxT( "Aluminum" ) );
|
||||
ADD_COLOR( g_BoardColors, 51, 43, 22, 0.83, "FR4 natural, dark" );
|
||||
ADD_COLOR( g_BoardColors, 109, 116, 75, 0.83, "FR4 natural" );
|
||||
ADD_COLOR( g_BoardColors, 252, 252, 250, 0.90, "PTFE natural" );
|
||||
ADD_COLOR( g_BoardColors, 205, 130, 0, 0.68, "Polyimide" );
|
||||
ADD_COLOR( g_BoardColors, 92, 17, 6, 0.90, "Phenolic natural" );
|
||||
ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, "Brown 1" );
|
||||
ADD_COLOR( g_BoardColors, 160, 123, 54, 0.83, "Brown 2" );
|
||||
ADD_COLOR( g_BoardColors, 146, 99, 47, 0.83, "Brown 3" );
|
||||
ADD_COLOR( g_BoardColors, 213, 213, 213, 1.0, "Aluminum" );
|
||||
|
||||
g_DefaultBackgroundTop = COLOR4D( 0.80, 0.80, 0.90, 1.0 );
|
||||
g_DefaultBackgroundBot = COLOR4D( 0.40, 0.40, 0.50, 1.0 );
|
||||
@@ -560,7 +559,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
auto findColor =
|
||||
[]( const wxString& aColorName, const CUSTOM_COLORS_LIST& aColorSet )
|
||||
{
|
||||
if( aColorName.StartsWith( wxT( "#" ) ) )
|
||||
if( aColorName.StartsWith( "#" ) )
|
||||
{
|
||||
return KIGFX::COLOR4D( aColorName );
|
||||
}
|
||||
@@ -609,28 +608,28 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
KIGFX::COLOR4D layerColor = COLOR4D::UNSPECIFIED;
|
||||
const wxString& materialName = stackupItem->GetMaterial();
|
||||
|
||||
if( materialName.StartsWith( wxT( "FR4" ) ) )
|
||||
if( materialName.StartsWith( "FR4" ) )
|
||||
{
|
||||
layerColor = findColor( wxT( "FR4 natural" ), g_BoardColors );
|
||||
layerColor = findColor( "FR4 natural", g_BoardColors );
|
||||
}
|
||||
else if( materialName.IsSameAs( wxT( "PTFE" ) )
|
||||
|| materialName.IsSameAs( wxT( "Teflon" ) ) )
|
||||
else if( materialName.IsSameAs( "PTFE" )
|
||||
|| materialName.IsSameAs( "Teflon" ) )
|
||||
{
|
||||
layerColor = findColor( wxT( "PTFE natural" ), g_BoardColors );
|
||||
layerColor = findColor( "PTFE natural", g_BoardColors );
|
||||
}
|
||||
else if( materialName.IsSameAs( wxT( "Polyimide" ) )
|
||||
|| materialName.IsSameAs( wxT( "Kapton" ) ) )
|
||||
else if( materialName.IsSameAs( "Polyimide" )
|
||||
|| materialName.IsSameAs( "Kapton" ) )
|
||||
{
|
||||
layerColor = findColor( wxT( "Polyimide" ), g_BoardColors );
|
||||
layerColor = findColor( "Polyimide", g_BoardColors );
|
||||
}
|
||||
else if( materialName.IsSameAs( wxT( "Al" ) ) )
|
||||
else if( materialName.IsSameAs( "Al" ) )
|
||||
{
|
||||
layerColor = findColor( wxT( "Aluminum" ), g_BoardColors );
|
||||
layerColor = findColor( "Aluminum", g_BoardColors );
|
||||
}
|
||||
else // A default color value for unknown dielectric material
|
||||
// (i.e. an exotic name entered by hand)
|
||||
{
|
||||
layerColor = findColor( wxT( "FR4 natural" ), g_BoardColors );
|
||||
layerColor = findColor( "FR4 natural", g_BoardColors );
|
||||
}
|
||||
|
||||
if( bodyColor == COLOR4D( 0, 0, 0, 0 ) )
|
||||
@@ -654,25 +653,25 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
|
||||
|
||||
const wxString& finishName = stackup.m_FinishType;
|
||||
|
||||
if( finishName.EndsWith( wxT( "OSP" ) ) )
|
||||
if( finishName.EndsWith( "OSP" ) )
|
||||
{
|
||||
m_CopperColor = to_SFVEC4F( findColor( wxT( "Copper" ), g_FinishColors ) );
|
||||
m_CopperColor = to_SFVEC4F( findColor( "Copper", g_FinishColors ) );
|
||||
}
|
||||
else if( finishName.EndsWith( wxT( "IG" ) )
|
||||
|| finishName.EndsWith( wxT( "gold" ) ) )
|
||||
else if( finishName.EndsWith( "IG" )
|
||||
|| finishName.EndsWith( "gold" ) )
|
||||
{
|
||||
m_CopperColor = to_SFVEC4F( findColor( wxT( "Gold" ), g_FinishColors ) );
|
||||
m_CopperColor = to_SFVEC4F( findColor( "Gold", g_FinishColors ) );
|
||||
}
|
||||
else if( finishName.StartsWith( wxT( "HAL" ) )
|
||||
|| finishName.StartsWith( wxT( "HASL" ) )
|
||||
|| finishName.EndsWith( wxT( "tin" ) )
|
||||
|| finishName.EndsWith( wxT( "nickel" ) ) )
|
||||
else if( finishName.StartsWith( "HAL" )
|
||||
|| finishName.StartsWith( "HASL" )
|
||||
|| finishName.EndsWith( "tin" )
|
||||
|| finishName.EndsWith( "nickel" ) )
|
||||
{
|
||||
m_CopperColor = to_SFVEC4F( findColor( wxT( "Tin" ), g_FinishColors ) );
|
||||
m_CopperColor = to_SFVEC4F( findColor( "Tin", g_FinishColors ) );
|
||||
}
|
||||
else if( finishName.EndsWith( wxT( "silver" ) ) )
|
||||
else if( finishName.EndsWith( "silver" ) )
|
||||
{
|
||||
m_CopperColor = to_SFVEC4F( findColor( wxT( "Silver" ), g_FinishColors ) );
|
||||
m_CopperColor = to_SFVEC4F( findColor( "Silver", g_FinishColors ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -347,7 +347,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
|
||||
-seg->GetSeg().A.y * m_biuTo3Dunits );
|
||||
const SFVEC2F end3DU ( seg->GetSeg().B.x * m_biuTo3Dunits,
|
||||
-seg->GetSeg().B.y * m_biuTo3Dunits );
|
||||
const double width = seg->GetWidth() + clearance.x * 2;
|
||||
const int width = seg->GetWidth() + clearance.x * 2;
|
||||
|
||||
// Cannot add segments that have the same start and end point
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
@@ -368,7 +368,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
|
||||
case SH_CIRCLE:
|
||||
{
|
||||
const SHAPE_CIRCLE* circle = (SHAPE_CIRCLE*) shape;
|
||||
const double radius = circle->GetRadius() + clearance.x;
|
||||
const int radius = circle->GetRadius() + clearance.x;
|
||||
const SFVEC2F center( circle->GetCenter().x * m_biuTo3Dunits,
|
||||
-circle->GetCenter().y * m_biuTo3Dunits );
|
||||
|
||||
@@ -409,7 +409,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
|
||||
-seg.GetSeg().A.y * m_biuTo3Dunits );
|
||||
const SFVEC2F end3DU( seg.GetSeg().B.x * m_biuTo3Dunits,
|
||||
-seg.GetSeg().B.y * m_biuTo3Dunits );
|
||||
const double width = arc->GetWidth() + clearance.x * 2;
|
||||
const int width = arc->GetWidth() + clearance.x * 2;
|
||||
|
||||
// Cannot add segments that have the same start and end point
|
||||
if( Is_segment_a_circle( start3DU, end3DU ) )
|
||||
@@ -429,7 +429,7 @@ void BOARD_ADAPTER::createPadWithClearance( const PAD* aPad, CONTAINER_2D_BASE*
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxT( "BOARD_ADAPTER::createPadWithClearance no implementation for " )
|
||||
wxFAIL_MSG( "BOARD_ADAPTER::createPadWithClearance no implementation for "
|
||||
+ SHAPE_TYPE_asString( shape->Type() ) );
|
||||
break;
|
||||
}
|
||||
@@ -459,7 +459,7 @@ OBJECT_2D* BOARD_ADAPTER::createPadWithDrill( const PAD* aPad, int aInflateValue
|
||||
|
||||
if( drillSize.x == drillSize.y ) // usual round hole
|
||||
{
|
||||
const double radius = ( drillSize.x / 2.0 ) + aInflateValue;
|
||||
const int radius = ( drillSize.x / 2 ) + aInflateValue;
|
||||
|
||||
const SFVEC2F center( aPad->GetPosition().x * m_biuTo3Dunits,
|
||||
-aPad->GetPosition().y * m_biuTo3Dunits );
|
||||
@@ -470,7 +470,7 @@ OBJECT_2D* BOARD_ADAPTER::createPadWithDrill( const PAD* aPad, int aInflateValue
|
||||
else // Oblong hole
|
||||
{
|
||||
const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape();
|
||||
double width = seg->GetWidth() + aInflateValue * 2;
|
||||
float width = seg->GetWidth() + aInflateValue * 2;
|
||||
|
||||
SFVEC2F start3DU( seg->GetSeg().A.x * m_biuTo3Dunits,
|
||||
-seg->GetSeg().A.y * m_biuTo3Dunits );
|
||||
@@ -493,10 +493,15 @@ void BOARD_ADAPTER::addPadsWithClearance( const FOOTPRINT* aFootprint,
|
||||
{
|
||||
for( PAD* pad : aFootprint->Pads() )
|
||||
{
|
||||
if( !pad->FlashLayer( aLayerId ) )
|
||||
if( !pad->IsOnLayer( aLayerId ) )
|
||||
continue;
|
||||
|
||||
// NPTH pads are not drawn on layers if the shape size and pos is the same as their hole:
|
||||
// Skip pad annulus when not connected on this layer (if removing is enabled)
|
||||
if( !pad->FlashLayer( aLayerId ) && IsCopperLayer( aLayerId ) )
|
||||
continue;
|
||||
|
||||
// NPTH pads are not drawn on layers if the
|
||||
// shape size and pos is the same as their hole:
|
||||
if( aSkipNPTHPadsWihNoCopper && ( pad->GetAttribute() == PAD_ATTRIB::NPTH ) )
|
||||
{
|
||||
if( pad->GetDrillSize() == pad->GetSize() && pad->GetOffset() == wxPoint( 0, 0 ) )
|
||||
@@ -521,28 +526,19 @@ void BOARD_ADAPTER::addPadsWithClearance( const FOOTPRINT* aFootprint,
|
||||
}
|
||||
}
|
||||
|
||||
const bool isPlated = ( ( aLayerId == F_Cu ) && pad->FlashLayer( F_Mask ) ) ||
|
||||
( ( aLayerId == B_Cu ) && pad->FlashLayer( B_Mask ) );
|
||||
|
||||
if( aSkipPlatedPads && isPlated )
|
||||
continue;
|
||||
|
||||
if( aSkipNonPlatedPads && !isPlated )
|
||||
continue;
|
||||
|
||||
wxSize margin( aInflateValue, aInflateValue );
|
||||
|
||||
switch( aLayerId )
|
||||
{
|
||||
case F_Cu:
|
||||
if( aSkipPlatedPads && pad->FlashLayer( F_Mask ) )
|
||||
continue;
|
||||
|
||||
if( aSkipNonPlatedPads && !pad->FlashLayer( F_Mask ) )
|
||||
continue;
|
||||
|
||||
break;
|
||||
|
||||
case B_Cu:
|
||||
if( aSkipPlatedPads && pad->FlashLayer( B_Mask ) )
|
||||
continue;
|
||||
|
||||
if( aSkipNonPlatedPads && !pad->FlashLayer( B_Mask ) )
|
||||
continue;
|
||||
|
||||
break;
|
||||
|
||||
case F_Mask:
|
||||
case B_Mask:
|
||||
margin.x += pad->GetSolderMaskMargin();
|
||||
@@ -571,7 +567,7 @@ void BOARD_ADAPTER::transformArcToSegments( const wxPoint& aCentre, const wxPoin
|
||||
const BOARD_ITEM& aBoardItem )
|
||||
{
|
||||
wxPoint arc_start, arc_end;
|
||||
double delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
|
||||
int delta = 3600 / aCircleToSegmentsCount; // rotate angle in 0.1 degree
|
||||
|
||||
arc_end = arc_start = aStart;
|
||||
|
||||
@@ -590,7 +586,7 @@ void BOARD_ADAPTER::transformArcToSegments( const wxPoint& aCentre, const wxPoin
|
||||
wxPoint curr_end = arc_start;
|
||||
wxPoint curr_start = arc_start;
|
||||
|
||||
for( double ii = delta; ii < aArcAngle; ii += delta )
|
||||
for( int ii = delta; ii < aArcAngle; ii += delta )
|
||||
{
|
||||
curr_end = arc_start;
|
||||
RotatePoint( &curr_end, aCentre, -ii );
|
||||
@@ -640,7 +636,7 @@ void BOARD_ADAPTER::addShapeWithClearance( const PCB_SHAPE* aShape,
|
||||
{
|
||||
// The full width of the lines to create
|
||||
// The extra 1 protects the inner/outer radius values from degeneracy
|
||||
const double linewidth = aShape->GetWidth() + ( 2 * aClearanceValue ) + 1;
|
||||
const int linewidth = aShape->GetWidth() + ( 2 * aClearanceValue ) + 1;
|
||||
|
||||
switch( aShape->GetShape() )
|
||||
{
|
||||
@@ -742,7 +738,7 @@ void BOARD_ADAPTER::addShapeWithClearance( const PCB_SHAPE* aShape,
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxT( "BOARD_ADAPTER::addShapeWithClearance no implementation for " )
|
||||
wxFAIL_MSG( "BOARD_ADAPTER::addShapeWithClearance no implementation for "
|
||||
+ aShape->SHAPE_T_asString() );
|
||||
break;
|
||||
}
|
||||
@@ -835,9 +831,9 @@ void BOARD_ADAPTER::buildPadOutlineAsSegments( const PAD* aPad, CONTAINER_2D_BAS
|
||||
const SFVEC2F center3DU( aPad->ShapePos().x * m_biuTo3Dunits,
|
||||
-aPad->ShapePos().y * m_biuTo3Dunits );
|
||||
|
||||
const double radius = aPad->GetSize().x / 2.0;
|
||||
const float inner_radius = ( radius - aWidth / 2.0 ) * m_biuTo3Dunits;
|
||||
const float outer_radius = ( radius + aWidth / 2.0 ) * m_biuTo3Dunits;
|
||||
const int radius = aPad->GetSize().x / 2;
|
||||
const float inner_radius = ( radius - aWidth / 2 ) * m_biuTo3Dunits;
|
||||
const float outer_radius = ( radius + aWidth / 2 ) * m_biuTo3Dunits;
|
||||
|
||||
aDstContainer->Add( new RING_2D( center3DU, inner_radius, outer_radius, *aPad ) );
|
||||
|
||||
|
||||
@@ -549,6 +549,7 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
addPadsWithClearance( footprint, m_platedPadsFront, F_Cu, 0, true, false, true );
|
||||
|
||||
addPadsWithClearance( footprint, m_platedPadsBack, B_Cu, 0, true, false, true );
|
||||
}
|
||||
|
||||
@@ -568,8 +569,8 @@ void BOARD_ADAPTER::createLayers( REPORTER* aStatusReporter )
|
||||
// Add pads to polygon list
|
||||
for( FOOTPRINT* footprint : m_board->Footprints() )
|
||||
{
|
||||
// Note: NPTH pads are not drawn on copper layers when the pad has same shape as
|
||||
// its hole
|
||||
// Note: NPTH pads are not drawn on copper layers when the pad
|
||||
// has same shape as its hole
|
||||
footprint->TransformPadsWithClearanceToPolygon( *layerPoly, curr_layer_id,
|
||||
0, ARC_HIGH_DEF, ERROR_INSIDE,
|
||||
true, renderPlatedPadsAsPlated,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -89,34 +89,32 @@ END_EVENT_TABLE()
|
||||
|
||||
EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList,
|
||||
BOARD_ADAPTER& aBoardAdapter, CAMERA& aCamera,
|
||||
S3D_CACHE* a3DCachePointer ) :
|
||||
HIDPI_GL_CANVAS( aParent, wxID_ANY, aAttribList, wxDefaultPosition, wxDefaultSize,
|
||||
S3D_CACHE* a3DCachePointer )
|
||||
: HIDPI_GL_CANVAS( aParent, wxID_ANY, aAttribList, wxDefaultPosition, wxDefaultSize,
|
||||
wxFULL_REPAINT_ON_RESIZE ),
|
||||
m_eventDispatcher( nullptr ),
|
||||
m_parentStatusBar( nullptr ),
|
||||
m_parentInfoBar( nullptr ),
|
||||
m_glRC( nullptr ),
|
||||
m_is_opengl_initialized( false ),
|
||||
m_is_opengl_version_supported( true ),
|
||||
m_editing_timeout_timer( this, wxID_HIGHEST + 1 ),
|
||||
m_redraw_trigger_timer( this, wxID_HIGHEST + 2 ),
|
||||
m_mouse_is_moving( false ),
|
||||
m_mouse_was_moved( false ),
|
||||
m_camera_is_moving( false ),
|
||||
m_render_pivot( false ),
|
||||
m_camera_moving_speed( 1.0f ),
|
||||
m_strtime_camera_movement( 0 ),
|
||||
m_animation_enabled( true ),
|
||||
m_moving_speed_multiplier( 3 ),
|
||||
m_boardAdapter( aBoardAdapter ),
|
||||
m_camera( aCamera ),
|
||||
m_3d_render( nullptr ),
|
||||
m_opengl_supports_raytracing( true ),
|
||||
m_render_raytracing_was_requested( false ),
|
||||
m_accelerator3DShapes( nullptr ),
|
||||
m_currentRollOverItem( nullptr )
|
||||
m_eventDispatcher( nullptr ),
|
||||
m_parentStatusBar( nullptr ),
|
||||
m_parentInfoBar( nullptr ),
|
||||
m_glRC( nullptr ),
|
||||
m_is_opengl_initialized( false ),
|
||||
m_is_opengl_version_supported( true ),
|
||||
m_mouse_is_moving( false ),
|
||||
m_mouse_was_moved( false ),
|
||||
m_camera_is_moving( false ),
|
||||
m_render_pivot( false ),
|
||||
m_camera_moving_speed( 1.0f ),
|
||||
m_strtime_camera_movement( 0 ),
|
||||
m_animation_enabled( true ),
|
||||
m_moving_speed_multiplier( 3 ),
|
||||
m_boardAdapter( aBoardAdapter ),
|
||||
m_camera( aCamera ),
|
||||
m_3d_render( nullptr ),
|
||||
m_opengl_supports_raytracing( true ),
|
||||
m_render_raytracing_was_requested( false ),
|
||||
m_accelerator3DShapes( nullptr ),
|
||||
m_currentRollOverItem( nullptr )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::EDA_3D_CANVAS" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::EDA_3D_CANVAS" );
|
||||
|
||||
m_editing_timeout_timer.SetOwner( this );
|
||||
Connect( m_editing_timeout_timer.GetId(), wxEVT_TIMER,
|
||||
@@ -169,7 +167,7 @@ EDA_3D_CANVAS::EDA_3D_CANVAS( wxWindow* aParent, const int* aAttribList,
|
||||
|
||||
EDA_3D_CANVAS::~EDA_3D_CANVAS()
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::~EDA_3D_CANVAS" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::~EDA_3D_CANVAS" );
|
||||
|
||||
delete m_accelerator3DShapes;
|
||||
m_accelerator3DShapes = nullptr;
|
||||
@@ -216,7 +214,7 @@ void EDA_3D_CANVAS::OnResize( wxSizeEvent& event )
|
||||
|
||||
bool EDA_3D_CANVAS::initializeOpenGL()
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::initializeOpenGL" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::initializeOpenGL" );
|
||||
|
||||
const GLenum err = glewInit();
|
||||
|
||||
@@ -230,13 +228,13 @@ bool EDA_3D_CANVAS::initializeOpenGL()
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::initializeOpenGL Using GLEW version %s" ),
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::initializeOpenGL Using GLEW version %s",
|
||||
FROM_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
|
||||
}
|
||||
|
||||
wxString version = FROM_UTF8( (char *) glGetString( GL_VERSION ) );
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::%s OpenGL version string %s." ),
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::%s OpenGL version string %s.",
|
||||
__WXFUNCTION__, version );
|
||||
|
||||
// Extract OpenGL version from string. This method is used because prior to OpenGL 2,
|
||||
@@ -252,7 +250,7 @@ bool EDA_3D_CANVAS::initializeOpenGL()
|
||||
|
||||
tmp = tokenizer.GetNextToken();
|
||||
|
||||
tokenizer.SetString( tmp, wxString( wxT( "." ) ) );
|
||||
tokenizer.SetString( tmp, wxString( "." ) );
|
||||
|
||||
if( tokenizer.HasMoreTokens() )
|
||||
tokenizer.GetNextToken().ToLong( &major );
|
||||
@@ -262,7 +260,7 @@ bool EDA_3D_CANVAS::initializeOpenGL()
|
||||
|
||||
if( major < 2 || ( ( major == 2 ) && ( minor < 1 ) ) )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::%s OpenGL ray tracing not supported." ),
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::%s OpenGL ray tracing not supported.",
|
||||
__WXFUNCTION__ );
|
||||
|
||||
if( GetParent() )
|
||||
@@ -276,8 +274,7 @@ bool EDA_3D_CANVAS::initializeOpenGL()
|
||||
|
||||
if( ( major == 1 ) && ( minor < 5 ) )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::%s OpenGL not supported." ),
|
||||
__WXFUNCTION__ );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::%s OpenGL not supported.", __WXFUNCTION__ );
|
||||
|
||||
m_is_opengl_version_supported = false;
|
||||
}
|
||||
@@ -330,10 +327,10 @@ void EDA_3D_CANVAS::DisplayStatus()
|
||||
{
|
||||
wxString msg;
|
||||
|
||||
msg.Printf( wxT( "dx %3.2f" ), m_camera.GetCameraPos().x );
|
||||
msg.Printf( "dx %3.2f", m_camera.GetCameraPos().x );
|
||||
m_parentStatusBar->SetStatusText( msg, static_cast<int>( EDA_3D_VIEWER_STATUSBAR::X_POS ) );
|
||||
|
||||
msg.Printf( wxT( "dy %3.2f" ), m_camera.GetCameraPos().y );
|
||||
msg.Printf( "dy %3.2f", m_camera.GetCameraPos().y );
|
||||
m_parentStatusBar->SetStatusText( msg, static_cast<int>( EDA_3D_VIEWER_STATUSBAR::Y_POS ) );
|
||||
}
|
||||
}
|
||||
@@ -354,7 +351,7 @@ void EDA_3D_CANVAS::DoRePaint()
|
||||
// SwapBuffer requires the window to be shown before calling
|
||||
if( !IsShownOnScreen() )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::DoRePaint !IsShown" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::DoRePaint !IsShown" );
|
||||
m_is_currently_painting.clear();
|
||||
return;
|
||||
}
|
||||
@@ -521,7 +518,7 @@ void EDA_3D_CANVAS::DoRePaint()
|
||||
if( m_render_pivot )
|
||||
{
|
||||
const float scale = glm::min( m_camera.GetZoom(), 1.0f );
|
||||
render_pivot( curtime_delta_s, scale );
|
||||
render_pivot( curtime_delta_s, scale * scale );
|
||||
}
|
||||
|
||||
// "Swaps the double-buffer of this window, making the back-buffer the
|
||||
@@ -580,7 +577,7 @@ void EDA_3D_CANVAS::OnEvent( wxEvent& aEvent )
|
||||
|
||||
void EDA_3D_CANVAS::OnEraseBackground( wxEraseEvent& event )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::OnEraseBackground" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::OnEraseBackground" );
|
||||
// Do nothing, to avoid flashing.
|
||||
}
|
||||
|
||||
@@ -589,7 +586,7 @@ void EDA_3D_CANVAS::OnMouseWheel( wxMouseEvent& event )
|
||||
{
|
||||
bool mouseActivity = false;
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_CANVAS::OnMouseWheel" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_CANVAS::OnMouseWheel" );
|
||||
|
||||
if( m_camera_is_moving )
|
||||
return;
|
||||
@@ -785,7 +782,7 @@ void EDA_3D_CANVAS::OnMouseMove( wxMouseEvent& event )
|
||||
m_3d_render_opengl->SetCurrentRollOverItem( nullptr );
|
||||
Request_refresh();
|
||||
|
||||
reporter.Report( wxEmptyString );
|
||||
reporter.Report( "" );
|
||||
}
|
||||
|
||||
m_currentRollOverItem = nullptr;
|
||||
@@ -847,14 +844,8 @@ void EDA_3D_CANVAS::OnMiddleUp( wxMouseEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CANVAS::OnTimerTimeout_Editing( wxTimerEvent& aEvent )
|
||||
void EDA_3D_CANVAS::OnTimerTimeout_Editing( wxTimerEvent& /* event */ )
|
||||
{
|
||||
if( aEvent.GetId() != m_editing_timeout_timer.GetId() )
|
||||
{
|
||||
aEvent.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
m_mouse_is_moving = false;
|
||||
m_mouse_was_moved = false;
|
||||
|
||||
@@ -875,14 +866,8 @@ void EDA_3D_CANVAS::restart_editingTimeOut_Timer()
|
||||
}
|
||||
|
||||
|
||||
void EDA_3D_CANVAS::OnTimerTimeout_Redraw( wxTimerEvent& aEvent )
|
||||
void EDA_3D_CANVAS::OnTimerTimeout_Redraw( wxTimerEvent& event )
|
||||
{
|
||||
if( aEvent.GetId() != m_redraw_trigger_timer.GetId() )
|
||||
{
|
||||
aEvent.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
Request_refresh( true );
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ void EDA_3D_CANVAS::render_pivot( float t , float aScale )
|
||||
glTranslatef( lookAtPos.x, lookAtPos.y, lookAtPos.z );
|
||||
|
||||
glScalef( aScale, aScale, aScale );
|
||||
|
||||
pivot_render_triangles( t * 0.5f );
|
||||
|
||||
t = t * 0.80f;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
* 3d models that come in the original data from the files without any transformations.
|
||||
*/
|
||||
|
||||
#include <gal/opengl/kiglew.h> // Must be included first
|
||||
#include <iostream>
|
||||
#include "3d_rendering/opengl/3d_model.h"
|
||||
#include "eda_3d_model_viewer.h"
|
||||
@@ -39,7 +38,6 @@
|
||||
#include <settings/common_settings.h>
|
||||
#include <pgm_base.h>
|
||||
#include <gal/dpi_scaling.h>
|
||||
#include <macros.h>
|
||||
|
||||
/**
|
||||
* Scale conversion from 3d model units to pcb units
|
||||
@@ -184,20 +182,6 @@ void EDA_3D_MODEL_VIEWER::Clear3DModel()
|
||||
|
||||
void EDA_3D_MODEL_VIEWER::ogl_initialize()
|
||||
{
|
||||
const GLenum err = glewInit();
|
||||
|
||||
if( GLEW_OK != err )
|
||||
{
|
||||
const wxString msgError = (const char*) glewGetErrorString( err );
|
||||
|
||||
wxLogMessage( msgError );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_MODEL_VIEWER::ogl_initialize Using GLEW version %s" ),
|
||||
FROM_UTF8( (char*) glewGetString( GLEW_VERSION ) ) );
|
||||
}
|
||||
|
||||
glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST );
|
||||
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
|
||||
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
|
||||
|
||||
@@ -41,7 +41,7 @@ static void dbg_save_rgb_buffer( const wxString& aFileName, unsigned char *aRGBp
|
||||
wxImage image( aXSize, aYSize );
|
||||
image.SetData( aRGBpixelBuffer );
|
||||
image = image.Mirror( false );
|
||||
image.SaveFile( aFileName + wxT( ".png" ), wxBITMAP_TYPE_PNG );
|
||||
image.SaveFile( aFileName + ".png", wxBITMAP_TYPE_PNG );
|
||||
image.Destroy();
|
||||
}
|
||||
|
||||
|
||||
@@ -276,7 +276,7 @@ OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateHoles( const LIST_OBJECT2D& aListH
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxT( "RENDER_3D_OPENGL::generateHoles: Object type not implemented" ) );
|
||||
wxFAIL_MSG( "RENDER_3D_OPENGL::generateHoles: Object type is not implemented" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -358,7 +358,7 @@ OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateLayerList( const BVH_CONTAINER_2D*
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxT( "RENDER_3D_OPENGL: Object type is not implemented" ) );
|
||||
wxFAIL_MSG( "RENDER_3D_OPENGL: Object type is not implemented" );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -374,22 +374,6 @@ OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateLayerList( const BVH_CONTAINER_2D*
|
||||
}
|
||||
|
||||
|
||||
OPENGL_RENDER_LIST* RENDER_3D_OPENGL::generateEmptyLayerList( PCB_LAYER_ID aLayerId )
|
||||
{
|
||||
float layer_z_bot = 0.0f;
|
||||
float layer_z_top = 0.0f;
|
||||
|
||||
getLayerZPos( aLayerId, layer_z_top, layer_z_bot );
|
||||
|
||||
TRIANGLE_DISPLAY_LIST* layerTriangles = new TRIANGLE_DISPLAY_LIST( 1 );
|
||||
|
||||
// store in a list so it will be latter deleted
|
||||
m_triangles.push_back( layerTriangles );
|
||||
|
||||
return new OPENGL_RENDER_LIST( *layerTriangles, m_circleTexture, layer_z_bot, layer_z_top );
|
||||
}
|
||||
|
||||
|
||||
OPENGL_RENDER_LIST* RENDER_3D_OPENGL::createBoard( const SHAPE_POLY_SET& aBoardPoly,
|
||||
const BVH_CONTAINER_2D* aThroughHoles )
|
||||
{
|
||||
@@ -404,8 +388,9 @@ OPENGL_RENDER_LIST* RENDER_3D_OPENGL::createBoard( const SHAPE_POLY_SET& aBoardP
|
||||
|
||||
if( listBoardObject2d.size() > 0 )
|
||||
{
|
||||
// We will set a unitary Z so it will in future used with transformations since the
|
||||
// board poly will be used not only to draw itself but also the solder mask layers.
|
||||
// We will set a unitary Z so it will in future used with transformations
|
||||
// since the board poly will be used not only to draw itself but also the
|
||||
// solder mask layers.
|
||||
const float layer_z_top = 1.0f;
|
||||
const float layer_z_bot = 0.0f;
|
||||
|
||||
@@ -578,7 +563,7 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
|
||||
const BVH_CONTAINER_2D* container2d = ii.second;
|
||||
|
||||
SHAPE_POLY_SET polyListSubtracted;
|
||||
SHAPE_POLY_SET* polyList = nullptr;
|
||||
SHAPE_POLY_SET* aPolyList = nullptr;
|
||||
|
||||
// Load the vertical (Z axis) component of shapes
|
||||
|
||||
@@ -595,8 +580,9 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
|
||||
{
|
||||
polyListSubtracted.BooleanSubtract( m_boardAdapter.GetThroughHoleOdPolys(),
|
||||
SHAPE_POLY_SET::PM_FAST );
|
||||
polyListSubtracted.BooleanSubtract( m_boardAdapter.GetOuterNonPlatedThroughHolePoly(),
|
||||
SHAPE_POLY_SET::PM_FAST );
|
||||
polyListSubtracted.BooleanSubtract(
|
||||
m_boardAdapter.GetOuterNonPlatedThroughHolePoly(),
|
||||
SHAPE_POLY_SET::PM_FAST );
|
||||
}
|
||||
|
||||
if( m_boardAdapter.GetFlag( FL_SUBTRACT_MASK_FROM_SILK ) )
|
||||
@@ -614,10 +600,10 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
|
||||
}
|
||||
}
|
||||
|
||||
polyList = &polyListSubtracted;
|
||||
aPolyList = &polyListSubtracted;
|
||||
}
|
||||
|
||||
OPENGL_RENDER_LIST* oglList = generateLayerList( container2d, polyList, layer_id,
|
||||
OPENGL_RENDER_LIST* oglList = generateLayerList( container2d, aPolyList, layer_id,
|
||||
&m_boardAdapter.GetThroughHoleIds() );
|
||||
|
||||
if( oglList != nullptr )
|
||||
@@ -640,10 +626,6 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
|
||||
|
||||
m_platedPadsFront = generateLayerList( m_boardAdapter.GetPlatedPadsFront(),
|
||||
&polySubtracted, F_Cu );
|
||||
|
||||
// An entry for F_Cu must exist in m_layers or we'll never look at m_platedPadsFront
|
||||
if( m_layers.count( F_Cu ) == 0 )
|
||||
m_layers[F_Cu] = generateEmptyLayerList( F_Cu );
|
||||
}
|
||||
|
||||
if( m_boardAdapter.GetBackPlatedPadPolys() )
|
||||
@@ -658,10 +640,6 @@ void RENDER_3D_OPENGL::reload( REPORTER* aStatusReporter, REPORTER* aWarningRepo
|
||||
|
||||
m_platedPadsBack = generateLayerList( m_boardAdapter.GetPlatedPadsBack(),
|
||||
&polySubtracted, B_Cu );
|
||||
|
||||
// An entry for B_Cu must exist in m_layers or we'll never look at m_platedPadsBack
|
||||
if( m_layers.count( B_Cu ) == 0 )
|
||||
m_layers[B_Cu] = generateEmptyLayerList( B_Cu );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -650,7 +650,6 @@ GLuint OPENGL_RENDER_LIST::generate_top_or_bot_seg_ends(
|
||||
|
||||
glDrawArrays( GL_TRIANGLES, 0, aTriangleContainer->GetVertexSize() );
|
||||
|
||||
glBindTexture( GL_TEXTURE_2D, 0 );
|
||||
glDisable( GL_TEXTURE_2D );
|
||||
glDisable( GL_ALPHA_TEST );
|
||||
glDisable( GL_BLEND );
|
||||
|
||||
@@ -504,7 +504,7 @@ void RENDER_3D_OPENGL::setCopperMaterial()
|
||||
void RENDER_3D_OPENGL::setPlatedCopperAndDepthOffset( PCB_LAYER_ID aLayer_id )
|
||||
{
|
||||
glEnable( GL_POLYGON_OFFSET_FILL );
|
||||
glPolygonOffset( -0.1f, -2.0f );
|
||||
glPolygonOffset(-0.1f, -2.0f );
|
||||
setLayerMaterial( aLayer_id );
|
||||
}
|
||||
|
||||
@@ -704,16 +704,18 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
{
|
||||
pLayerDispList->DrawAllCameraCulled( m_camera.GetPos().z, drawMiddleSegments );
|
||||
|
||||
// Draw plated pads
|
||||
// Draw copper plated pads
|
||||
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
|
||||
( m_platedPadsFront || m_platedPadsBack ) )
|
||||
setPlatedCopperAndDepthOffset( layer_id );
|
||||
|
||||
if( layer_id == F_Cu && m_platedPadsFront )
|
||||
{
|
||||
setPlatedCopperAndDepthOffset( layer_id );
|
||||
m_platedPadsFront->DrawAllCameraCulled( m_camera.GetPos().z,
|
||||
drawMiddleSegments );
|
||||
}
|
||||
else if( layer_id == B_Cu && m_platedPadsBack )
|
||||
{
|
||||
setPlatedCopperAndDepthOffset( layer_id );
|
||||
m_platedPadsBack->DrawAllCameraCulled( m_camera.GetPos().z,
|
||||
drawMiddleSegments );
|
||||
}
|
||||
@@ -749,10 +751,16 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
viasHolesLayer,
|
||||
m_antiBoard );
|
||||
|
||||
// Draw plated pads
|
||||
if( layer_id == F_Cu && m_platedPadsFront )
|
||||
// Draw copper plated pads
|
||||
|
||||
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
|
||||
( m_platedPadsFront || m_platedPadsBack ) )
|
||||
{
|
||||
setPlatedCopperAndDepthOffset( layer_id );
|
||||
}
|
||||
|
||||
if( layer_id == F_Cu && m_platedPadsFront )
|
||||
{
|
||||
m_platedPadsFront->DrawAllCameraCulledSubtractLayer(
|
||||
drawMiddleSegments,
|
||||
m_outerThroughHoles,
|
||||
@@ -761,7 +769,6 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
}
|
||||
else if( layer_id == B_Cu && m_platedPadsBack )
|
||||
{
|
||||
setPlatedCopperAndDepthOffset( layer_id );
|
||||
m_platedPadsBack->DrawAllCameraCulledSubtractLayer(
|
||||
drawMiddleSegments,
|
||||
m_outerThroughHoles,
|
||||
@@ -778,16 +785,21 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
m_outerThroughHoles,
|
||||
m_antiBoard );
|
||||
|
||||
if( layer_id == F_Cu && m_platedPadsFront )
|
||||
// Draw copper plated pads
|
||||
if( ( ( layer_id == F_Cu ) || ( layer_id == B_Cu ) ) &&
|
||||
( m_platedPadsFront || m_platedPadsBack ) )
|
||||
{
|
||||
setPlatedCopperAndDepthOffset( layer_id );
|
||||
}
|
||||
|
||||
if( layer_id == F_Cu && m_platedPadsFront )
|
||||
{
|
||||
m_platedPadsFront->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
|
||||
m_outerThroughHoles,
|
||||
m_antiBoard );
|
||||
}
|
||||
else if( layer_id == B_Cu && m_platedPadsBack )
|
||||
{
|
||||
setPlatedCopperAndDepthOffset( layer_id );
|
||||
m_platedPadsBack->DrawAllCameraCulledSubtractLayer( drawMiddleSegments,
|
||||
m_outerThroughHoles,
|
||||
m_antiBoard );
|
||||
@@ -926,7 +938,7 @@ bool RENDER_3D_OPENGL::Redraw( bool aIsMoving, REPORTER* aStatusReporter,
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_SRC0_ALPHA, GL_PRIMARY_COLOR );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_SRC1_ALPHA, GL_CONSTANT );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA );
|
||||
glTexEnvi( GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_CONSTANT );
|
||||
|
||||
render3dModels( false, true );
|
||||
render3dModels( true, true );
|
||||
|
||||
@@ -84,8 +84,6 @@ private:
|
||||
PCB_LAYER_ID aLayerId,
|
||||
const BVH_CONTAINER_2D* aThroughHoles = nullptr );
|
||||
|
||||
OPENGL_RENDER_LIST* generateEmptyLayerList( PCB_LAYER_ID aLayerId );
|
||||
|
||||
void addTopAndBottomTriangles( TRIANGLE_DISPLAY_LIST* aDst, const SFVEC2F& v0,
|
||||
const SFVEC2F& v1, const SFVEC2F& v2, float top, float bot );
|
||||
|
||||
|
||||
@@ -192,9 +192,9 @@ const float& POST_SHADER::GetShadowFactorAt( const SFVEC2I& aPos ) const
|
||||
|
||||
void POST_SHADER::DebugBuffersOutputAsImages() const
|
||||
{
|
||||
DBG_SaveBuffer( wxT( "m_shadow_att_factor" ), m_shadow_att_factor, m_size.x, m_size.y );
|
||||
DBG_SaveBuffer( wxT( "m_color" ), m_color, m_size.x, m_size.y );
|
||||
DBG_SaveNormalsBuffer( wxT( "m_normals" ), m_normals, m_size.x, m_size.y );
|
||||
DBG_SaveBuffer( "m_shadow_att_factor", m_shadow_att_factor, m_size.x, m_size.y );
|
||||
DBG_SaveBuffer( "m_color", m_color, m_size.x, m_size.y );
|
||||
DBG_SaveNormalsBuffer( "m_normals", m_normals, m_size.x, m_size.y );
|
||||
|
||||
// Normalize depth
|
||||
float *normalizedDepth = (float*) malloc( m_size.x * m_size.y * sizeof( float ) );
|
||||
@@ -210,7 +210,7 @@ void POST_SHADER::DebugBuffersOutputAsImages() const
|
||||
}
|
||||
}
|
||||
|
||||
DBG_SaveBuffer( wxT( "m_depthNormalized" ), normalizedDepth, m_size.x, m_size.y );
|
||||
DBG_SaveBuffer( "m_depthNormalized", normalizedDepth, m_size.x, m_size.y );
|
||||
|
||||
free( normalizedDepth );
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ void RENDER_3D_RAYTRACE::render( GLubyte* ptrPBO, REPORTER* aStatusReporter )
|
||||
break;
|
||||
|
||||
default:
|
||||
wxASSERT_MSG( false, wxT( "Invalid state on m_renderState" ) );
|
||||
wxASSERT_MSG( false, "Invalid state on m_renderState");
|
||||
restartRenderState();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::CreateMenuBar()
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::CreateMenuBar" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::CreateMenuBar" );
|
||||
|
||||
COMMON_CONTROL* tool = m_toolManager->GetTool<COMMON_CONTROL>();
|
||||
WX_MENUBAR* menuBar = new WX_MENUBAR();
|
||||
@@ -48,12 +48,12 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar()
|
||||
ACTION_MENU* fileMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
fileMenu->Add( _( "Export Current View as PNG..." ),
|
||||
wxEmptyString,
|
||||
"",
|
||||
ID_MENU_SCREENCOPY_PNG,
|
||||
BITMAPS::export_png );
|
||||
|
||||
fileMenu->Add( _( "Export Current View as JPEG..." ),
|
||||
wxEmptyString,
|
||||
"",
|
||||
ID_MENU_SCREENCOPY_JPEG,
|
||||
BITMAPS::export_file );
|
||||
|
||||
@@ -67,7 +67,7 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar()
|
||||
ACTION_MENU* editMenu = new ACTION_MENU( false, tool );
|
||||
|
||||
editMenu->Add( _( "Copy 3D Image" ),
|
||||
wxEmptyString,
|
||||
"",
|
||||
ID_TOOL_SCREENCOPY_TOCLIBBOARD,
|
||||
BITMAPS::copy );
|
||||
|
||||
@@ -109,7 +109,7 @@ void EDA_3D_VIEWER_FRAME::CreateMenuBar()
|
||||
BITMAPS::tools,
|
||||
ACTION_MENU::CHECK );
|
||||
|
||||
prefsMenu->Add( _( "Preferences..." ) + wxT( "\tCtrl+," ),
|
||||
prefsMenu->Add( _( "Preferences..." ) + "\tCtrl+,",
|
||||
_( "Show preferences for all open tools" ),
|
||||
wxID_PREFERENCES,
|
||||
BITMAPS::preference );
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::ReCreateMainToolbar()
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::ReCreateMainToolbar" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::ReCreateMainToolbar" );
|
||||
|
||||
wxWindowUpdateLocker dummy( this );
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME( KIWAY *aKiway, PCB_BASE_FRAME *aParent
|
||||
m_currentCamera( m_trackBallCamera ),
|
||||
m_trackBallCamera( 2 * RANGE_SCALE_3D )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME %s" ), aTitle );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::EDA_3D_VIEWER_FRAME %s", aTitle );
|
||||
|
||||
m_disable_ray_tracing = false;
|
||||
m_aboutTitle = _( "KiCad 3D Viewer" );
|
||||
@@ -281,7 +281,7 @@ void EDA_3D_VIEWER_FRAME::refreshRender()
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::Exit3DFrame( wxCommandEvent &event )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::Exit3DFrame" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::Exit3DFrame" );
|
||||
|
||||
Close( true );
|
||||
}
|
||||
@@ -289,7 +289,7 @@ void EDA_3D_VIEWER_FRAME::Exit3DFrame( wxCommandEvent &event )
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::OnCloseWindow( wxCloseEvent &event )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::OnCloseWindow" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::OnCloseWindow" );
|
||||
|
||||
if( m_canvas )
|
||||
m_canvas->Close();
|
||||
@@ -308,8 +308,7 @@ void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
|
||||
int id = event.GetId();
|
||||
bool isChecked = event.IsChecked();
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::Process_Special_Functions id %d "
|
||||
"isChecked %d" ),
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::Process_Special_Functions id %d isChecked %d",
|
||||
id,
|
||||
isChecked );
|
||||
|
||||
@@ -342,7 +341,7 @@ void EDA_3D_VIEWER_FRAME::Process_Special_Functions( wxCommandEvent &event )
|
||||
return;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxT( "Invalid event in EDA_3D_VIEWER_FRAME::Process_Special_Functions()" ) );
|
||||
wxFAIL_MSG( "Invalid event in EDA_3D_VIEWER_FRAME::Process_Special_Functions()" );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -357,9 +356,9 @@ void EDA_3D_VIEWER_FRAME::OnRenderEngineSelection( wxCommandEvent &event )
|
||||
else
|
||||
m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL );
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::OnRenderEngineSelection type %s " ),
|
||||
m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::RAYTRACING ? wxT( "raytracing" )
|
||||
: wxT( "realtime" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::OnRenderEngineSelection type %s ",
|
||||
( m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::RAYTRACING ) ? "raytracing" :
|
||||
"realtime" );
|
||||
|
||||
if( old_engine != m_boardAdapter.GetRenderEngine() )
|
||||
RenderEngineChanged();
|
||||
@@ -368,8 +367,7 @@ void EDA_3D_VIEWER_FRAME::OnRenderEngineSelection( wxCommandEvent &event )
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::OnDisableRayTracing( wxCommandEvent& aEvent )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::%s disabling ray tracing." ),
|
||||
__WXFUNCTION__ );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::%s disabling ray tracing.", __WXFUNCTION__ );
|
||||
|
||||
m_disable_ray_tracing = true;
|
||||
m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL );
|
||||
@@ -378,7 +376,7 @@ void EDA_3D_VIEWER_FRAME::OnDisableRayTracing( wxCommandEvent& aEvent )
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::OnActivate( wxActivateEvent &aEvent )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::OnActivate" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::OnActivate" );
|
||||
|
||||
if( aEvent.GetActive() && m_canvas )
|
||||
{
|
||||
@@ -412,7 +410,7 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
|
||||
EDA_3D_VIEWER_SETTINGS* cfg = dynamic_cast<EDA_3D_VIEWER_SETTINGS*>( aCfg );
|
||||
wxASSERT( cfg );
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::LoadSettings" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::LoadSettings" );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
@@ -505,9 +503,8 @@ void EDA_3D_VIEWER_FRAME::LoadSettings( APP_SETTINGS_BASE *aCfg )
|
||||
#if 0
|
||||
RENDER_ENGINE engine = static_cast<RENDER_ENGINE>( cfg->m_Render.engine );
|
||||
wxLogTrace( m_logTrace, engine == RENDER_ENGINE::RAYTRACING ?
|
||||
wxT( "EDA_3D_VIEWER_FRAME::LoadSettings render setting Ray Trace" )
|
||||
:
|
||||
wxT( "EDA_3D_VIEWER_FRAME::LoadSettings render setting OpenGL" ) );
|
||||
"EDA_3D_VIEWER_FRAME::LoadSettings render setting Ray Trace" :
|
||||
"EDA_3D_VIEWER_FRAME::LoadSettings render setting OpenGL" );
|
||||
#else
|
||||
m_boardAdapter.SetRenderEngine( RENDER_ENGINE::OPENGL );
|
||||
#endif
|
||||
@@ -529,11 +526,11 @@ void EDA_3D_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE *aCfg )
|
||||
|
||||
EDA_BASE_FRAME::SaveSettings( cfg );
|
||||
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::SaveSettings" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::SaveSettings" );
|
||||
|
||||
wxLogTrace( m_logTrace, m_boardAdapter.GetRenderEngine() == RENDER_ENGINE::RAYTRACING ?
|
||||
wxT( "EDA_3D_VIEWER_FRAME::SaveSettings render setting Ray Trace" ) :
|
||||
wxT( "EDA_3D_VIEWER_FRAME::SaveSettings render setting OpenGL" ) );
|
||||
"EDA_3D_VIEWER_FRAME::SaveSettings render setting Ray Trace" :
|
||||
"EDA_3D_VIEWER_FRAME::SaveSettings render setting OpenGL" );
|
||||
|
||||
if( cfg )
|
||||
{
|
||||
@@ -626,7 +623,7 @@ void EDA_3D_VIEWER_FRAME::SaveSettings( APP_SETTINGS_BASE *aCfg )
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged )
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::CommonSettingsChanged" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::CommonSettingsChanged" );
|
||||
|
||||
// Regen menu bars, etc
|
||||
EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
|
||||
@@ -735,7 +732,7 @@ void EDA_3D_VIEWER_FRAME::takeScreenshot( wxCommandEvent& event )
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::RenderEngineChanged()
|
||||
{
|
||||
wxLogTrace( m_logTrace, wxT( "EDA_3D_VIEWER_FRAME::RenderEngineChanged()" ) );
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER_FRAME::RenderEngineChanged()" );
|
||||
|
||||
if( m_canvas )
|
||||
m_canvas->RenderEngineChanged();
|
||||
@@ -744,7 +741,7 @@ void EDA_3D_VIEWER_FRAME::RenderEngineChanged()
|
||||
|
||||
void EDA_3D_VIEWER_FRAME::loadCommonSettings()
|
||||
{
|
||||
wxCHECK_RET( m_canvas, wxT( "Cannot load settings to null canvas" ) );
|
||||
wxCHECK_RET( m_canvas, "Cannot load settings to null canvas" );
|
||||
|
||||
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
using KIGFX::COLOR4D;
|
||||
|
||||
///! Update the schema version whenever a migration is required
|
||||
const int viewer3dSchemaVersion = 2;
|
||||
const int viewer3dSchemaVersion = 1;
|
||||
|
||||
|
||||
EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
|
||||
@@ -63,7 +63,7 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
|
||||
|
||||
// OpenGL options
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_copper_thickness",
|
||||
&m_Render.opengl_copper_thickness, false ) );
|
||||
&m_Render.opengl_copper_thickness, true ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_show_model_bbox",
|
||||
&m_Render.opengl_show_model_bbox, false ) );
|
||||
m_params.emplace_back( new PARAM<bool>( "render.opengl_highlight_on_rollover",
|
||||
@@ -202,12 +202,6 @@ EDA_3D_VIEWER_SETTINGS::EDA_3D_VIEWER_SETTINGS()
|
||||
&m_Camera.projection_mode, 1 ) );
|
||||
|
||||
registerMigration( 0, 1, std::bind( &EDA_3D_VIEWER_SETTINGS::migrateSchema0to1, this ) );
|
||||
|
||||
registerMigration( 1, 2, [&]() -> bool
|
||||
{
|
||||
Set( "render.opengl_copper_thickness", false );
|
||||
return true;
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ TOOL_ACTION EDA_3D_ACTIONS::resetView( "3DViewer.Control.resetView",
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::flipView( "3DViewer.Control.flipView",
|
||||
AS_ACTIVE,
|
||||
'F', "",
|
||||
0, "",
|
||||
_( "Flip Board" ), _( "Flip the board view" ),
|
||||
BITMAPS::flip_board, AF_NONE, (void*) ID_VIEW3D_FLIP );
|
||||
|
||||
@@ -202,18 +202,21 @@ TOOL_ACTION EDA_3D_ACTIONS::materialCAD( "3DViewer.Control.materialCAD",
|
||||
_( "Use a CAD color style based on the diffuse color of the material" ),
|
||||
BITMAPS::INVALID_BITMAP, AF_NONE, (void*) MATERIAL_MODE::CAD_MODE );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::rotate45axisZ( "3DViewer.Control.rotate45axisZ",
|
||||
AS_ACTIVE,
|
||||
WXK_TAB, "",
|
||||
"Rotate 45 degrees over Z axis" );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::showTHT( "3DViewer.Control.attributesTHT",
|
||||
AS_ACTIVE,
|
||||
'T', "",
|
||||
_( "Toggle Through Hole 3D models" ),
|
||||
_( "Toggle 3D models for 'Through hole' type components" ),
|
||||
_( "Toggle Through Hole 3D models" ), _( "Toggle 3D models for 'Through hole' type components" ),
|
||||
BITMAPS::show_tht, AF_NONE, (void*) FL_FP_ATTRIBUTES_NORMAL );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::showSMD( "3DViewer.Control.attributesSMD",
|
||||
AS_ACTIVE,
|
||||
'S', "",
|
||||
_( "Toggle SMD 3D models" ),
|
||||
_( "Toggle 3D models for 'Surface mount' type components" ),
|
||||
_( "Toggle SMD 3D models" ), _( "Toggle 3D models for 'Surface mount' type components" ),
|
||||
BITMAPS::show_smt, AF_NONE, (void*) FL_FP_ATTRIBUTES_NORMAL_INSERT );
|
||||
|
||||
TOOL_ACTION EDA_3D_ACTIONS::showVirtual( "3DViewer.Control.attributesOther",
|
||||
|
||||
@@ -75,6 +75,7 @@ public:
|
||||
static TOOL_ACTION materialDiffuse;
|
||||
static TOOL_ACTION materialCAD;
|
||||
|
||||
static TOOL_ACTION rotate45axisZ;
|
||||
static TOOL_ACTION showTHT;
|
||||
static TOOL_ACTION showSMD;
|
||||
static TOOL_ACTION showVirtual;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <kiface_base.h>
|
||||
#include <tools/eda_3d_controller.h>
|
||||
#include "eda_3d_actions.h"
|
||||
#include "dialogs/panel_preview_3d_model.h"
|
||||
#include <3d_rendering/opengl/render_3d_opengl.h>
|
||||
|
||||
|
||||
@@ -114,36 +113,10 @@ int EDA_3D_CONTROLLER::Main( const TOOL_EVENT& aEvent )
|
||||
// Main loop: keep receiving events
|
||||
while( TOOL_EVENT* evt = Wait() )
|
||||
{
|
||||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
wxWindow* canvas = m_toolMgr->GetToolHolder()->GetToolCanvas();
|
||||
wxWindow* topLevelParent = canvas->GetParent();
|
||||
|
||||
while( topLevelParent && !topLevelParent->IsTopLevel() )
|
||||
topLevelParent = topLevelParent->GetParent();
|
||||
|
||||
if( topLevelParent && dynamic_cast<DIALOG_SHIM*>( topLevelParent ) )
|
||||
{
|
||||
DIALOG_SHIM* dialog = static_cast<DIALOG_SHIM*>( topLevelParent );
|
||||
|
||||
if( dialog->IsQuasiModal() )
|
||||
dialog->EndQuasiModal( wxID_CANCEL );
|
||||
else
|
||||
dialog->EndModal( wxID_CANCEL );
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
else if( evt->IsClick( BUT_RIGHT ) )
|
||||
{
|
||||
if( evt->IsClick( BUT_RIGHT ) )
|
||||
m_menu.ShowContextMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 2016 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -34,7 +34,6 @@
|
||||
#include <common_ogl/ogl_attr_list.h>
|
||||
#include <filename_resolver.h>
|
||||
#include <pcbnew/footprint.h>
|
||||
#include <wx_filename.h>
|
||||
|
||||
#include <wx/filedlg.h>
|
||||
|
||||
@@ -165,7 +164,7 @@ bool DIALOG_SELECT_3DMODEL::TransferDataFromWindow()
|
||||
// file selection mode: retrieve the filename and specify a
|
||||
// path relative to one of the config paths
|
||||
wxFileName fname = m_FileTree->GetFilePath();
|
||||
fname.Normalize( FN_NORMALIZE_FLAGS | wxPATH_NORM_ENV_VARS );
|
||||
fname.Normalize();
|
||||
m_model->m_Filename = m_resolver->ShortenPath( fname.GetFullPath() );
|
||||
|
||||
return true;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2016 Mario Luzeiro <mrluzeiro@ua.pt>
|
||||
* Copyright (C) 2015 Cirilo Bernardo <cirilo.bernardo@gmail.com>
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2015-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2015-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -124,10 +124,8 @@ PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL( wxWindow* aParent, PCB_BASE_FRAM
|
||||
m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
|
||||
|
||||
for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
|
||||
{
|
||||
Connect( eventType, wxMenuEventHandler( PANEL_PREVIEW_3D_MODEL::OnMenuEvent ), nullptr,
|
||||
this );
|
||||
}
|
||||
|
||||
#ifdef __WXOSX__
|
||||
// Call layout once to get the proper button sizes after the bitmaps have been set
|
||||
@@ -168,7 +166,7 @@ void PANEL_PREVIEW_3D_MODEL::OnMenuEvent( wxMenuEvent& aEvent )
|
||||
|
||||
void PANEL_PREVIEW_3D_MODEL::loadSettings()
|
||||
{
|
||||
wxCHECK_RET( m_previewPane, wxT( "Cannot load settings to null canvas" ) );
|
||||
wxCHECK_RET( m_previewPane, "Cannot load settings to null canvas" );
|
||||
|
||||
COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
|
||||
|
||||
@@ -243,16 +241,13 @@ static double rotationFromString( const wxString& aValue )
|
||||
|
||||
wxString PANEL_PREVIEW_3D_MODEL::formatScaleValue( double aValue )
|
||||
{
|
||||
return wxString::Format( wxT( "%.4f" ),
|
||||
aValue );
|
||||
return wxString::Format( "%.4f", aValue );
|
||||
}
|
||||
|
||||
|
||||
wxString PANEL_PREVIEW_3D_MODEL::formatRotationValue( double aValue )
|
||||
{
|
||||
return wxString::Format( wxT( "%.2f %s" ),
|
||||
aValue,
|
||||
GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
|
||||
return wxString::Format( "%.2f %s", aValue, GetAbbreviatedUnitsLabel( EDA_UNITS::DEGREES ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -260,13 +255,9 @@ wxString PANEL_PREVIEW_3D_MODEL::formatOffsetValue( double aValue )
|
||||
{
|
||||
// Convert from internal units (mm) to user units
|
||||
if( m_userUnits == EDA_UNITS::INCHES )
|
||||
aValue /= 25.4;
|
||||
else if( m_userUnits == EDA_UNITS::MILS )
|
||||
aValue /= 25.4 / 1e3;
|
||||
aValue /= 25.4f;
|
||||
|
||||
return wxString::Format( wxT( "%.6f %s" ),
|
||||
aValue,
|
||||
GetAbbreviatedUnitsLabel( m_userUnits ) );
|
||||
return wxString::Format( "%.4f %s", aValue, GetAbbreviatedUnitsLabel( m_userUnits ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -406,19 +397,18 @@ void PANEL_PREVIEW_3D_MODEL::doIncrementOffset( wxSpinEvent& event, double aSign
|
||||
else if( spinCtrl == m_spinZoffset )
|
||||
textCtrl = zoff;
|
||||
|
||||
double step_mm = OFFSET_INCREMENT_MM;
|
||||
double curr_value_mm = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
|
||||
double step = OFFSET_INCREMENT_MM;
|
||||
|
||||
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
|
||||
{
|
||||
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000;
|
||||
}
|
||||
if( m_userUnits == EDA_UNITS::INCHES )
|
||||
step = OFFSET_INCREMENT_MIL/1000.0;
|
||||
|
||||
curr_value_mm += ( step_mm * aSign );
|
||||
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
|
||||
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
|
||||
double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
|
||||
|
||||
textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
|
||||
curr_value += ( step * aSign );
|
||||
curr_value = std::max( -MAX_OFFSET, curr_value );
|
||||
curr_value = std::min( curr_value, MAX_OFFSET );
|
||||
|
||||
textCtrl->SetValue( formatOffsetValue( curr_value ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -470,29 +460,29 @@ void PANEL_PREVIEW_3D_MODEL::onMouseWheelOffset( wxMouseEvent& event )
|
||||
{
|
||||
wxTextCtrl* textCtrl = (wxTextCtrl*) event.GetEventObject();
|
||||
|
||||
double step_mm = OFFSET_INCREMENT_MM;
|
||||
double step = OFFSET_INCREMENT_MM;
|
||||
|
||||
if( event.ShiftDown( ) )
|
||||
step_mm = OFFSET_INCREMENT_MM_FINE;
|
||||
step = OFFSET_INCREMENT_MM_FINE;
|
||||
|
||||
if( m_userUnits == EDA_UNITS::MILS || m_userUnits == EDA_UNITS::INCHES )
|
||||
if( m_userUnits == EDA_UNITS::INCHES )
|
||||
{
|
||||
step_mm = 25.4*OFFSET_INCREMENT_MIL/1000.0;
|
||||
step = OFFSET_INCREMENT_MIL/1000.0;
|
||||
|
||||
if( event.ShiftDown( ) )
|
||||
step_mm = 25.4*OFFSET_INCREMENT_MIL_FINE/1000.0;
|
||||
step = OFFSET_INCREMENT_MIL_FINE/1000.0;
|
||||
}
|
||||
|
||||
if( event.GetWheelRotation() >= 0 )
|
||||
step_mm = -step_mm;
|
||||
step = -step;
|
||||
|
||||
double curr_value_mm = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
|
||||
double curr_value = DoubleValueFromString( m_userUnits, textCtrl->GetValue() ) / IU_PER_MM;
|
||||
|
||||
curr_value_mm += step_mm;
|
||||
curr_value_mm = std::max( -MAX_OFFSET, curr_value_mm );
|
||||
curr_value_mm = std::min( curr_value_mm, MAX_OFFSET );
|
||||
curr_value += step;
|
||||
curr_value = std::max( -MAX_OFFSET, curr_value );
|
||||
curr_value = std::min( curr_value, MAX_OFFSET );
|
||||
|
||||
textCtrl->SetValue( formatOffsetValue( curr_value_mm ) );
|
||||
textCtrl->SetValue( formatOffsetValue( curr_value ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ German (DE) Rafael Sokolowski <Rafael.Sokolowski[at]web-dot-de
|
||||
Japanese (JA) Kenta Yonekura <yoneken[at]kicad-dot-jp>
|
||||
Simplified Chinese (zh_CN) taotieren <admin[at]taotieren-dot-com>
|
||||
|
||||
Remy Halvick, David J S Briscoe, Dominique Laigle, Paul Burke
|
||||
Remy Halvick, David Briscoe, Dominique Laigle, Paul Burke
|
||||
|
||||
|
||||
== Programm credits for icons and others
|
||||
|
||||
+13
-28
@@ -156,11 +156,6 @@ option( KICAD_STEP_EXPORT_LIB
|
||||
"Build and use kicad2step as a library, meant for debugging"
|
||||
OFF )
|
||||
|
||||
cmake_dependent_option( KICAD_WIN32_VERIFY_CODESIGN
|
||||
"When enabled, verifies the code signing signature of certain DLLs loaded during runtime."
|
||||
OFF "WIN32"
|
||||
OFF )
|
||||
|
||||
# Global setting: exports are explicit
|
||||
set( CMAKE_CXX_VISIBILITY_PRESET "hidden" )
|
||||
set( CMAKE_VISIBILITY_INLINES_HIDDEN ON )
|
||||
@@ -182,10 +177,6 @@ if( KICAD_GAL_PROFILE )
|
||||
add_definitions( -DKICAD_GAL_PROFILE )
|
||||
endif()
|
||||
|
||||
if( KICAD_WIN32_VERIFY_CODESIGN )
|
||||
add_definitions( -DKICAD_WIN32_VERIFY_CODESIGN )
|
||||
endif()
|
||||
|
||||
# Ensure DEBUG is defined for all platforms in Debug builds
|
||||
# change to add_compile_definitions() after minimum required CMake version is 3.12
|
||||
set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:DEBUG> )
|
||||
@@ -499,10 +490,9 @@ endif()
|
||||
# KIFACE_SUFFIX is the file extension used for top level program modules which
|
||||
# implement the KIFACE interface. A valid suffix starts with a period '.'.
|
||||
|
||||
if( WIN32 )
|
||||
# We use .kiface extension so we don't collide with python DSO. (Linux/mac issue?)
|
||||
# Windows works fine with the native dll extension
|
||||
# which also resolves metadata issues because windows wants to see the dll extension
|
||||
if( false )
|
||||
# This is the eventual situation near milestone C) of modular-kicad blueprint.
|
||||
# Until then we use .kiface extension so we don't collide with python DSO.
|
||||
set( KIFACE_SUFFIX ${CMAKE_SHARED_MODULE_SUFFIX} )
|
||||
else()
|
||||
# Temporary situation until we can dovetail the python DSO into the kiface DSO.
|
||||
@@ -779,6 +769,12 @@ set( INC_AFTER
|
||||
find_package( SWIG 3.0 REQUIRED )
|
||||
include( ${SWIG_USE_FILE} )
|
||||
|
||||
# pybind11 is header-only, so include the subdir
|
||||
add_subdirectory(thirdparty/pybind11)
|
||||
|
||||
# Make sure that we get our pybind11 and not the system pybind11 (ours is patched to work with wx)
|
||||
include_directories( BEFORE SYSTEM ${PYBIND11_INCLUDE_DIR} )
|
||||
|
||||
set( PythonInterp_FIND_VERSION 3.6 )
|
||||
set( PythonLibs_FIND_VERSION 3.6 )
|
||||
|
||||
@@ -820,12 +816,6 @@ message( STATUS "Python module install path: ${PYTHON_DEST}" )
|
||||
|
||||
find_package( PythonLibs 3.6 REQUIRED )
|
||||
|
||||
# pybind11 is header-only, so include the subdir
|
||||
add_subdirectory(thirdparty/pybind11)
|
||||
|
||||
# Make sure that we get our pybind11 and not the system pybind11 (ours is patched to work with wx)
|
||||
include_directories( BEFORE SYSTEM ${PYBIND11_INCLUDE_DIR} )
|
||||
|
||||
# Infrequently needed headers go at end of search paths, append to INC_AFTER which
|
||||
# although is used for all components, should be a harmless hit for something like eeschema
|
||||
# so long as unused search paths are at the end like this.
|
||||
@@ -848,11 +838,9 @@ if( UNIX AND NOT APPLE AND KICAD_SCRIPTING_WXPYTHON )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( WXPYTHON_FLAVOR )
|
||||
message( STATUS "Found wxPython ${WXPYTHON_FLAVOR} "
|
||||
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
|
||||
"(wxWidgets ${WXPYTHON_WXVERSION})" )
|
||||
endif()
|
||||
message( STATUS "Found ${WXPYTHON_FLAVOR} "
|
||||
"${WXPYTHON_VERSION}/${WXPYTHON_TOOLKIT} "
|
||||
"(wxWidgets ${WXPYTHON_WXVERSION})" )
|
||||
|
||||
#
|
||||
# Find wxWidgets library, required
|
||||
@@ -1012,10 +1000,7 @@ add_subdirectory( cvpcb ) # must be after pcbnew
|
||||
add_subdirectory( kicad ) # should follow pcbnew, eeschema
|
||||
add_subdirectory( tools )
|
||||
add_subdirectory( utils )
|
||||
|
||||
if( KICAD_BUILD_QA_TESTS )
|
||||
add_subdirectory( qa )
|
||||
endif()
|
||||
add_subdirectory( qa )
|
||||
|
||||
# Demos
|
||||
if( KICAD_INSTALL_DEMOS )
|
||||
|
||||
@@ -28,28 +28,22 @@ include( ${CMAKE_MODULE_PATH}/KiCadFullVersion.cmake )
|
||||
|
||||
# Extract the major and minor build version as a string
|
||||
string( REGEX MATCH
|
||||
"([0-9]+)\\.([0-9]+)\\.([0-9]+).*"
|
||||
KICAD_MAJOR_MINOR_PATCH_VERSION
|
||||
"([0-9]+)\\.([0-9]+)\\..*"
|
||||
KICAD_MAJOR_MINOR_VERSION
|
||||
"${KICAD_SEMANTIC_VERSION}"
|
||||
)
|
||||
|
||||
if( CMAKE_MATCH_COUNT EQUAL 3 )
|
||||
if( CMAKE_MATCH_COUNT EQUAL 2 )
|
||||
# Match slot 0 is the full string, so we want slots 1 & 2
|
||||
set( KICAD_MAJOR_MINOR_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}" )
|
||||
|
||||
set( KICAD_MAJOR_MINOR_PATCH_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}" )
|
||||
set( KICAD_MAJOR_MINOR_PATCH_TUPLE "{ ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, ${CMAKE_MATCH_3} }" )
|
||||
|
||||
set( KICAD_MAJOR_MINOR_VERSION_TUPLE "{ ${CMAKE_MATCH_1}, ${CMAKE_MATCH_2} }" )
|
||||
set( KICAD_MAJOR_VERSION "${CMAKE_MATCH_1}" )
|
||||
set( KICAD_MINOR_VERSION "${CMAKE_MATCH_2}" )
|
||||
set( KICAD_PATCH_VERSION "${CMAKE_MATCH_3}" )
|
||||
|
||||
set( KICAD_WIN32_RC_FILEVER_STR "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}.${KICAD_GIT_REV}\\0" )
|
||||
set( KICAD_WIN32_RC_FILEVER "${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, ${CMAKE_MATCH_3}, ${KICAD_GIT_REV}" )
|
||||
set( KICAD_WIN32_RC_PRODVER_STR "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}\\0" )
|
||||
set( KICAD_WIN32_RC_PRODVER "${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, ${CMAKE_MATCH_3}, ${KICAD_GIT_REV}" )
|
||||
set( KICAD_WIN32_RC_FILEVER_STR "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.0.0\\0" )
|
||||
set( KICAD_WIN32_RC_FILEVER "${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, 0, 0" )
|
||||
set( KICAD_WIN32_RC_PRODVER_STR "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}\\0" )
|
||||
set( KICAD_WIN32_RC_PRODVER "${CMAKE_MATCH_1}, ${CMAKE_MATCH_2}, 0, 0" )
|
||||
else()
|
||||
message( FATAL_ERROR "Unable to extract major, minor and patch version string" )
|
||||
message( FATAL_ERROR "Unable to extract major and minor version string" )
|
||||
endif()
|
||||
|
||||
set( _wvh_new_version_text
|
||||
@@ -64,10 +58,8 @@ set( _wvh_new_version_text
|
||||
#define KICAD_VERSION_FULL \"${KICAD_VERSION_FULL}\"
|
||||
#define KICAD_SEMANTIC_VERSION \"${KICAD_SEMANTIC_VERSION}\"
|
||||
#define KICAD_MAJOR_VERSION \"${KICAD_MAJOR_VERSION}\"
|
||||
#define KICAD_MINOR_VERSION \"${KICAD_MINOR_VERSION}\"
|
||||
#define KICAD_PATCH_VERSION \"${KICAD_PATCH_VERSION}\"
|
||||
#define KICAD_MAJOR_MINOR_VERSION \"${KICAD_MAJOR_MINOR_VERSION}\"
|
||||
#define KICAD_MAJOR_MINOR_PATCH_TUPLE ${KICAD_MAJOR_MINOR_PATCH_TUPLE}
|
||||
#define KICAD_MAJOR_MINOR_VERSION_TUPLE ${KICAD_MAJOR_MINOR_VERSION_TUPLE}
|
||||
#define KICAD_WIN32_RC_PRODVER ${KICAD_WIN32_RC_PRODVER}
|
||||
#define KICAD_WIN32_RC_PRODVER_STR \"${KICAD_WIN32_RC_PRODVER_STR}\"
|
||||
#define KICAD_WIN32_RC_FILEVER ${KICAD_WIN32_RC_FILEVER}
|
||||
|
||||
@@ -38,17 +38,8 @@ macro( create_git_version_header _git_src_path )
|
||||
${GIT_EXECUTABLE} describe --dirty
|
||||
WORKING_DIRECTORY ${_git_src_path}
|
||||
OUTPUT_VARIABLE _git_DESCRIBE
|
||||
ERROR_VARIABLE _git_describe_error
|
||||
RESULT_VARIABLE _git_describe_result
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(
|
||||
COMMAND
|
||||
${GIT_EXECUTABLE} rev-list --count --first-parent HEAD
|
||||
WORKING_DIRECTORY ${_git_src_path}
|
||||
OUTPUT_VARIABLE _git_REV_COUNT
|
||||
ERROR_VARIABLE _git_rev_count_error
|
||||
RESULT_VARIABLE _git_rev_count_result
|
||||
ERROR_VARIABLE _git_log_error
|
||||
RESULT_VARIABLE _git_log_result
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
set( ENV{LC_ALL} ${_Git_SAVED_LC_ALL} )
|
||||
@@ -56,20 +47,8 @@ macro( create_git_version_header _git_src_path )
|
||||
|
||||
# Check to make sure 'git' command did not fail. Otherwise fallback
|
||||
# to KiCadVersion.cmake as the revision level.
|
||||
if( _git_describe_result EQUAL 0 )
|
||||
if( _git_DESCRIBE )
|
||||
set( KICAD_VERSION "(${_git_DESCRIBE})" )
|
||||
endif()
|
||||
|
||||
if( _git_rev_count_result EQUAL 0 )
|
||||
set( KICAD_GIT_REV "${_git_REV_COUNT}" )
|
||||
|
||||
# Sanity check
|
||||
if (NOT KICAD_GIT_REV MATCHES "^[0-9]+$")
|
||||
set( KICAD_GIT_REV "0" )
|
||||
endif ()
|
||||
else()
|
||||
# Incase the command failed, we can just default to 0, only a problem in CI right now
|
||||
set( KICAD_GIT_REV "0" )
|
||||
endif()
|
||||
|
||||
endmacro()
|
||||
|
||||
@@ -37,7 +37,7 @@ unset(_Python_NAMES)
|
||||
|
||||
set(_PYTHON1_VERSIONS 1.6 1.5)
|
||||
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
|
||||
set(_PYTHON3_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
set(_PYTHON3_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
|
||||
# Disabling the "search every possible place" code for now
|
||||
# see https://gitlab.com/kicad/code/kicad/-/issues/8553
|
||||
@@ -75,15 +75,11 @@ if( ${PYTHON_ROOT_DIR} )
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES}
|
||||
PATHS ${PYTHON_ROOT_DIR}
|
||||
NO_DEFAULT_PATH )
|
||||
elseif(VCPKG_TOOLCHAIN)
|
||||
# Our VCPKG usage will always place it in a known location
|
||||
find_program(PYTHON_EXECUTABLE
|
||||
NAMES ${_Python_NAMES}
|
||||
PATHS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/python3"
|
||||
)
|
||||
else()
|
||||
# If there is no specific path given, look for python in the path
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
|
||||
if(NOT VCPKG_TOOLCHAIN)
|
||||
# If there is no specific path given, look for python in the path
|
||||
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Set up the versions we know about, in the order we will search. Always add
|
||||
@@ -116,6 +112,8 @@ if(NOT PYTHON_EXECUTABLE)
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.2" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.1" )
|
||||
list( APPEND _Python_PPATHS "C:/python/${_CURRENT_VERSION}.0" )
|
||||
elseif(VCPKG_TOOLCHAIN)
|
||||
list( APPEND _Python_PPATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/tools/python3" )
|
||||
else()
|
||||
list( APPEND _Python_PPATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath] )
|
||||
endif()
|
||||
|
||||
@@ -44,7 +44,7 @@ cmake_find_frameworks(Python)
|
||||
|
||||
set(_PYTHON1_VERSIONS 1.6 1.5)
|
||||
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
|
||||
set(_PYTHON3_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
set(_PYTHON3_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
|
||||
if(PythonLibs_FIND_VERSION)
|
||||
if(PythonLibs_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
|
||||
|
||||
@@ -40,7 +40,7 @@ if( VCPKG_TOOLCHAIN )
|
||||
# python 3.8+ requires us to use python to add additional load directories (PATH no longer supported)
|
||||
# vcpkg does not copy all the dlls into the python folder so we need this for development
|
||||
# as the wxpython modules need the wxwidgets library DLLs to load
|
||||
set( _py_dll "import os;os.add_dll_directory(\"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin\");os.add_dll_directory(\"${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin\");" )
|
||||
set( _py_dll "import os;os.add_dll_directory(\"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin\");os.add_dll_directory(\"${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin\");" )
|
||||
else()
|
||||
set( _py_dll "" )
|
||||
endif()
|
||||
|
||||
@@ -231,7 +231,11 @@ endif()
|
||||
#=====================================================================
|
||||
if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
# Useful common wx libs needed by almost all components.
|
||||
set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
|
||||
if(VCPKG_TOOLCHAIN)
|
||||
set(wxWidgets_COMMON_LIBRARIES libpng16 tiff jpeg zlib libexpat)
|
||||
else()
|
||||
set(wxWidgets_COMMON_LIBRARIES png tiff jpeg zlib regex expat)
|
||||
endif()
|
||||
|
||||
# DEPRECATED: Use find_package(wxWidgets COMPONENTS mono) instead.
|
||||
if(NOT wxWidgets_FIND_COMPONENTS)
|
||||
@@ -254,24 +258,22 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
#-------------------------------------------------------------------
|
||||
#
|
||||
# Get filename components for a configuration. For example,
|
||||
# if _CONFIGURATION = mswunivud, then _PF="msw", _UNV=univ, _UCD=u _DBG=d
|
||||
# if _CONFIGURATION = mswu, then _PF="msw", _UNV="", _UCD=u _DBG=""
|
||||
# if _CONFIGURATION = mswunivud, then _UNV=univ, _UCD=u _DBG=d
|
||||
# if _CONFIGURATION = mswu, then _UNV="", _UCD=u _DBG=""
|
||||
#
|
||||
macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _PF _UNV _UCD _DBG)
|
||||
DBG_MSG_V(${_CONFIGURATION})
|
||||
macro(WX_GET_NAME_COMPONENTS _CONFIGURATION _UNV _UCD _DBG)
|
||||
string(REGEX MATCH "univ" ${_UNV} "${_CONFIGURATION}")
|
||||
string(REGEX REPLACE "[msw|qt].*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
|
||||
string(REGEX REPLACE "msw.*(u)[d]*$" "u" ${_UCD} "${_CONFIGURATION}")
|
||||
if(${_UCD} STREQUAL ${_CONFIGURATION})
|
||||
set(${_UCD} "")
|
||||
endif()
|
||||
string(REGEX MATCH "d$" ${_DBG} "${_CONFIGURATION}")
|
||||
string(REGEX MATCH "^[msw|qt]*" ${_PF} "${_CONFIGURATION}")
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Find libraries associated to a configuration.
|
||||
#
|
||||
macro(WX_FIND_LIBS _PF _UNV _UCD _DBG)
|
||||
macro(WX_FIND_LIBS _UNV _UCD _DBG)
|
||||
DBG_MSG_V("m_unv = ${_UNV}")
|
||||
DBG_MSG_V("m_ucd = ${_UCD}")
|
||||
DBG_MSG_V("m_dbg = ${_DBG}")
|
||||
@@ -284,6 +286,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
NAMES
|
||||
wx${LIB}${_UCD}${_DBG} # for regex
|
||||
wx${LIB}${_DBG}
|
||||
${LIB}${_DBG} # vcpkg libraries aren't specific to wx
|
||||
PATHS ${WX_LIB_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
@@ -293,7 +296,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
# Find wxWidgets multilib base libraries.
|
||||
find_library(WX_base${_DBG}
|
||||
NAMES
|
||||
wxbase32${_UCD}${_DBG}
|
||||
wxbase31${_UCD}${_DBG}
|
||||
wxbase30${_UCD}${_DBG}
|
||||
wxbase29${_UCD}${_DBG}
|
||||
@@ -308,7 +310,6 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
foreach(LIB net odbc xml)
|
||||
find_library(WX_${LIB}${_DBG}
|
||||
NAMES
|
||||
wxbase32${_UCD}${_DBG}_${LIB}
|
||||
wxbase31${_UCD}${_DBG}_${LIB}
|
||||
wxbase30${_UCD}${_DBG}_${LIB}
|
||||
wxbase29${_UCD}${_DBG}_${LIB}
|
||||
@@ -325,14 +326,13 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
# Find wxWidgets monolithic library.
|
||||
find_library(WX_mono${_DBG}
|
||||
NAMES
|
||||
wx${_PF}${_UNV}32${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}31${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}30${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}29${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}28${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}27${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}26${_UCD}${_DBG}
|
||||
wx${_PF}${_UNV}25${_UCD}${_DBG}
|
||||
wxmsw${_UNV}31${_UCD}${_DBG}
|
||||
wxmsw${_UNV}30${_UCD}${_DBG}
|
||||
wxmsw${_UNV}29${_UCD}${_DBG}
|
||||
wxmsw${_UNV}28${_UCD}${_DBG}
|
||||
wxmsw${_UNV}27${_UCD}${_DBG}
|
||||
wxmsw${_UNV}26${_UCD}${_DBG}
|
||||
wxmsw${_UNV}25${_UCD}${_DBG}
|
||||
PATHS ${WX_LIB_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
@@ -340,17 +340,16 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
|
||||
# Find wxWidgets multilib libraries.
|
||||
foreach(LIB core adv aui html media xrc dbgrid gl qa richtext
|
||||
stc ribbon propgrid webview)
|
||||
webview stc ribbon propgrid)
|
||||
find_library(WX_${LIB}${_DBG}
|
||||
NAMES
|
||||
wx${_PF}${_UNV}32${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}31${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}30${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}29${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}28${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}27${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}26${_UCD}${_DBG}_${LIB}
|
||||
wx${_PF}${_UNV}25${_UCD}${_DBG}_${LIB}
|
||||
wxmsw${_UNV}31${_UCD}${_DBG}_${LIB}
|
||||
wxmsw${_UNV}30${_UCD}${_DBG}_${LIB}
|
||||
wxmsw${_UNV}29${_UCD}${_DBG}_${LIB}
|
||||
wxmsw${_UNV}28${_UCD}${_DBG}_${LIB}
|
||||
wxmsw${_UNV}27${_UCD}${_DBG}_${LIB}
|
||||
wxmsw${_UNV}26${_UCD}${_DBG}_${LIB}
|
||||
wxmsw${_UNV}25${_UCD}${_DBG}_${LIB}
|
||||
PATHS ${WX_LIB_DIR}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
@@ -516,6 +515,74 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
set(WX_LIB_DIR_PREFIX vc)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TOOLCHAIN)
|
||||
set(wxWidgets_FOUND TRUE)
|
||||
find_path(wxWidgets_ROOT_DIR
|
||||
NAMES include/wx/wx.h
|
||||
PATHS
|
||||
ENV wxWidgets_ROOT_DIR
|
||||
DOC "wxWidgets base/installation directory"
|
||||
)
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/debug/lib)
|
||||
set(wxWidgets_CONFIGURATION mswud)
|
||||
else()
|
||||
set(wxWidgets_LIB_DIR ${wxWidgets_ROOT_DIR}/lib)
|
||||
set(wxWidgets_CONFIGURATION mswu)
|
||||
endif()
|
||||
|
||||
set(wxWidgets_BIN_DIR ${wxWidgets_ROOT_DIR}/bin)
|
||||
set(wxWidgets_INCLUDE_DIR ${wxWidgets_ROOT_DIR}/include)
|
||||
file(GLOB DLL ${wxWidgets_BIN_DIR}/wxmsw*.dll)
|
||||
if (DLL)
|
||||
set(wxWidgets_DEFINITIONS WXUSINGDLL)
|
||||
DBG_MSG_V("detected SHARED/DLL tree wxWidgets_LIB_DIR=${wxWidgets_LIB_DIR}")
|
||||
endif ()
|
||||
set(WX_ROOT_DIR ${wxWidgets_ROOT_DIR})
|
||||
set(WX_LIB_DIR ${wxWidgets_LIB_DIR}) # needed by macro
|
||||
set(WX_CONFIGURATION_LIST ${wxWidgets_CONFIGURATION})
|
||||
|
||||
# Set wxWidgets lib setup include directory.
|
||||
if (EXISTS ${wxWidgets_INCLUDE_DIR}/wx/setup.h)
|
||||
set(wxWidgets_INCLUDE_DIRS ${wxWidgets_INCLUDE_DIR})
|
||||
else ()
|
||||
DBG_MSG("wxWidgets_FOUND FALSE because ${wxWidgets_INCLUDE_DIR}/wx/setup.h does not exists.")
|
||||
set(wxWidgets_FOUND FALSE)
|
||||
endif ()
|
||||
|
||||
# Set wxWidgets main include directory.
|
||||
if (EXISTS ${wxWidgets_ROOT_DIR}/include/wx/wx.h)
|
||||
list(APPEND wxWidgets_INCLUDE_DIRS ${wxWidgets_ROOT_DIR}/include)
|
||||
else ()
|
||||
DBG_MSG("wxWidgets_FOUND FALSE because wxWidgets_ROOT_DIR=${wxWidgets_ROOT_DIR} has no ${wxWidgets_ROOT_DIR}/include/wx/wx.h")
|
||||
set(wxWidgets_FOUND FALSE)
|
||||
endif ()
|
||||
|
||||
DBG_MSG_V("WX_CONFIGURATION_LIST=${WX_CONFIGURATION_LIST}")
|
||||
|
||||
|
||||
# Get configuration parameters from the name.
|
||||
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
|
||||
|
||||
|
||||
# Find wxWidgets libraries.
|
||||
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
|
||||
if (WX_USE_REL_AND_DBG)
|
||||
WX_FIND_LIBS("${UNV}" "${UCD}" "d")
|
||||
endif ()
|
||||
|
||||
# Settings for requested libs (i.e., include dir, libraries, etc.).
|
||||
WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}")
|
||||
|
||||
# Add necessary definitions for unicode builds
|
||||
if ("${UCD}" STREQUAL "u")
|
||||
list(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE)
|
||||
endif ()
|
||||
|
||||
# Add necessary definitions for debug builds
|
||||
set(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__)
|
||||
|
||||
else()
|
||||
if(BUILD_SHARED_LIBS)
|
||||
find_path(wxWidgets_LIB_DIR
|
||||
NAMES
|
||||
@@ -550,6 +617,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
DOC "Path to wxWidgets libraries"
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# If wxWidgets_LIB_DIR changed, clear all libraries.
|
||||
@@ -607,7 +675,7 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
endif()
|
||||
|
||||
# Get configuration parameters from the name.
|
||||
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} PF UNV UCD DBG)
|
||||
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
|
||||
|
||||
# Set wxWidgets lib setup include directory.
|
||||
if(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
|
||||
@@ -627,9 +695,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
|
||||
endif()
|
||||
|
||||
# Find wxWidgets libraries.
|
||||
WX_FIND_LIBS("${PF}" "${UNV}" "${UCD}" "${DBG}")
|
||||
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
|
||||
if(WX_USE_REL_AND_DBG)
|
||||
WX_FIND_LIBS("${PF}" "${UNV}" "${UCD}" "d")
|
||||
WX_FIND_LIBS("${UNV}" "${UCD}" "d")
|
||||
endif()
|
||||
|
||||
# Settings for requested libs (i.e., include dir, libraries, etc.).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# This program source code file is part of KICAD, a free EDA CAD application.
|
||||
#
|
||||
# Copyright (C) 2016 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
# Copyright (C) 2016-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
# Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
@@ -37,7 +37,7 @@
|
||||
# KiCad.
|
||||
#
|
||||
# Note: This version string should follow the semantic versioning system
|
||||
set( KICAD_SEMANTIC_VERSION "6.0.11-unknown" )
|
||||
set( KICAD_SEMANTIC_VERSION "6.99.0" )
|
||||
|
||||
# Default the version to the semantic version.
|
||||
# This is overridden by the git repository tag though (if using git)
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
FROM registry.gitlab.com/kicad/kicad-ci/source_containers/master/ubuntu:22.04 as build-doxygen-env
|
||||
USER root
|
||||
|
||||
WORKDIR /src
|
||||
COPY . ./
|
||||
|
||||
RUN ls
|
||||
RUN mkdir build && cd build
|
||||
|
||||
WORKDIR /src/build
|
||||
|
||||
RUN cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DKICAD_USE_OCC=ON \
|
||||
-DKICAD_SCRIPTING_WXPYTHON=ON \
|
||||
-DKICAD_SPICE=ON
|
||||
RUN make doxygen-docs
|
||||
RUN make doxygen-python
|
||||
|
||||
|
||||
FROM scratch as output-image
|
||||
|
||||
COPY --from=build-doxygen-env /src/Documentation/doxygen/html /doxygen-docs_html
|
||||
COPY --from=build-doxygen-env /src/build/pcbnew/doxygen-python/html /doxygen-python_html
|
||||
@@ -1,6 +0,0 @@
|
||||
doxygen.Dockerfile.dockerignore.git
|
||||
.gitlab
|
||||
.github
|
||||
.idea
|
||||
.vs
|
||||
build
|
||||
@@ -16,6 +16,9 @@ KiCad uses a host of CI resources.
|
||||
|
||||
GitLab CI pipeline status can be viewed for Linux and Windows builds of the latest commits.
|
||||
|
||||
Additional status is available for builds:
|
||||
[<img alt="Jenkins" src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fjenkins.simonrichter.eu%2Fjob%2Fwindows-kicad-ps-pipeline%2F&label=Windows%2C%20MSVC%Nightly&style=plastic">](https://jenkins.simonrichter.eu/job/windows-kicad-ps-pipeline/)
|
||||
|
||||
## Release status
|
||||
[](https://repology.org/project/kicad/versions)
|
||||
[](https://repology.org/metapackage/kicad/versions)
|
||||
|
||||
@@ -26,13 +26,11 @@ set_source_files_properties( bitmap2cmp_gui.cpp PROPERTIES
|
||||
COMPILE_DEFINITIONS "COMPILING_DLL"
|
||||
)
|
||||
|
||||
if( WIN32 )
|
||||
if( MINGW )
|
||||
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( bitmap2component )
|
||||
else()
|
||||
set( BITMAP2COMPONENT_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/bitmap2component.rc )
|
||||
endif()
|
||||
if( MINGW )
|
||||
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
|
||||
mingw_resource_compiler( bitmap2component )
|
||||
else()
|
||||
set( BITMAP2COMPONENT_RESOURCES ${CMAKE_SOURCE_DIR}/resources/msw/bitmap2component.rc )
|
||||
endif()
|
||||
|
||||
if( APPLE )
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KICAD, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2010 jean-pierre.charras
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -468,7 +468,7 @@ wxString BM2CMP_FRAME::FormatOutputSize( double aSize )
|
||||
}
|
||||
else
|
||||
{
|
||||
text.Printf( wxT( "%d" ), KiROUND( aSize ) );
|
||||
text.Printf( "%d", KiROUND( aSize ) );
|
||||
}
|
||||
|
||||
return text;
|
||||
|
||||
@@ -503,22 +503,21 @@ void BITMAPCONV_INFO::createOutputData( BMP2CMP_MOD_LAYER aModLayer )
|
||||
polyset_areas.BooleanSubtract( polyset_holes, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
// Ensure there are no self intersecting polygons
|
||||
if( polyset_areas.NormalizeAreaOutlines() )
|
||||
polyset_areas.NormalizeAreaOutlines();
|
||||
|
||||
// Convert polygon with holes to a unique polygon
|
||||
polyset_areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
// Output current resulting polygon(s)
|
||||
for( int ii = 0; ii < polyset_areas.OutlineCount(); ii++ )
|
||||
{
|
||||
// Convert polygon with holes to a unique polygon
|
||||
polyset_areas.Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
|
||||
|
||||
// Output current resulting polygon(s)
|
||||
for( int ii = 0; ii < polyset_areas.OutlineCount(); ii++ )
|
||||
{
|
||||
SHAPE_LINE_CHAIN& poly = polyset_areas.Outline( ii );
|
||||
outputOnePolygon( poly, getBoardLayerName( aModLayer ));
|
||||
}
|
||||
|
||||
polyset_areas.RemoveAllContours();
|
||||
polyset_holes.RemoveAllContours();
|
||||
main_outline = true;
|
||||
SHAPE_LINE_CHAIN& poly = polyset_areas.Outline( ii );
|
||||
outputOnePolygon( poly, getBoardLayerName( aModLayer ));
|
||||
}
|
||||
|
||||
polyset_areas.RemoveAllContours();
|
||||
polyset_holes.RemoveAllContours();
|
||||
main_outline = true;
|
||||
}
|
||||
|
||||
paths = paths->next;
|
||||
|
||||
@@ -619,8 +619,8 @@ set( TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/tmp" )
|
||||
# generate logs is useful only if you have problems
|
||||
set( CREATE_LOG_FILES true )
|
||||
|
||||
set( BITMAP_INFO_FILE "${CMAKE_SOURCE_DIR}/common/bitmap_info.cpp" )
|
||||
set( BITMAP_INFO_TEMPLATE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.cpp.in" )
|
||||
set( BITMAP_INFO_FILE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.h" )
|
||||
set( BITMAP_INFO_TEMPLATE "${CMAKE_SOURCE_DIR}/include/bitmaps/bitmap_info.h.in" )
|
||||
set( BITMAP_INFO_LIST "" )
|
||||
|
||||
set( ALL_PNGS "" )
|
||||
@@ -739,7 +739,7 @@ function( bitmap_dir pngWidth pngHeight bmapList )
|
||||
png2png( ${tmpFile} ${pngPath} )
|
||||
|
||||
set( bitmapInfo
|
||||
" aBitmapInfoCache[BITMAPS::${bmn}].emplace_back( BITMAPS::${bmn}, wxT( \"${pngFile}\" ), ${pngHeight}, wxT( \"${theme}\" ) );\n"
|
||||
" { BITMAPS::${bmn}, wxT( \"${pngFile}\" ), ${pngHeight}, wxT( \"${theme}\" ) },\n"
|
||||
)
|
||||
|
||||
set( BITMAP_INFO_LIST "${BITMAP_INFO_LIST}${bitmapInfo}" )
|
||||
|
||||
@@ -315,7 +315,6 @@ set( COMMON_SRCS
|
||||
bin_mod.cpp
|
||||
bitmap.cpp
|
||||
bitmap_base.cpp
|
||||
bitmap_info.cpp
|
||||
bitmap_store.cpp
|
||||
board_printout.cpp
|
||||
build_version.cpp
|
||||
|
||||
+49
-38
@@ -82,6 +82,13 @@ static const wxChar DRCEpsilon[] = wxT( "DRCEpsilon" );
|
||||
*/
|
||||
static const wxChar HoleWallThickness[] = wxT( "HoleWallPlatingThickness" );
|
||||
|
||||
/**
|
||||
* Testing mode for new connectivity algorithm. Setting this to on will cause all modifications
|
||||
* to the netlist to be recalculated on the fly. This may be slower than the standard process
|
||||
* at the moment
|
||||
*/
|
||||
static const wxChar RealtimeConnectivity[] = wxT( "RealtimeConnectivity" );
|
||||
|
||||
/**
|
||||
* Configure the coroutine stack size in bytes. This should be allocated in multiples of
|
||||
* the system page size (n*4096 is generally safe)
|
||||
@@ -187,7 +194,7 @@ static const wxChar AllowManualCanvasScale[] = wxT( "AllowManualCanvasScale" );
|
||||
*/
|
||||
wxString dumpParamCfg( const PARAM_CFG& aParam )
|
||||
{
|
||||
wxString s = aParam.m_Ident + wxT( ": " );
|
||||
wxString s = aParam.m_Ident + ": ";
|
||||
|
||||
/*
|
||||
* This implementation is rather simplistic, but it is
|
||||
@@ -210,9 +217,9 @@ wxString dumpParamCfg( const PARAM_CFG& aParam )
|
||||
s << *static_cast<const PARAM_CFG_FILENAME&>( aParam ).m_Pt_param;
|
||||
break;
|
||||
case paramcfg_id::PARAM_BOOL:
|
||||
s << ( *static_cast<const PARAM_CFG_BOOL&>( aParam ).m_Pt_param ? wxT( "true" ) : wxT( "false" ) );
|
||||
s << ( *static_cast<const PARAM_CFG_BOOL&>( aParam ).m_Pt_param ? "true" : "false" );
|
||||
break;
|
||||
default: s << wxT( "Unsupported PARAM_CFG variant: " ) << aParam.m_Type;
|
||||
default: s << "Unsupported PARAM_CFG variant: " << aParam.m_Type;
|
||||
}
|
||||
|
||||
return s;
|
||||
@@ -242,28 +249,29 @@ static void dumpCfg( const std::vector<PARAM_CFG*>& aArray )
|
||||
*/
|
||||
static wxFileName getAdvancedCfgFilename()
|
||||
{
|
||||
const static wxString cfg_filename{ wxT( "kicad_advanced" ) };
|
||||
const static wxString cfg_filename{ "kicad_advanced" };
|
||||
return wxFileName( SETTINGS_MANAGER::GetUserSettingsPath(), cfg_filename );
|
||||
}
|
||||
|
||||
|
||||
ADVANCED_CFG::ADVANCED_CFG()
|
||||
{
|
||||
wxLogTrace( AdvancedConfigMask, wxT( "Init advanced config" ) );
|
||||
wxLogTrace( AdvancedConfigMask, "Init advanced config" );
|
||||
|
||||
// Init defaults - this is done in case the config doesn't exist,
|
||||
// then the values will remain as set here.
|
||||
m_RealTimeConnectivity = true;
|
||||
m_CoroutineStackSize = AC_STACK::default_stack;
|
||||
m_ShowRouterDebugGraphics = false;
|
||||
m_DrawArcAccuracy = 10.0;
|
||||
m_DrawArcCenterMaxAngle = 50.0;
|
||||
m_MaxTangentAngleDeviation = 1.0;
|
||||
m_MaxTrackLengthToKeep = 0.0005;
|
||||
m_MaxTrackLengthToKeep = 0.0001;
|
||||
m_ExtraZoneDisplayModes = false;
|
||||
m_DrawTriangulationOutlines = false;
|
||||
|
||||
m_ExtraClearance = 0.0005;
|
||||
m_DRCEpsilon = 0.0005; // 0.5um is small enough not to materially violate
|
||||
m_ExtraClearance = 0.0001;
|
||||
m_DRCEpsilon = 0.0001; // 0.1um is small enough not to materially violate
|
||||
// any constraints.
|
||||
|
||||
m_HoleWallThickness = 0.020; // IPC-6012 says 15-18um; Cadence says at least
|
||||
@@ -305,7 +313,7 @@ void ADVANCED_CFG::loadFromConfigFile()
|
||||
|
||||
if( !k_advanced.FileExists() )
|
||||
{
|
||||
wxLogTrace( AdvancedConfigMask, wxT( "File does not exist %s" ), k_advanced.GetFullPath() );
|
||||
wxLogTrace( AdvancedConfigMask, "File does not exist %s", k_advanced.GetFullPath() );
|
||||
|
||||
// load the defaults
|
||||
wxConfig emptyConfig;
|
||||
@@ -314,9 +322,9 @@ void ADVANCED_CFG::loadFromConfigFile()
|
||||
return;
|
||||
}
|
||||
|
||||
wxLogTrace( AdvancedConfigMask, wxT( "Loading advanced config from: %s" ), k_advanced.GetFullPath() );
|
||||
wxLogTrace( AdvancedConfigMask, "Loading advanced config from: %s", k_advanced.GetFullPath() );
|
||||
|
||||
wxFileConfig file_cfg( wxEmptyString, wxEmptyString, k_advanced.GetFullPath() );
|
||||
wxFileConfig file_cfg( "", "", k_advanced.GetFullPath() );
|
||||
loadSettings( file_cfg );
|
||||
}
|
||||
|
||||
@@ -325,92 +333,95 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
|
||||
{
|
||||
std::vector<PARAM_CFG*> configParams;
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::RealtimeConnectivity,
|
||||
&m_RealTimeConnectivity, true ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::ExtraFillMargin,
|
||||
&m_ExtraClearance, m_ExtraClearance, 0.0, 1.0 ) );
|
||||
&m_ExtraClearance, 0.0005, 0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DRCEpsilon,
|
||||
&m_DRCEpsilon, m_DRCEpsilon, 0.0, 1.0 ) );
|
||||
&m_DRCEpsilon, 0.0005, 0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::HoleWallThickness,
|
||||
&m_HoleWallThickness, m_HoleWallThickness, 0.0, 1.0 ) );
|
||||
&m_HoleWallThickness, 0.020, 0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_INT( true, AC_KEYS::CoroutineStackSize,
|
||||
&m_CoroutineStackSize, AC_STACK::default_stack,
|
||||
AC_STACK::min_stack, AC_STACK::max_stack ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRouterDebugGraphics,
|
||||
&m_ShowRouterDebugGraphics, m_ShowRouterDebugGraphics ) );
|
||||
&m_ShowRouterDebugGraphics, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::CompactFileSave,
|
||||
&m_CompactSave, m_CompactSave ) );
|
||||
&m_CompactSave, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcAccuracy,
|
||||
&m_DrawArcAccuracy, m_DrawArcAccuracy, 0.0, 100000.0 ) );
|
||||
&m_DrawArcAccuracy, 10.0, 0.0, 100000.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::DrawArcCenterStartEndMaxAngle,
|
||||
&m_DrawArcCenterMaxAngle, m_DrawArcCenterMaxAngle, 0.0, 100000.0 ) );
|
||||
&m_DrawArcCenterMaxAngle, 50.0, 0.0, 100000.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTangentTrackAngleDeviation,
|
||||
&m_MaxTangentAngleDeviation, m_MaxTangentAngleDeviation, 0.0, 90.0 ) );
|
||||
&m_MaxTangentAngleDeviation, 1.0, 0.0, 90.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MaxTrackLengthToKeep,
|
||||
&m_MaxTrackLengthToKeep, m_MaxTrackLengthToKeep, 0.0, 1.0 ) );
|
||||
&m_MaxTrackLengthToKeep, 0.0005, 0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ExtraZoneDisplayModes,
|
||||
&m_ExtraZoneDisplayModes, m_ExtraZoneDisplayModes ) );
|
||||
&m_ExtraZoneDisplayModes, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::StrokeTriangulation,
|
||||
&m_DrawTriangulationOutlines, m_DrawTriangulationOutlines ) );
|
||||
&m_DrawTriangulationOutlines, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::MinPlotPenWidth,
|
||||
&m_MinPlotPenWidth, m_MinPlotPenWidth, 0.0, 1.0 ) );
|
||||
&m_MinPlotPenWidth, 0.0212, 0.0, 1.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugZoneFiller,
|
||||
&m_DebugZoneFiller, m_DebugZoneFiller ) );
|
||||
&m_DebugZoneFiller, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DebugPDFWriter,
|
||||
&m_DebugPDFWriter, m_DebugPDFWriter ) );
|
||||
&m_DebugPDFWriter, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_DOUBLE( true, AC_KEYS::SmallDrillMarkSize,
|
||||
&m_SmallDrillMarkSize, m_SmallDrillMarkSize, 0.0, 3.0 ) );
|
||||
&m_SmallDrillMarkSize, 0.35, 0.0, 3.0 ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HotkeysDumper,
|
||||
&m_HotkeysDumper, m_HotkeysDumper ) );
|
||||
&m_HotkeysDumper, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::DrawBoundingBoxes,
|
||||
&m_DrawBoundingBoxes, m_DrawBoundingBoxes ) );
|
||||
&m_DrawBoundingBoxes, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowPcbnewExportNetlist,
|
||||
&m_ShowPcbnewExportNetlist, m_ShowPcbnewExportNetlist ) );
|
||||
&m_ShowPcbnewExportNetlist, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelFileCache,
|
||||
&m_Skip3DModelFileCache, m_Skip3DModelFileCache ) );
|
||||
&m_Skip3DModelFileCache, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::Skip3DModelMemoryCache,
|
||||
&m_Skip3DModelMemoryCache, m_Skip3DModelMemoryCache ) );
|
||||
&m_Skip3DModelMemoryCache, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HideVersionFromTitle,
|
||||
&m_HideVersionFromTitle, m_HideVersionFromTitle ) );
|
||||
&m_HideVersionFromTitle, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRepairSchematic,
|
||||
&m_ShowRepairSchematic, m_ShowRepairSchematic ) );
|
||||
&m_ShowRepairSchematic, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowEventCounters,
|
||||
&m_ShowEventCounters, m_ShowEventCounters ) );
|
||||
&m_ShowEventCounters, false ) );
|
||||
|
||||
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::AllowManualCanvasScale,
|
||||
&m_AllowManualCanvasScale, m_AllowManualCanvasScale ) );
|
||||
&m_AllowManualCanvasScale, false ) );
|
||||
|
||||
// Special case for trace mask setting...we just grab them and set them immediately
|
||||
// Because we even use wxLogTrace inside of advanced config
|
||||
wxString traceMasks = wxEmptyString;
|
||||
configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, wxEmptyString ) );
|
||||
wxString traceMasks = "";
|
||||
configParams.push_back( new PARAM_CFG_WXSTRING( true, AC_KEYS::TraceMasks, &traceMasks, "" ) );
|
||||
|
||||
// Load the config from file
|
||||
wxConfigLoadSetups( &aCfg, configParams );
|
||||
|
||||
// Now actually set the trace masks
|
||||
wxStringTokenizer traceMaskTokenizer( traceMasks, wxT( "," ) );
|
||||
wxStringTokenizer traceMaskTokenizer( traceMasks, "," );
|
||||
|
||||
while( traceMaskTokenizer.HasMoreTokens() )
|
||||
{
|
||||
|
||||
@@ -42,10 +42,10 @@ ARRAY_AXIS::ARRAY_AXIS() : m_type( NUMBERING_TYPE::NUMBERING_NUMERIC ), m_offset
|
||||
|
||||
const wxString& ARRAY_AXIS::GetAlphabet() const
|
||||
{
|
||||
static const wxString alphaNumeric = wxT( "0123456789" );
|
||||
static const wxString alphaHex = wxT( "0123456789ABCDEF" );
|
||||
static const wxString alphaFull = wxT( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
|
||||
static const wxString alphaNoIOSQXZ = wxT( "ABCDEFGHJKLMNPRTUVWY" );
|
||||
static const wxString alphaNumeric = "0123456789";
|
||||
static const wxString alphaHex = "0123456789ABCDEF";
|
||||
static const wxString alphaFull = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
static const wxString alphaNoIOSQXZ = "ABCDEFGHJKLMNPRTUVWY";
|
||||
|
||||
switch( m_type )
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ bool ASSET_ARCHIVE::Load()
|
||||
long ASSET_ARCHIVE::GetFileContents( const wxString& aFilePath, const unsigned char* aDest,
|
||||
size_t aMaxLen )
|
||||
{
|
||||
wxFAIL_MSG( wxT( "Unimplemented" ) );
|
||||
wxFAIL_MSG( "Unimplemented" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ const wxString& BASE_SCREEN::GetPageNumber() const
|
||||
static wxString pageNumber;
|
||||
|
||||
if( m_pageNumber.IsEmpty() )
|
||||
pageNumber.Printf( wxT( "%d" ), m_virtualPageNumber );
|
||||
pageNumber.Printf( "%d", m_virtualPageNumber );
|
||||
else
|
||||
pageNumber = m_pageNumber;
|
||||
|
||||
@@ -86,9 +86,9 @@ const wxString& BASE_SCREEN::GetPageNumber() const
|
||||
void BASE_SCREEN::Show( int nestLevel, std::ostream& os ) const
|
||||
{
|
||||
// for now, make it look like XML, expand on this later.
|
||||
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << wxT( ">\n" );
|
||||
NestedSpace( nestLevel, os ) << '<' << GetClass().Lower().mb_str() << ">\n";
|
||||
|
||||
NestedSpace( nestLevel, os ) << wxT( "</" ) << GetClass().Lower().mb_str() << wxT( ">\n" );
|
||||
NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+10
-5
@@ -181,7 +181,7 @@ wxString MessageTextFromValue( EDA_UNITS aUnits, double aValue, bool aAddUnitLab
|
||||
|
||||
if( aAddUnitLabel )
|
||||
{
|
||||
text += wxT( " " );
|
||||
text += " ";
|
||||
text += GetAbbreviatedUnitsLabel( aUnits, aType );
|
||||
}
|
||||
|
||||
@@ -226,17 +226,22 @@ wxString StringFromValue( EDA_UNITS aUnits, double aValue, bool aAddUnitSymbol,
|
||||
|
||||
if( value_to_print != 0.0 && fabs( value_to_print ) <= 0.0001 )
|
||||
{
|
||||
len = snprintf( buf, sizeof( buf ) - 1, "%.10f", value_to_print );
|
||||
len = sprintf( buf, "%.10f", value_to_print );
|
||||
|
||||
while( --len > 0 && buf[len] == '0' )
|
||||
buf[len] = '\0';
|
||||
|
||||
if( len >= 0 && ( buf[len]=='.' || buf[len]==',' ) )
|
||||
if( buf[len]=='.' || buf[len]==',' )
|
||||
buf[len] = '\0';
|
||||
else
|
||||
++len;
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf( buf, sizeof( buf ) - 1, "%.10g", value_to_print );
|
||||
if( aUnits == EDA_UNITS::MILS )
|
||||
len = sprintf( buf, "%.7g", value_to_print );
|
||||
else
|
||||
len = sprintf( buf, "%.10g", value_to_print );
|
||||
}
|
||||
|
||||
wxString stringValue( buf, wxConvUTF8 );
|
||||
@@ -347,7 +352,7 @@ double DoubleValueFromString( EDA_UNITS aUnits, const wxString& aTextValue, EDA_
|
||||
{
|
||||
aUnits = EDA_UNITS::INCHES;
|
||||
}
|
||||
else if( unit == wxT( "oz" ) ) // 1 oz = 1.37 mils
|
||||
else if( unit == "oz" ) // 1 oz = 1.37 mils
|
||||
{
|
||||
aUnits = EDA_UNITS::MILS;
|
||||
dtmp *= 1.37;
|
||||
|
||||
@@ -121,13 +121,6 @@ wxBitmap KiBitmap( const BITMAP_OPAQUE* aBitmap )
|
||||
|
||||
int KiIconScale( wxWindow* aWindow )
|
||||
{
|
||||
#if defined( __WXMSW__) && wxCHECK_VERSION( 3, 1, 6 )
|
||||
// Basically don't try and scale within kicad and let wx do its thing
|
||||
// with wx introducing bitmap bundles, it will auto scale automatically with dpi
|
||||
// the issue is, none of the scaling factors have any tie to system scaling
|
||||
// this means wx is actually going to scale again causing even more distorted icons
|
||||
return 4;
|
||||
#else
|
||||
const int vert_size = aWindow->ConvertDialogToPixels( wxSize( 0, 8 ) ).y;
|
||||
|
||||
// Autoscale won't exceed unity until the system has quite high resolution,
|
||||
@@ -138,7 +131,6 @@ int KiIconScale( wxWindow* aWindow )
|
||||
else if( vert_size > 29 ) return 7;
|
||||
else if( vert_size > 24 ) return 6;
|
||||
else return 4;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-28
@@ -6,7 +6,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 jean-pierre.charras
|
||||
* Copyright (C) 2011-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2011-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -251,32 +251,14 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
|
||||
aDC->GetLogicalOrigin( &logicalOriginX, &logicalOriginY );
|
||||
|
||||
bool useTransform = aDC->CanUseTransformMatrix();
|
||||
|
||||
// We already have issues to draw a bitmap on the wxDC, depending on wxWidgets version.
|
||||
// Now we have an issue on wxWidgets 3.1.6 and later to fix the clipboard
|
||||
// and the bitmap position when using TransformMatrix
|
||||
// So for version >= 3.1.6 do not use it
|
||||
// Be carefull before changing the code.
|
||||
#if wxCHECK_VERSION( 3, 1, 6 )
|
||||
useTransform = false;
|
||||
#endif
|
||||
|
||||
wxAffineMatrix2D init_matrix = aDC->GetTransformMatrix();
|
||||
|
||||
wxPoint clipAreaPos;
|
||||
|
||||
if( useTransform )
|
||||
{
|
||||
wxAffineMatrix2D matrix = aDC->GetTransformMatrix();
|
||||
matrix.Translate( pos.x, pos.y );
|
||||
matrix.Scale( GetScalingFactor(), GetScalingFactor() );
|
||||
aDC->SetTransformMatrix( matrix );
|
||||
// Needed on wx <= 3.1.5, and this is strange...
|
||||
// Nevertheless, this code has problem (the bitmap is not seen)
|
||||
// with wx version > 3.1.5
|
||||
clipAreaPos.x = pos.x;
|
||||
clipAreaPos.y = pos.y;
|
||||
|
||||
pos.x = pos.y = 0;
|
||||
}
|
||||
else
|
||||
@@ -287,15 +269,8 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
|
||||
|
||||
pos.x = KiROUND( pos.x / GetScalingFactor() );
|
||||
pos.y = KiROUND( pos.y / GetScalingFactor() );
|
||||
size.x = KiROUND( size.x / GetScalingFactor() );
|
||||
size.y = KiROUND( size.y / GetScalingFactor() );
|
||||
clipAreaPos.x = pos.x;
|
||||
clipAreaPos.y = pos.y;
|
||||
}
|
||||
|
||||
aDC->DestroyClippingRegion();
|
||||
aDC->SetClippingRegion( clipAreaPos, size );
|
||||
|
||||
if( GetGRForceBlackPenState() )
|
||||
{
|
||||
wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() );
|
||||
@@ -313,8 +288,6 @@ void BITMAP_BASE::DrawBitmap( wxDC* aDC, const wxPoint& aPos )
|
||||
aDC->SetUserScale( scale, scale );
|
||||
aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );
|
||||
}
|
||||
|
||||
aDC->DestroyClippingRegion();
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -158,6 +158,7 @@ wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight )
|
||||
|
||||
wxMemoryInputStream is( data, count );
|
||||
wxImage image( is, wxBITMAP_TYPE_PNG );
|
||||
wxBitmap bitmap( image );
|
||||
|
||||
return image;
|
||||
}
|
||||
@@ -235,5 +236,6 @@ wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight )
|
||||
|
||||
void BITMAP_STORE::buildBitmapInfoCache()
|
||||
{
|
||||
BuildBitmapInfo( m_bitmapInfoCache );
|
||||
for( const BITMAP_INFO& entry : g_BitmapInfo )
|
||||
m_bitmapInfoCache[entry.id].emplace_back( entry );
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018 CERN
|
||||
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
@@ -70,7 +70,6 @@ BOARD_PRINTOUT::BOARD_PRINTOUT( const BOARD_PRINTOUT_SETTINGS& aParams,
|
||||
m_settings( aParams )
|
||||
{
|
||||
m_view = aView;
|
||||
m_gerbviewPrint = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,12 +85,12 @@ void BOARD_PRINTOUT::GetPageInfo( int* minPage, int* maxPage, int* selPageFrom,
|
||||
|
||||
void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPageCount )
|
||||
{
|
||||
wxDC* dc = GetDC();
|
||||
auto dc = GetDC();
|
||||
KIGFX::GAL_DISPLAY_OPTIONS options;
|
||||
std::unique_ptr<KIGFX::GAL_PRINT> galPrint = KIGFX::GAL_PRINT::Create( options, dc );
|
||||
KIGFX::GAL* gal = galPrint->GetGAL();
|
||||
KIGFX::PRINT_CONTEXT* printCtx = galPrint->GetPrintCtx();
|
||||
std::unique_ptr<KIGFX::PAINTER> painter = getPainter( gal );
|
||||
auto galPrint = KIGFX::GAL_PRINT::Create( options, dc );
|
||||
auto gal = galPrint->GetGAL();
|
||||
auto printCtx = galPrint->GetPrintCtx();
|
||||
auto painter = getPainter( gal );
|
||||
std::unique_ptr<KIGFX::VIEW> view( m_view->DataReference() );
|
||||
|
||||
// Target paper size
|
||||
@@ -116,10 +115,6 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
||||
{
|
||||
for( int i = 0; i < LAYER_ID_COUNT; ++i )
|
||||
dstSettings->SetLayerColor( i, COLOR4D::BLACK );
|
||||
|
||||
// In B&W mode, draw the background only in wxhite, because any other color
|
||||
// will be replaced by a black background
|
||||
dstSettings->SetBackgroundColor( COLOR4D::WHITE );
|
||||
}
|
||||
else // color enabled
|
||||
{
|
||||
@@ -136,9 +131,6 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
||||
|
||||
setupPainter( *painter );
|
||||
setupViewLayers( *view, m_settings.m_LayerSet );
|
||||
dstSettings->SetPrintLayers( m_settings.m_LayerSet );
|
||||
|
||||
dstSettings->SetLayerName( aLayerName );
|
||||
|
||||
wxSize sheetSizeMils = m_settings.m_pageInfo.GetSizeMils();
|
||||
VECTOR2I sheetSizeIU( milsToIU( sheetSizeMils.GetWidth() ),
|
||||
@@ -183,11 +175,6 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
||||
gal->SetClearColor( dstSettings->GetBackgroundColor() );
|
||||
gal->ClearScreen();
|
||||
|
||||
if( m_gerbviewPrint )
|
||||
// Mandatory in Gerbview to use the same order for printing as for screen redraw
|
||||
// due to negative objects that need a specific order
|
||||
view->UseDrawPriority( true );
|
||||
|
||||
{
|
||||
KIGFX::GAL_DRAWING_CONTEXT ctx( gal );
|
||||
view->Redraw();
|
||||
|
||||
+48
-48
@@ -95,42 +95,42 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
wxString aMsg;
|
||||
// DO NOT translate information in the msg_version string
|
||||
|
||||
wxString eol = aHtml ? wxT( "<br>" ) : wxT( "\n" );
|
||||
wxString eol = aHtml ? "<br>" : "\n";
|
||||
|
||||
// Tabs instead of spaces for the plaintext version for shorter string length
|
||||
wxString indent4 = aHtml ? wxT( " " ) : wxT( "\t" );
|
||||
wxString indent4 = aHtml ? " " : "\t";
|
||||
|
||||
#define ON wxT( "ON" ) << eol
|
||||
#define OFF wxT( "OFF" ) << eol
|
||||
#define ON "ON" << eol
|
||||
#define OFF "OFF" << eol
|
||||
|
||||
wxString version;
|
||||
version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? wxT( "(UNSUPPORTED)" )
|
||||
version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? "(UNSUPPORTED)"
|
||||
: GetBuildVersion() )
|
||||
#ifdef DEBUG
|
||||
<< wxT( ", debug" )
|
||||
<< ", debug"
|
||||
#else
|
||||
<< wxT( ", release" )
|
||||
<< ", release"
|
||||
#endif
|
||||
<< wxT( " build" );
|
||||
<< " build";
|
||||
|
||||
wxPlatformInfo platform;
|
||||
aMsg << wxT( "Application: " ) << aTitle;
|
||||
aMsg << "Application: " << aTitle;
|
||||
|
||||
#if defined( KICAD_BUILD_ARCH_X64 )
|
||||
aMsg << wxT( " (64-bit)" );
|
||||
aMsg << " (64-bit)";
|
||||
#elif defined( KICAD_BUILD_ARCH_X86 )
|
||||
aMsg << wxT( " (32-bit)" );
|
||||
aMsg << " (32-bit)";
|
||||
#elif defined( KICAD_BUILD_ARCH_ARM )
|
||||
aMsg << wxT( " (ARM 32-bit)" );
|
||||
aMsg << " (ARM 32-bit)";
|
||||
#elif defined( KICAD_BUILD_ARCH_ARM64 )
|
||||
aMsg << wxT( " (ARM 64-bit)" );
|
||||
aMsg << " (ARM 64-bit)";
|
||||
#endif
|
||||
|
||||
aMsg << eol << eol;
|
||||
|
||||
|
||||
aMsg << wxT( "Version: " ) << version << eol << eol;
|
||||
aMsg << wxT( "Libraries:" ) << eol;
|
||||
aMsg << "Version: " << version << eol << eol;
|
||||
aMsg << "Libraries:" << eol;
|
||||
|
||||
aMsg << indent4 << wxGetLibraryVersionInfo().GetVersionString() << eol;
|
||||
|
||||
@@ -139,26 +139,26 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
|
||||
aMsg << eol;
|
||||
|
||||
aMsg << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " )
|
||||
<< GetPlatformGetBitnessName() << wxT( ", " )
|
||||
<< platform.GetEndiannessName() << wxT( ", " )
|
||||
aMsg << "Platform: " << wxGetOsDescription() << ", "
|
||||
<< GetPlatformGetBitnessName() << ", "
|
||||
<< platform.GetEndiannessName() << ", "
|
||||
<< platform.GetPortIdName();
|
||||
|
||||
#ifdef __WXGTK__
|
||||
aMsg << wxT( ", " ) << wxGetenv( wxT( "XDG_SESSION_DESKTOP" ) )
|
||||
<< wxT( ", " ) << wxGetenv( wxT( "XDG_SESSION_TYPE" ) );
|
||||
aMsg << ", " << wxGetenv( "XDG_SESSION_DESKTOP" )
|
||||
<< ", " << wxGetenv( "XDG_SESSION_TYPE" );
|
||||
#endif
|
||||
|
||||
aMsg << eol << eol;
|
||||
|
||||
if( !aBrief )
|
||||
{
|
||||
aMsg << wxT( "Build Info:" ) << eol;
|
||||
aMsg << indent4 << wxT( "Date: " ) << GetBuildDate() << eol;
|
||||
aMsg << "Build Info:" << eol;
|
||||
aMsg << indent4 << "Date: " << GetBuildDate() << eol;
|
||||
}
|
||||
|
||||
aMsg << indent4 << wxT( "wxWidgets: " ) << wxVERSION_NUM_DOT_STRING << wxT( " (" );
|
||||
aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 wxT( ")" );
|
||||
aMsg << indent4 << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " (";
|
||||
aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")";
|
||||
|
||||
// Get the GTK+ version where possible.
|
||||
#ifdef __WXGTK__
|
||||
@@ -166,68 +166,68 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
|
||||
major = wxPlatformInfo().Get().GetToolkitMajorVersion();
|
||||
minor = wxPlatformInfo().Get().GetToolkitMinorVersion();
|
||||
aMsg << wxT( " GTK+ " ) << major << wxT( "." ) << minor;
|
||||
aMsg << " GTK+ " << major << "." << minor;
|
||||
#endif
|
||||
|
||||
aMsg << eol;
|
||||
|
||||
aMsg << indent4 << wxT( "Boost: " ) << ( BOOST_VERSION / 100000 ) << wxT( "." )
|
||||
aMsg << indent4 << "Boost: " << ( BOOST_VERSION / 100000 ) << wxT( "." )
|
||||
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." )
|
||||
<< ( BOOST_VERSION % 100 ) << eol;
|
||||
|
||||
#ifdef KICAD_USE_OCC
|
||||
aMsg << indent4 << wxT( "OCC: " ) << OCC_VERSION_COMPLETE << eol;
|
||||
aMsg << indent4 << "OCC: " << OCC_VERSION_COMPLETE << eol;
|
||||
#endif
|
||||
|
||||
aMsg << indent4 << wxT( "Curl: " ) << GetCurlLibVersion() << eol;
|
||||
aMsg << indent4 << "Curl: " << GetCurlLibVersion() << eol;
|
||||
|
||||
#if defined( KICAD_SPICE )
|
||||
#if defined( NGSPICE_BUILD_VERSION )
|
||||
aMsg << indent4 << wxT( "ngspice: " ) << NGSPICE_BUILD_VERSION << eol;
|
||||
aMsg << indent4 << "ngspice: " << NGSPICE_BUILD_VERSION << eol;
|
||||
#elif defined( NGSPICE_HAVE_CONFIG_H )
|
||||
#undef HAVE_STRNCASECMP /* is redefined in ngspice/config.h */
|
||||
#include <ngspice/config.h>
|
||||
aMsg << indent4 << wxT( "ngspice: " ) << PACKAGE_VERSION << eol;
|
||||
aMsg << indent4 << "ngspice: " << PACKAGE_VERSION << eol;
|
||||
#elif defined( NGSPICE_PACKAGE_VERSION )
|
||||
aMsg << indent4 << wxT( "ngspice: " ) << NGSPICE_PACKAGE_VERSION << eol;
|
||||
aMsg << indent4 << "ngspice: " << NGSPICE_PACKAGE_VERSION << eol;
|
||||
#else
|
||||
aMsg << indent4 << wxT( "ngspice: " ) << wxT( "unknown" ) << eol;
|
||||
aMsg << indent4 << "ngspice: " << "unknown" << eol;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
aMsg << indent4 << wxT( "Compiler: " );
|
||||
aMsg << indent4 << "Compiler: ";
|
||||
#if defined(__clang__)
|
||||
aMsg << wxT( "Clang " ) << __clang_major__ << wxT( "." ) << __clang_minor__ << wxT( "." ) << __clang_patchlevel__;
|
||||
aMsg << "Clang " << __clang_major__ << "." << __clang_minor__ << "." << __clang_patchlevel__;
|
||||
#elif defined(__GNUG__)
|
||||
aMsg << wxT( "GCC " ) << __GNUC__ << wxT( "." ) << __GNUC_MINOR__ << wxT( "." ) << __GNUC_PATCHLEVEL__;
|
||||
aMsg << "GCC " << __GNUC__ << "." << __GNUC_MINOR__ << "." << __GNUC_PATCHLEVEL__;
|
||||
#elif defined(_MSC_VER)
|
||||
aMsg << wxT( "Visual C++ " ) << _MSC_VER;
|
||||
aMsg << "Visual C++ " << _MSC_VER;
|
||||
#elif defined(__INTEL_COMPILER)
|
||||
aMsg << wxT( "Intel C++ " ) << __INTEL_COMPILER;
|
||||
aMsg << "Intel C++ " << __INTEL_COMPILER;
|
||||
#else
|
||||
aMsg << wxT( "Other Compiler " );
|
||||
aMsg << "Other Compiler ";
|
||||
#endif
|
||||
|
||||
#if defined(__GXX_ABI_VERSION)
|
||||
aMsg << wxT( " with C++ ABI " ) << __GXX_ABI_VERSION << eol;
|
||||
aMsg << " with C++ ABI " << __GXX_ABI_VERSION << eol;
|
||||
#else
|
||||
aMsg << wxT( " without C++ ABI" ) << eol;
|
||||
aMsg << " without C++ ABI" << eol;
|
||||
#endif
|
||||
|
||||
aMsg << eol;
|
||||
|
||||
// Add build settings config (build options):
|
||||
aMsg << wxT( "Build settings:" ) << eol;
|
||||
aMsg << "Build settings:" << eol;
|
||||
|
||||
#ifdef KICAD_USE_OCC
|
||||
aMsg << indent4 << wxT( "KICAD_USE_OCC=" ) << ON;
|
||||
aMsg << indent4 << "KICAD_USE_OCC=" << ON;
|
||||
#endif
|
||||
|
||||
#ifdef KICAD_USE_EGL
|
||||
aMsg << indent4 << wxT( "KICAD_USE_EGL=" ) << ON;
|
||||
aMsg << indent4 << "KICAD_USE_EGL=" << ON;
|
||||
#endif
|
||||
|
||||
aMsg << indent4 << wxT( "KICAD_SPICE=" );
|
||||
aMsg << indent4 << "KICAD_SPICE=";
|
||||
#ifdef KICAD_SPICE
|
||||
aMsg << ON;
|
||||
#else
|
||||
@@ -235,12 +235,12 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
aMsg << indent4 << wxT( "KICAD_STDLIB_DEBUG=" );
|
||||
aMsg << indent4 << "KICAD_STDLIB_DEBUG=";
|
||||
#ifdef KICAD_STDLIB_DEBUG
|
||||
aMsg << ON;
|
||||
#else
|
||||
aMsg << OFF;
|
||||
aMsg << indent4 << wxT( "KICAD_STDLIB_LIGHT_DEBUG=" );
|
||||
aMsg << indent4 << "KICAD_STDLIB_LIGHT_DEBUG=";
|
||||
#ifdef KICAD_STDLIB_LIGHT_DEBUG
|
||||
aMsg << ON;
|
||||
#else
|
||||
@@ -248,14 +248,14 @@ wxString GetVersionInfoData( const wxString& aTitle, bool aHtml, bool aBrief )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
aMsg << indent4 << wxT( "KICAD_SANITIZE_ADDRESS=" );
|
||||
aMsg << indent4 << "KICAD_SANITIZE_ADDRESS=";
|
||||
#ifdef KICAD_SANITIZE_ADDRESS
|
||||
aMsg << ON;
|
||||
#else
|
||||
aMsg << OFF;
|
||||
#endif
|
||||
|
||||
aMsg << indent4 << wxT( "KICAD_SANITIZE_THREADS=" );
|
||||
aMsg << indent4 << "KICAD_SANITIZE_THREADS=";
|
||||
#ifdef KICAD_SANITIZE_THREADS
|
||||
aMsg << ON;
|
||||
#else
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ wxString ExpandTextVars( const wxString& aSource,
|
||||
else
|
||||
{
|
||||
// Token not resolved: leave the reference unchanged
|
||||
newbuf.append( wxT( "${" ) + token + wxT( "}" ) );
|
||||
newbuf.append( "${" + token + "}" );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -404,7 +404,7 @@ void PARAM_CFG_WXSTRING_SET::ReadParam( wxConfigBase* aConfig ) const
|
||||
|
||||
key = m_Ident;
|
||||
key << i;
|
||||
data = aConfig->Read( key, wxEmptyString );
|
||||
data = aConfig->Read( key, wxT( "" ) );
|
||||
|
||||
if( data.IsEmpty() )
|
||||
break;
|
||||
@@ -494,7 +494,7 @@ void PARAM_CFG_LIBNAME_LIST::ReadParam( wxConfigBase* aConfig ) const
|
||||
id_lib = m_Ident;
|
||||
id_lib << indexlib;
|
||||
indexlib++;
|
||||
libname = aConfig->Read( id_lib, wxEmptyString );
|
||||
libname = aConfig->Read( id_lib, wxT( "" ) );
|
||||
|
||||
if( libname.IsEmpty() )
|
||||
break;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010 Rafael Sokolowski <Rafael.Sokolowski@web.de>
|
||||
* Copyright (C) 2010-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2010-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -64,18 +64,18 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
aInfo.SetAppName( Pgm().App().GetAppName() );
|
||||
|
||||
/* Copyright information */
|
||||
aInfo.SetCopyright( "(C) 1992-2022 KiCad Developers Team" );
|
||||
aInfo.SetCopyright( "(C) 1992-2021 KiCad Developers Team" );
|
||||
|
||||
/* KiCad build version */
|
||||
wxString version;
|
||||
version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? wxT( "(UNSUPPORTED)" )
|
||||
version << ( KIPLATFORM::APP::IsOperatingSystemUnsupported() ? "(UNSUPPORTED)"
|
||||
: GetBuildVersion() )
|
||||
#ifdef DEBUG
|
||||
<< wxT( ", debug" )
|
||||
<< ", debug"
|
||||
#else
|
||||
<< wxT( ", release" )
|
||||
<< ", release"
|
||||
#endif
|
||||
<< wxT( " build" );
|
||||
<< " build";
|
||||
|
||||
aInfo.SetBuildVersion( version );
|
||||
aInfo.SetBuildDate( GetBuildDate() );
|
||||
@@ -93,15 +93,15 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
|
||||
// Just in case someone builds KiCad with the platform native of Boost instead of
|
||||
// the version included with the KiCad source.
|
||||
libVersion << wxT( "and Boost " ) << ( BOOST_VERSION / 100000 ) << wxT( "." )
|
||||
<< ( BOOST_VERSION / 100 % 1000 ) << wxT( "." ) << ( BOOST_VERSION % 100 )
|
||||
<< wxT( "\n" );
|
||||
libVersion << "and Boost " << ( BOOST_VERSION / 100000 ) << "."
|
||||
<< ( BOOST_VERSION / 100 % 1000 ) << "." << ( BOOST_VERSION % 100 )
|
||||
<< "\n";
|
||||
|
||||
// Operating System Information
|
||||
|
||||
wxPlatformInfo platformInfo;
|
||||
|
||||
libVersion << wxT( "Platform: " ) << wxGetOsDescription() << wxT( ", " )
|
||||
libVersion << "Platform: " << wxGetOsDescription() << ", "
|
||||
// TODO (ISM): Readd conditional once our wx fork and flatpaks are running released 3.1.5
|
||||
#if 0 && wxCHECK_VERSION( 3, 1, 5 )
|
||||
<< platformInfo.GetBitnessName();
|
||||
@@ -117,64 +117,64 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
wxString description;
|
||||
|
||||
/* short description */
|
||||
description << wxT( "<p>" );
|
||||
description << wxT( "<b><u>" )
|
||||
description << "<p>";
|
||||
description << "<b><u>"
|
||||
<< _( "Description" )
|
||||
<< wxT( "</u></b>" ); // bold & underlined font for caption
|
||||
<< "</u></b>"; // bold & underlined font for caption
|
||||
|
||||
description << wxT( "<p>" )
|
||||
description << "<p>"
|
||||
<< _( "The KiCad EDA Suite is a set of open source applications for the "
|
||||
"creation of electronic schematics and printed circuit boards." )
|
||||
<< wxT( "</p>" );
|
||||
<< "</p>";
|
||||
|
||||
description << wxT( "</p>" );
|
||||
description << "</p>";
|
||||
|
||||
/* websites */
|
||||
description << wxT( "<p><b><u>" )
|
||||
description << "<p><b><u>"
|
||||
<< _( "KiCad on the web" )
|
||||
<< wxT( "</u></b>" ); // bold & underlined font for caption
|
||||
<< "</u></b>"; // bold & underlined font for caption
|
||||
|
||||
// bullet-ed list with some http links
|
||||
description << wxT( "<ul>" );
|
||||
description << wxT( "<li>" )
|
||||
description << "<ul>";
|
||||
description << "<li>"
|
||||
<< _( "The official KiCad website - " )
|
||||
<< HtmlHyperlink( wxT( "http://www.kicad.org" ) )
|
||||
<< wxT( "</li>" );
|
||||
description << wxT( "<li>" )
|
||||
<< HtmlHyperlink( "http://www.kicad.org" )
|
||||
<< "</li>";
|
||||
description << "<li>"
|
||||
<< _( "Developer website - " )
|
||||
<< HtmlHyperlink( wxT( "https://go.kicad.org/dev" ) )
|
||||
<< wxT( "</li>" );
|
||||
<< HtmlHyperlink( "https://go.kicad.org/dev" )
|
||||
<< "</li>";
|
||||
|
||||
description << wxT( "<li>" )
|
||||
description << "<li>"
|
||||
<< _("Official KiCad library repositories - " )
|
||||
<< HtmlHyperlink( wxT( "https://go.kicad.org/libraries" ) )
|
||||
<< wxT( "</li>" );
|
||||
<< HtmlHyperlink( "https://go.kicad.org/libraries" )
|
||||
<< "</li>";
|
||||
|
||||
description << wxT( "</ul></p>" );
|
||||
description << "</ul></p>";
|
||||
|
||||
description << wxT( "<p><b><u>" )
|
||||
description << "<p><b><u>"
|
||||
<< _( "Bug tracker" )
|
||||
<< wxT( "</u></b>" ); // bold & underlined font caption
|
||||
<< "</u></b>"; // bold & underlined font caption
|
||||
|
||||
// bullet-ed list with some http links
|
||||
description << wxT( "<ul>" );
|
||||
description << wxT( "<li>" )
|
||||
description << "<ul>";
|
||||
description << "<li>"
|
||||
<< _( "Report or examine bugs - " )
|
||||
<< HtmlHyperlink( wxT( "https://go.kicad.org/bugs" ) )
|
||||
<< wxT( "</li>" );
|
||||
description << wxT( "</ul></p>" );
|
||||
<< HtmlHyperlink( "https://go.kicad.org/bugs" )
|
||||
<< "</li>";
|
||||
description << "</ul></p>";
|
||||
|
||||
description << wxT( "<p><b><u>" )
|
||||
description << "<p><b><u>"
|
||||
<< _( "KiCad users group and community" )
|
||||
<< wxT( "</u></b>" ); // bold & underlined font caption
|
||||
<< "</u></b>"; // bold & underlined font caption
|
||||
|
||||
description << wxT( "<ul>" );
|
||||
description << wxT( "<li>" )
|
||||
description << "<ul>";
|
||||
description << "<li>"
|
||||
<< _( "KiCad forum - " )
|
||||
<< HtmlHyperlink( wxT( "https://go.kicad.org/forum" ) )
|
||||
<< wxT( "</li>" );
|
||||
<< HtmlHyperlink( "https://go.kicad.org/forum" )
|
||||
<< "</li>";
|
||||
|
||||
description << wxT( "</ul></p>" );
|
||||
description << "</ul></p>";
|
||||
|
||||
aInfo.SetDescription( description );
|
||||
|
||||
@@ -182,12 +182,12 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
// License information also HTML formatted:
|
||||
wxString license;
|
||||
license
|
||||
<< wxT( "<div align='center'>" )
|
||||
<< "<div align='center'>"
|
||||
<< HtmlNewline( 4 )
|
||||
<< _( "The complete KiCad EDA Suite is released under the" ) << HtmlNewline( 2 )
|
||||
<< HtmlHyperlink( wxT( "http://www.gnu.org/licenses" ),
|
||||
<< HtmlHyperlink( "http://www.gnu.org/licenses",
|
||||
_( "GNU General Public License (GPL) version 3 or any later version" ) )
|
||||
<< wxT( "</div>" );
|
||||
<< "</div>";
|
||||
|
||||
aInfo.SetLicense( license );
|
||||
|
||||
@@ -208,20 +208,20 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
#define LEAD_DEV _( "Lead Development Team" )
|
||||
#define FORMER_DEV _( "Lead Development Alumni" )
|
||||
#define CONTRIB_DEV _( "Additional Contributions By")
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Wayne Stambaugh" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Jean-Pierre Charras", LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Wayne Stambaugh", LEAD_DEV, nullptr ) );
|
||||
|
||||
// Alphabetical after the first two
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jon Evans" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Jon Evans", LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Roberto Fernandez Bautista" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Seth Hillbrand" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Ian McInerney" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Seth Hillbrand", LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Ian McInerney", LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Orson (Maciej Sumiński)" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mark Roszko" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Thomas Pointhuber" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Mikolaj Wielgus" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Tomasz Wlostowski" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Jeff Young" ), LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Mark Roszko", LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Thomas Pointhuber", LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Mikolaj Wielgus", LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Tomasz Wlostowski", LEAD_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( "Jeff Young", LEAD_DEV, nullptr ) );
|
||||
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "John Beard" ), FORMER_DEV, nullptr ) );
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Dick Hollenbeck" ), FORMER_DEV, nullptr ) );
|
||||
@@ -533,13 +533,13 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
aInfo.AddDeveloper( new CONTRIBUTOR( wxT( "Nick Østergaard" ), CONTRIB_DEV, nullptr ) );
|
||||
|
||||
// The document writers
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ) ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Marco Ciampa" ) ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Jon Evans" ) ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Dick Hollenbeck" ) ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Igor Plyatov" ) ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Wayne Stambaugh" ) ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( wxT( "Fabrizio Tappero" ) ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( "Jean-Pierre Charras" ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( "Marco Ciampa" ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( "Jon Evans" ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( "Dick Hollenbeck" ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( "Igor Plyatov" ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( "Wayne Stambaugh" ) );
|
||||
aInfo.AddDocWriter( new CONTRIBUTOR( "Fabrizio Tappero" ) );
|
||||
|
||||
/* The translators
|
||||
* As category the language to which the translation was done is used
|
||||
@@ -547,339 +547,319 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Martin Kratoška" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Czech (CS)" ) ) );
|
||||
"Czech (CS)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Radek Kuznik" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Czech (CS)" ) ) );
|
||||
"Czech (CS)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Roman Ondráček" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Czech (CS)" ) ) );
|
||||
"Czech (CS)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jan Straka" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Czech (CS)" ) ) );
|
||||
"Czech (CS)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jan Vykydal" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Czech (CS)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jonathan Haas" ),
|
||||
"Czech (CS)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Jonathan Haas",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "German (DE)" ) ) );
|
||||
"German (DE)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mark Hämmerling" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "German (DE)" ) ) );
|
||||
"German (DE)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mathias Neumann" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "German (DE)" ) ) );
|
||||
"German (DE)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Dominik Wernberger" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "German (DE)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Manolis Stefanis" ),
|
||||
"German (DE)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Manolis Stefanis",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Greek (el_GR)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Athanasios Vlastos" ),
|
||||
"Greek (el_GR)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Athanasios Vlastos",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Greek (el_GR)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Milonas Kostas" ),
|
||||
"Greek (el_GR)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Milonas Kostas",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Greek (el_GR)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Michail Misirlis" ),
|
||||
"Greek (el_GR)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Michail Misirlis",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Greek (el_GR)" ) ) );
|
||||
"Greek (el_GR)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Adolfo Jayme Barrientos" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Spanish (ES)" ) ) );
|
||||
"Spanish (ES)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Roberto Fernandez Bautista" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Spanish (ES)" ) ) );
|
||||
"Spanish (ES)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Augusto Fraga Giachero" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Spanish (ES)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Pedro Martin del Valle" ),
|
||||
"Spanish (ES)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Pedro Martin del Valle",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Spanish (ES)" ) ) );
|
||||
"Spanish (ES)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Figuero" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Spanish (ES)" ) ) );
|
||||
"Spanish (ES)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Iñigo Zuluaga" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Spanish (ES)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Vesa Solonen" ),
|
||||
"Spanish (ES)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Vesa Solonen",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Finnish (FI)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Alex Gellen" ),
|
||||
"Finnish (FI)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Alex Gellen",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Finnish (FI)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "J. Lavoie" ),
|
||||
"Finnish (FI)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "J. Lavoie",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Finnish (FI)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Purkka Koodari" ),
|
||||
"Finnish (FI)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Purkka Koodari",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Finnish (FI)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Ola Rinta-Koski" ),
|
||||
"Finnish (FI)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Ola Rinta-Koski",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Finnish (FI)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Riku Viitanen" ),
|
||||
"Finnish (FI)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Riku Viitanen",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Finnish (FI)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Simo Mattila" ),
|
||||
"Finnish (FI)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Simo Mattila",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Finnish (FI)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Jean-Pierre Charras" ),
|
||||
"Finnish (FI)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Jean-Pierre Charras",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "French (FR)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Marco Ciampa" ),
|
||||
"French (FR)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Marco Ciampa",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Italian (IT)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Hiroshi Tokita" ),
|
||||
"Italian (IT)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Hiroshi Tokita",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Japanese (JA)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kenta Yonekura" ),
|
||||
"Japanese (JA)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Kenta Yonekura",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Japanese (JA)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Ji Yoon Choi" ),
|
||||
"Japanese (JA)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Ji Yoon Choi",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Japanese (JA)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Hidemichi Gotou" ),
|
||||
"Japanese (JA)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Hidemichi Gotou",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Japanese (JA)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kaoru Zenyouji" ),
|
||||
"Japanese (JA)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Kaoru Zenyouji",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Japanese (JA)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kinichiro Inoguchi" ),
|
||||
"Japanese (JA)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Kinichiro Inoguchi",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Japanese (JA)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Norio Suzuki" ),
|
||||
"Japanese (JA)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Norio Suzuki",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Japanese (JA)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "starfort-jp" ),
|
||||
"Japanese (JA)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "starfort-jp",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Japanese (JA)" ) ) );
|
||||
"Japanese (JA)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "킴슨김랑기" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Ji Yoon Choi" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "jeongsuAn" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "이상수" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "jehunseo" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Uibeom Jung" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "박준언" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "방준영" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "박기정" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "hokim" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "강명구" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "서범기" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Korean (KO)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Arend-Jan van Hilten" ),
|
||||
"Korean (KO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Arend-Jan van Hilten",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Dutch (NL)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "CJ van der Hoeven" ),
|
||||
"Dutch (NL)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "CJ van der Hoeven",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Dutch (NL)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Pim Jansen" ),
|
||||
"Dutch (NL)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Pim Jansen",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Dutch (NL)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Allan Nordhøy" ),
|
||||
"Dutch (NL)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Allan Nordhøy",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Norwegian (NO)" ) ) );
|
||||
"Norwegian (NO)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mateusz Skowroński" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Polish (PL)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Kerusey Karyu" ),
|
||||
"Polish (PL)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Kerusey Karyu",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Polish (PL)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Mark Roszko" ),
|
||||
"Polish (PL)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Mark Roszko",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Polish (PL)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "ZbeeGin" ),
|
||||
"Polish (PL)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "ZbeeGin",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Polish (PL)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Augusto Fraga Giachero" ),
|
||||
"Polish (PL)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Augusto Fraga Giachero",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Brazilian Portuguese (PT_BR)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Wellington Terumi Uemura" ),
|
||||
"Brazilian Portuguese (PT_BR)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Wellington Terumi Uemura",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Brazilian Portuguese (PT_BR)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Augusto Fraga Giachero" ),
|
||||
"Brazilian Portuguese (PT_BR)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Augusto Fraga Giachero",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Portuguese (PT)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Renie Marquet" ),
|
||||
"Portuguese (PT)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Renie Marquet",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Portuguese (PT)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Rafael Silva" ),
|
||||
"Portuguese (PT)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Rafael Silva",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Portuguese (PT)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Igor Plyatov" ),
|
||||
"Portuguese (PT)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Igor Plyatov",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Russian (RU)" ) ) );
|
||||
"Russian (RU)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Дмитрий Дёмин" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Russian (RU)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Andrey Fedorushkov" ),
|
||||
"Russian (RU)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Andrey Fedorushkov",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Russian (RU)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Eldar Khayrullin" ),
|
||||
"Russian (RU)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Eldar Khayrullin",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Russian (RU)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Konstantin Baranovskiy" ),
|
||||
"Russian (RU)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Konstantin Baranovskiy",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Russian (RU)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Axel Henriksson" ),
|
||||
"Russian (RU)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Axel Henriksson",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Swedish (SV)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Richard Jonsson" ),
|
||||
"Swedish (SV)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Richard Jonsson",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Swedish (SV)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Allan Nordhøy" ),
|
||||
"Swedish (SV)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Allan Nordhøy",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Swedish (SV)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Boonchai Kingrungped" ),
|
||||
"Swedish (SV)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Boonchai Kingrungped",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Thai (TH)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Liu Guang" ),
|
||||
"Thai (TH)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Liu Guang",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Simplified Chinese (zh_CN)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Taotieren" ),
|
||||
"Simplified Chinese (zh_CN)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Taotieren",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Simplified Chinese (zh_CN)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Dingzhong Chen" ),
|
||||
"Simplified Chinese (zh_CN)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Dingzhong Chen",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Simplified Chinese (zh_CN)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "David Chen" ),
|
||||
"Simplified Chinese (zh_CN)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "David Chen",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Simplified Chinese (zh_CN)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Rigo Ligo" ),
|
||||
"Simplified Chinese (zh_CN)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Rigo Ligo",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Simplified Chinese (zh_CN)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Tian Yunhao" ),
|
||||
"Simplified Chinese (zh_CN)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Tian Yunhao",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Simplified Chinese (zh_CN)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "David Chen" ),
|
||||
"Simplified Chinese (zh_CN)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "David Chen",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Traditional Chinese (zh_TW)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "kai chiao chuang" ),
|
||||
"Traditional Chinese (zh_TW)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "kai chiao chuang",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Traditional Chinese (zh_TW)" ) ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Taotieren" ),
|
||||
"Traditional Chinese (zh_TW)" ) );
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( "Taotieren",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Traditional Chinese (zh_TW)" ) ) );
|
||||
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Remy Halvick" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Other" ) ) );
|
||||
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "David J S Briscoe" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Other" ) ) );
|
||||
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Dominique Laigle" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Other" ) ) );
|
||||
|
||||
aInfo.AddTranslator( new CONTRIBUTOR( wxT( "Paul Burke" ),
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
wxT( "Other" ) ) );
|
||||
"Traditional Chinese (zh_TW)" ) );
|
||||
|
||||
|
||||
// Program credits for 3d models
|
||||
@@ -899,33 +879,33 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "Evan Shultz"), LIBRARIANS, aInfo.CreateKiBitmap( BITMAPS::library ) ) );
|
||||
|
||||
#define MODELS_3D_CONTRIBUTION _( "3D models by" )
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "Scripts by Maui" ),
|
||||
wxT( "https://github.com/easyw" ),
|
||||
wxT( "https://gitlab.com/kicad/libraries/kicad-packages3D-generator" ),
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( "Scripts by Maui",
|
||||
"https://github.com/easyw",
|
||||
"https://gitlab.com/kicad/libraries/kicad-packages3D-generator",
|
||||
MODELS_3D_CONTRIBUTION,
|
||||
aInfo.CreateKiBitmap( BITMAPS::three_d ) ) );
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "GitLab contributors" ),
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( "GitLab contributors",
|
||||
wxEmptyString,
|
||||
wxT( "https://gitlab.com/kicad/libraries/kicad-packages3D/-/graphs/master" ),
|
||||
"https://gitlab.com/kicad/libraries/kicad-packages3D/-/graphs/master",
|
||||
MODELS_3D_CONTRIBUTION,
|
||||
aInfo.CreateKiBitmap( BITMAPS::three_d ) ) );
|
||||
|
||||
#define SYMBOL_LIB_CONTRIBUTION _( "Symbols by" )
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "GitLab contributors" ),
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( "GitLab contributors",
|
||||
wxEmptyString,
|
||||
wxT( "https://gitlab.com/kicad/libraries/kicad-symbols/-/graphs/master" ),
|
||||
"https://gitlab.com/kicad/libraries/kicad-symbols/-/graphs/master",
|
||||
SYMBOL_LIB_CONTRIBUTION,
|
||||
aInfo.CreateKiBitmap( BITMAPS::add_component ) ) );
|
||||
|
||||
#define FOOTPRINT_LIB_CONTRIBUTION _( "Footprints by" )
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "Scripts by Thomas Pointhuber" ),
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( "Scripts by Thomas Pointhuber",
|
||||
wxEmptyString,
|
||||
wxT( "https://gitlab.com/kicad/libraries/kicad-footprint-generator" ),
|
||||
"https://gitlab.com/kicad/libraries/kicad-footprint-generator",
|
||||
FOOTPRINT_LIB_CONTRIBUTION,
|
||||
aInfo.CreateKiBitmap( BITMAPS::module ) ) );
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( wxT( "GitLab contributors" ),
|
||||
aInfo.AddLibrarian( new CONTRIBUTOR( "GitLab contributors",
|
||||
wxEmptyString,
|
||||
wxT( "https://gitlab.com/kicad/libraries/kicad-footprints/-/graphs/master" ),
|
||||
"https://gitlab.com/kicad/libraries/kicad-footprints/-/graphs/master",
|
||||
FOOTPRINT_LIB_CONTRIBUTION,
|
||||
aInfo.CreateKiBitmap( BITMAPS::module ) ) );
|
||||
|
||||
@@ -939,16 +919,16 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
ICON_CONTRIBUTION ) );
|
||||
aInfo.AddArtist( new CONTRIBUTOR( wxT( "Fabrizio Tappero" ),
|
||||
aInfo.AddArtist( new CONTRIBUTOR( "Fabrizio Tappero",
|
||||
wxEmptyString,
|
||||
wxEmptyString,
|
||||
ICON_CONTRIBUTION ) );
|
||||
|
||||
// Program credits for package developers.
|
||||
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Steven Falco" ) ) );
|
||||
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Jean-Samuel Reynaud" ) ) );
|
||||
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Bernhard Stegmaier" ) ) );
|
||||
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Adam Wolf" ) ) );
|
||||
aInfo.AddPackager( new CONTRIBUTOR( "Steven Falco" ) );
|
||||
aInfo.AddPackager( new CONTRIBUTOR( "Jean-Samuel Reynaud" ) );
|
||||
aInfo.AddPackager( new CONTRIBUTOR( "Bernhard Stegmaier" ) );
|
||||
aInfo.AddPackager( new CONTRIBUTOR( "Adam Wolf" ) );
|
||||
aInfo.AddPackager( new CONTRIBUTOR( wxT( "Nick Østergaard" ) ) );
|
||||
}
|
||||
|
||||
@@ -981,9 +961,9 @@ static wxString HtmlHyperlink( const wxString& aUrl, const wxString& aDescriptio
|
||||
wxString hyperlink = wxEmptyString;
|
||||
|
||||
if( aDescription.IsEmpty() )
|
||||
hyperlink << wxT( "<a href='" ) << aUrl << wxT( "'>" ) << aUrl << wxT( "</a>" );
|
||||
hyperlink << "<a href='" << aUrl << "'>" << aUrl << "</a>";
|
||||
else
|
||||
hyperlink << wxT( "<a href='" ) << aUrl << wxT( "'>" ) << aDescription << wxT( "</a>" );
|
||||
hyperlink << "<a href='" << aUrl << "'>" << aDescription << "</a>";
|
||||
|
||||
return hyperlink;
|
||||
}
|
||||
@@ -1001,7 +981,7 @@ static wxString HtmlNewline( const unsigned int aCount )
|
||||
wxString newlineTags = wxEmptyString;
|
||||
|
||||
for( size_t i = 0; i<aCount; ++i )
|
||||
newlineTags << wxT( "<br>" );
|
||||
newlineTags << "<br>";
|
||||
|
||||
return newlineTags;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ DIALOG_ABOUT::DIALOG_ABOUT( EDA_BASE_FRAME *aParent, ABOUT_APP_INFO& aAppInfo )
|
||||
m_titleName = aParent->GetAboutTitle();
|
||||
m_staticTextAppTitle->SetLabel( m_titleName );
|
||||
m_staticTextCopyright->SetLabel( m_info.GetCopyright() );
|
||||
m_staticTextBuildVersion->SetLabel( wxT( "Version: " ) + m_info.GetBuildVersion() );
|
||||
m_staticTextBuildVersion->SetLabel( "Version: " + m_info.GetBuildVersion() );
|
||||
m_staticTextLibVersion->SetLabel( m_info.GetLibVersion() );
|
||||
|
||||
SetTitle( wxString::Format( _( "About %s" ), m_titleName ) );
|
||||
@@ -222,7 +222,7 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxNotebook* aParent, const wxSt
|
||||
// Of course the padding is different depending on the platform so we adjust the
|
||||
// padding accordingly.
|
||||
#if defined( __WXGTK__ )
|
||||
padding += wxT( " " );
|
||||
padding += " ";
|
||||
#endif
|
||||
wxPanel* outerPanel = new wxPanel( aParent );
|
||||
wxBoxSizer* outerSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
+4
-11
@@ -25,7 +25,6 @@
|
||||
#include <dialog_shim.h>
|
||||
#include <ignore.h>
|
||||
#include <kiway_player.h>
|
||||
#include <kiway.h>
|
||||
#include <pgm_base.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <kiplatform/ui.h>
|
||||
@@ -123,9 +122,6 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
|
||||
if( kiwayHolder )
|
||||
SetKiway( this, &kiwayHolder->Kiway() );
|
||||
|
||||
if( HasKiway() )
|
||||
Kiway().SetBlockingDialog( this );
|
||||
|
||||
Bind( wxEVT_CLOSE_WINDOW, &DIALOG_SHIM::OnCloseWindow, this );
|
||||
Bind( wxEVT_BUTTON, &DIALOG_SHIM::OnButton, this );
|
||||
|
||||
@@ -147,9 +143,6 @@ DIALOG_SHIM::~DIALOG_SHIM()
|
||||
if( IsQuasiModal() )
|
||||
EndQuasiModal( wxID_CANCEL );
|
||||
|
||||
if( HasKiway() )
|
||||
Kiway().SetBlockingDialog( nullptr );
|
||||
|
||||
if( m_qmodal_parent_disabler )
|
||||
delete m_qmodal_parent_disabler; // usually NULL by now
|
||||
}
|
||||
@@ -406,8 +399,8 @@ void DIALOG_SHIM::OnPaint( wxPaintEvent &event )
|
||||
|
||||
void DIALOG_SHIM::OnModify()
|
||||
{
|
||||
if( !GetTitle().StartsWith( wxT( "*" ) ) )
|
||||
SetTitle( wxT( "*" ) + GetTitle() );
|
||||
if( !GetTitle().StartsWith( "*" ) )
|
||||
SetTitle( "*" + GetTitle() );
|
||||
}
|
||||
|
||||
|
||||
@@ -495,8 +488,8 @@ void DIALOG_SHIM::EndQuasiModal( int retCode )
|
||||
|
||||
if( !IsQuasiModal() )
|
||||
{
|
||||
wxFAIL_MSG( wxT( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal" )
|
||||
wxT( "wasn't called" ) );
|
||||
wxFAIL_MSG( "either DIALOG_SHIM::EndQuasiModal called twice or ShowQuasiModal"
|
||||
"wasn't called" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
@@ -396,18 +396,13 @@ void DIALOG_COLOR_PICKER::drawRGBPalette()
|
||||
|
||||
// Use Y axis from bottom to top and origin to center
|
||||
bitmapDC.SetAxisOrientation( true, true );
|
||||
#if wxCHECK_VERSION( 3, 1, 7 )
|
||||
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
|
||||
bitmapDC.SetDeviceOrigin( half_size, -half_size );
|
||||
#else
|
||||
bitmapDC.SetDeviceOrigin( half_size, half_size );
|
||||
#endif
|
||||
|
||||
// Reserve room to draw cursors inside the bitmap
|
||||
half_size -= m_cursorsSize/2;
|
||||
|
||||
// Draw the 3 RGB cursors, using white color to make them always visible:
|
||||
wxPen pen( wxColor( 255, 255, 255 ), 2 ); // use 2 pixels for pen size
|
||||
wxPen pen( wxColor( 255, 255, 255 ) );
|
||||
wxBrush brush( wxColor( 0, 0, 0 ), wxBRUSHSTYLE_TRANSPARENT );
|
||||
bitmapDC.SetPen( pen );
|
||||
bitmapDC.SetBrush( brush );
|
||||
@@ -466,12 +461,7 @@ void DIALOG_COLOR_PICKER::drawHSVPalette()
|
||||
|
||||
// Use Y axis from bottom to top and origin to center
|
||||
bitmapDC.SetAxisOrientation( true, true );
|
||||
#if wxCHECK_VERSION( 3, 1, 7 )
|
||||
// For some reason, SetDeviceOrigin has changed in wxWidgets 3.1.6 or 3.1.7
|
||||
bitmapDC.SetDeviceOrigin( half_size, -half_size );
|
||||
#else
|
||||
bitmapDC.SetDeviceOrigin( half_size, half_size );
|
||||
#endif
|
||||
|
||||
// Reserve room to draw cursors inside the bitmap
|
||||
half_size -= m_cursorsSize / 2;
|
||||
@@ -480,7 +470,7 @@ void DIALOG_COLOR_PICKER::drawHSVPalette()
|
||||
m_cursorBitmapHSV.x = cos( m_hue * M_PI / 180.0 ) * half_size * m_sat;
|
||||
m_cursorBitmapHSV.y = sin( m_hue * M_PI / 180.0 ) * half_size * m_sat;
|
||||
|
||||
wxPen pen( wxColor( 0, 0, 0 ), 2 ); // Use 2 pixels as pensize
|
||||
wxPen pen( wxColor( 0, 0, 0 ) );
|
||||
wxBrush brush( wxColor( 0, 0, 0 ), wxBRUSHSTYLE_TRANSPARENT );
|
||||
bitmapDC.SetPen( pen );
|
||||
bitmapDC.SetBrush( brush );
|
||||
|
||||
@@ -153,7 +153,7 @@ bool DIALOG_CONFIGURE_PATHS::TransferDataToWindow()
|
||||
|
||||
for( auto it = paths->begin(); it != paths->end(); ++it )
|
||||
{
|
||||
if ( !( *it ).m_Alias.StartsWith( wxT( "${" ) ) && !( *it ).m_Alias.StartsWith( wxT( "$(" ) ) )
|
||||
if ( !( *it ).m_Alias.StartsWith( "${" ) && !( *it ).m_Alias.StartsWith( "$(" ) )
|
||||
{
|
||||
AppendSearchPath( it->m_Alias, it->m_Pathvar, it->m_Description );
|
||||
|
||||
@@ -172,7 +172,7 @@ bool DIALOG_CONFIGURE_PATHS::TransferDataToWindow()
|
||||
const wxString& path = it->second.GetValue();
|
||||
AppendEnvVar( it->first, path, it->second.GetDefinedExternally() );
|
||||
|
||||
if( m_curdir.IsEmpty() && !path.StartsWith( wxT( "${" ) ) && !path.StartsWith( wxT( "$(" ) ) )
|
||||
if( m_curdir.IsEmpty() && !path.StartsWith( "${" ) && !path.StartsWith( "$(" ) )
|
||||
m_curdir = path;
|
||||
}
|
||||
|
||||
@@ -639,19 +639,19 @@ void DIALOG_CONFIGURE_PATHS::OnHelp( wxCommandEvent& event )
|
||||
"level. Environment variables defined at the system or user level "
|
||||
"take precedence over the ones defined in this table. This means the "
|
||||
"values in this table are ignored." );
|
||||
msg << wxT( "<br><br><b>" );
|
||||
msg << "<br><br><b>";
|
||||
msg << _( "To ensure environment variable names are valid on all platforms, the name field "
|
||||
"will only accept upper case letters, digits, and the underscore characters." );
|
||||
msg << wxT( "</b>" );
|
||||
msg << "</b>";
|
||||
|
||||
for( const auto& var : ENV_VAR::GetPredefinedEnvVars() )
|
||||
{
|
||||
msg << wxT( "<br><br><b>" ) << var << wxT( "</b>" );
|
||||
msg << "<br><br><b>" << var << "</b>";
|
||||
|
||||
const auto desc = ENV_VAR::LookUpEnvVarHelp( var );
|
||||
|
||||
if( desc.size() > 0 )
|
||||
msg << wxT( ": " ) << desc;
|
||||
msg << ": " << desc;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -38,15 +38,13 @@ DIALOG_PASTE_SPECIAL::DIALOG_PASTE_SPECIAL( wxWindow* aParent,
|
||||
"any designators that already exist in the design." ) );
|
||||
|
||||
m_pasteOptions->SetItemToolTip( static_cast<int>( PASTE_MODE::KEEP_ANNOTATIONS ),
|
||||
wxEmptyString ); // Self explanatory
|
||||
wxT( "" ) ); // Self explanatory
|
||||
|
||||
m_pasteOptions->SetItemToolTip( static_cast<int>( PASTE_MODE::REMOVE_ANNOTATIONS ),
|
||||
wxString::Format( _( "Replaces reference designators "
|
||||
"with '%s'." ),
|
||||
aReplacement ) );
|
||||
|
||||
m_sdbSizerOK->SetFocus();
|
||||
|
||||
// Now all widgets have the size fixed, call FinishDialogSettings
|
||||
finishDialogSettings();
|
||||
}
|
||||
|
||||
@@ -40,11 +40,10 @@ static int DEFAULT_COL_WIDTHS[] = { 200, 600 };
|
||||
EDA_LIST_DIALOG::EDA_LIST_DIALOG( wxWindow* aParent, const wxString& aTitle,
|
||||
const wxArrayString& aItemHeaders,
|
||||
const std::vector<wxArrayString>& aItemList,
|
||||
const wxString& aPreselectText, bool aSortList ) :
|
||||
const wxString& aPreselectText ) :
|
||||
EDA_LIST_DIALOG_BASE( aParent, wxID_ANY, aTitle )
|
||||
{
|
||||
m_itemsList = &aItemList;
|
||||
m_sortList = aSortList;
|
||||
|
||||
m_filterBox->SetHint( _( "Filter" ) );
|
||||
|
||||
@@ -235,6 +234,5 @@ static int wxCALLBACK myCompareFunction( wxIntPtr aItem1, wxIntPtr aItem2,
|
||||
|
||||
void EDA_LIST_DIALOG::sortList()
|
||||
{
|
||||
if( m_sortList )
|
||||
m_listBox->SortItems( myCompareFunction, 0 );
|
||||
m_listBox->SortItems( myCompareFunction, 0 );
|
||||
}
|
||||
|
||||
@@ -144,32 +144,32 @@ PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS( DIALOG_SHIM* aDialog, wxWindow* aP
|
||||
|
||||
if( m_iconScaleSlider )
|
||||
{
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_TOP,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_TOP,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_BOTTOM,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_BOTTOM,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_LINEUP,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_LINEUP,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_LINEDOWN,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_PAGEUP,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_PAGEDOWN,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_THUMBTRACK,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_THUMBTRACK,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_THUMBRELEASE,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_THUMBRELEASE,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleSlider->Connect( wxEVT_SCROLL_CHANGED,
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
wxScrollEventHandler( PANEL_COMMON_SETTINGS::OnScaleSlider ),
|
||||
nullptr, this );
|
||||
m_iconScaleAuto->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED,
|
||||
wxCommandEventHandler( PANEL_COMMON_SETTINGS::OnIconScaleAuto ),
|
||||
@@ -241,7 +241,6 @@ bool PANEL_COMMON_SETTINGS::TransferDataToWindow()
|
||||
m_defaultPDFViewer->SetValue( Pgm().UseSystemPdfBrowser() );
|
||||
m_otherPDFViewer->SetValue( !Pgm().UseSystemPdfBrowser() );
|
||||
m_PDFViewerPath->SetValue( Pgm().GetPdfBrowserName() );
|
||||
setPdfViewerPathState();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -317,7 +316,6 @@ void PANEL_COMMON_SETTINGS::ResetPanel()
|
||||
m_defaultPDFViewer->SetValue( defaultSettings.m_System.use_system_pdf_viewer );
|
||||
m_otherPDFViewer->SetValue( !defaultSettings.m_System.use_system_pdf_viewer );
|
||||
m_PDFViewerPath->SetValue( defaultSettings.m_System.pdf_viewer_name );
|
||||
setPdfViewerPathState();
|
||||
}
|
||||
|
||||
|
||||
@@ -466,14 +464,8 @@ void PANEL_COMMON_SETTINGS::OnPDFViewerClick( wxCommandEvent& event )
|
||||
}
|
||||
|
||||
|
||||
void PANEL_COMMON_SETTINGS::OnRadioButtonPdfViewer( wxCommandEvent& aEvent )
|
||||
void PANEL_COMMON_SETTINGS::onUpdateUIPdfPath( wxUpdateUIEvent& event )
|
||||
{
|
||||
setPdfViewerPathState();
|
||||
// Used by both the m_pdfViewerBtn and m_PDFViewerPath
|
||||
event.Enable( m_otherPDFViewer->GetValue() );
|
||||
}
|
||||
|
||||
|
||||
void PANEL_COMMON_SETTINGS::setPdfViewerPathState()
|
||||
{
|
||||
m_PDFViewerPath->Enable( m_otherPDFViewer->GetValue() );
|
||||
m_pdfViewerBtn->Enable( m_otherPDFViewer->GetValue() );
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -326,9 +326,9 @@ PANEL_COMMON_SETTINGS_BASE::PANEL_COMMON_SETTINGS_BASE( wxWindow* parent, wxWind
|
||||
|
||||
// Connect Events
|
||||
m_textEditorBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnTextEditorClick ), NULL, this );
|
||||
m_defaultPDFViewer->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnRadioButtonPdfViewer ), NULL, this );
|
||||
m_otherPDFViewer->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnRadioButtonPdfViewer ), NULL, this );
|
||||
m_PDFViewerPath->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_COMMON_SETTINGS_BASE::onUpdateUIPdfPath ), NULL, this );
|
||||
m_pdfViewerBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnPDFViewerClick ), NULL, this );
|
||||
m_pdfViewerBtn->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_COMMON_SETTINGS_BASE::onUpdateUIPdfPath ), NULL, this );
|
||||
m_canvasScaleAuto->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnCanvasScaleAuto ), NULL, this );
|
||||
}
|
||||
|
||||
@@ -336,9 +336,9 @@ PANEL_COMMON_SETTINGS_BASE::~PANEL_COMMON_SETTINGS_BASE()
|
||||
{
|
||||
// Disconnect Events
|
||||
m_textEditorBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnTextEditorClick ), NULL, this );
|
||||
m_defaultPDFViewer->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnRadioButtonPdfViewer ), NULL, this );
|
||||
m_otherPDFViewer->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnRadioButtonPdfViewer ), NULL, this );
|
||||
m_PDFViewerPath->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_COMMON_SETTINGS_BASE::onUpdateUIPdfPath ), NULL, this );
|
||||
m_pdfViewerBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnPDFViewerClick ), NULL, this );
|
||||
m_pdfViewerBtn->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_COMMON_SETTINGS_BASE::onUpdateUIPdfPath ), NULL, this );
|
||||
m_canvasScaleAuto->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( PANEL_COMMON_SETTINGS_BASE::OnCanvasScaleAuto ), NULL, this );
|
||||
|
||||
}
|
||||
|
||||
@@ -662,7 +662,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnRadioButton">OnRadioButtonPdfViewer</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
@@ -738,7 +737,6 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnRadioButton">OnRadioButtonPdfViewer</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@@ -803,6 +801,7 @@
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnUpdateUI">onUpdateUIPdfPath</event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
@@ -877,6 +876,7 @@
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnButtonClick">OnPDFViewerClick</event>
|
||||
<event name="OnUpdateUI">onUpdateUIPdfPath</event>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c)
|
||||
// C++ code generated with wxFormBuilder (version 3.10.0-4761b0c5)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
@@ -88,7 +88,7 @@ class PANEL_COMMON_SETTINGS_BASE : public RESETTABLE_PANEL
|
||||
|
||||
// Virtual event handlers, override them in your derived class
|
||||
virtual void OnTextEditorClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnRadioButtonPdfViewer( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void onUpdateUIPdfPath( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void OnPDFViewerClick( wxCommandEvent& event ) { event.Skip(); }
|
||||
virtual void OnCanvasScaleAuto( wxCommandEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ void PANEL_HOTKEYS_EDITOR::dumpHotkeys()
|
||||
|
||||
wxFileName fn( filename );
|
||||
|
||||
wxFFileOutputStream fileStream( fn.GetFullPath(), wxT( "w" ) );
|
||||
wxFFileOutputStream fileStream( fn.GetFullPath(), "w" );
|
||||
wxTextOutputStream stream( fileStream );
|
||||
|
||||
if( !fn.IsDirWritable() || ( fn.Exists() && !fn.IsFileWritable() ) )
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
#include <pgm_base.h>
|
||||
#include <base_units.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <bitmaps.h>
|
||||
#include <netclass.h>
|
||||
#include <confirm.h>
|
||||
@@ -70,13 +69,11 @@ std::vector<BITMAPS> g_lineStyleIcons;
|
||||
wxArrayString g_lineStyleNames;
|
||||
|
||||
|
||||
PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_FRAME* aFrame,
|
||||
NETCLASSES* aNetclasses,
|
||||
PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, NETCLASSES* aNetclasses,
|
||||
const std::vector<wxString>& aNetNames,
|
||||
bool aIsEEschema ) :
|
||||
PANEL_SETUP_NETCLASSES_BASE( aParent->GetTreebook() ),
|
||||
m_frame( aFrame ),
|
||||
m_parent( aParent ),
|
||||
m_Parent( aParent ),
|
||||
m_netclasses( aNetclasses ),
|
||||
m_netNames( aNetNames ),
|
||||
m_hoveredCol( -1 )
|
||||
@@ -188,8 +185,6 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_
|
||||
&PANEL_SETUP_NETCLASSES::OnNetclassGridMouseEvent,
|
||||
this );
|
||||
|
||||
m_frame->Bind( UNITS_CHANGED, &PANEL_SETUP_NETCLASSES::onUnitsChanged, this );
|
||||
|
||||
m_netclassGrid->EndBatch();
|
||||
m_membershipGrid->EndBatch();
|
||||
Thaw();
|
||||
@@ -210,24 +205,6 @@ PANEL_SETUP_NETCLASSES::~PANEL_SETUP_NETCLASSES()
|
||||
m_netclassGrid->Disconnect( wxEVT_GRID_CELL_CHANGING,
|
||||
wxGridEventHandler( PANEL_SETUP_NETCLASSES::OnNetclassGridCellChanging ),
|
||||
nullptr, this );
|
||||
|
||||
m_frame->Unbind( UNITS_CHANGED, &PANEL_SETUP_NETCLASSES::onUnitsChanged, this );
|
||||
}
|
||||
|
||||
|
||||
void PANEL_SETUP_NETCLASSES::onUnitsChanged( wxCommandEvent& aEvent )
|
||||
{
|
||||
NETCLASSES tempNetClasses;
|
||||
NETCLASSES* saveNetClasses = m_netclasses;
|
||||
|
||||
m_netclasses = &tempNetClasses; // No, address of stack var does not escape function
|
||||
|
||||
TransferDataFromWindow();
|
||||
TransferDataToWindow();
|
||||
|
||||
m_netclasses = saveNetClasses;
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +227,7 @@ static void netclassToGridRow( EDA_UNITS aUnits, wxGrid* aGrid, int aRow, const
|
||||
SET_MILS_CELL( GRID_WIREWIDTH, nc->GetWireWidth() );
|
||||
SET_MILS_CELL( GRID_BUSWIDTH, nc->GetBusWidth() );
|
||||
|
||||
wxString colorAsString = nc->GetSchematicColor().ToCSSString();
|
||||
wxString colorAsString = nc->GetSchematicColor().ToWxString( wxC2S_CSS_SYNTAX );
|
||||
aGrid->SetCellValue( aRow, GRID_SCHEMATIC_COLOR, colorAsString );
|
||||
|
||||
int lineStyleIdx = std::max( 0, nc->GetLineStyle() );
|
||||
@@ -274,7 +251,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
|
||||
m_netclassGrid->AppendRows((int) m_netclasses->GetCount() + 1 ); // + 1 for default netclass
|
||||
|
||||
// enter the Default NETCLASS.
|
||||
netclassToGridRow( m_frame->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
|
||||
netclassToGridRow( m_Parent->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
|
||||
|
||||
// make the Default NETCLASS name read-only
|
||||
wxGridCellAttr* cellAttr = m_netclassGrid->GetOrCreateCellAttr( 0, GRID_NAME );
|
||||
@@ -288,7 +265,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
|
||||
{
|
||||
NETCLASSPTR netclass = i->second;
|
||||
|
||||
netclassToGridRow( m_frame->GetUserUnits(), m_netclassGrid, row, netclass );
|
||||
netclassToGridRow( m_Parent->GetUserUnits(), m_netclassGrid, row, netclass );
|
||||
|
||||
for( const wxString& net : *netclass )
|
||||
{
|
||||
@@ -384,7 +361,7 @@ static void gridRowToNetclass( EDA_UNITS aUnits, wxGrid* grid, int row, const NE
|
||||
nc->SetSchematicColor( wxColour( grid->GetCellValue( row, GRID_SCHEMATIC_COLOR ) ) );
|
||||
|
||||
nc->SetLineStyle( g_lineStyleNames.Index( grid->GetCellValue( row, GRID_LINESTYLE ) ) );
|
||||
wxASSERT_MSG( nc->GetLineStyle() >= 0, wxT( "Line style name not found." ) );
|
||||
wxASSERT_MSG( nc->GetLineStyle() >= 0, "Line style name not found." );
|
||||
}
|
||||
|
||||
|
||||
@@ -396,7 +373,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
|
||||
m_netclasses->Clear();
|
||||
|
||||
// Copy the default NetClass:
|
||||
gridRowToNetclass( m_frame->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
|
||||
gridRowToNetclass( m_Parent->GetUserUnits(), m_netclassGrid, 0, m_netclasses->GetDefault() );
|
||||
|
||||
// Copy other NetClasses:
|
||||
for( int row = 1; row < m_netclassGrid->GetNumberRows(); ++row )
|
||||
@@ -405,7 +382,7 @@ bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
|
||||
GRID_NAME ) );
|
||||
|
||||
if( m_netclasses->Add( nc ) )
|
||||
gridRowToNetclass( m_frame->GetUserUnits(), m_netclassGrid, row, nc );
|
||||
gridRowToNetclass( m_Parent->GetUserUnits(), m_netclassGrid, row, nc );
|
||||
}
|
||||
|
||||
// Now read all nets and push them in the corresponding netclass net buffer
|
||||
@@ -438,7 +415,7 @@ bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, const wxString& aNa
|
||||
if( tmp.IsEmpty() )
|
||||
{
|
||||
wxString msg = _( "Netclass must have a name." );
|
||||
m_parent->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME );
|
||||
m_Parent->SetError( msg, this, m_netclassGrid, aRow, GRID_NAME );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -447,7 +424,7 @@ bool PANEL_SETUP_NETCLASSES::validateNetclassName( int aRow, const wxString& aNa
|
||||
if( ii != aRow && m_netclassGrid->GetCellValue( ii, GRID_NAME ).CmpNoCase( tmp ) == 0 )
|
||||
{
|
||||
wxString msg = _( "Netclass name already in use." );
|
||||
m_parent->SetError( msg, this, m_netclassGrid, focusFirst ? aRow : ii, GRID_NAME );
|
||||
m_Parent->SetError( msg, this, m_netclassGrid, focusFirst ? aRow : ii, GRID_NAME );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES( PAGED_DIALOG* aParent,
|
||||
|
||||
if( m_pinMapSpecialCase )
|
||||
{
|
||||
wxString pinMapSeverities[] = { _( "From Pin Conflicts Map" ), wxEmptyString, _( "Ignore" ) };
|
||||
wxString pinMapSeverities[] = { _( "From Pin Conflicts Map" ), wxT( "" ), _( "Ignore" ) };
|
||||
int errorCode = m_pinMapSpecialCase->GetErrorCode();
|
||||
wxString msg = m_pinMapSpecialCase->GetErrorText();
|
||||
|
||||
@@ -123,9 +123,9 @@ PANEL_SETUP_SEVERITIES::PANEL_SETUP_SEVERITIES( PAGED_DIALOG* aParent,
|
||||
|
||||
for( size_t i = 0; i < 3; ++i )
|
||||
{
|
||||
if( pinMapSeverities[i] == wxEmptyString )
|
||||
if( pinMapSeverities[i] == wxT( "" ) )
|
||||
{
|
||||
wxStaticText* spacer = new wxStaticText( radioPanel, wxID_ANY, wxEmptyString );
|
||||
wxStaticText* spacer = new wxStaticText( radioPanel, wxID_ANY, wxT( "" ) );
|
||||
radioSizer->Add( spacer, 0, wxRIGHT | wxEXPAND, 17 );
|
||||
}
|
||||
else
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
#include <wx/menu.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <kiplatform/ui.h>
|
||||
#include <kiway_holder.h>
|
||||
#include <project.h>
|
||||
|
||||
WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow* parent, wxWindowID id, const wxPoint& pos,
|
||||
const wxSize& size, long style ) :
|
||||
@@ -189,20 +187,20 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
|
||||
switch( aLine.severity )
|
||||
{
|
||||
case RPT_SEVERITY_ERROR:
|
||||
retv = wxT( "<font color=#F04040 size=3>" ) + _( "Error:" ) + " </font>"
|
||||
wxT( "<font size=3>" ) + aLine.message + wxT( "</font><br>" );
|
||||
retv = "<font color=#F04040 size=3>" + _( "Error:" ) + " </font>"
|
||||
"<font size=3>" + aLine.message + "</font><br>";
|
||||
break;
|
||||
case RPT_SEVERITY_WARNING:
|
||||
retv = wxT( "<font size=3>" ) + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
|
||||
retv = "<font size=3>" + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
|
||||
break;
|
||||
case RPT_SEVERITY_INFO:
|
||||
retv = wxT( "<font color=#909090 size=3>" ) + aLine.message + wxT( "</font><br>" );
|
||||
retv = "<font color=#909090 size=3>" + aLine.message + "</font><br>";
|
||||
break;
|
||||
case RPT_SEVERITY_ACTION:
|
||||
retv = wxT( "<font color=#60D060 size=3>" ) + aLine.message + wxT( "</font><br>" );
|
||||
retv = "<font color=#60D060 size=3>" + aLine.message + "</font><br>";
|
||||
break;
|
||||
default:
|
||||
retv = wxT( "<font size=3>" ) + aLine.message + wxT( "</font><br>" );
|
||||
retv = "<font size=3>" + aLine.message + "</font><br>";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -210,26 +208,26 @@ wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
|
||||
switch( aLine.severity )
|
||||
{
|
||||
case RPT_SEVERITY_ERROR:
|
||||
retv = wxT( "<font color=#D00000 size=3>" ) + _( "Error:" ) + " </font>"
|
||||
wxT( "<font size=3>" ) + aLine.message + wxT( "</font><br>" );
|
||||
retv = "<font color=#D00000 size=3>" + _( "Error:" ) + " </font>"
|
||||
"<font size=3>" + aLine.message + "</font><br>";
|
||||
break;
|
||||
case RPT_SEVERITY_WARNING:
|
||||
retv = wxT( "<font size=3>" ) + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
|
||||
retv = "<font size=3>" + _( "Warning:" ) + wxS( " " ) + aLine.message + "</font><br>";
|
||||
break;
|
||||
case RPT_SEVERITY_INFO:
|
||||
retv = wxT( "<font color=#808080 size=3>" ) + aLine.message + wxT( "</font><br>" );
|
||||
retv = "<font color=#808080 size=3>" + aLine.message + "</font><br>";
|
||||
break;
|
||||
case RPT_SEVERITY_ACTION:
|
||||
retv = wxT( "<font color=#008000 size=3>" ) + aLine.message + wxT( "</font><br>" );
|
||||
retv = "<font color=#008000 size=3>" + aLine.message + "</font><br>";
|
||||
break;
|
||||
default:
|
||||
retv = wxT( "<font size=3>" ) + aLine.message + wxT( "</font><br>" );
|
||||
retv = "<font size=3>" + aLine.message + "</font><br>";
|
||||
}
|
||||
}
|
||||
|
||||
// wxHtmlWindow fails to do correct baseline alignment between Japanese/Chinese cells and
|
||||
// Roman cells. This keeps the line in a single cell.
|
||||
retv.Replace( wxT( " " ), wxT( " " ) );
|
||||
retv.Replace( " ", " " );
|
||||
|
||||
return retv;
|
||||
}
|
||||
@@ -250,7 +248,7 @@ wxString WX_HTML_REPORT_PANEL::generatePlainText( const REPORT_LINE& aLine )
|
||||
void WX_HTML_REPORT_PANEL::onRightClick( wxMouseEvent& event )
|
||||
{
|
||||
wxMenu popup;
|
||||
popup.Append( wxID_COPY, wxT( "Copy" ) );
|
||||
popup.Append( wxID_COPY, "Copy" );
|
||||
PopupMenu( &popup );
|
||||
}
|
||||
|
||||
@@ -354,14 +352,7 @@ void WX_HTML_REPORT_PANEL::onBtnSaveToFile( wxCommandEvent& event )
|
||||
wxFileName fn;
|
||||
|
||||
if( m_reportFileName.empty() )
|
||||
{
|
||||
fn = wxT( "report.txt" );
|
||||
|
||||
KIWAY_HOLDER* parent = dynamic_cast<KIWAY_HOLDER*>( m_parent );
|
||||
|
||||
if( parent )
|
||||
fn.SetPath( parent->Prj().GetProjectPath() );
|
||||
}
|
||||
fn = wxT( "./report.txt" );
|
||||
else
|
||||
fn = m_reportFileName;
|
||||
|
||||
@@ -376,7 +367,7 @@ void WX_HTML_REPORT_PANEL::onBtnSaveToFile( wxCommandEvent& event )
|
||||
if( fn.GetExt().IsEmpty() )
|
||||
fn.SetExt( "txt" );
|
||||
|
||||
wxFFile f( fn.GetFullPath(), wxT( "wb" ) );
|
||||
wxFFile f( fn.GetFullPath(), "wb" );
|
||||
|
||||
if( !f.IsOpened() )
|
||||
{
|
||||
|
||||
@@ -94,7 +94,6 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
|
||||
|
||||
ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS );
|
||||
EnableScrolling( false, false ); // otherwise Zoom Auto disables GAL canvas
|
||||
KIPLATFORM::UI::SetOverlayScrolling( this, false ); // Prevent excessive repaint on GTK
|
||||
|
||||
Connect( wxEVT_SIZE, wxSizeEventHandler( EDA_DRAW_PANEL_GAL::onSize ), nullptr, this );
|
||||
Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( EDA_DRAW_PANEL_GAL::onEnter ), nullptr,
|
||||
@@ -174,11 +173,6 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
|
||||
|
||||
void EDA_DRAW_PANEL_GAL::DoRePaint()
|
||||
{
|
||||
if( !m_refreshMutex.try_lock() )
|
||||
return;
|
||||
|
||||
std::lock_guard<std::mutex> lock( m_refreshMutex, std::adopt_lock );
|
||||
|
||||
// Repaint the canvas, and fix scrollbar cursors
|
||||
// Usually called by a OnPaint event, but because it does not use a wxPaintDC,
|
||||
// it can be called outside a wxPaintEvent.
|
||||
@@ -218,24 +212,13 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
|
||||
try
|
||||
{
|
||||
cntUpd.Start();
|
||||
|
||||
try
|
||||
{
|
||||
m_view->UpdateItems();
|
||||
}
|
||||
catch( std::out_of_range& err )
|
||||
{
|
||||
// Don't do anything here but don't fail
|
||||
// This can happen when we don't catch `at()` calls
|
||||
wxString msg;
|
||||
msg.Printf( wxT( "Out of Range error: %s" ), err.what() );
|
||||
wxLogDebug( msg );
|
||||
}
|
||||
|
||||
m_view->UpdateItems();
|
||||
cntUpd.Stop();
|
||||
|
||||
cntCtx.Start();
|
||||
KIGFX::GAL_DRAWING_CONTEXT ctx( m_gal );
|
||||
int cookie = rand();
|
||||
m_gal->LockContext( cookie );
|
||||
m_gal->BeginDrawing();
|
||||
cntCtx.Stop();
|
||||
|
||||
if( m_view->IsTargetDirty( KIGFX::TARGET_OVERLAY )
|
||||
@@ -256,11 +239,9 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
|
||||
|
||||
if( m_view->IsDirty() )
|
||||
{
|
||||
if( m_backend != GAL_TYPE_OPENGL // Already called in opengl
|
||||
&& m_view->IsTargetDirty( KIGFX::TARGET_NONCACHED ) )
|
||||
{
|
||||
if( m_backend != GAL_TYPE_OPENGL && // Already called in opengl
|
||||
m_view->IsTargetDirty( KIGFX::TARGET_NONCACHED ) )
|
||||
m_gal->ClearScreen();
|
||||
}
|
||||
|
||||
m_view->ClearTargets();
|
||||
|
||||
@@ -277,6 +258,9 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
|
||||
m_gal->DrawCursor( m_viewControls->GetCursorPosition() );
|
||||
|
||||
cntCtxDestroy.Start();
|
||||
m_gal->EndDrawing();
|
||||
m_gal->UnlockContext( cookie );
|
||||
cntCtxDestroy.Stop();
|
||||
}
|
||||
catch( std::exception& err )
|
||||
{
|
||||
@@ -295,9 +279,6 @@ void EDA_DRAW_PANEL_GAL::DoRePaint()
|
||||
}
|
||||
}
|
||||
|
||||
// ctx goes out of scope here so destructor would be called
|
||||
cntCtxDestroy.Stop();
|
||||
|
||||
|
||||
if( isDirty )
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2013 Jean-Pierre Charras <jp.charras at wanadoo.fr>.
|
||||
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -494,12 +494,6 @@ void DRAWING_SHEET_PARSER::parseBitmap( DS_DATA_ITEM_BITMAP * aItem )
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
case T_comment:
|
||||
NeedSYMBOLorNUMBER();
|
||||
aItem->m_Info = FromUTF8();
|
||||
NeedRIGHT();
|
||||
break;
|
||||
|
||||
case T_pngdata:
|
||||
readPngdata( aItem );
|
||||
break;
|
||||
@@ -899,7 +893,7 @@ bool DS_DATA_MODEL::LoadDrawingSheet( const wxString& aFullFileName, bool Append
|
||||
}
|
||||
}
|
||||
|
||||
wxFFile wksFile( fullFileName, wxT( "rb" ) );
|
||||
wxFFile wksFile( fullFileName, "rb" );
|
||||
|
||||
if( ! wksFile.IsOpened() )
|
||||
{
|
||||
@@ -939,7 +933,7 @@ bool DS_DATA_MODEL::LoadDrawingSheet( const wxString& aFullFileName, bool Append
|
||||
}
|
||||
catch( const std::bad_alloc& )
|
||||
{
|
||||
wxLogMessage( wxT( "Memory exhaustion reading drawing sheet" ) );
|
||||
wxLogMessage( "Memory exhaustion reading drawing sheet" );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,18 +142,19 @@ wxString DS_DRAW_ITEM_LIST::BuildFullText( const wxString& aTextbase )
|
||||
}
|
||||
else if( token->IsSameAs( wxT( "PAPER" ) ) )
|
||||
{
|
||||
*token = m_paperFormat ? *m_paperFormat : wxString( wxEmptyString );
|
||||
*token = m_paperFormat ? *m_paperFormat : wxString( "" );
|
||||
tokenUpdated = true;
|
||||
}
|
||||
else if( token->IsSameAs( wxT( "LAYER" ) ) )
|
||||
{
|
||||
*token = m_sheetLayer ? *m_sheetLayer : wxString( wxEmptyString );
|
||||
*token = m_sheetLayer ? *m_sheetLayer : wxString( "" );
|
||||
tokenUpdated = true;
|
||||
}
|
||||
else if( m_titleBlock )
|
||||
{
|
||||
m_titleBlock->TextVarResolver( token, m_project );
|
||||
// no need for tokenUpdated; TextVarResolver() did a full resolve
|
||||
return m_titleBlock->TextVarResolver( token, m_project );
|
||||
return true;
|
||||
}
|
||||
|
||||
if( tokenUpdated )
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user